Ignore:
Timestamp:
Jun 15, 2009, 8:01:12 PM (16 years ago)
Author:
[email protected]
Message:

2009-06-15 Gavin Barraclough <[email protected]>

Reviewed by Sam Weinig.

Having introduced the RepatchBuffer, ProcessorReturnAddress is now a do-nothing
wrapper around ReturnAddressPtr. Remove it. In tugging on this piece of string
it made sense to roll out the use of ReturnAddressPtr a little further into
JITStubs (which had always been the intention).

No performance impact.

  • assembler/AbstractMacroAssembler.h: (JSC::AbstractMacroAssembler::RepatchBuffer::relinkCallerToTrampoline): (JSC::AbstractMacroAssembler::RepatchBuffer::relinkCallerToFunction): (JSC::AbstractMacroAssembler::RepatchBuffer::relinkNearCallerToTrampoline):
  • assembler/MacroAssemblerCodeRef.h: (JSC::ReturnAddressPtr::ReturnAddressPtr):
  • bytecode/CodeBlock.h: (JSC::CodeBlock::getStubInfo): (JSC::CodeBlock::getCallLinkInfo): (JSC::CodeBlock::getMethodCallLinkInfo): (JSC::CodeBlock::getBytecodeIndex):
  • interpreter/Interpreter.cpp: (JSC::bytecodeOffsetForPC):
  • jit/JIT.cpp: (JSC::ctiPatchNearCallByReturnAddress): (JSC::ctiPatchCallByReturnAddress):
  • jit/JIT.h: (JSC::JIT::compileGetByIdProto): (JSC::JIT::compileGetByIdChain): (JSC::JIT::compilePutByIdTransition): (JSC::JIT::compilePatchGetArrayLength):
  • jit/JITPropertyAccess.cpp: (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::patchGetByIdSelf): (JSC::JIT::patchPutByIdReplace): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdChain):
  • jit/JITStubs.cpp: (JSC::JITThunks::tryCachePutByID): (JSC::JITThunks::tryCacheGetByID): (JSC::StackHack::StackHack): (JSC::returnToThrowTrampoline): (JSC::throwStackOverflowError): (JSC::JITStubs::DEFINE_STUB_FUNCTION):
  • jit/JITStubs.h: (JSC::): (JSC::JITStackFrame::returnAddressSlot):
  • runtime/JSGlobalData.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/jit/JITStubs.cpp

    r44693 r44705  
    323323#if ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS)
    324324
    325 NEVER_INLINE void JITThunks::tryCachePutByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValue baseValue, const PutPropertySlot& slot)
     325NEVER_INLINE void JITThunks::tryCachePutByID(CallFrame* callFrame, CodeBlock* codeBlock, ReturnAddressPtr returnAddress, JSValue baseValue, const PutPropertySlot& slot)
    326326{
    327327    // The interpreter checks for recursion here; I do not believe this can occur in CTI.
     
    367367}
    368368
    369 NEVER_INLINE void JITThunks::tryCacheGetByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValue baseValue, const Identifier& propertyName, const PropertySlot& slot)
     369NEVER_INLINE void JITThunks::tryCacheGetByID(CallFrame* callFrame, CodeBlock* codeBlock, ReturnAddressPtr returnAddress, JSValue baseValue, const Identifier& propertyName, const PropertySlot& slot)
    370370{
    371371    // FIXME: Write a test that proves we need to check for recursion here just
     
    474474        , savedReturnAddress(*stackFrame.returnAddressSlot())
    475475    {
    476         *stackFrame.returnAddressSlot() = reinterpret_cast<void*>(jscGeneratedNativeCode);
     476        *stackFrame.returnAddressSlot() = ReturnAddressPtr(FunctionPtr(jscGeneratedNativeCode));
    477477    }
    478478
     
    483483
    484484    JITStackFrame& stackFrame;
    485     void* savedReturnAddress;
     485    ReturnAddressPtr savedReturnAddress;
    486486};
    487487
    488488#define STUB_INIT_STACK_FRAME(stackFrame) SETUP_VA_LISTL_ARGS; JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS); StackHack stackHack(stackFrame)
    489 #define STUB_SET_RETURN_ADDRESS(returnAddress) stackHack.savedReturnAddress = returnAddress
     489#define STUB_SET_RETURN_ADDRESS(returnAddress) stackHack.savedReturnAddress = ReturnAddressPtr(returnAddress)
    490490#define STUB_RETURN_ADDRESS stackHack.savedReturnAddress
    491491
     
    493493
    494494#define STUB_INIT_STACK_FRAME(stackFrame) SETUP_VA_LISTL_ARGS; JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS)
    495 #define STUB_SET_RETURN_ADDRESS(returnAddress) *stackFrame.returnAddressSlot() = returnAddress
     495#define STUB_SET_RETURN_ADDRESS(returnAddress) *stackFrame.returnAddressSlot() = ReturnAddressPtr(returnAddress)
    496496#define STUB_RETURN_ADDRESS *stackFrame.returnAddressSlot()
    497497
     
    502502// good to keep the code size down by leaving as much of the exception
    503503// handling code out of line as possible.
    504 static NEVER_INLINE void returnToThrowTrampoline(JSGlobalData* globalData, void* exceptionLocation, void*& returnAddressSlot)
     504static NEVER_INLINE void returnToThrowTrampoline(JSGlobalData* globalData, ReturnAddressPtr exceptionLocation, ReturnAddressPtr& returnAddressSlot)
    505505{
    506506    ASSERT(globalData->exception);
    507507    globalData->exceptionLocation = exceptionLocation;
    508     returnAddressSlot = reinterpret_cast<void*>(ctiVMThrowTrampoline);
    509 }
    510 
    511 static NEVER_INLINE void throwStackOverflowError(CallFrame* callFrame, JSGlobalData* globalData, void* exceptionLocation, void*& returnAddressSlot)
     508    returnAddressSlot = ReturnAddressPtr(FunctionPtr(ctiVMThrowTrampoline));
     509}
     510
     511static NEVER_INLINE void throwStackOverflowError(CallFrame* callFrame, JSGlobalData* globalData, ReturnAddressPtr exceptionLocation, ReturnAddressPtr& returnAddressSlot)
    512512{
    513513    globalData->exception = createStackOverflowError(callFrame);
     
    673673    CallFrame* oldCallFrame = stackFrame.callFrame->callerFrame();
    674674    stackFrame.callFrame = oldCallFrame;
    675     throwStackOverflowError(oldCallFrame, stackFrame.globalData, oldCallFrame->returnPC(), STUB_RETURN_ADDRESS);
     675    throwStackOverflowError(oldCallFrame, stackFrame.globalData, ReturnAddressPtr(oldCallFrame->returnPC()), STUB_RETURN_ADDRESS);
    676676}
    677677
     
    12791279        CallFrame* callFrame = CallFrame::create(previousCallFrame->registers() + registerOffset);
    12801280
    1281         callFrame->init(0, static_cast<Instruction*>(STUB_RETURN_ADDRESS), previousCallFrame->scopeChain(), previousCallFrame, 0, argCount, 0);
     1281        callFrame->init(0, static_cast<Instruction*>((STUB_RETURN_ADDRESS).value()), previousCallFrame->scopeChain(), previousCallFrame, 0, argCount, 0);
    12821282        stackFrame.callFrame = callFrame;
    12831283
Note: See TracChangeset for help on using the changeset viewer.