1. 11 Jul, 2012 1 commit
    • fpizlo@apple.com's avatar
      DFG should have fast virtual calls · 5e135773
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=90924
      
      Source/JavaScriptCore: 
      
      Reviewed by Gavin Barraclough.
              
      Implements virtual call support in the style of the old JIT, with the
      caveat that we still use the same slow path for both InternalFunction
      calls and JSFunction calls. Also rationalized the way that our
      CodeOrigin indices tie into exception checks (previously it was a
      strange one-to-one mapping with fairly limited assertions; now it's a
      one-to-many mapping for CodeOrigins to exception checks, respectively).
      I also took the opportunity to clean up
      CallLinkInfo::callReturnLocation, which previously was either a Call or
      a NearCall. Now it's just a NearCall. As well, exceptions during slow
      path call resolution are now handled by returning an exception throwing
      thunk rather than returning null. And finally, I made a few things
      public that were previously private-with-lots-of-friends, because I
      truly despise the thought of listing each thunk generating function as
      a friend of JSValue and friends.
              
      * bytecode/CallLinkInfo.cpp:
      (JSC::CallLinkInfo::unlink):
      * bytecode/CallLinkInfo.h:
      (CallLinkInfo):
      * bytecode/CodeOrigin.h:
      (JSC::CodeOrigin::CodeOrigin):
      (JSC::CodeOrigin::isSet):
      * dfg/DFGAssemblyHelpers.h:
      (JSC::DFG::AssemblyHelpers::AssemblyHelpers):
      * dfg/DFGCCallHelpers.h:
      (JSC::DFG::CCallHelpers::CCallHelpers):
      * dfg/DFGGPRInfo.h:
      (GPRInfo):
      * dfg/DFGJITCompiler.cpp:
      (JSC::DFG::JITCompiler::link):
      (JSC::DFG::JITCompiler::compileFunction):
      * dfg/DFGJITCompiler.h:
      (JSC::DFG::CallBeginToken::CallBeginToken):
      (JSC::DFG::CallBeginToken::~CallBeginToken):
      (CallBeginToken):
      (JSC::DFG::CallBeginToken::set):
      (JSC::DFG::CallBeginToken::registerWithExceptionCheck):
      (JSC::DFG::CallBeginToken::codeOrigin):
      (JSC::DFG::CallExceptionRecord::CallExceptionRecord):
      (CallExceptionRecord):
      (JSC::DFG::JITCompiler::currentCodeOriginIndex):
      (JITCompiler):
      (JSC::DFG::JITCompiler::beginCall):
      (JSC::DFG::JITCompiler::notifyCall):
      (JSC::DFG::JITCompiler::prepareForExceptionCheck):
      (JSC::DFG::JITCompiler::addExceptionCheck):
      (JSC::DFG::JITCompiler::addFastExceptionCheck):
      * dfg/DFGOperations.cpp:
      * dfg/DFGRepatch.cpp:
      (JSC::DFG::dfgLinkFor):
      * dfg/DFGSpeculativeJIT.h:
      (JSC::DFG::SpeculativeJIT::appendCallWithExceptionCheck):
      * dfg/DFGSpeculativeJIT32_64.cpp:
      (JSC::DFG::SpeculativeJIT::emitCall):
      * dfg/DFGSpeculativeJIT64.cpp:
      (JSC::DFG::SpeculativeJIT::emitCall):
      * dfg/DFGThunks.cpp:
      (JSC::DFG::emitPointerValidation):
      (DFG):
      (JSC::DFG::throwExceptionFromCallSlowPathGenerator):
      (JSC::DFG::slowPathFor):
      (JSC::DFG::linkForThunkGenerator):
      (JSC::DFG::linkCallThunkGenerator):
      (JSC::DFG::linkConstructThunkGenerator):
      (JSC::DFG::virtualForThunkGenerator):
      (JSC::DFG::virtualCallThunkGenerator):
      (JSC::DFG::virtualConstructThunkGenerator):
      * dfg/DFGThunks.h:
      (DFG):
      * jit/JIT.cpp:
      (JSC::JIT::privateCompile):
      (JSC::JIT::linkFor):
      * runtime/Executable.h:
      (ExecutableBase):
      (JSC::ExecutableBase::offsetOfJITCodeFor):
      (JSC::ExecutableBase::offsetOfNumParametersFor):
      * runtime/JSValue.h:
      (JSValue):
      
      LayoutTests: 
      
      Rubber stamped by Oliver Hunt.
      
      This changes which piece of code appears on top of the stack at the point of a stack
      overflow. As far as Oliver and I can tell, it doesn't matter, so I just rebased the
      test.
      
      * fast/js/stack-trace-expected.txt:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122392 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5e135773
  2. 26 Jan, 2012 1 commit
  3. 10 Jan, 2012 1 commit
    • fpizlo@apple.com's avatar
      CodeBlock.h declares too many things · ea74cb1c
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=76001
      
      Rubber stamped by Gavin Barraclough.
              
      Removed all non-CodeBlock type declarations from CodeBlock.h, and put them
      into separate header files. Also removed all non-CodeBlock method implementations
      from CodeBlock.cpp and put them into corresponding cpp files.
      
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * Target.pri:
      * assembler/RepatchBuffer.h:
      * bytecode/CallLinkInfo.cpp: Added.
      (JSC::CallLinkInfo::unlink):
      * bytecode/CallLinkInfo.h: Added.
      (JSC::CallLinkInfo::callTypeFor):
      (JSC::CallLinkInfo::CallLinkInfo):
      (JSC::CallLinkInfo::~CallLinkInfo):
      (JSC::CallLinkInfo::isLinked):
      (JSC::CallLinkInfo::seenOnce):
      (JSC::CallLinkInfo::setSeen):
      (JSC::getCallLinkInfoReturnLocation):
      (JSC::getCallLinkInfoBytecodeIndex):
      * bytecode/CallReturnOffsetToBytecodeOffset.h: Added.
      (JSC::CallReturnOffsetToBytecodeOffset::CallReturnOffsetToBytecodeOffset):
      (JSC::getCallReturnOffset):
      * bytecode/CodeBlock.cpp:
      * bytecode/CodeBlock.h:
      * bytecode/CodeType.h: Added.
      * bytecode/ExpressionRangeInfo.h: Added.
      * bytecode/GlobalResolveInfo.h: Added.
      (JSC::GlobalResolveInfo::GlobalResolveInfo):
      * bytecode/HandlerInfo.h: Added.
      * bytecode/LineInfo.h: Added.
      * bytecode/MethodCallLinkInfo.cpp: Added.
      (JSC::MethodCallLinkInfo::reset):
      * bytecode/MethodCallLinkInfo.h: Added.
      (JSC::MethodCallLinkInfo::MethodCallLinkInfo):
      (JSC::MethodCallLinkInfo::seenOnce):
      (JSC::MethodCallLinkInfo::setSeen):
      (JSC::getMethodCallLinkInfoReturnLocation):
      (JSC::getMethodCallLinkInfoBytecodeIndex):
      * bytecode/StructureStubInfo.h:
      (JSC::getStructureStubInfoReturnLocation):
      (JSC::getStructureStubInfoBytecodeIndex):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104646 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ea74cb1c