Changeset 160745 in webkit
- Timestamp:
- Dec 17, 2013, 7:38:14 PM (12 years ago)
- Location:
- branches/jsCStack/Source/JavaScriptCore
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/jsCStack/Source/JavaScriptCore/ChangeLog
r160730 r160745 1 2013-12-17 Mark Lam <mark.lam@apple.com> 2 3 frameRegisterCount() should include maxFrameExtentForSlowPathCall. 4 https://bugs.webkit.org/show_bug.cgi?id=125881. 5 6 Reviewed by Geoffrey Garen, Michael Saboff, and Filip Pizlo. 7 8 * assembler/MaxFrameExtentForSlowPathCall.h: 9 - Added CallerFrameAndPCSize to all the maxFrameExtentForSlowPathCall values. 10 * bytecode/VirtualRegister.h: 11 (JSC::VirtualRegister::offsetInBytes): 12 * dfg/DFGGraph.cpp: 13 (JSC::DFG::Graph::frameRegisterCount): 14 * jit/JIT.cpp: 15 (JSC::JIT::privateCompile): 16 (JSC::JIT::frameRegisterCountFor): 17 * jit/JIT.h: 18 * jit/JITOpcodes.cpp: 19 (JSC::JIT::emit_op_catch): 20 * jit/JITOpcodes32_64.cpp: 21 (JSC::JIT::emit_op_catch): 22 * llint/LLIntData.cpp: 23 (JSC::LLInt::Data::performAssertions): 24 - Adjusted maxFrameExtentForSlowPathCall values for CallerFrameAndPCSize. 25 * llint/LLIntEntrypoint.cpp: 26 (JSC::LLInt::frameRegisterCountFor): 27 * llint/LowLevelInterpreter.asm: 28 - Adjusted maxFrameExtentForSlowPathCall values for CallerFrameAndPCSize. 29 1 30 2013-12-17 Mark Lam <mark.lam@apple.com> 2 31 -
branches/jsCStack/Source/JavaScriptCore/assembler/MaxFrameExtentForSlowPathCall.h
r160730 r160745 36 36 // from JS code. 37 37 38 // We also need to add space to account for CallerFrameAndPCSize (2 pointers) 39 // and pad the sum up to a multiple of stackAlignmentBytes(). 40 38 41 #if ENABLE(LLINT_C_LOOP) 39 42 static const size_t maxFrameExtentForSlowPathCall = 0; 40 43 41 44 #elif CPU(X86_64) && OS(WINDOWS) 42 // 4 args in registers, but stack space needs to be allocated for all args. 43 static const size_t maxFrameExtentForSlowPathCall = 48; 45 // 4 args in registers, but stack space needs to be allocated for all args, 46 // plus 16 bytes for CallerFrameAndPCSize. 47 static const size_t maxFrameExtentForSlowPathCall = 64; 44 48 45 49 #elif CPU(X86_64) 46 // All args in registers .47 static const size_t maxFrameExtentForSlowPathCall = 0;50 // All args in registers, plus 16 bytes for CallerFrameAndPCSize. 51 static const size_t maxFrameExtentForSlowPathCall = 16; 48 52 49 53 #elif CPU(X86) 50 // 6 args on stack (24 bytes) + 8 bytes to align the stack.54 // 6 args on stack (24 bytes) plus 8 bytes for CallerFrameAndPCSize. 51 55 static const size_t maxFrameExtentForSlowPathCall = 32; 52 56 53 57 #elif CPU(ARM64) 54 // All args in registers .55 static const size_t maxFrameExtentForSlowPathCall = 0;58 // All args in registers, plus 16 bytes for CallerFrameAndPCSize. 59 static const size_t maxFrameExtentForSlowPathCall = 16; 56 60 57 61 #elif CPU(ARM) 58 // First four args in registers, remaining 4 args on stack. 59 static const size_t maxFrameExtentForSlowPathCall = 16; 62 // First four args in registers, remaining 4 args on stack, 63 // plus 8 byte for CallerFrameAndPCSize and 8 bytes padding. 64 static const size_t maxFrameExtentForSlowPathCall = 32; 60 65 61 66 #elif CPU(SH4) 62 // First four args in registers, remaining 4 args on stack. 63 static const size_t maxFrameExtentForSlowPathCall = 16; 67 // First four args in registers, remaining 4 args on stack, 68 // plus 8 byte for CallerFrameAndPCSize and 8 bytes padding. 69 static const size_t maxFrameExtentForSlowPathCall = 32; 64 70 65 71 #elif CPU(MIPS) 66 // Though args are in registers, there need to be space on the stack for all args. 67 static const size_t maxFrameExtentForSlowPathCall = 32; 72 // Though args are in registers, there need to be space on the stack for all args, 73 // plus 8 bytes CallerFrameAndPCSize and 8 bytes padding. 74 static const size_t maxFrameExtentForSlowPathCall = 48; 68 75 69 76 #else -
branches/jsCStack/Source/JavaScriptCore/bytecode/VirtualRegister.h
r158237 r160745 66 66 int toConstantIndex() const { ASSERT(isConstant()); return m_virtualRegister - s_firstConstantRegisterIndex; } 67 67 int offset() const { return m_virtualRegister; } 68 int offsetInBytes() const { return m_virtualRegister * sizeof(Register); } 68 69 69 70 bool operator==(const VirtualRegister other) const { return m_virtualRegister == other.m_virtualRegister; } -
branches/jsCStack/Source/JavaScriptCore/dfg/DFGGraph.cpp
r160562 r160745 37 37 #include "JIT.h" 38 38 #include "JSActivation.h" 39 #include "MaxFrameExtentForSlowPathCall.h" 39 40 #include "OperandsInlines.h" 40 41 #include "Operations.h" … … 705 706 unsigned Graph::frameRegisterCount() 706 707 { 707 unsigned result = m_nextMachineLocal + std::max(m_parameterSlots, static_cast<unsigned>( JSStack::CallerFrameAndPCSize));708 unsigned result = m_nextMachineLocal + std::max(m_parameterSlots, static_cast<unsigned>(maxFrameExtentForSlowPathCallInRegisters)); 708 709 result = WTF::roundUpToMultipleOf(stackAlignmentRegisters(), result); 709 710 return result; -
branches/jsCStack/Source/JavaScriptCore/jit/JIT.cpp
r160527 r160745 49 49 #include "SamplingTool.h" 50 50 #include "SlowPathCall.h" 51 #include "StackAlignment.h" 51 52 #include <wtf/CryptographicallyRandomNumber.h> 52 53 … … 540 541 #endif 541 542 542 addPtr(TrustedImm32(virtualRegisterForLocal(frameRegisterCountFor(m_codeBlock) - 1).offset () * sizeof(Register) - maxFrameExtentForSlowPathCall), callFrameRegister, regT1);543 addPtr(TrustedImm32(virtualRegisterForLocal(frameRegisterCountFor(m_codeBlock) - 1).offsetInBytes()), callFrameRegister, regT1); 543 544 stackCheck = branchPtr(Above, AbsoluteAddress(m_vm->addressOfJSStackLimit()), regT1); 544 545 } … … 780 781 } 781 782 783 unsigned JIT::frameRegisterCountFor(CodeBlock* codeBlock) 784 { 785 size_t registerCount = codeBlock->m_numCalleeRegisters + maxFrameExtentForSlowPathCallInRegisters; 786 ASSERT(registerCount == WTF::roundUpToMultipleOf(stackAlignmentRegisters(), registerCount)); 787 return registerCount; 788 } 782 789 783 790 } // namespace JSC -
branches/jsCStack/Source/JavaScriptCore/jit/JIT.h
r160340 r160745 245 245 static void linkSlowCall(CodeBlock* callerCodeBlock, CallLinkInfo*); 246 246 247 static unsigned frameRegisterCountFor(CodeBlock* codeBlock) 248 { 249 ASSERT(!(codeBlock->m_numCalleeRegisters & 1)); 250 return codeBlock->m_numCalleeRegisters; 251 } 247 static unsigned frameRegisterCountFor(CodeBlock*); 252 248 253 249 private: -
branches/jsCStack/Source/JavaScriptCore/jit/JITOpcodes.cpp
r160656 r160745 638 638 load64(Address(regT3, VM::callFrameForThrowOffset()), callFrameRegister); 639 639 640 size_t frameExtent = JIT::frameRegisterCountFor(codeBlock()) * sizeof(Register) + maxFrameExtentForSlowPathCall; 641 ASSERT(frameExtent == WTF::roundUpToMultipleOf(stackAlignmentBytes(), frameExtent)); 642 addPtr(TrustedImm32(-frameExtent), callFrameRegister, stackPointerRegister); 640 int offset = virtualRegisterForLocal(frameRegisterCountFor(codeBlock()) - 1).offsetInBytes(); 641 addPtr(TrustedImm32(offset), callFrameRegister, stackPointerRegister); 643 642 644 643 load64(Address(regT3, VM::exceptionOffset()), regT0); -
branches/jsCStack/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
r160656 r160745 925 925 load32(Address(regT3, VM::callFrameForThrowOffset()), callFrameRegister); 926 926 927 size_t frameExtent = JIT::frameRegisterCountFor(codeBlock()) * sizeof(Register) + maxFrameExtentForSlowPathCall; 928 ASSERT(frameExtent == WTF::roundUpToMultipleOf(stackAlignmentBytes(), frameExtent)); 929 addPtr(TrustedImm32(-frameExtent), callFrameRegister, stackPointerRegister); 927 int offset = virtualRegisterForLocal(frameRegisterCountFor(codeBlock()) - 1).offsetInBytes(); 928 addPtr(TrustedImm32(offset), callFrameRegister, stackPointerRegister); 930 929 931 930 // Now store the exception returned by operationThrow. -
branches/jsCStack/Source/JavaScriptCore/llint/LLIntData.cpp
r160522 r160745 126 126 ASSERT(ValueNull == TagBitTypeOther); 127 127 #endif 128 #if CPU(X86_64) || CPU(ARM64) ||ENABLE(LLINT_C_LOOP)128 #if ENABLE(LLINT_C_LOOP) 129 129 ASSERT(maxFrameExtentForSlowPathCall == 0); 130 #elif CPU(ARM) || CPU(SH4) 130 #elif CPU(X86_64) && OS(WINDOWS) 131 ASSERT(maxFrameExtentForSlowPathCall == 64); 132 #elif CPU(X86_64) || CPU(ARM64) 131 133 ASSERT(maxFrameExtentForSlowPathCall == 16); 132 #elif CPU(X86) || CPU( MIPS)134 #elif CPU(X86) || CPU(ARM) || CPU(SH4) 133 135 ASSERT(maxFrameExtentForSlowPathCall == 32); 136 #elif CPU(MIPS) 137 ASSERT(maxFrameExtentForSlowPathCall == 48); 134 138 #endif 135 139 ASSERT(StringType == 5); -
branches/jsCStack/Source/JavaScriptCore/llint/LLIntEntrypoint.cpp
r160186 r160745 34 34 #include "LLIntThunks.h" 35 35 #include "LowLevelInterpreter.h" 36 #include "MaxFrameExtentForSlowPathCall.h" 37 #include "StackAlignment.h" 36 38 #include "VM.h" 37 39 … … 124 126 unsigned frameRegisterCountFor(CodeBlock* codeBlock) 125 127 { 126 return codeBlock->m_numCalleeRegisters; 128 size_t registerCount = codeBlock->m_numCalleeRegisters + maxFrameExtentForSlowPathCallInRegisters; 129 ASSERT(registerCount == WTF::roundUpToMultipleOf(stackAlignmentRegisters(), registerCount)); 130 return registerCount; 127 131 } 128 132 -
branches/jsCStack/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
r160694 r160745 74 74 end 75 75 76 if X86_64 or ARM64 orC_LOOP76 if C_LOOP 77 77 const maxFrameExtentForSlowPathCall = 0 78 elsif ARM or ARMv7_TRADITIONAL or ARMv7 or SH478 elsif X86_64 or ARM64 79 79 const maxFrameExtentForSlowPathCall = 16 80 elsif X86 or MIPS80 elsif X86 or ARM or ARMv7_TRADITIONAL or ARMv7 or SH4 81 81 const maxFrameExtentForSlowPathCall = 32 82 elsif MIPS 83 const maxFrameExtentForSlowPathCall = 48 82 84 end 83 85
Note:
See TracChangeset
for help on using the changeset viewer.