More stack limit and reserved zone renaming.
authormark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Jul 2016 22:06:20 +0000 (22:06 +0000)
committermark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Jul 2016 22:06:20 +0000 (22:06 +0000)
https://bugs.webkit.org/show_bug.cgi?id=159690

Rubber-stamped by Geoffrey Garen.

We should rename the following:
    osStackLimitWithReserve => softStackLimit
    reservedZoneSize => softReservedZoneSize
    errorModeReservedZoneSize => reservedZoneSize

* API/tests/PingPongStackOverflowTest.cpp:
(testPingPongStackOverflow):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::compile):
(JSC::DFG::JITCompiler::compileFunction):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::lower):
* interpreter/CLoopStack.cpp:
(JSC::CLoopStack::CLoopStack):
(JSC::CLoopStack::grow):
(JSC::CLoopStack::releaseExcessCapacity):
(JSC::CLoopStack::addToCommittedByteCount):
(JSC::CLoopStack::setSoftReservedZoneSize):
(JSC::CLoopStack::setReservedZoneSize): Deleted.
* interpreter/CLoopStack.h:
(JSC::CLoopStack::size):
* interpreter/CLoopStackInlines.h:
(JSC::CLoopStack::shrink):
* jit/JIT.cpp:
(JSC::JIT::compileWithoutLinking):
* jit/SetupVarargsFrame.cpp:
(JSC::emitSetupVarargsFrameFastCase):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/ErrorHandlingScope.cpp:
(JSC::ErrorHandlingScope::ErrorHandlingScope):
(JSC::ErrorHandlingScope::~ErrorHandlingScope):
* runtime/ErrorHandlingScope.h:
* runtime/Options.h:
* runtime/RegExp.cpp:
(JSC::RegExp::finishCreation):
(JSC::RegExp::compile):
(JSC::RegExp::compileMatchOnly):
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::setStackPointerAtVMEntry):
(JSC::VM::updateSoftReservedZoneSize):
(JSC::VM::updateStackLimit):
(JSC::VM::updateReservedZoneSize): Deleted.
* runtime/VM.h:
(JSC::VM::stackPointerAtVMEntry):
(JSC::VM::softReservedZoneSize):
(JSC::VM::softStackLimit):
(JSC::VM::addressOfSoftStackLimit):
(JSC::VM::cloopStackLimit):
(JSC::VM::setCLoopStackLimit):
(JSC::VM::isSafeToRecurse):
(JSC::VM::reservedZoneSize): Deleted.
(JSC::VM::osStackLimitWithReserve): Deleted.
(JSC::VM::addressOfOSStackLimitWithReserve): Deleted.
* runtime/VMInlines.h:
(JSC::VM::ensureStackCapacityFor):
* wasm/WASMFunctionCompiler.h:
(JSC::WASMFunctionCompiler::startFunction):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@203130 268f45cc-cd09-0410-ab3c-d52691b4dbfc

21 files changed:
Source/JavaScriptCore/API/tests/PingPongStackOverflowTest.cpp
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/dfg/DFGJITCompiler.cpp
Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
Source/JavaScriptCore/interpreter/CLoopStack.cpp
Source/JavaScriptCore/interpreter/CLoopStack.h
Source/JavaScriptCore/interpreter/CLoopStackInlines.h
Source/JavaScriptCore/jit/JIT.cpp
Source/JavaScriptCore/jit/SetupVarargsFrame.cpp
Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
Source/JavaScriptCore/llint/LowLevelInterpreter.asm
Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
Source/JavaScriptCore/runtime/ErrorHandlingScope.cpp
Source/JavaScriptCore/runtime/ErrorHandlingScope.h
Source/JavaScriptCore/runtime/Options.h
Source/JavaScriptCore/runtime/RegExp.cpp
Source/JavaScriptCore/runtime/VM.cpp
Source/JavaScriptCore/runtime/VM.h
Source/JavaScriptCore/runtime/VMInlines.h
Source/JavaScriptCore/wasm/WASMFunctionCompiler.h

index 33f0772..1ffe757 100644 (file)
@@ -120,13 +120,13 @@ int testPingPongStackOverflow()
     JSC::initializeThreading();
     Options::initialize(); // Ensure options is initialized first.
 
+    auto origSoftReservedZoneSize = Options::softReservedZoneSize();
     auto origReservedZoneSize = Options::reservedZoneSize();
