Changeset 161084 in webkit
- Timestamp:
- Dec 25, 2013, 11:17:13 PM (11 years ago)
- Location:
- branches/jsCStack/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/jsCStack/Source/JavaScriptCore/ChangeLog
r161061 r161084 1 2013-12-25 Mark Lam <mark.lam@apple.com> 2 3 jsc-layout-tests.yaml/js/script-tests/function-apply-aliased.js.layout-no-cjit is failing. 4 https://bugs.webkit.org/show_bug.cgi?id=126174. 5 6 Not yet reviewed. 7 8 When we do a stack check in a function prologue, the activation object 9 in the frame hasn't been set yet. The test failures came from the stack 10 unwinding code trying to tear off the frame to a non-existant activation 11 object. Since we haven't entered the function yet and the frame is 12 technically not fully "pushed" yet, we can throw i.e. start the unwinding 13 from the caller frame instead. This fixes the issue. 14 15 * llint/LLIntSlowPaths.cpp: 16 (JSC::LLInt::LLINT_SLOW_PATH_DECL): 17 - When we have a StackOverflowError, return the caller's CallFrame in 18 the second value in the SlowPathReturnType. 19 * llint/LowLevelInterpreter.asm: 20 - Check if the second value of the SlowPathReturnType from the stack 21 check is 0. If not 0, set the cfr to the returned CallFrame* before 22 we start handling the StackOverflowError and unwinding the stack. 23 1 24 2013-12-24 Michael Saboff <msaboff@apple.com> 2 25 -
branches/jsCStack/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
r160967 r161084 443 443 #endif 444 444 445 // This stack check is done in the prologue for a function call, and the 446 // CallFrame is not completely set up yet. For example, if the frame needs 447 // an activation object, the activation object will only be set up after 448 // we start executing the function. If we need to throw a StackOverflowError 449 // here, then we need to tell the prologue to start the stack unwinding from 450 // the caller frame (which is fully set up) instead. To do that, we return 451 // the caller's CallFrame in the second return value. 452 // 453 // If the stack check succeeds and we don't need to throw the error, then 454 // we'll return 0 instead. The prologue will check for a non-zero value 455 // when determining whether to set the callFrame or not. 456 445 457 // For JIT enabled builds which uses the C stack, the stack is not growable. 446 458 // Hence, if we get here, then we know a stack overflow is imminent. So, just … … 448 460 #if ENABLE(LLINT_C_LOOP) 449 461 ASSERT(!exec->vm().interpreter->stack().containsAddress(exec->topOfFrame())); 450 if (UNLIKELY(!vm.interpreter->stack().ensureCapacityFor(exec->topOfFrame()))) 462 if (LIKELY(vm.interpreter->stack().ensureCapacityFor(exec->topOfFrame()))) 463 LLINT_RETURN_TWO(pc, 0); 451 464 #endif 452 { 453 exec = exec->callerFrame(); 454 Interpreter::ErrorHandlingMode mode(exec); 455 CommonSlowPaths::interpreterThrowInCaller(exec, createStackOverflowError(exec)); 456 pc = returnToThrowForThrownException(exec); 457 } 458 LLINT_END_IMPL(); 465 466 exec = exec->callerFrame(); 467 Interpreter::ErrorHandlingMode mode(exec); 468 CommonSlowPaths::interpreterThrowInCaller(exec, createStackOverflowError(exec)); 469 pc = returnToThrowForThrownException(exec); 470 LLINT_RETURN_TWO(pc, exec); 459 471 } 460 472 -
branches/jsCStack/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
r160936 r161084 434 434 # Stack height check failed - need to call a slow_path. 435 435 callSlowPath(_llint_stack_check) 436 bpeq t1, 0, .stackHeightOK 437 move t1, cfr 436 438 .stackHeightOK: 437 439 end
Note:
See TracChangeset
for help on using the changeset viewer.