Changeset 157581 in webkit
- Timestamp:
- Oct 17, 2013, 11:12:28 AM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 18 edited
-
ChangeLog (modified) (1 diff)
-
jit/JIT.h (modified) (1 diff)
-
jit/JITInlines.h (modified) (1 diff)
-
jit/JITOpcodes.cpp (modified) (1 diff)
-
jit/JITOpcodes32_64.cpp (modified) (2 diffs)
-
jit/JITOperations.cpp (modified) (1 diff)
-
jit/JITOperations.h (modified) (6 diffs)
-
jit/JITStubs.cpp (modified) (1 diff)
-
jit/JITStubs.h (modified) (2 diffs)
-
jit/JITStubsARM.h (modified) (4 diffs)
-
jit/JITStubsARM64.h (modified) (2 diffs)
-
jit/JITStubsARMv7.h (modified) (2 diffs)
-
jit/JITStubsMIPS.h (modified) (1 diff)
-
jit/JITStubsMSVC64.asm (modified) (2 diffs)
-
jit/JITStubsSH4.h (modified) (1 diff)
-
jit/JITStubsX86.h (modified) (2 diffs)
-
jit/JITStubsX86_64.h (modified) (1 diff)
-
jit/JSInterfaceJIT.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r157576 r157581 1 2013-10-17 Michael Saboff <msaboff@apple.com> 2 3 Transition cti_op_throw and cti_vm_throw to a JIT operation 4 https://bugs.webkit.org/show_bug.cgi?id=122931 5 6 Reviewed by Filip Pizlo. 7 8 Moved cti_op_throw to operationThrow. Made the caller responsible for jumping to the 9 catch handler. Eliminated cti_op_throw_static_error, cti_vm_throw, ctiVMThrowTrampoline() 10 and their callers as it is now dead code. There is some work needed on the Microsoft X86 11 callOperation to handle the need to provide space for structure return value. 12 13 * jit/JIT.h: 14 * jit/JITInlines.h: 15 (JSC::JIT::callOperation): 16 * jit/JITOpcodes.cpp: 17 (JSC::JIT::emit_op_throw): 18 * jit/JITOpcodes32_64.cpp: 19 (JSC::JIT::emit_op_throw): 20 (JSC::JIT::emit_op_catch): 21 * jit/JITOperations.cpp: 22 * jit/JITOperations.h: 23 * jit/JITStubs.cpp: 24 * jit/JITStubs.h: 25 * jit/JITStubsARM.h: 26 * jit/JITStubsARM64.h: 27 * jit/JITStubsARMv7.h: 28 * jit/JITStubsMIPS.h: 29 * jit/JITStubsMSVC64.asm: 30 * jit/JITStubsSH4.h: 31 * jit/JITStubsX86.h: 32 * jit/JITStubsX86_64.h: 33 * jit/JSInterfaceJIT.h: 34 1 35 2013-10-17 Mark Lam <mark.lam@apple.com> 2 36 -
trunk/Source/JavaScriptCore/jit/JIT.h
r157559 r157581 796 796 MacroAssembler::Call callOperation(WithProfileTag, J_JITOperation_EPc, int, Instruction*); 797 797 MacroAssembler::Call callOperation(J_JITOperation_EZ, int, int32_t); 798 #if USE(JSVALUE64) 799 MacroAssembler::Call callOperation(Jhe_JITOperation_EJ, RegisterID); 800 #else 801 MacroAssembler::Call callOperation(Jhe_JITOperation_EJ, RegisterID, RegisterID); 802 #endif 798 803 MacroAssembler::Call callOperation(P_JITOperation_EJS, GPRReg, size_t); 799 804 MacroAssembler::Call callOperation(P_JITOperation_EZ, int32_t); -
trunk/Source/JavaScriptCore/jit/JITInlines.h
r157559 r157581 292 292 } 293 293 294 #if USE(JSVALUE64) 295 ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(Jhe_JITOperation_EJ operation, GPRReg arg1) 296 { 297 #if COMPILER(MSVC) && CPU(X86) 298 // Need to make space on stack for return value, use that address as first arg (in register), 299 // move callFrameRegister to second argument register and push the passed arg1. 300 updateTopCallFrame(); 301 MacroAssembler::Call call = appendCall(operation); 302 // These may not be pops: 303 // pop(regT0); // Restore arg1 slot 304 // pop(regT0); // Get handler's call frame 305 // pop(regT1); // Get handler's address 306 return call; 307 #else 308 setupArgumentsWithExecState(arg1); 309 updateTopCallFrame(); 310 return appendCall(operation); 311 #endif 312 } 313 #else 314 ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(Jhe_JITOperation_EJ operation, GPRReg arg1Tag, GPRReg arg1Payload) 315 { 316 setupArgumentsWithExecState(arg1Payload, arg1Tag); 317 updateTopCallFrame(); 318 return appendCall(operation); 319 } 320 #endif 321 294 322 ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(P_JITOperation_EZ operation, int32_t op) 295 323 { -
trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp
r157559 r157581 484 484 void JIT::emit_op_throw(Instruction* currentInstruction) 485 485 { 486 JITStubCall stubCall(this, cti_op_throw);487 stubCall.addArgument(currentInstruction[1].u.operand, regT2);488 stubCall.call();489 486 ASSERT(regT0 == returnValueRegister); 490 #ifndef NDEBUG 491 // cti_op_throw always changes it's return address,492 // this point in the code should never be reached.493 breakpoint();494 #endif 487 emitGetVirtualRegister(currentInstruction[1].u.operand, regT0); 488 callOperation(operationThrow, regT0); 489 // After operationThrow returns, returnValueRegister (regT0) has the handler's callFrame and 490 // returnValue2Register has the handler's entry address. 491 jump(returnValue2Register); 495 492 } 496 493 -
trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
r157559 r157581 813 813 void JIT::emit_op_throw(Instruction* currentInstruction) 814 814 { 815 unsigned exception = currentInstruction[1].u.operand; 816 JITStubCall stubCall(this, cti_op_throw); 817 stubCall.addArgument(exception); 818 stubCall.call(); 819 820 #ifndef NDEBUG 821 // cti_op_throw always changes it's return address, 822 // this point in the code should never be reached. 823 breakpoint(); 824 #endif 815 ASSERT(regT0 == returnValueRegister); 816 emitLoad(currentInstruction[1].u.operand, regT1, regT0); 817 callOperation(operationThrow, regT1, regT0); 818 // After operationThrow returns, returnValueRegister (regT0) has the handler's callFrame and 819 // returnValue2Register has the handler's entry address. 820 jump(returnValue2Register); 825 821 } 826 822 … … 972 968 void JIT::emit_op_catch(Instruction* currentInstruction) 973 969 { 974 // cti_op_throw returns the callFrame for the handler.970 // operationThrow returns the callFrame for the handler. 975 971 move(regT0, callFrameRegister); 976 972 977 // Now store the exception returned by cti_op_throw.973 // Now store the exception returned by operationThrow. 978 974 loadPtr(Address(stackPointerRegister, OBJECT_OFFSETOF(struct JITStackFrame, vm)), regT3); 979 975 load32(Address(regT3, VM::exceptionOffset() + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), regT0); -
trunk/Source/JavaScriptCore/jit/JITOperations.cpp
r157559 r157581 1616 1616 } 1617 1617 1618 JITHandlerEncoded JIT_OPERATION operationThrow(ExecState* exec, EncodedJSValue encodedExceptionValue) 1619 { 1620 VM* vm = &exec->vm(); 1621 NativeCallFrameTracer tracer(vm, exec); 1622 1623 JSValue exceptionValue = JSValue::decode(encodedExceptionValue); 1624 vm->throwException(exec, exceptionValue); 1625 ExceptionHandler handler = genericUnwind(vm, exec, exceptionValue); 1626 return dfgHandlerEncoded(handler.callFrame, handler.catchRoutine); 1627 } 1628 1618 1629 JITHandlerEncoded JIT_OPERATION lookupExceptionHandler(ExecState* exec) 1619 1630 { -
trunk/Source/JavaScriptCore/jit/JITOperations.h
r157559 r157581 28 28 29 29 #include "CallFrame.h" 30 #include "JITExceptions.h" 30 31 #include "JSArray.h" 31 32 #include "JSCJSValue.h" … … 43 44 #else 44 45 #define JIT_OPERATION 46 #endif 47 48 extern "C" { 49 50 // This method is used to lookup an exception hander, keyed by faultLocation, which is 51 // the return location from one of the calls out to one of the helper operations above. 52 53 // According to C++ rules, a type used for the return signature of function with C linkage (i.e. 54 // 'extern "C"') needs to be POD; hence putting any constructors into it could cause either compiler 55 // warnings, or worse, a change in the ABI used to return these types. 56 struct JITHandler { 57 union Union { 58 struct Struct { 59 ExecState* exec; 60 void* handler; 61 } s; 62 uint64_t encoded; 63 } u; 64 }; 65 66 inline JITHandler createJITHandler(ExecState* exec, void* handler) 67 { 68 JITHandler result; 69 result.u.s.exec = exec; 70 result.u.s.handler = handler; 71 return result; 72 } 73 74 #if CPU(X86_64) 75 typedef JITHandler JITHandlerEncoded; 76 inline JITHandlerEncoded dfgHandlerEncoded(ExecState* exec, void* handler) 77 { 78 return createJITHandler(exec, handler); 79 } 80 #else 81 typedef uint64_t JITHandlerEncoded; 82 inline JITHandlerEncoded dfgHandlerEncoded(ExecState* exec, void* handler) 83 { 84 COMPILE_ASSERT(sizeof(JITHandler::Union) == sizeof(uint64_t), JITHandler_Union_is_64bit); 85 return createJITHandler(exec, handler).u.encoded; 86 } 45 87 #endif 46 88 … … 61 103 J: EncodedJSValue 62 104 Jcp: const JSValue* 105 Jhe: JITHandlerEncoded 63 106 Jsa: JSActivation* 64 107 Jss: JSString* … … 100 143 typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EZIcfZ)(ExecState*, int32_t, InlineCallFrame*, int32_t); 101 144 typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EZZ)(ExecState*, int32_t, int32_t); 145 typedef JITHandlerEncoded JIT_OPERATION (*Jhe_JITOperation_EJ)(ExecState*, EncodedJSValue); 102 146 typedef JSCell* JIT_OPERATION (*C_JITOperation_E)(ExecState*); 103 147 typedef JSCell* JIT_OPERATION (*C_JITOperation_EZ)(ExecState*, int32_t); … … 167 211 typedef JSString* JIT_OPERATION (*Jss_JITOperation_EZ)(ExecState*, int32_t); 168 212 169 extern "C" {170 171 // This method is used to lookup an exception hander, keyed by faultLocation, which is172 // the return location from one of the calls out to one of the helper operations above.173 174 // According to C++ rules, a type used for the return signature of function with C linkage (i.e.175 // 'extern "C"') needs to be POD; hence putting any constructors into it could cause either compiler176 // warnings, or worse, a change in the ABI used to return these types.177 struct JITHandler {178 union Union {179 struct Struct {180 ExecState* exec;181 void* handler;182 } s;183 uint64_t encoded;184 } u;185 };186 187 inline JITHandler createJITHandler(ExecState* exec, void* handler)188 {189 JITHandler result;190 result.u.s.exec = exec;191 result.u.s.handler = handler;192 return result;193 }194 195 #if CPU(X86_64)196 typedef JITHandler JITHandlerEncoded;197 inline JITHandlerEncoded dfgHandlerEncoded(ExecState* exec, void* handler)198 {199 return createJITHandler(exec, handler);200 }201 #else202 typedef uint64_t JITHandlerEncoded;203 inline JITHandlerEncoded dfgHandlerEncoded(ExecState* exec, void* handler)204 {205 COMPILE_ASSERT(sizeof(JITHandler::Union) == sizeof(uint64_t), JITHandler_Union_is_64bit);206 return createJITHandler(exec, handler).u.encoded;207 }208 #endif209 213 JITHandlerEncoded JIT_OPERATION lookupExceptionHandler(ExecState*) WTF_INTERNAL; 210 214 … … 261 265 void JIT_OPERATION operationHandleWatchdogTimer(ExecState*) WTF_INTERNAL; 262 266 void JIT_OPERATION operationThrowStaticError(ExecState*, EncodedJSValue, int32_t) WTF_INTERNAL; 267 JITHandlerEncoded JIT_OPERATION operationThrow(ExecState*, EncodedJSValue) WTF_INTERNAL; 263 268 void JIT_OPERATION operationDebug(ExecState*, int32_t) WTF_INTERNAL; 264 269 #if ENABLE(DFG_JIT) -
trunk/Source/JavaScriptCore/jit/JITStubs.cpp
r157559 r157581 128 128 } 129 129 130 #if !defined(NDEBUG)131 132 extern "C" {133 134 static void jscGeneratedNativeCode()135 {136 // When executing a JIT stub function (which might do an allocation), we hack the return address137 // to pretend to be executing this function, to keep stack logging tools from blowing out138 // memory.139 }140 141 }142 143 struct StackHack {144 ALWAYS_INLINE StackHack(JITStackFrame& stackFrame)145 : stackFrame(stackFrame)146 , savedReturnAddress(*stackFrame.returnAddressSlot())147 {148 if (!CodeProfiling::enabled())149 *stackFrame.returnAddressSlot() = ReturnAddressPtr(FunctionPtr(jscGeneratedNativeCode));150 }151 152 ALWAYS_INLINE ~StackHack()153 {154 *stackFrame.returnAddressSlot() = savedReturnAddress;155 }156 157 JITStackFrame& stackFrame;158 ReturnAddressPtr savedReturnAddress;159 };160 161 #define STUB_INIT_STACK_FRAME(stackFrame) JITStackFrame& stackFrame = *reinterpret_cast_ptr<JITStackFrame*>(STUB_ARGS); StackHack stackHack(stackFrame)162 #define STUB_SET_RETURN_ADDRESS(returnAddress) stackHack.savedReturnAddress = ReturnAddressPtr(returnAddress)163 #define STUB_RETURN_ADDRESS stackHack.savedReturnAddress164 165 #else166 167 #define STUB_INIT_STACK_FRAME(stackFrame) JITStackFrame& stackFrame = *reinterpret_cast_ptr<JITStackFrame*>(STUB_ARGS)168 #define STUB_SET_RETURN_ADDRESS(returnAddress) *stackFrame.returnAddressSlot() = ReturnAddressPtr(returnAddress)169 #define STUB_RETURN_ADDRESS *stackFrame.returnAddressSlot()170 171 #endif172 173 // The reason this is not inlined is to avoid having to do a PIC branch174 // to get the address of the ctiVMThrowTrampoline function. It's also175 // good to keep the code size down by leaving as much of the exception176 // handling code out of line as possible.177 static NEVER_INLINE void returnToThrowTrampoline(VM* vm, ReturnAddressPtr exceptionLocation, ReturnAddressPtr& returnAddressSlot)178 {179 RELEASE_ASSERT(vm->exception());180 vm->exceptionLocation = exceptionLocation;181 returnAddressSlot = ReturnAddressPtr(FunctionPtr(ctiVMThrowTrampoline));182 }183 184 #define VM_THROW_EXCEPTION() \185 do { \186 VM_THROW_EXCEPTION_AT_END(); \187 return 0; \188 } while (0)189 #define VM_THROW_EXCEPTION_AT_END() \190 do {\191 returnToThrowTrampoline(stackFrame.vm, STUB_RETURN_ADDRESS, STUB_RETURN_ADDRESS);\192 } while (0)193 194 #define CHECK_FOR_EXCEPTION() \195 do { \196 if (UNLIKELY(stackFrame.vm->exception())) \197 VM_THROW_EXCEPTION(); \198 } while (0)199 #define CHECK_FOR_EXCEPTION_AT_END() \200 do { \201 if (UNLIKELY(stackFrame.vm->exception())) \202 VM_THROW_EXCEPTION_AT_END(); \203 } while (0)204 #define CHECK_FOR_EXCEPTION_VOID() \205 do { \206 if (UNLIKELY(stackFrame.vm->exception())) { \207 VM_THROW_EXCEPTION_AT_END(); \208 return; \209 } \210 } while (0)211 212 class ErrorFunctor {213 public:214 virtual ~ErrorFunctor() { }215 virtual JSValue operator()(ExecState*) = 0;216 };217 218 class ErrorWithExecFunctor : public ErrorFunctor {219 public:220 typedef JSObject* (*Factory)(ExecState* exec);221 222 ErrorWithExecFunctor(Factory factory)223 : m_factory(factory)224 {225 }226 227 virtual JSValue operator()(ExecState* exec) OVERRIDE228 {229 return m_factory(exec);230 }231 232 private:233 Factory m_factory;234 };235 236 class ErrorWithExecAndCalleeFunctor : public ErrorFunctor {237 public:238 typedef JSObject* (*Factory)(ExecState* exec, JSValue callee);239 240 ErrorWithExecAndCalleeFunctor(Factory factory, JSValue callee)241 : m_factory(factory), m_callee(callee)242 {243 }244 245 virtual JSValue operator()(ExecState* exec) OVERRIDE246 {247 return m_factory(exec, m_callee);248 }249 private:250 Factory m_factory;251 JSValue m_callee;252 };253 254 // Helper function for JIT stubs that may throw an exception in the middle of255 // processing a function call. This function rolls back the stack to256 // our caller, so exception processing can proceed from a valid state.257 template<typename T> static T throwExceptionFromOpCall(JITStackFrame& jitStackFrame, CallFrame* newCallFrame, ReturnAddressPtr& returnAddressSlot, ErrorFunctor* createError = 0)258 {259 CallFrame* callFrame = newCallFrame->callerFrame()->removeHostCallFrameFlag();260 jitStackFrame.callFrame = callFrame;261 ASSERT(callFrame);262 callFrame->vm().topCallFrame = callFrame;263 if (createError)264 callFrame->vm().throwException(callFrame, (*createError)(callFrame));265 ASSERT(callFrame->vm().exception());266 returnToThrowTrampoline(&callFrame->vm(), ReturnAddressPtr(newCallFrame->returnPC()), returnAddressSlot);267 return T();268 }269 270 // If the CPU specific header does not provide an implementation, use the default one here.271 #ifndef DEFINE_STUB_FUNCTION272 #define DEFINE_STUB_FUNCTION(rtype, op) rtype JIT_STUB cti_##op(STUB_ARGS_DECLARATION)273 #endif274 275 DEFINE_STUB_FUNCTION(void*, op_throw)276 {277 STUB_INIT_STACK_FRAME(stackFrame);278 stackFrame.vm->throwException(stackFrame.callFrame, stackFrame.args[0].jsValue());279 ExceptionHandler handler = genericUnwind(stackFrame.vm, stackFrame.callFrame, stackFrame.args[0].jsValue());280 STUB_SET_RETURN_ADDRESS(handler.catchRoutine);281 return handler.callFrame;282 }283 284 DEFINE_STUB_FUNCTION(void, op_throw_static_error)285 {286 STUB_INIT_STACK_FRAME(stackFrame);287 288 CallFrame* callFrame = stackFrame.callFrame;289 String message = errorDescriptionForValue(callFrame, stackFrame.args[0].jsValue())->value(callFrame);290 if (stackFrame.args[1].asInt32)291 stackFrame.vm->throwException(callFrame, createReferenceError(callFrame, message));292 else293 stackFrame.vm->throwException(callFrame, createTypeError(callFrame, message));294 VM_THROW_EXCEPTION_AT_END();295 }296 297 DEFINE_STUB_FUNCTION(void*, vm_throw)298 {299 STUB_INIT_STACK_FRAME(stackFrame);300 VM* vm = stackFrame.vm;301 ExceptionHandler handler = genericUnwind(vm, stackFrame.callFrame, vm->exception());302 STUB_SET_RETURN_ADDRESS(handler.catchRoutine);303 return handler.callFrame;304 }305 306 130 #if USE(JSVALUE32_64) 307 131 EncodedExceptionHandler JIT_STUB cti_vm_handle_exception(CallFrame* callFrame) -
trunk/Source/JavaScriptCore/jit/JITStubs.h
r157572 r157581 335 335 #endif 336 336 337 extern "C" void ctiVMThrowTrampoline();338 337 extern "C" void ctiVMHandleException(); 339 338 extern "C" void ctiOpThrowNotCaught(); … … 356 355 357 356 extern "C" { 358 void JIT_STUB cti_op_throw_static_error(STUB_ARGS_DECLARATION) WTF_INTERNAL;359 void* JIT_STUB cti_op_throw(STUB_ARGS_DECLARATION) WTF_INTERNAL;360 void* JIT_STUB cti_vm_throw(STUB_ARGS_DECLARATION) REFERENCED_FROM_ASM WTF_INTERNAL;361 357 362 358 #if USE(JSVALUE32_64) -
trunk/Source/JavaScriptCore/jit/JITStubsARM.h
r157571 r157581 175 175 176 176 asm ( 177 ".text" "\n"178 ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"179 HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"180 INLINE_ARM_FUNCTION(ctiVMThrowTrampoline)181 SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"182 "mov r0, sp" "\n"183 "bl " SYMBOL_STRING(cti_vm_throw) "\n"184 185 177 // Both has the same return sequence 186 178 ".text" "\n" … … 394 386 } 395 387 396 __asm void ctiVMThrowTrampoline()397 {398 ARM399 PRESERVE8400 mov r0, sp401 bl cti_vm_throw402 add sp, sp, # PRESERVEDR4_OFFSET403 ldmia sp!, {r4-r6, r8-r11, lr}404 add sp, sp, #12405 bx lr406 }407 408 388 __asm void ctiOpThrowNotCaught() 409 389 { … … 455 435 MSVC_BEGIN( EXPORT ctiTrampoline) 456 436 MSVC_BEGIN( EXPORT ctiTrampolineEnd) 457 MSVC_BEGIN( EXPORT ctiVMThrowTrampoline)458 437 MSVC_BEGIN( EXPORT ctiOpThrowNotCaught) 459 438 MSVC_BEGIN( EXPORT ctiVMHandleException) … … 476 455 MSVC_BEGIN(ctiTrampoline ENDP) 477 456 MSVC_BEGIN() 478 MSVC_BEGIN(ctiVMThrowTrampoline PROC)479 MSVC_BEGIN( mov r0, sp)480 MSVC_BEGIN( bl cti_vm_throw)481 MSVC_BEGIN(ctiOpThrowNotCaught)482 MSVC_BEGIN( add sp, sp, #68 ; sync with PRESERVEDR4_OFFSET)483 MSVC_BEGIN( ldmia sp!, {r4-r6, r8-r11, lr})484 MSVC_BEGIN( add sp, sp, #12)485 MSVC_BEGIN( bx lr)486 MSVC_BEGIN(ctiVMThrowTrampoline ENDP)487 MSVC_BEGIN()488 457 MSVC_BEGIN(ctiVMHandleException PROC) 489 458 MSVC_BEGIN( mov r0, r5) -
trunk/Source/JavaScriptCore/jit/JITStubsARM64.h
r157474 r157581 105 105 "mov x0, x25" "\n" 106 106 "bl " LOCAL_REFERENCE(cti_vm_handle_exception) "\n" 107 // When cti_vm_ throw_slowpathreturns, x0 has callFrame and x1 has handler address107 // When cti_vm_handle_exception returns, x0 has callFrame and x1 has handler address 108 108 "mov x25, x0" "\n" 109 109 "br x1" "\n" … … 128 128 HIDE_SYMBOL(ctiTrampolineEnd) "\n" 129 129 SYMBOL_STRING(ctiTrampolineEnd) ":" "\n" 130 );131 132 asm (133 ".section __TEXT,__text,regular,pure_instructions" "\n"134 ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"135 ".align 2" "\n"136 HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"137 SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"138 "mov x0, sp" "\n"139 "bl " LOCAL_REFERENCE(cti_vm_throw) "\n"140 "hlt 0xdead" "\n" // Should not be reached!141 130 ); 142 131 -
trunk/Source/JavaScriptCore/jit/JITStubsARMv7.h
r157571 r157581 246 246 ".text" "\n" 247 247 ".align 2" "\n" 248 ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"249 HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"250 ".thumb" "\n"251 ".thumb_func " THUMB_FUNC_PARAM(ctiVMThrowTrampoline) "\n"252 SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"253 "mov r0, sp" "\n"254 "bl " LOCAL_REFERENCE(cti_vm_throw) "\n"255 "ldr r11, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R11_OFFSET) "]" "\n"256 "ldr r10, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R10_OFFSET) "]" "\n"257 "ldr r9, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R9_OFFSET) "]" "\n"258 "ldr r8, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R8_OFFSET) "]" "\n"259 "ldr r7, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R7_OFFSET) "]" "\n"260 "ldr r6, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R6_OFFSET) "]" "\n"261 "ldr r5, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R5_OFFSET) "]" "\n"262 "ldr r4, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R4_OFFSET) "]" "\n"263 "ldr lr, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_RETURN_ADDRESS_OFFSET) "]" "\n"264 "add sp, sp, #" STRINGIZE_VALUE_OF(FIRST_STACK_ARGUMENT) "\n"265 "bx lr" "\n"266 );267 268 asm (269 ".text" "\n"270 ".align 2" "\n"271 248 ".globl " SYMBOL_STRING(ctiVMHandleException) "\n" 272 249 HIDE_SYMBOL(ctiVMHandleException) "\n" … … 516 493 } 517 494 518 __asm void ctiVMThrowTrampoline()519 {520 PRESERVE8521 mov r0, sp522 bl cti_vm_throw523 ldr r11, [sp, # PRESERVED_R11_OFFSET ]524 ldr r10, [sp, # PRESERVED_R10_OFFSET ]525 ldr r9, [sp, # PRESERVED_R9_OFFSET ]526 ldr r8, [sp, # PRESERVED_R8_OFFSET ]527 ldr r7, [sp, # PRESERVED_R7_OFFSET ]528 ldr r6, [sp, # PRESERVED_R6_OFFSET ]529 ldr r5, [sp, # PRESERVED_R5_OFFSET ]530 ldr r4, [sp, # PRESERVED_R4_OFFSET ]531 ldr lr, [sp, # PRESERVED_RETURN_ADDRESS_OFFSET ]532 add sp, sp, # FIRST_STACK_ARGUMENT533 bx lr534 }535 536 495 __asm void ctiOpThrowNotCaught() 537 496 { -
trunk/Source/JavaScriptCore/jit/JITStubsMIPS.h
r154173 r157581 102 102 ".set nomacro" "\n" 103 103 ".set nomips16" "\n" 104 ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"105 ".ent " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"106 SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"107 #if WTF_MIPS_PIC108 ".set macro" "\n"109 ".cpload $31" "\n"110 "la $25," SYMBOL_STRING(cti_vm_throw) "\n"111 ".set nomacro" "\n"112 "bal " SYMBOL_STRING(cti_vm_throw) "\n"113 "move $4,$29" "\n"114 #else115 "jal " SYMBOL_STRING(cti_vm_throw) "\n"116 "move $4,$29" "\n"117 #endif118 "lw $16," STRINGIZE_VALUE_OF(PRESERVED_S0_OFFSET) "($29)" "\n"119 "lw $17," STRINGIZE_VALUE_OF(PRESERVED_S1_OFFSET) "($29)" "\n"120 "lw $18," STRINGIZE_VALUE_OF(PRESERVED_S2_OFFSET) "($29)" "\n"121 "lw $19," STRINGIZE_VALUE_OF(PRESERVED_S3_OFFSET) "($29)" "\n"122 "lw $20," STRINGIZE_VALUE_OF(PRESERVED_S4_OFFSET) "($29)" "\n"123 "lw $31," STRINGIZE_VALUE_OF(PRESERVED_RETURN_ADDRESS_OFFSET) "($29)" "\n"124 "jr $31" "\n"125 "addiu $29,$29," STRINGIZE_VALUE_OF(STACK_LENGTH) "\n"126 ".set reorder" "\n"127 ".set macro" "\n"128 ".end " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"129 );130 131 asm (132 ".text" "\n"133 ".align 2" "\n"134 ".set noreorder" "\n"135 ".set nomacro" "\n"136 ".set nomips16" "\n"137 104 ".globl " SYMBOL_STRING(ctiVMHandleException) "\n" 138 105 ".ent " SYMBOL_STRING(ctiVMHandleException) "\n" -
trunk/Source/JavaScriptCore/jit/JITStubsMSVC64.asm
r156671 r157581 29 29 30 30 PUBLIC ctiTrampoline 31 PUBLIC ctiVMThrowTrampoline32 31 PUBLIC ctiOpThrowNotCaught 33 32 PUBLIC getHostCallReturnValue … … 67 66 ctiTrampoline ENDP 68 67 69 ctiVMThrowTrampoline PROC70 mov rcx, rsp71 call cti_vm_throw72 int 373 ctiVMThrowTrampoline ENDP74 75 68 ctiVMHandleException PROC 76 69 sub rsp, 16 -
trunk/Source/JavaScriptCore/jit/JITStubsSH4.h
r157335 r157581 84 84 85 85 asm volatile ( 86 ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"87 HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"88 SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"89 "mov.l .L2" SYMBOL_STRING(cti_vm_throw) ",r0" "\n"90 "mov r15, r4" "\n"91 "mov.l @(r0,r12),r11" "\n"92 "jsr @r11" "\n"93 "nop" "\n"94 "add #" STRINGIZE_VALUE_OF(SAVED_R8_OFFSET) ", r15" "\n"95 "mov.l @r15+,r8" "\n"96 "mov.l @r15+,r9" "\n"97 "mov.l @r15+,r10" "\n"98 "mov.l @r15+,r11" "\n"99 "mov.l @r15+,r13" "\n"100 "lds.l @r15+,pr" "\n"101 "mov.l @r15+,r14" "\n"102 "add #12, r15" "\n"103 "rts" "\n"104 "nop" "\n"105 ".align 2" "\n"106 ".L2" SYMBOL_STRING(cti_vm_throw) ":.long " SYMBOL_STRING(cti_vm_throw) "@GOT \n"107 );108 109 asm volatile (110 86 ".globl " SYMBOL_STRING(ctiVMHandleException) "\n" 111 87 HIDE_SYMBOL(ctiVMHandleException) "\n" -
trunk/Source/JavaScriptCore/jit/JITStubsX86.h
r157571 r157581 78 78 79 79 asm ( 80 ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"81 HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"82 SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"83 "movl %esp, %ecx" "\n"84 "call " LOCAL_REFERENCE(cti_vm_throw) "\n"85 "int3" "\n"86 );87 88 asm (89 80 ".globl " SYMBOL_STRING(ctiVMHandleException) "\n" 90 81 HIDE_SYMBOL(ctiVMHandleException) "\n" … … 295 286 } 296 287 297 __declspec(naked) void ctiVMThrowTrampoline()298 {299 __asm {300 mov ecx, esp;301 call cti_vm_throw;302 int 3;303 }304 }305 306 288 __declspec(naked) void ctiVMHandleException() 307 289 { -
trunk/Source/JavaScriptCore/jit/JITStubsX86_64.h
r157571 r157581 91 91 92 92 asm ( 93 ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"94 HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"95 SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"96 "movq %rsp, %rdi" "\n"97 "call " LOCAL_REFERENCE(cti_vm_throw) "\n"98 "int3" "\n"99 );100 101 asm (102 93 ".globl " SYMBOL_STRING(ctiVMHandleException) "\n" 103 94 HIDE_SYMBOL(ctiVMHandleException) "\n" -
trunk/Source/JavaScriptCore/jit/JSInterfaceJIT.h
r157546 r157581 63 63 #if CPU(X86_64) 64 64 static const RegisterID returnValueRegister = X86Registers::eax; 65 static const RegisterID returnValue2Register = X86Registers::edx; 65 66 static const RegisterID cachedResultRegister = X86Registers::eax; 66 67 #if !OS(WINDOWS)
Note:
See TracChangeset
for help on using the changeset viewer.