Changeset 39226 in webkit
- Timestamp:
- Dec 11, 2008 8:20:17 PM (15 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r39206 r39226 1 2008-12-11 Gavin Barraclough <barraclough@apple.com> 2 3 Reviewed by Oliver Hunt. 4 5 Remove CTI_ARGUMENTS mode, use va_start implementation on Windows, 6 unifying JIT callback (cti_*) argument access on OS X & Windows 7 8 No performance impact. 9 10 * interpreter/Interpreter.h: 11 * jit/JIT.cpp: 12 (JSC::JIT::privateCompileCTIMachineTrampolines): 13 * jit/JIT.h: 14 * jit/JITInlineMethods.h: 15 (JSC::JIT::emitCTICall): 16 * jit/JITPropertyAccess.cpp: 17 (JSC::JIT::privateCompilePutByIdTransition): 18 * wtf/Platform.h: 19 1 20 2008-12-11 Holger Freyther <zecke@selfish.org> 2 21 -
trunk/JavaScriptCore/interpreter/Interpreter.h
r39161 r39226 55 55 #if ENABLE(JIT) 56 56 57 #if USE(CTI_ARGUMENT)58 #define CTI_ARGS void** args59 #define ARGS (args)60 #else61 57 #define CTI_ARGS void* args, ... 62 58 #define ARGS (reinterpret_cast<void**>(vl_args) - 1) 63 #endif64 65 #if USE(FAST_CALL_CTI_ARGUMENT)66 67 #if COMPILER(MSVC)68 #define SFX_CALL __fastcall69 #elif COMPILER(GCC)70 #define SFX_CALL __attribute__ ((fastcall))71 #else72 #error Need to support fastcall calling convention in this compiler73 #endif74 75 #else76 77 #if COMPILER(MSVC)78 #define SFX_CALL __cdecl79 #else80 59 #define SFX_CALL 81 #endif82 83 #endif84 60 85 61 typedef uint64_t VoidPtrPair; -
trunk/JavaScriptCore/jit/JIT.cpp
r39197 r39226 76 76 ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" 77 77 SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" 78 #if USE(CTI_ARGUMENT)79 #if USE(FAST_CALL_CTI_ARGUMENT)80 "movl %esp, %ecx" "\n"81 #else82 "movl %esp, 0(%esp)" "\n"83 #endif84 "call " SYMBOL_STRING(_ZN3JSC11Interpreter12cti_vm_throwEPPv) "\n"85 #else86 78 "call " SYMBOL_STRING(_ZN3JSC11Interpreter12cti_vm_throwEPvz) "\n" 87 #endif88 79 "addl $0x20, %esp" "\n" 89 80 "popl %ebx" "\n" … … 2042 2033 JmpSrc hasCodeBlock1 = __ jne(); 2043 2034 __ popl_r(X86::ebx); 2044 restoreArgumentReference();2045 2035 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame); 2046 2036 JmpSrc callJSFunction1 = __ call(); … … 2056 2046 emitPutCTIArg(X86::ebx, 4); 2057 2047 emitPutCTIArg(X86::eax, 12); 2058 restoreArgumentReference();2059 2048 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame); 2060 2049 JmpSrc callArityCheck1 = __ call(); … … 2069 2058 __ popl_r(X86::ebx); 2070 2059 emitPutCTIArg(X86::ebx, 4); 2071 restoreArgumentReference();2072 2060 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame); 2073 2061 JmpSrc callDontLazyLinkCall = __ call(); … … 2084 2072 JmpSrc hasCodeBlock2 = __ jne(); 2085 2073 __ popl_r(X86::ebx); 2086 restoreArgumentReference();2087 2074 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame); 2088 2075 JmpSrc callJSFunction2 = __ call(); … … 2098 2085 emitPutCTIArg(X86::ebx, 4); 2099 2086 emitPutCTIArg(X86::eax, 12); 2100 restoreArgumentReference();2101 2087 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame); 2102 2088 JmpSrc callArityCheck2 = __ call(); … … 2111 2097 __ popl_r(X86::ebx); 2112 2098 emitPutCTIArg(X86::ebx, 4); 2113 restoreArgumentReference();2114 2099 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame); 2115 2100 JmpSrc callLazyLinkCall = __ call(); … … 2126 2111 JmpSrc hasCodeBlock3 = __ jne(); 2127 2112 __ popl_r(X86::ebx); 2128 restoreArgumentReference();2129 2113 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame); 2130 2114 JmpSrc callJSFunction3 = __ call(); … … 2140 2124 emitPutCTIArg(X86::ebx, 4); 2141 2125 emitPutCTIArg(X86::eax, 12); 2142 restoreArgumentReference();2143 2126 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame); 2144 2127 JmpSrc callArityCheck3 = __ call(); -
trunk/JavaScriptCore/jit/JIT.h
r39197 r39226 277 277 static const int repatchGetByIdDefaultOffset = 256; 278 278 279 #if USE(FAST_CALL_CTI_ARGUMENT)280 static const int ctiArgumentInitSize = 2;281 #elif USE(CTI_ARGUMENT)282 static const int ctiArgumentInitSize = 4;283 #else284 static const int ctiArgumentInitSize = 0;285 #endif286 279 // These architecture specific value are used to enable repatching - see comment on op_put_by_id. 287 280 static const int repatchOffsetPutByIdStructure = 7; … … 292 285 static const int repatchOffsetGetByIdPropertyMapOffset = 22; 293 286 #if ENABLE(OPCODE_SAMPLING) 294 static const int repatchOffsetGetByIdSlowCaseCall = 27 + 4 + ctiArgumentInitSize;287 static const int repatchOffsetGetByIdSlowCaseCall = 27 + 4; 295 288 #else 296 static const int repatchOffsetGetByIdSlowCaseCall = 17 + 4 + ctiArgumentInitSize;289 static const int repatchOffsetGetByIdSlowCaseCall = 17 + 4; 297 290 #endif 298 291 static const int repatchOffsetOpCallCall = 6; … … 458 451 void emitTagAsBoolImmediate(RegisterID reg); 459 452 460 void restoreArgumentReference();461 void restoreArgumentReferenceForTrampoline();462 463 453 JmpSrc emitNakedCall(unsigned bytecodeIndex, RegisterID); 464 454 JmpSrc emitNakedCall(unsigned bytecodeIndex, void* function); -
trunk/JavaScriptCore/jit/JITInlineMethods.h
r39121 r39226 202 202 } 203 203 204 ALWAYS_INLINE void JIT::restoreArgumentReference()205 {206 #if USE(CTI_ARGUMENT)207 #if USE(FAST_CALL_CTI_ARGUMENT)208 __ movl_rr(X86::esp, X86::ecx);209 #else210 __ movl_rm(X86::esp, 0, X86::esp);211 #endif212 #endif213 }214 215 ALWAYS_INLINE void JIT::restoreArgumentReferenceForTrampoline()216 {217 #if USE(CTI_ARGUMENT) && USE(FAST_CALL_CTI_ARGUMENT)218 __ movl_rr(X86::esp, X86::ecx);219 __ addl_i32r(4, X86::ecx);220 #endif221 }222 223 224 204 ALWAYS_INLINE JmpSrc JIT::emitCTICall(unsigned bytecodeIndex, CTIHelper_j helper) 225 205 { … … 227 207 store32(Imm32(m_interpreter->sampler()->encodeSample(m_codeBlock->instructions().begin() + bytecodeIndex, true)), m_interpreter->sampler()->sampleSlot()); 228 208 #endif 229 restoreArgumentReference();230 209 emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame); 231 210 JmpSrc ctiCall = call(); … … 244 223 store32(Imm32(m_interpreter->sampler()->encodeSample(m_codeBlock->instructions().begin() + bytecodeIndex, true)), m_interpreter->sampler()->sampleSlot()); 245 224 #endif 246 restoreArgumentReference();247 225 emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame); 248 226 JmpSrc ctiCall = call(); … … 261 239 store32(Imm32(m_interpreter->sampler()->encodeSample(m_codeBlock->instructions().begin() + bytecodeIndex, true)), m_interpreter->sampler()->sampleSlot()); 262 240 #endif 263 restoreArgumentReference();264 241 emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame); 265 242 JmpSrc ctiCall = call(); … … 278 255 store32(Imm32(m_interpreter->sampler()->encodeSample(m_codeBlock->instructions().begin() + bytecodeIndex, true)), m_interpreter->sampler()->sampleSlot()); 279 256 #endif 280 restoreArgumentReference();281 257 emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame); 282 258 JmpSrc ctiCall = call(); … … 295 271 store32(Imm32(m_interpreter->sampler()->encodeSample(m_codeBlock->instructions().begin() + bytecodeIndex, true)), m_interpreter->sampler()->sampleSlot()); 296 272 #endif 297 restoreArgumentReference();298 273 emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame); 299 274 JmpSrc ctiCall = call(); … … 312 287 store32(Imm32(m_interpreter->sampler()->encodeSample(m_codeBlock->instructions().begin() + bytecodeIndex, true)), m_interpreter->sampler()->sampleSlot()); 313 288 #endif 314 restoreArgumentReference();315 289 emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame); 316 290 JmpSrc ctiCall = call(); … … 329 303 store32(Imm32(m_interpreter->sampler()->encodeSample(m_codeBlock->instructions().begin() + bytecodeIndex, true)), m_interpreter->sampler()->sampleSlot()); 330 304 #endif 331 restoreArgumentReference();332 305 emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame); 333 306 JmpSrc ctiCall = call(); -
trunk/JavaScriptCore/jit/JITPropertyAccess.cpp
r39123 r39226 282 282 for (unsigned i = 0; i < failureCases.size(); ++i) 283 283 __ link(failureCases[i], __ label()); 284 restoreArgumentReferenceForTrampoline();285 284 failureJump = __ jmp(); 286 285 } -
trunk/JavaScriptCore/wtf/Platform.h
r39206 r39226 456 456 #endif 457 457 458 /* Use "fastcall" calling convention on MSVC */459 #if COMPILER(MSVC)460 #define WTF_USE_FAST_CALL_CTI_ARGUMENT 1461 #define WTF_USE_CTI_ARGUMENT 1462 #endif463 464 458 #if !PLATFORM(QT) 465 459 #define WTF_USE_FONT_FAST_PATH 1
Note: See TracChangeset
for help on using the changeset viewer.