Changeset 43374 in webkit for trunk/JavaScriptCore/jit/JITStubs.cpp
- Timestamp:
- May 7, 2009, 4:33:00 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/JITStubs.cpp
r43362 r43374 66 66 #if COMPILER(GCC) && PLATFORM(X86) 67 67 68 COMPILE_ASSERT(STUB_ARGS_code == 0x0C, STUB_ARGS_code_is_0x0C); 69 COMPILE_ASSERT(STUB_ARGS_callFrame == 0x0E, STUB_ARGS_callFrame_is_0x0E); 68 // These ASSERTs remind you that, if you change the layout of JITStackFrame, you 69 // need to change the assembly trampolines below to match. 70 COMPILE_ASSERT(offsetof(struct JITStackFrame, callFrame) == 0x38, JITStackFrame_callFrame_offset_matches_ctiTrampoline); 71 COMPILE_ASSERT(offsetof(struct JITStackFrame, code) == 0x30, JITStackFrame_code_offset_matches_ctiTrampoline); 72 COMPILE_ASSERT(offsetof(struct JITStackFrame, savedEBX) == 0x1c, JITStackFrame_stub_argument_space_matches_ctiTrampoline); 70 73 71 74 #if PLATFORM(DARWIN) … … 85 88 "subl $0x1c, %esp" "\n" 86 89 "movl $512, %esi" "\n" 87 "movl 0x38(%esp), %edi" "\n" // Ox38 = 0x0E * 4, 0x0E = STUB_ARGS_callFrame (see assertion above)88 "call *0x30(%esp)" "\n" // Ox30 = 0x0C * 4, 0x0C = STUB_ARGS_code (see assertion above)90 "movl 0x38(%esp), %edi" "\n" 91 "call *0x30(%esp)" "\n" 89 92 "addl $0x1c, %esp" "\n" 90 93 "popl %ebx" "\n" … … 118 121 #elif COMPILER(GCC) && PLATFORM(X86_64) 119 122 120 COMPILE_ASSERT(STUB_ARGS_code == 0x10, STUB_ARGS_code_is_0x10); 121 COMPILE_ASSERT(STUB_ARGS_callFrame == 0x12, STUB_ARGS_callFrame_is_0x12); 123 // These ASSERTs remind you that, if you change the layout of JITStackFrame, you 124 // need to change the assembly trampolines below to match. 125 COMPILE_ASSERT(offsetof(struct JITStackFrame, callFrame) == 0x90, JITStackFrame_callFrame_offset_matches_ctiTrampoline); 126 COMPILE_ASSERT(offsetof(struct JITStackFrame, code) == 0x80, JITStackFrame_code_offset_matches_ctiTrampoline); 127 COMPILE_ASSERT(offsetof(struct JITStackFrame, savedRBX) == 0x48, JITStackFrame_stub_argument_space_matches_ctiTrampoline); 122 128 123 129 #if PLATFORM(DARWIN) … … 141 147 "movq $0xFFFF000000000000, %r14" "\n" 142 148 "movq $0xFFFF000000000002, %r15" "\n" 143 "movq 0x90(%rsp), %r13" "\n" // Ox90 = 0x12 * 8, 0x12 = STUB_ARGS_callFrame (see assertion above)144 "call *0x80(%rsp)" "\n" // Ox80 = 0x10 * 8, 0x10 = STUB_ARGS_code (see assertion above)149 "movq 0x90(%rsp), %r13" "\n" 150 "call *0x80(%rsp)" "\n" 145 151 "addq $0x48, %rsp" "\n" 146 152 "popq %rbx" "\n" … … 171 177 "ret" "\n" 172 178 ); 173 179 174 180 #elif COMPILER(MSVC) 181 182 // These ASSERTs remind you that, if you change the layout of JITStackFrame, you 183 // need to change the assembly trampolines below to match. 184 COMPILE_ASSERT(offsetof(struct JITStackFrame, callFrame) == 0x38, JITStackFrame_callFrame_offset_matches_ctiTrampoline); 185 COMPILE_ASSERT(offsetof(struct JITStackFrame, code) == 0x30, JITStackFrame_code_offset_matches_ctiTrampoline); 186 COMPILE_ASSERT(offsetof(struct JITStackFrame, savedEBX) == 0x1c, JITStackFrame_stub_argument_space_matches_ctiTrampoline); 175 187 176 188 extern "C" { … … 188 200 mov ecx, esp; 189 201 mov edi, [esp + 0x38]; 190 call [esp + 0x30]; // Ox30 = 0x0C * 4, 0x0C = STUB_ARGS_code (see assertion above)202 call [esp + 0x30]; 191 203 add esp, 0x1c; 192 204 pop ebx;
Note:
See TracChangeset
for help on using the changeset viewer.