Changeset 160573 in webkit
- Timestamp:
- Dec 13, 2013, 4:39:45 PM (11 years ago)
- Location:
- branches/jsCStack/Source/JavaScriptCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/jsCStack/Source/JavaScriptCore/ChangeLog
r160562 r160573 1 2013-12-13 Mark Lam <mark.lam@apple.com> 2 3 Fix exception handling for the LLINT. 4 https://bugs.webkit.org/show_bug.cgi?id=125672. 5 6 Reviewed by Geoffrey Garen. 7 8 The baseline JIT exception handling is still broken. 9 10 * JavaScriptCore.order: 11 * llint/LLIntSlowPaths.cpp: 12 * llint/LLIntSlowPaths.h: 13 * llint/LowLevelInterpreter.asm: 14 * llint/LowLevelInterpreter32_64.asm: 15 - updated the 32bit file with some of the changes to keep track with the 64bit 16 one though it doesn't build yet. The build failure will clearly tell us some of 17 the things that need to be fixed later. 18 * llint/LowLevelInterpreter64.asm: 19 - Called restoreStackPointerAfterCall() in op_catch and nativeCallTrampoline to 20 restore the appropriate stack pointer. 21 - Renamed the restoreStackPointerAfterJSCall() macro to restoreStackPointerAfterCall 22 because we also need to call it after a call to a native / host function. 23 - Removed llint_throw_from_native_call because it no longer does anything useful. 24 - Moved call to functionEpilogue() in nativeCallTrampoline before the exception 25 check because we should have returned from the native / host function already. 26 27 The Interpreter::unwind() code also relies on this. The VM will unwind and "pop" 28 JS frames, but will stop at host frames. The host frame should pop itself. Then, 29 we call Interpreter::unwind() again to continue for caller frames further up 30 the stack. 31 32 - Removed the check for the sentinel frame in handleUncaughtException because 33 we're guaranteed to be at the frame above the sentinel frame. 34 1 35 2013-12-13 Michael Saboff <msaboff@apple.com> 2 36 -
branches/jsCStack/Source/JavaScriptCore/JavaScriptCore.order
r159709 r160573 4982 4982 _llint_slow_path_profile_will_call 4983 4983 _llint_slow_path_profile_did_call 4984 _llint_throw_from_native_call4985 4984 _llint_begin 4986 4985 _llint_program_prologue -
branches/jsCStack/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
r160253 r160573 1308 1308 } 1309 1309 1310 LLINT_SLOW_PATH_DECL(throw_from_native_call)1311 {1312 LLINT_BEGIN();1313 ASSERT(vm.exception());1314 LLINT_END();1315 }1316 1317 1310 LLINT_SLOW_PATH_DECL(slow_path_handle_exception) 1318 1311 { -
branches/jsCStack/Source/JavaScriptCore/llint/LLIntSlowPaths.h
r160253 r160573 119 119 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_profile_will_call); 120 120 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_profile_did_call); 121 LLINT_SLOW_PATH_HIDDEN_DECL(throw_from_native_call);122 121 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_handle_exception); 123 122 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_resolve_scope); -
branches/jsCStack/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
r160527 r160573 277 277 move calleeFramePtr, sp 278 278 call LLIntCallLinkInfo::machineCodeTarget[callLinkInfo] 279 restoreStackPointerAfter JSCall()279 restoreStackPointerAfterCall() 280 280 dispatchAfterCall() 281 281 end … … 291 291 addp CallerFrameAndPCSize, t1, sp 292 292 call callee 293 restoreStackPointerAfter JSCall()293 restoreStackPointerAfterCall() 294 294 dispatchAfterCall() 295 295 end -
branches/jsCStack/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
r160497 r160573 344 344 end 345 345 346 macro doHandleUncaughtException(extraStackSpace)347 346 _handleUncaughtException: 348 functionEpilogue(extraStackSpace) 347 loadp ScopeChain[cfr], t3 348 andp MarkedBlockMask, t3 349 loadp MarkedBlock::m_weakSet + WeakSet::m_vm[t3], t3 350 loadp VM::callFrameForThrow[t3], cfr 351 352 # So far, we've unwound the stack to the frame just below the sentinel frame. 353 # We need to pop to the sentinel frame and do the necessary clean up for 354 # returning to the caller C frame. 355 loadp CallerFrame[cfr], cfr 356 357 loadp Callee[cfr], t3 # VM.topCallFrame 358 loadp ScopeChain[cfr], t6 359 storep t6, [t3] 360 361 callToJavaScriptEpilogue() 349 362 ret 350 end351 363 352 364 macro doReturnFromHostFunction(extraStackSpace) … … 2130 2142 error 2131 2143 end 2132 bineq VM::m_exception + TagOffset[t3], EmptyValueTag, . exception2144 bineq VM::m_exception + TagOffset[t3], EmptyValueTag, .handleException 2133 2145 ret 2134 .exception: 2146 2147 .handleException: 2135 2148 preserveReturnAddressAfterCall(t1) # This is really only needed on X86 2136 loadi ArgumentCount + TagOffset[cfr], PC2137 callSlowPath(_llint_throw_from_native_call)2149 storep cfr, VM::topCallFrame[t3] 2150 restoreStackPointerAfterCall() 2138 2151 jmp _llint_throw_from_slow_path_trampoline 2139 2152 end -
branches/jsCStack/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
r160562 r160573 142 142 end 143 143 144 macro restoreStackPointerAfter JSCall()144 macro restoreStackPointerAfterCall() 145 145 loadp CodeBlock[cfr], t1 146 146 loadi CodeBlock::m_numCalleeRegisters[t1], t1 … … 281 281 loadp VM::callFrameForThrow[t3], cfr 282 282 283 bpeq CodeBlock[cfr], 1, .calleeFramePopped 283 # So far, we've unwound the stack to the frame just below the sentinel frame. 284 # We need to pop to the sentinel frame and do the necessary clean up for 285 # returning to the caller C frame. 284 286 loadp CallerFrame[cfr], cfr 285 287 286 .calleeFramePopped:287 288 loadp Callee[cfr], t3 # VM.topCallFrame 288 289 loadp ScopeChain[cfr], t6 … … 1853 1854 loadp MarkedBlock::m_weakSet + WeakSet::m_vm[t3], t3 1854 1855 loadp VM::callFrameForThrow[t3], cfr 1856 restoreStackPointerAfterCall() 1857 1855 1858 loadp CodeBlock[cfr], PB 1856 1859 loadp CodeBlock::m_instructions[PB], PB … … 1957 1960 end 1958 1961 1959 btqnz VM::m_exception[t3], .exception1960 1962 functionEpilogue() 1963 1964 btqnz VM::m_exception[t3], .handleException 1961 1965 ret 1962 .exception: 1963 if X86_64 1964 pop t1 1965 end 1966 loadi ArgumentCount + TagOffset[cfr], PC 1967 loadp CodeBlock[cfr], PB 1968 loadp CodeBlock::m_vm[PB], t0 1969 loadp CodeBlock::m_instructions[PB], PB 1970 storep cfr, VM::topCallFrame[t0] 1971 callSlowPath(_llint_throw_from_native_call) 1966 1967 .handleException: 1968 storep cfr, VM::topCallFrame[t3] 1969 restoreStackPointerAfterCall() 1972 1970 jmp _llint_throw_from_slow_path_trampoline 1973 1971 end
Note:
See TracChangeset
for help on using the changeset viewer.