Changeset 43352 in webkit for trunk/JavaScriptCore/jit


Ignore:
Timestamp:
May 7, 2009, 11:45:34 AM (16 years ago)
Author:
[email protected]
Message:

2009-05-07 Geoffrey Garen <[email protected]>

Reviewed by Gavin Barraclough.

Removed a few more special constants, and replaced them with uses of
the JITStackFrame struct.

Removed one of the two possible definitions of VoidPtrPair. The Mac
definition was more elegant, but SunSpider doesn't think it's any
faster, and it's net less elegant to have two ways of doing things.

  • jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompile):
  • jit/JITStubs.h: (JSC::):
Location:
trunk/JavaScriptCore/jit
Files:
2 edited

Legend:

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

    r43331 r43352  
    11031103        }
    11041104        case op_profile_will_call: {
    1105             emitGetCTIParam(STUB_ARGS_profilerReference, regT0);
     1105            emitGetCTIParam(FIELD_OFFSET(JITStackFrame, enabledProfilerReference) / sizeof (void*), regT0);
    11061106            Jump noProfiler = branchTestPtr(Zero, Address(regT0));
    11071107            emitPutJITStubArgFromVirtualRegister(currentInstruction[1].u.operand, 1, regT0);
     
    11121112        }
    11131113        case op_profile_did_call: {
    1114             emitGetCTIParam(STUB_ARGS_profilerReference, regT0);
     1114            emitGetCTIParam(FIELD_OFFSET(JITStackFrame, enabledProfilerReference) / sizeof (void*), regT0);
    11151115            Jump noProfiler = branchTestPtr(Zero, Address(regT0));
    11161116            emitPutJITStubArgFromVirtualRegister(currentInstruction[1].u.operand, 1, regT0);
     
    15241524        emitPutImmediateToCallFrameHeader(m_codeBlock, RegisterFile::CodeBlock);
    15251525
    1526         emitGetCTIParam(STUB_ARGS_registerFile, regT0);
     1526        emitGetCTIParam(FIELD_OFFSET(JITStackFrame, registerFile) / sizeof (void*), regT0);
    15271527        addPtr(Imm32(m_codeBlock->m_numCalleeRegisters * sizeof(Register)), callFrameRegister, regT1);
    15281528       
  • trunk/JavaScriptCore/jit/JITStubs.h

    r43334 r43352  
    110110#endif
    111111
     112#define STUB_ARGS_code (offsetof(struct JITStackFrame, code) / sizeof (void*))
     113#define STUB_ARGS_callFrame (offsetof(struct JITStackFrame, callFrame) / sizeof (void*))
     114
     115#define STUB_RETURN_ADDRESS_SLOT (STUB_ARGS[-1])
     116
    112117#if USE(JIT_STUB_ARGUMENT_VA_LIST)
    113118    #define STUB_ARGS_DECLARATION void* args, ...
     
    136141#endif
    137142
    138 #if PLATFORM(X86_64)
    139 #define STUB_ARGS_offset 0x10
    140 #else
    141 #define STUB_ARGS_offset 0x0C
    142 #endif
    143 
    144 #define STUB_ARGS_code (STUB_ARGS_offset)
    145 #define STUB_ARGS_registerFile (STUB_ARGS_offset + 1)
    146 #define STUB_ARGS_callFrame (STUB_ARGS_offset + 2)
    147 #define STUB_ARGS_exception (STUB_ARGS_offset + 3)
    148 #define STUB_ARGS_profilerReference (STUB_ARGS_offset + 4)
    149 #define STUB_ARGS_globalData (STUB_ARGS_offset + 5)
    150 
    151 #define STUB_RETURN_ADDRESS_SLOT (STUB_ARGS[-1])
    152 
    153 // The Mac compilers are fine with this,
    154 #if PLATFORM(MAC)
    155     struct VoidPtrPair {
    156         void* first;
    157         void* second;
    158     };
    159 #define RETURN_PAIR(a,b) VoidPtrPair pair = { a, b }; return pair
    160 #else
    161143    typedef uint64_t VoidPtrPair;
    162144    union VoidPtrPairValue {
     
    164146        VoidPtrPair i;
    165147    };
    166 #define RETURN_PAIR(a,b) VoidPtrPairValue pair = {{ a, b }}; return pair.i
    167 #endif
     148    #define RETURN_PAIR(a,b) VoidPtrPairValue pair = {{ a, b }}; return pair.i
    168149
    169150    extern "C" void ctiVMThrowTrampoline();
Note: See TracChangeset for help on using the changeset viewer.