Changeset 37297 in webkit for trunk/JavaScriptCore/VM/CTI.cpp
- Timestamp:
- Oct 4, 2008, 2:12:54 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/VM/CTI.cpp
r37294 r37297 75 75 76 76 #if COMPILER(GCC) && PLATFORM(X86) 77 77 78 asm( 78 79 ".globl _ctiTrampoline" "\n" … … 82 83 "subl $0x24, %esp" "\n" 83 84 "movl $512, %esi" "\n" 84 "call *0x30(%esp)" "\n" // Ox30 = 0x0C * 4, 0x0C = CTI_ARGS_code85 "call *0x30(%esp)" "\n" // Ox30 = 0x0C * 4, 0x0C = CTI_ARGS_code 85 86 "addl $0x24, %esp" "\n" 86 87 "popl %edi" "\n" … … 92 93 ".globl _ctiVMThrowTrampoline" "\n" 93 94 "_ctiVMThrowTrampoline:" "\n" 94 #ifndef NDEBUG95 "movl 0x34(%esp), %ecx" "\n" //Ox34 = 0x0D * 4, 0x0D = CTI_ARGS_exec96 "cmpl $0, 8(%ecx)" "\n"97 "jne 1f" "\n"98 "int3" "\n"99 "1:" "\n"100 #endif101 95 "call __ZN3JSC7Machine12cti_vm_throwEPv" "\n" 102 96 "addl $0x24, %esp" "\n" … … 107 101 108 102 #elif COMPILER(MSVC) 109 extern "C" 110 {103 104 extern "C" { 111 105 112 __declspec(naked) JSValue* ctiTrampoline(void* code, ExecState* exec, RegisterFile* registerFile, Register* r, JSValue** exception, Profiler**, JSGlobalData*)106 __declspec(naked) JSValue* ctiTrampoline(void* code, RegisterFile*, Register*, JSValue** exception, Profiler**, JSGlobalData*) 113 107 { 114 108 __asm { … … 129 123 { 130 124 __asm { 131 mov [esp], esp;125 mov [esp], esp; 132 126 call JSC::Machine::cti_vm_throw; 133 127 add esp, 0x24; … … 247 241 } 248 242 249 #ifdef NDEBUG 250 251 ALWAYS_INLINE void CTI::emitDebugExceptionCheck() 252 { 253 } 254 255 #else 256 257 ALWAYS_INLINE void CTI::emitDebugExceptionCheck() 258 { 259 emitGetCTIParam(CTI_ARGS_exec, X86::ecx); 260 m_jit.cmpl_i32m(0, OBJECT_OFFSET(ExecState, m_exception), X86::ecx); 261 X86Assembler::JmpSrc noException = m_jit.emitUnlinkedJe(); 262 m_jit.emitInt3(); 263 m_jit.link(noException, m_jit.label()); 264 } 243 #ifndef NDEBUG 265 244 266 245 void CTI::printOpcodeOperandTypes(unsigned src1, unsigned src2) … … 305 284 X86Assembler::JmpSrc call = m_jit.emitCall(r); 306 285 m_calls.append(CallRecord(call, opcodeIndex)); 307 emitDebugExceptionCheck();308 286 309 287 return call; … … 318 296 X86Assembler::JmpSrc call = m_jit.emitCall(); 319 297 m_calls.append(CallRecord(call, helper, opcodeIndex)); 320 emitDebugExceptionCheck();321 298 #if ENABLE(SAMPLING_TOOL) 322 299 m_jit.movl_i32m(0, &inCalledCode); … … 334 311 X86Assembler::JmpSrc call = m_jit.emitCall(); 335 312 m_calls.append(CallRecord(call, helper, opcodeIndex)); 336 emitDebugExceptionCheck();337 313 #if ENABLE(SAMPLING_TOOL) 338 314 m_jit.movl_i32m(0, &inCalledCode); … … 350 326 X86Assembler::JmpSrc call = m_jit.emitCall(); 351 327 m_calls.append(CallRecord(call, helper, opcodeIndex)); 352 emitDebugExceptionCheck();353 328 #if ENABLE(SAMPLING_TOOL) 354 329 m_jit.movl_i32m(0, &inCalledCode); … … 366 341 X86Assembler::JmpSrc call = m_jit.emitCall(); 367 342 m_calls.append(CallRecord(call, helper, opcodeIndex)); 368 emitDebugExceptionCheck();369 343 #if ENABLE(SAMPLING_TOOL) 370 344 m_jit.movl_i32m(0, &inCalledCode); … … 382 356 X86Assembler::JmpSrc call = m_jit.emitCall(); 383 357 m_calls.append(CallRecord(call, helper, opcodeIndex)); 384 emitDebugExceptionCheck();385 358 #if ENABLE(SAMPLING_TOOL) 386 359 m_jit.movl_i32m(0, &inCalledCode); … … 1224 1197 1225 1198 // Restore our caller's "r". 1226 emitGetCTIParam(CTI_ARGS_exec, X86::ecx);1227 1199 emitGetArg(RegisterFile::CallerRegisters, X86::edi); 1228 1200 emitPutCTIParam(X86::edi, CTI_ARGS_r); 1229 m_jit.movl_rm(X86::edi, OBJECT_OFFSET(ExecState, m_callFrame), X86::ecx);1230 1201 1231 1202 // Return. … … 1787 1758 case op_catch: { 1788 1759 emitGetCTIParam(CTI_ARGS_r, X86::edi); // edi := r 1789 emitGetCTIParam(CTI_ARGS_exec, X86::ecx);1790 m_jit.movl_mr(OBJECT_OFFSET(ExecState, m_exception), X86::ecx, X86::eax);1791 m_jit.movl_i32m(0, OBJECT_OFFSET(ExecState, m_exception), X86::ecx);1792 1760 emitPutResult(instruction[i + 1].u.operand); 1793 1761 i += 2;
Note:
See TracChangeset
for help on using the changeset viewer.