Changeset 44884 in webkit for trunk/JavaScriptCore
- Timestamp:
- Jun 19, 2009, 5:49:36 PM (16 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r44873 r44884 1 2009-06-19 Gavin Barraclough <[email protected]> 2 3 Reviewed by Oliver Hunt. 4 5 Fix armv7 JIT build issues. 6 7 Unfortunate the arm compiler does not like the use of offsetof on JITStackFrame (since it now contains non POD types), 8 and the FIELD_OFFSET macro does not appear constantish enough for it to be happy with its use in COMPILE_ASSERT macros. 9 10 * Replace offsetofs with FIELD_OFFSETs (safe on C++ objects). 11 * Move COMPILE_ASSERTs defending layout of JITStackFrame structure on armv7 into JITThunks constructor. 12 13 * jit/JIT.cpp: 14 * jit/JIT.h: 15 * jit/JITInlineMethods.h: 16 (JSC::JIT::restoreArgumentReference): 17 * jit/JITOpcodes.cpp: 18 (JSC::JIT::emit_op_catch): 19 * jit/JITStubs.cpp: 20 (JSC::JITThunks::JITThunks): 21 1 22 2009-06-19 Adam Treat <[email protected]> 2 23 -
trunk/JavaScriptCore/jit/JIT.cpp
r44844 r44884 836 836 move(ImmPtr(reinterpret_cast<void*>(ctiVMThrowTrampoline)), regT2); 837 837 emitGetFromCallFrameHeaderPtr(RegisterFile::CallerFrame, callFrameRegister); 838 poke(callFrameRegister, offsetof(struct JITStackFrame, callFrame) / sizeof (void*));838 poke(callFrameRegister, FIELD_OFFSET(struct JITStackFrame, callFrame) / sizeof (void*)); 839 839 restoreReturnAddressBeforeReturn(regT2); 840 840 ret(); -
trunk/JavaScriptCore/jit/JIT.h
r44797 r44884 28 28 29 29 #include <wtf/Platform.h> 30 31 // FIELD_OFFSET: Like the C++ offsetof macro, but you can use it with classes. 32 // The magic number 0x4000 is insignificant. We use it to avoid using NULL, since 33 // NULL can cause compiler problems, especially in cases of multiple inheritance. 34 #define FIELD_OFFSET(class, field) (reinterpret_cast<ptrdiff_t>(&(reinterpret_cast<class*>(0x4000)->field)) - 0x4000) 30 35 31 36 #if ENABLE(JIT) -
trunk/JavaScriptCore/jit/JITInlineMethods.h
r44523 r44884 35 35 #endif 36 36 37 // FIELD_OFFSET: Like the C++ offsetof macro, but you can use it with classes.38 // The magic number 0x4000 is insignificant. We use it to avoid using NULL, since39 // NULL can cause compiler problems, especially in cases of multiple inheritance.40 #define FIELD_OFFSET(class, field) (reinterpret_cast<ptrdiff_t>(&(reinterpret_cast<class*>(0x4000)->field)) - 0x4000)41 42 37 namespace JSC { 43 38 … … 226 221 ALWAYS_INLINE void JIT::restoreArgumentReference() 227 222 { 228 poke(callFrameRegister, offsetof(struct JITStackFrame, callFrame) / sizeof (void*));223 poke(callFrameRegister, FIELD_OFFSET(struct JITStackFrame, callFrame) / sizeof (void*)); 229 224 } 230 225 ALWAYS_INLINE void JIT::restoreArgumentReferenceForTrampoline() {} … … 233 228 { 234 229 move(stackPointerRegister, firstArgumentRegister); 235 poke(callFrameRegister, offsetof(struct JITStackFrame, callFrame) / sizeof (void*));230 poke(callFrameRegister, FIELD_OFFSET(struct JITStackFrame, callFrame) / sizeof (void*)); 236 231 } 237 232 ALWAYS_INLINE void JIT::restoreArgumentReferenceForTrampoline() -
trunk/JavaScriptCore/jit/JITOpcodes.cpp
r44838 r44884 690 690 { 691 691 killLastResultRegister(); // FIXME: Implicitly treat op_catch as a labeled statement, and remove this line of code. 692 peek(callFrameRegister, offsetof(struct JITStackFrame, callFrame) / sizeof (void*));692 peek(callFrameRegister, FIELD_OFFSET(struct JITStackFrame, callFrame) / sizeof (void*)); 693 693 emitPutVirtualRegister(currentInstruction[1].u.operand); 694 694 } -
trunk/JavaScriptCore/jit/JITStubs.cpp
r44844 r44884 196 196 #endif 197 197 198 COMPILE_ASSERT(offsetof(struct JITStackFrame, preservedReturnAddress) == 0x20, JITStackFrame_outerReturnAddress_offset_matches_ctiTrampoline);199 COMPILE_ASSERT(offsetof(struct JITStackFrame, preservedR4) == 0x24, JITStackFrame_outerReturnAddress_offset_matches_ctiTrampoline);200 COMPILE_ASSERT(offsetof(struct JITStackFrame, preservedR5) == 0x28, JITStackFrame_outerReturnAddress_offset_matches_ctiTrampoline);201 COMPILE_ASSERT(offsetof(struct JITStackFrame, preservedR6) == 0x2c, JITStackFrame_outerReturnAddress_offset_matches_ctiTrampoline);202 203 COMPILE_ASSERT(offsetof(struct JITStackFrame, registerFile) == 0x30, JITStackFrame_registerFile_offset_matches_ctiTrampoline);204 COMPILE_ASSERT(offsetof(struct JITStackFrame, callFrame) == 0x34, JITStackFrame_callFrame_offset_matches_ctiTrampoline);205 COMPILE_ASSERT(offsetof(struct JITStackFrame, exception) == 0x38, JITStackFrame_exception_offset_matches_ctiTrampoline);206 // The fifth argument is the first item already on the stack.207 COMPILE_ASSERT(offsetof(struct JITStackFrame, enabledProfilerReference) == 0x3c, JITStackFrame_enabledProfilerReference_offset_matches_ctiTrampoline);208 209 198 asm volatile ( 210 199 ".text" "\n" … … 339 328 { 340 329 JIT::compileCTIMachineTrampolines(globalData, &m_executablePool, &m_ctiArrayLengthTrampoline, &m_ctiStringLengthTrampoline, &m_ctiVirtualCallPreLink, &m_ctiVirtualCallLink, &m_ctiVirtualCall, &m_ctiNativeCallThunk); 330 331 #if PLATFORM(ARM_V7) 332 // Unfortunate the arm compiler does not like the use of offsetof on JITStackFrame (since it contains non POD types), 333 // and the FIELD_OFFSET macro does not appear constantish enough for it to be happy with its use in COMPILE_ASSERT 334 // macros. 335 ASSERT(FIELD_OFFSET(struct JITStackFrame, preservedReturnAddress) == 0x20); 336 ASSERT(FIELD_OFFSET(struct JITStackFrame, preservedR4) == 0x24); 337 ASSERT(FIELD_OFFSET(struct JITStackFrame, preservedR5) == 0x28); 338 ASSERT(FIELD_OFFSET(struct JITStackFrame, preservedR6) == 0x2c); 339 340 ASSERT(FIELD_OFFSET(struct JITStackFrame, registerFile) == 0x30); 341 ASSERT(FIELD_OFFSET(struct JITStackFrame, callFrame) == 0x34); 342 ASSERT(FIELD_OFFSET(struct JITStackFrame, exception) == 0x38); 343 // The fifth argument is the first item already on the stack. 344 ASSERT(FIELD_OFFSET(struct JITStackFrame, enabledProfilerReference) == 0x3c); 345 346 ASSERT(FIELD_OFFSET(struct JITStackFrame, thunkReturnAddress) == 0x1C); 347 #endif 341 348 } 342 349 … … 564 571 565 572 #if PLATFORM(ARM_V7) 566 567 COMPILE_ASSERT(offsetof(struct JITStackFrame, thunkReturnAddress) == 0x1C, JITStackFrame_outerReturnAddress_offset_matches_ctiTrampoline);568 573 569 574 #define DEFINE_STUB_FUNCTION(rtype, op) \
Note:
See TracChangeset
for help on using the changeset viewer.