-    auto origErrorModeReservedZoneSize = Options::errorModeReservedZoneSize();
     auto origUseLLInt = Options::useLLInt();
     auto origMaxPerThreadStackUsage = Options::maxPerThreadStackUsage();
 
-    Options::reservedZoneSize() = 128 * KB;
-    Options::errorModeReservedZoneSize() = 64 * KB;
+    Options::softReservedZoneSize() = 128 * KB;
+    Options::reservedZoneSize() = 64 * KB;
 #if ENABLE(JIT)
     // Normally, we want to disable the LLINT to force the use of JITted code which is necessary for
     // reproducing the regression in https://bugs.webkit.org/show_bug.cgi?id=148749. However, we only
@@ -158,7 +158,7 @@ int testPingPongStackOverflow()
     JSStringRelease(PingPongStackOverflowObjectString);
 
     unsigned stackSize = 32 * KB;
-    Options::maxPerThreadStackUsage() = stackSize + Options::reservedZoneSize();
+    Options::maxPerThreadStackUsage() = stackSize + Options::softReservedZoneSize();
 
     exception = nullptr;
     scriptResult = JSEvaluateScript(context, script, nullptr, nullptr, 1, &exception);
@@ -173,8 +173,8 @@ int testPingPongStackOverflow()
         printf("PASS: PingPongStackOverflow test.\n");
     }
 
+    Options::softReservedZoneSize() = origSoftReservedZoneSize;
     Options::reservedZoneSize() = origReservedZoneSize;
-    Options::errorModeReservedZoneSize() = origErrorModeReservedZoneSize;
     Options::useLLInt() = origUseLLInt;
     Options::maxPerThreadStackUsage() = origMaxPerThreadStackUsage;
 
