Changeset 173282 in webkit
- Timestamp:
- Sep 4, 2014 2:23:38 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r173279 r173282 1 2014-09-04 Michael Saboff <msaboff@apple.com> 2 3 REGRESSION(r173031): crashes during run-layout-jsc on x86/Linux 4 https://bugs.webkit.org/show_bug.cgi?id=136436 5 6 Reviewed by Geoffrey Garen. 7 8 Instead of trying to calculate a stack pointer that allows for possible 9 stacked argument space, just use the "home" stack pointer location. 10 That stack pointer provides space for the worst case number of stacked 11 arguments on architectures that use stacked arguments. It also provides 12 stack space so that the return PC and caller frame pointer that are stored 13 as part of making the call to operationCallEval will not override any part 14 of the callee frame created on the stack. 15 16 Changed compileCallEval() to use the stackPointer value of the calling 17 function. That stack pointer is calculated to have enough space for 18 outgoing stacked arguments. By moving the stack pointer to its "home" 19 position, the caller frame and return PC are not set as part of making 20 the call to operationCallEval(). Moved the explicit setting of the 21 callerFrame field of the callee CallFrame from operationCallEval() to 22 compileCallEval() since it has been the artifact of making a call for 23 most architectures. Simplified the exception logic in compileCallEval() 24 as a result of the change. To be compliant with the stack state 25 expected by virtualCallThunkGenerator(), moved the stack pointer to 26 point above the CallerFrameAndPC of the callee CallFrame. 27 28 * jit/JIT.h: Changed callOperationNoExceptionCheck(J_JITOperation_EE, ...) 29 to callOperation(J_JITOperation_EE, ...) as it now can do a typical exception 30 check. 31 * jit/JITCall.cpp & jit/JITCall32_64.cpp: 32 (JSC::JIT::compileCallEval): Use the home stack pointer when making the call 33 to operationCallEval. Since the stack pointer adjustment no longer needs 34 to be done after making the call to operationCallEval(), the exception check 35 logic can be simplified. 36 (JSC::JIT::compileCallEvalSlowCase): Restored the stack pointer to point 37 to above the calleeFrame as this is what the generated thunk expects. 38 * jit/JITInlines.h: 39 (JSC::JIT::callOperation): Refactor of callOperationNoExceptionCheck 40 with the addition of a standard exception check. 41 (JSC::JIT::callOperationNoExceptionCheck): Deleted. 42 * jit/JITOperations.cpp: 43 (JSC::operationCallEval): Eliminated the explicit setting of caller frame 44 as that is now done in the code generated by compileCallEval(). 45 1 46 2014-09-03 Filip Pizlo <fpizlo@apple.com> 2 47 -
trunk/Source/JavaScriptCore/jit/JIT.h
r173199 r173282 719 719 MacroAssembler::Call callOperation(V_JITOperation_ECC, RegisterID, RegisterID); 720 720 MacroAssembler::Call callOperation(V_JITOperation_ECICC, RegisterID, const Identifier*, RegisterID, RegisterID); 721 MacroAssembler::Call callOperation(J_JITOperation_EE, RegisterID); 721 722 MacroAssembler::Call callOperation(V_JITOperation_EIdJZ, const Identifier*, RegisterID, int32_t); 722 723 MacroAssembler::Call callOperation(V_JITOperation_EJ, RegisterID); … … 739 740 MacroAssembler::Call callOperation(V_JITOperation_EZ, int32_t); 740 741 MacroAssembler::Call callOperationWithCallFrameRollbackOnException(J_JITOperation_E); 741 MacroAssembler::Call callOperationNoExceptionCheck(J_JITOperation_EE, RegisterID);742 742 MacroAssembler::Call callOperationWithCallFrameRollbackOnException(V_JITOperation_ECb, CodeBlock*); 743 743 MacroAssembler::Call callOperationWithCallFrameRollbackOnException(Z_JITOperation_E); -
trunk/Source/JavaScriptCore/jit/JITCall.cpp
r173069 r173282 137 137 { 138 138 addPtr(TrustedImm32(-static_cast<ptrdiff_t>(sizeof(CallerFrameAndPC))), stackPointerRegister, regT1); 139 callOperationNoExceptionCheck(operationCallEval, regT1); 140 141 Jump noException = emitExceptionCheck(InvertedExceptionCheck); 142 addPtr(TrustedImm32(stackPointerOffsetFor(m_codeBlock) * sizeof(Register)), callFrameRegister, stackPointerRegister); 143 exceptionCheck(jump()); 144 145 noException.link(this); 146 addSlowCase(branch64(Equal, regT0, TrustedImm64(JSValue::encode(JSValue())))); 139 storePtr(callFrameRegister, Address(regT1, CallFrame::callerFrameOffset())); 147 140 148 141 addPtr(TrustedImm32(stackPointerOffsetFor(m_codeBlock) * sizeof(Register)), callFrameRegister, stackPointerRegister); 149 142 checkStackPointerAlignment(); 150 143 144 callOperation(operationCallEval, regT1); 145 146 addSlowCase(branch64(Equal, regT0, TrustedImm64(JSValue::encode(JSValue())))); 147 151 148 sampleCodeBlock(m_codeBlock); 152 149 … … 157 154 { 158 155 linkSlowCase(iter); 156 int registerOffset = -instruction[4].u.operand; 157 158 addPtr(TrustedImm32(registerOffset * sizeof(Register) + sizeof(CallerFrameAndPC)), callFrameRegister, stackPointerRegister); 159 159 160 160 load64(Address(stackPointerRegister, sizeof(Register) * JSStack::Callee - sizeof(CallerFrameAndPC)), regT0); -
trunk/Source/JavaScriptCore/jit/JITCall32_64.cpp
r173069 r173282 221 221 { 222 222 addPtr(TrustedImm32(-static_cast<ptrdiff_t>(sizeof(CallerFrameAndPC))), stackPointerRegister, regT1); 223 224 callOperationNoExceptionCheck(operationCallEval, regT1); 225 226 Jump noException = emitExceptionCheck(InvertedExceptionCheck); 223 storePtr(callFrameRegister, Address(regT1, CallFrame::callerFrameOffset())); 224 227 225 addPtr(TrustedImm32(stackPointerOffsetFor(m_codeBlock) * sizeof(Register)), callFrameRegister, stackPointerRegister); 228 exceptionCheck(jump()); 229 230 noException.link(this); 226 227 callOperation(operationCallEval, regT1); 228 231 229 addSlowCase(branch32(Equal, regT1, TrustedImm32(JSValue::EmptyValueTag))); 232 230 233 addPtr(TrustedImm32(stackPointerOffsetFor(m_codeBlock) * sizeof(Register)), callFrameRegister, stackPointerRegister);234 checkStackPointerAlignment();235 236 231 sampleCodeBlock(m_codeBlock); 237 232 … … 242 237 { 243 238 linkSlowCase(iter); 239 240 int registerOffset = -instruction[4].u.operand; 241 242 addPtr(TrustedImm32(registerOffset * sizeof(Register) + sizeof(CallerFrameAndPC)), callFrameRegister, stackPointerRegister); 244 243 245 244 loadPtr(Address(stackPointerRegister, sizeof(Register) * JSStack::Callee - sizeof(CallerFrameAndPC)), regT0); -
trunk/Source/JavaScriptCore/jit/JITInlines.h
r172189 r173282 318 318 } 319 319 320 ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(J_JITOperation_EE operation, RegisterID regOp) 321 { 322 setupArgumentsWithExecState(regOp); 323 updateTopCallFrame(); 324 return appendCallWithExceptionCheck(operation); 325 } 326 320 327 ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(V_JITOperation_EPc operation, Instruction* bytecodePC) 321 328 { … … 334 341 setupArgumentsExecState(); 335 342 return appendCallWithCallFrameRollbackOnException(operation); 336 }337 338 ALWAYS_INLINE MacroAssembler::Call JIT::callOperationNoExceptionCheck(J_JITOperation_EE operation, RegisterID regOp)339 {340 setupArgumentsWithExecState(regOp);341 updateTopCallFrame();342 return appendCall(operation);343 343 } 344 344 -
trunk/Source/JavaScriptCore/jit/JITOperations.cpp
r173199 r173282 613 613 execCallee->setScope(exec->scope()); 614 614 execCallee->setCodeBlock(0); 615 execCallee->setCallerFrame(exec);616 615 617 616 if (!isHostFunction(execCallee->calleeAsValue(), globalFuncEval))
Note: See TracChangeset
for help on using the changeset viewer.