index 49fbd8e..f978c34 100644 (file)
@@ -1,3 +1,73 @@
+2016-07-12  Mark Lam  <mark.lam@apple.com>
+
+        More stack limit and reserved zone renaming.
+        https://bugs.webkit.org/show_bug.cgi?id=159690
+
+        Rubber-stamped by Geoffrey Garen.
+
+        We should rename the following:
+            osStackLimitWithReserve => softStackLimit
+            reservedZoneSize => softReservedZoneSize
+            errorModeReservedZoneSize => reservedZoneSize
+
+        * API/tests/PingPongStackOverflowTest.cpp:
+        (testPingPongStackOverflow):
+        * dfg/DFGJITCompiler.cpp:
+        (JSC::DFG::JITCompiler::compile):
+        (JSC::DFG::JITCompiler::compileFunction):
+        * ftl/FTLLowerDFGToB3.cpp:
+        (JSC::FTL::DFG::LowerDFGToB3::lower):
+        * interpreter/CLoopStack.cpp:
+        (JSC::CLoopStack::CLoopStack):
+        (JSC::CLoopStack::grow):
+        (JSC::CLoopStack::releaseExcessCapacity):
+        (JSC::CLoopStack::addToCommittedByteCount):
+        (JSC::CLoopStack::setSoftReservedZoneSize):
+        (JSC::CLoopStack::setReservedZoneSize): Deleted.
+        * interpreter/CLoopStack.h:
+        (JSC::CLoopStack::size):
+        * interpreter/CLoopStackInlines.h:
+        (JSC::CLoopStack::shrink):
+        * jit/JIT.cpp:
+        (JSC::JIT::compileWithoutLinking):
+        * jit/SetupVarargsFrame.cpp:
+        (JSC::emitSetupVarargsFrameFastCase):
+        * llint/LLIntSlowPaths.cpp:
+        (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+        * llint/LowLevelInterpreter.asm:
+        * llint/LowLevelInterpreter32_64.asm:
+        * llint/LowLevelInterpreter64.asm:
+        * runtime/ErrorHandlingScope.cpp:
+        (JSC::ErrorHandlingScope::ErrorHandlingScope):
+        (JSC::ErrorHandlingScope::~ErrorHandlingScope):
+        * runtime/ErrorHandlingScope.h:
+        * runtime/Options.h:
+        * runtime/RegExp.cpp:
+        (JSC::RegExp::finishCreation):
+        (JSC::RegExp::compile):
+        (JSC::RegExp::compileMatchOnly):
+        * runtime/VM.cpp:
+        (JSC::VM::VM):
+        (JSC::VM::setStackPointerAtVMEntry):
+        (JSC::VM::updateSoftReservedZoneSize):
+        (JSC::VM::updateStackLimit):
+        (JSC::VM::updateReservedZoneSize): Deleted.
+        * runtime/VM.h:
+        (JSC::VM::stackPointerAtVMEntry):
+        (JSC::VM::softReservedZoneSize):
+        (JSC::VM::softStackLimit):
+        (JSC::VM::addressOfSoftStackLimit):
+        (JSC::VM::cloopStackLimit):
+        (JSC::VM::setCLoopStackLimit):
+        (JSC::VM::isSafeToRecurse):
+        (JSC::VM::reservedZoneSize): Deleted.
+        (JSC::VM::osStackLimitWithReserve): Deleted.
+        (JSC::VM::addressOfOSStackLimitWithReserve): Deleted.
+        * runtime/VMInlines.h:
+        (JSC::VM::ensureStackCapacityFor):
+        * wasm/WASMFunctionCompiler.h:
+        (JSC::WASMFunctionCompiler::startFunction):
+
 2016-07-12  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
 
         Remove ENABLE_CSS3_TEXT_LINE_BREAK flag
index 8045891..d421387 100644 (file)
@@ -342,7 +342,7 @@ void JITCompiler::compile()
 
     // Plant a check that sufficient space is available in the JSStack.
     addPtr(TrustedImm32(virtualRegisterForLocal(m_graph.requiredRegisterCountForExecutionAndExit() - 1).offset() * sizeof(Register)), GPRInfo::callFrameRegister, GPRInfo::regT1);
-    Jump stackOverflow = branchPtr(Above, AbsoluteAddress(m_vm->addressOfOSStackLimitWithReserve()), GPRInfo::regT1);
+    Jump stackOverflow = branchPtr(Above, AbsoluteAddress(m_vm->addressOfSoftStackLimit()), GPRInfo::regT1);
 
     addPtr(TrustedImm32(m_graph.stackPointerOffset() * sizeof(Register)), GPRInfo::callFrameRegister, stackPointerRegister);
     checkStackPointerAlignment();
@@ -405,7 +405,7 @@ void JITCompiler::compileFunction()
     Label fromArityCheck(this);
     // Plant a check that sufficient space is available in the JSStack.
     addPtr(TrustedImm32(virtualRegisterForLocal(m_graph.requiredRegisterCountForExecutionAndExit() - 1).offset() * sizeof(Register)), GPRInfo::callFrameRegister, GPRInfo::regT1);
-    Jump stackOverflow = branchPtr(Above, AbsoluteAddress(m_vm->addressOfOSStackLimitWithReserve()), GPRInfo::regT1);
+    Jump stackOverflow = branchPtr(Above, AbsoluteAddress(m_vm->addressOfSoftStackLimit()), GPRInfo::regT1);
 
     // Move the stack pointer down to accommodate locals
     addPtr(TrustedImm32(m_graph.stackPointerOffset() * sizeof(Register)), GPRInfo::callFrameRegister, stackPointerRegister);
index ecac90e..fc617fd 100644 (file)
@@ -189,7 +189,7 @@ public:
 
         // Stack Overflow Check.
         unsigned exitFrameSize = m_graph.requiredRegisterCountForExit() * sizeof(Register);
-        MacroAssembler::AbsoluteAddress addressOfStackLimit(vm().addressOfOSStackLimitWithReserve());
+        MacroAssembler::AbsoluteAddress addressOfStackLimit(vm().addressOfSoftStackLimit());
         PatchpointValue* stackOverflowHandler = m_out.patchpoint(Void);
         CallSiteIndex callSiteIndex = callSiteIndexForCodeOrigin(m_ftlState, CodeOrigin(0));
         stackOverflowHandler->appendSomeRegister(m_callFrame);
index ec7fee3..ba46516 100644 (file)
@@ -54,7 +54,7 @@ CLoopStack::CLoopStack(VM& vm)
     : m_vm(vm)
     , m_topCallFrame(vm.topCallFrame)
     , m_end(0)
-    , m_reservedZoneSizeInRegisters(0)
+    , m_softReservedZoneSizeInRegisters(0)
 {
     size_t capacity = Options::maxPerThreadStackUsage();
     ASSERT(capacity && isPageAligned(capacity));
@@ -78,7 +78,7 @@ CLoopStack::~CLoopStack()
 
 bool CLoopStack::grow(Register* newTopOfStack)
 {
-    Register* newTopOfStackWithReservedZone = newTopOfStack - m_reservedZoneSizeInRegisters;
+    Register* newTopOfStackWithReservedZone = newTopOfStack - m_softReservedZoneSizeInRegisters;
 
     // If we have already committed enough memory to satisfy this request,
     // just update the end pointer and return.
@@ -126,7 +126,7 @@ void CLoopStack::sanitizeStack()
 
 void CLoopStack::releaseExcessCapacity()
 {
-    Register* highAddressWithReservedZone = highAddress() - m_reservedZoneSizeInRegisters;
+    Register* highAddressWithReservedZone = highAddress() - m_softReservedZoneSizeInRegisters;
     ptrdiff_t delta = reinterpret_cast<char*>(highAddressWithReservedZone) - reinterpret_cast<char*>(m_commitTop);
     m_reservation.decommit(m_commitTop, delta);
     addToCommittedByteCount(-delta);
@@ -140,10 +140,10 @@ void CLoopStack::addToCommittedByteCount(long byteCount)
     committedBytesCount += byteCount;
 }
 
-void CLoopStack::setReservedZoneSize(size_t reservedZoneSize)
+void CLoopStack::setSoftReservedZoneSize(size_t reservedZoneSize)
 {
-    m_reservedZoneSizeInRegisters = reservedZoneSize / sizeof(Register);
-    if (m_commitTop >= (m_end + 1) - m_reservedZoneSizeInRegisters)
+    m_softReservedZoneSizeInRegisters = reservedZoneSize / sizeof(Register);
+    if (m_commitTop >= (m_end + 1) - m_softReservedZoneSizeInRegisters)
         grow(m_end + 1);
 }
 
index ac08a2f..5c0b69a 100644 (file)
@@ -67,7 +67,7 @@ namespace JSC {
 
         size_t size() const { return highAddress() - lowAddress(); }
 
-        void setReservedZoneSize(size_t);
+        void setSoftReservedZoneSize(size_t);
 
         inline Register* topOfStack();
 
@@ -104,7 +104,7 @@ namespace JSC {
         Register* m_commitTop;
         PageReservation m_reservation;
         Register* m_lastStackTop;
-        ptrdiff_t m_reservedZoneSizeInRegisters;
+        ptrdiff_t m_softReservedZoneSizeInRegisters;
 
         friend class LLIntOffsetsExtractor;
     };
index b8b5bb8..44e385b 100644 (file)
@@ -64,7 +64,7 @@ inline void CLoopStack::shrink(Register* newTopOfStack)
     // invoke std::max() with it as an argument. To work around this, we first
     // assign the constant to a local variable, and use the local instead.
     ptrdiff_t maxExcessCapacity = CLoopStack::maxExcessCapacity;
-    ptrdiff_t maxExcessInRegisters = std::max(maxExcessCapacity, m_reservedZoneSizeInRegisters);
+    ptrdiff_t maxExcessInRegisters = std::max(maxExcessCapacity, m_softReservedZoneSizeInRegisters);
     if (m_end == baseOfStack() && (highAddress() - m_commitTop) >= maxExcessInRegisters)
         releaseExcessCapacity();
 }
index be3485c..f27d39a 100644 (file)
@@ -599,7 +599,7 @@ void JIT::compileWithoutLinking(JITCompilationEffort effort)
     }
 
     addPtr(TrustedImm32(stackPointerOffsetFor(m_codeBlock) * sizeof(Register)), callFrameRegister, regT1);
-    Jump stackOverflow = branchPtr(Above, AbsoluteAddress(m_vm->addressOfOSStackLimitWithReserve()), regT1);
+    Jump stackOverflow = branchPtr(Above, AbsoluteAddress(m_vm->addressOfSoftStackLimit()), regT1);
 
     move(regT1, stackPointerRegister);
     checkStackPointerAlignment();
index 22cbba0..194e979 100644 (file)
@@ -82,7 +82,7 @@ void emitSetupVarargsFrameFastCase(CCallHelpers& jit, GPRReg numUsedSlotsGPR, GP
     
     emitSetVarargsFrame(jit, scratchGPR1, true, numUsedSlotsGPR, scratchGPR2);
 
-    slowCase.append(jit.branchPtr(CCallHelpers::Above, CCallHelpers::AbsoluteAddress(jit.vm()->addressOfOSStackLimitWithReserve()), scratchGPR2));
+    slowCase.append(jit.branchPtr(CCallHelpers::Above, CCallHelpers::AbsoluteAddress(jit.vm()->addressOfSoftStackLimit()), scratchGPR2));
 
     // Initialize ArgumentCount.
     jit.store32(scratchGPR1, CCallHelpers::Address(scratchGPR2, CallFrameSlot::argumentCount * static_cast<int>(sizeof(Register)) + PayloadOffset));
index 9620238..65a1713 100644 (file)
@@ -483,7 +483,7 @@ LLINT_SLOW_PATH_DECL(stack_check)
     dataLogF("Num vars = %u.\n", exec->codeBlock()->m_numVars);
 
 #if ENABLE(JIT)
-    dataLogF("Current end is at %p.\n", exec->vm().osStackLimitWithReserve());
+    dataLogF("Current end is at %p.\n", exec->vm().softStackLimit());
 #else
     dataLogF("Current end is at %p.\n", exec->vm().cloopStackLimit());
 #endif
index 2a75c83..0199315 100644 (file)
@@ -954,7 +954,7 @@ macro prologue(codeBlockGetter, codeBlockSetter, osrSlowPath, traceSlowPath)
     if C_LOOP
         bpbeq VM::m_cloopStackLimit[t2], t0, .stackHeightOK
     else
-        bpbeq VM::m_osStackLimitWithReserve[t2], t0, .stackHeightOK
+        bpbeq VM::m_softStackLimit[t2], t0, .stackHeightOK
     end
 
     # Stack height check failed - need to call a slow_path.
index b530413..7287f6b 100644 (file)
@@ -155,7 +155,7 @@ macro doVMEntry(makeCall)
     if C_LOOP
         bpaeq t3, VM::m_cloopStackLimit[vm], .stackHeightOK
     else
-        bpaeq t3, VM::m_osStackLimitWithReserve[vm], .stackHeightOK
+        bpaeq t3, VM::m_softStackLimit[vm], .stackHeightOK
     end
 
     if C_LOOP
index 2763303..b30afa2 100644 (file)
@@ -143,7 +143,7 @@ macro doVMEntry(makeCall)
     if C_LOOP
         bpaeq t3, VM::m_cloopStackLimit[vm], .stackHeightOK
     else
-        bpaeq t3, VM::m_osStackLimitWithReserve[vm], .stackHeightOK
+        bpaeq t3, VM::m_softStackLimit[vm], .stackHeightOK
     end
 
     if C_LOOP
index 9e85313..072a9fa 100644 (file)
@@ -35,14 +35,14 @@ ErrorHandlingScope::ErrorHandlingScope(VM& vm)
     : m_vm(vm)
 {
     RELEASE_ASSERT(m_vm.stackPointerAtVMEntry());
-    size_t newReservedZoneSize = Options::errorModeReservedZoneSize();
-    m_savedReservedZoneSize = m_vm.updateReservedZoneSize(newReservedZoneSize);
+    size_t newSoftReservedZoneSize = Options::reservedZoneSize();
+    m_savedSoftReservedZoneSize = m_vm.updateSoftReservedZoneSize(newSoftReservedZoneSize);
 }
 
 ErrorHandlingScope::~ErrorHandlingScope()
 {
     RELEASE_ASSERT(m_vm.stackPointerAtVMEntry());
-    m_vm.updateReservedZoneSize(m_savedReservedZoneSize);
+    m_vm.updateSoftReservedZoneSize(m_savedSoftReservedZoneSize);
 }
 
 } // namespace JSC
index 451b241..4ac70df 100644 (file)
@@ -36,7 +36,7 @@ public:
     JS_EXPORT_PRIVATE ~ErrorHandlingScope();
 private:
     VM& m_vm;
-    size_t m_savedReservedZoneSize;
+    size_t m_savedSoftReservedZoneSize;
 };
 
 } // namespace JSC
index c27285b..70365f0 100644 (file)
@@ -112,9 +112,9 @@ typedef const char* optionString;
     \
     v(bool, reportMustSucceedExecutableAllocations, false, Normal, nullptr) \
     \
-    v(unsigned, maxPerThreadStackUsage, 4 * MB, Normal, nullptr) \
-    v(unsigned, reservedZoneSize, 128 * KB, Normal, nullptr) \
-    v(unsigned, errorModeReservedZoneSize, 64 * KB, Normal, nullptr) \
+    v(unsigned, maxPerThreadStackUsage, 4 * MB, Normal, "Max allowed stack usage by the VM") \
+    v(unsigned, softReservedZoneSize, 128 * KB, Normal, "The amount of stack JSC usually reserves for host code.") \
+    v(unsigned, reservedZoneSize, 64 * KB, Normal, "This is the amount of stack JSC guarantees for client and VM code.") \
     \
     v(bool, crashIfCantAllocateJITMemory, false, Normal, nullptr) \
     v(unsigned, jitMemoryReservationSize, 0, Normal, "Set this number to change the executable allocation size in ExecutableAllocatorFixedVMPool. (In bytes.)") \
index 9a5e69f..6ff7772 100644 (file)
@@ -222,7 +222,7 @@ RegExp::RegExp(VM& vm, const String& patternString, RegExpFlags flags)
 void RegExp::finishCreation(VM& vm)
 {
     Base::finishCreation(vm);
-    Yarr::YarrPattern pattern(m_patternString, m_flags, &m_constructionError, vm.osStackLimitWithReserve());
+    Yarr::YarrPattern pattern(m_patternString, m_flags, &m_constructionError, vm.softStackLimit());
     if (m_constructionError)
         m_state = ParseError;
     else
@@ -264,7 +264,7 @@ void RegExp::compile(VM* vm, Yarr::YarrCharSize charSize)
 {
     ConcurrentJITLocker locker(m_lock);
     
-    Yarr::YarrPattern pattern(m_patternString, m_flags, &m_constructionError, vm->osStackLimitWithReserve());
+    Yarr::YarrPattern pattern(m_patternString, m_flags, &m_constructionError, vm->softStackLimit());
     if (m_constructionError) {
         RELEASE_ASSERT_NOT_REACHED();
 #if COMPILER_QUIRK(CONSIDERS_UNREACHABLE_CODE)
@@ -317,7 +317,7 @@ void RegExp::compileMatchOnly(VM* vm, Yarr::YarrCharSize charSize)
 {
     ConcurrentJITLocker locker(m_lock);
     
-    Yarr::YarrPattern pattern(m_patternString, m_flags, &m_constructionError, vm->osStackLimitWithReserve());
+    Yarr::YarrPattern pattern(m_patternString, m_flags, &m_constructionError, vm->softStackLimit());
     if (m_constructionError) {
         RELEASE_ASSERT_NOT_REACHED();
 #if COMPILER_QUIRK(CONSIDERS_UNREACHABLE_CODE)
index d4e7f9d..b842ec3 100644 (file)
@@ -197,7 +197,7 @@ VM::VM(VMType vmType, HeapType heapType)
 {
     interpreter = new Interpreter(*this);
     StackBounds stack = wtfThreadData().stack();
-    updateReservedZoneSize(Options::reservedZoneSize());
+    updateSoftReservedZoneSize(Options::softReservedZoneSize());
     setLastStackTop(stack.origin());
 
     // Need to be careful to keep everything consistent here
@@ -613,17 +613,17 @@ void VM::setStackPointerAtVMEntry(void* sp)
     updateStackLimit();
 }
 
-size_t VM::updateReservedZoneSize(size_t reservedZoneSize)
+size_t VM::updateSoftReservedZoneSize(size_t softReservedZoneSize)
 {
-    size_t oldReservedZoneSize = m_reservedZoneSize;
-    m_reservedZoneSize = reservedZoneSize;
+    size_t oldSoftReservedZoneSize = m_currentSoftReservedZoneSize;
+    m_currentSoftReservedZoneSize = softReservedZoneSize;
 #if !ENABLE(JIT)
-    interpreter->cloopStack().setReservedZoneSize(reservedZoneSize);
+    interpreter->cloopStack().setSoftReservedZoneSize(softReservedZoneSize);
 #endif
 
     updateStackLimit();
 
-    return oldReservedZoneSize;
+    return oldSoftReservedZoneSize;
 }
 
 #if PLATFORM(WIN)
@@ -654,20 +654,20 @@ static void preCommitStackMemory(void* stackLimit)
 inline void VM::updateStackLimit()
 {
 #if PLATFORM(WIN)
-    void* lastOSStackLimitWithReserve = m_osStackLimitWithReserve;
+    void* lastSoftStackLimit = m_softStackLimit;
 #endif
 
     if (m_stackPointerAtVMEntry) {
         ASSERT(wtfThreadData().stack().isGrowingDownward());
         char* startOfStack = reinterpret_cast<char*>(m_stackPointerAtVMEntry);
-        m_osStackLimitWithReserve = wtfThreadData().stack().recursionLimit(startOfStack, Options::maxPerThreadStackUsage(), m_reservedZoneSize);
+        m_softStackLimit = wtfThreadData().stack().recursionLimit(startOfStack, Options::maxPerThreadStackUsage(), m_currentSoftReservedZoneSize);
     } else {
-        m_osStackLimitWithReserve = wtfThreadData().stack().recursionLimit(m_reservedZoneSize);
+        m_softStackLimit = wtfThreadData().stack().recursionLimit(m_currentSoftReservedZoneSize);
     }
 
 #if PLATFORM(WIN)
-    if (lastOSStackLimitWithReserve != m_osStackLimitWithReserve)
-        preCommitStackMemory(m_osStackLimitWithReserve);
+    if (lastSoftStackLimit != m_softStackLimit)
+        preCommitStackMemory(m_softStackLimit);
 #endif
 }
 
index 7dd1233..d398593 100644 (file)
@@ -459,14 +459,14 @@ public:
     void* stackPointerAtVMEntry() const { return m_stackPointerAtVMEntry; }
     void setStackPointerAtVMEntry(void*);
 
-    size_t reservedZoneSize() const { return m_reservedZoneSize; }
-    size_t updateReservedZoneSize(size_t reservedZoneSize);
+    size_t softReservedZoneSize() const { return m_currentSoftReservedZoneSize; }
+    size_t updateSoftReservedZoneSize(size_t softReservedZoneSize);
 
     static size_t committedStackByteCount();
     inline bool ensureStackCapacityFor(Register* newTopOfStack);
 
-    void* osStackLimitWithReserve() { return m_osStackLimitWithReserve; }
-    void** addressOfOSStackLimitWithReserve() { return &m_osStackLimitWithReserve; }
+    void* softStackLimit() { return m_softStackLimit; }
+    void** addressOfSoftStackLimit() { return &m_softStackLimit; }
 #if !ENABLE(JIT)
     void* cloopStackLimit() { return m_cloopStackLimit; }
     void setCLoopStackLimit(void* limit) { m_cloopStackLimit = limit; }
@@ -476,7 +476,7 @@ public:
     {
         ASSERT(wtfThreadData().stack().isGrowingDownward());
         int8_t* curr = reinterpret_cast<int8_t*>(&curr);
-        int8_t* limit = reinterpret_cast<int8_t*>(m_osStackLimitWithReserve);
+        int8_t* limit = reinterpret_cast<int8_t*>(m_softStackLimit);
         return curr >= limit && static_cast<size_t>(curr - limit) >= neededStackInBytes;
     }
 
@@ -648,8 +648,8 @@ private:
 #endif
 
     void* m_stackPointerAtVMEntry;
-    size_t m_reservedZoneSize;
-    void* m_osStackLimitWithReserve { nullptr };
+    size_t m_currentSoftReservedZoneSize;
+    void* m_softStackLimit { nullptr };
 #if !ENABLE(JIT)
     void* m_cloopStackLimit { nullptr };
 #endif
index f46c37e..4b3bad5 100644 (file)
@@ -40,7 +40,7 @@ bool VM::ensureStackCapacityFor(Register* newTopOfStack)
 {
 #if ENABLE(JIT)
     ASSERT(wtfThreadData().stack().isGrowingDownward());
-    return newTopOfStack >= m_osStackLimitWithReserve;
+    return newTopOfStack >= m_softStackLimit;
 #else
     return interpreter->cloopStack().ensureCapacityFor(newTopOfStack);
 #endif
index 5bac43d..7ac7247 100644 (file)
@@ -135,7 +135,7 @@ public:
         m_beginLabel = label();
 
         addPtr(TrustedImm32(-m_calleeSaveSpace - WTF::roundUpToMultipleOf(stackAlignmentRegisters(), m_stackHeight) * sizeof(StackSlot) - maxFrameExtentForSlowPathCall), GPRInfo::callFrameRegister, GPRInfo::regT1);
-        m_stackOverflow = branchPtr(Above, AbsoluteAddress(m_vm->addressOfOSStackLimitWithReserve()), GPRInfo::regT1);
+        m_stackOverflow = branchPtr(Above, AbsoluteAddress(m_vm->addressOfSoftStackLimit()), GPRInfo::regT1);
 
         move(GPRInfo::regT1, stackPointerRegister);
         checkStackPointerAlignment();