Changeset 159605 in webkit


Ignore:
Timestamp:
Nov 20, 2013 9:29:42 PM (10 years ago)
Author:
mark.lam@apple.com
Message:

Introducing VMEntryScope to update the VM stack limit.
https://bugs.webkit.org/show_bug.cgi?id=124634.

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

  1. Introduced USE(SEPARATE_C_AND_JS_STACK) (defined in Platform.h). Currently, it is hardcoded to use separate C and JS stacks. Once we switch to using the C stack for JS frames, we'll need to fix this to only be enabled when ENABLE(LLINT_C_LOOP).
  1. Stack limits are now tracked in the VM.

Logically, there are 2 stack limits:

  1. m_stackLimit for the native C stack, and
  2. m_jsStackLimit for the JS stack.

If USE(SEPARATE_C_AND_JS_STACK), then the 2 limits are the same
value, and are implemented as 2 fields in a union.

  1. The VM native stackLimit is set as follows:
    1. Initially, the VM sets it to the limit of the stack of the thread that instantiated the VM. This allows the parser and bytecode generator to run before we enter the VM to execute JS code.
  1. Upon entry into the VM to execute JS code (via one of the Interpreter::execute...() functions), we instantiate a VMEntryScope that sets the VM's stackLimit to the limit of the current thread's stack. The VMEntryScope will automatically restore the previous entryScope and stack limit upon destruction.

If USE(SEPARATE_C_AND_JS_STACK), the JSStack's methods will set the VM's
jsStackLimit whenever it grows or shrinks.

  1. The VM now provides a isSafeToRecurse() function that compares the current stack pointer against its native stackLimit. This subsumes and obsoletes the VMStackBounds class.
  1. The VMEntryScope class also subsumes DynamicGlobalObjectScope for tracking the JSGlobalObject that we last entered the VM with.
  1. Renamed dynamicGlobalObject() to vmEntryGlobalObject() since that is the value that the function retrieves.
  1. Changed JIT and LLINT code to do stack checks against the jsStackLimit in the VM class instead of the JSStack.
  • API/JSBase.cpp:

(JSEvaluateScript):
(JSCheckScriptSyntax):

  • API/JSContextRef.cpp:

(JSGlobalContextRetain):
(JSGlobalContextRelease):

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
  • JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::BytecodeGenerator):

  • bytecompiler/BytecodeGenerator.h:

(JSC::BytecodeGenerator::emitNode):
(JSC::BytecodeGenerator::emitNodeInConditionContext):

  • debugger/Debugger.cpp:

(JSC::Debugger::detach):
(JSC::Debugger::recompileAllJSFunctions):
(JSC::Debugger::pauseIfNeeded):

  • debugger/DebuggerCallFrame.cpp:

(JSC::DebuggerCallFrame::vmEntryGlobalObject):

  • debugger/DebuggerCallFrame.h:
  • dfg/DFGJITCompiler.cpp:

(JSC::DFG::JITCompiler::compileFunction):

  • dfg/DFGOSREntry.cpp:
  • ftl/FTLLink.cpp:

(JSC::FTL::link):

  • ftl/FTLOSREntry.cpp:
  • heap/Heap.cpp:

(JSC::Heap::lastChanceToFinalize):
(JSC::Heap::deleteAllCompiledCode):

  • interpreter/CachedCall.h:

(JSC::CachedCall::CachedCall):

  • interpreter/CallFrame.cpp:

(JSC::CallFrame::vmEntryGlobalObject):

  • interpreter/CallFrame.h:
  • interpreter/Interpreter.cpp:

(JSC::unwindCallFrame):
(JSC::Interpreter::unwind):
(JSC::Interpreter::execute):
(JSC::Interpreter::executeCall):
(JSC::Interpreter::executeConstruct):
(JSC::Interpreter::prepareForRepeatCall):
(JSC::Interpreter::debug):

  • interpreter/JSStack.cpp:

(JSC::JSStack::JSStack):
(JSC::JSStack::growSlowCase):

  • interpreter/JSStack.h:
  • interpreter/JSStackInlines.h:

(JSC::JSStack::shrink):
(JSC::JSStack::grow):

  • Moved these inlined functions here from JSStack.h. It reduces some #include dependencies of JSSTack.h which had previously resulted in some EWS bots' unhappiness with this patch.

(JSC::JSStack::updateStackLimit):

  • jit/JIT.cpp:

(JSC::JIT::privateCompile):

  • jit/JITCall.cpp:

(JSC::JIT::compileLoadVarargs):

  • jit/JITCall32_64.cpp:

(JSC::JIT::compileLoadVarargs):

  • jit/JITOperations.cpp:
  • llint/LLIntSlowPaths.cpp:
  • llint/LowLevelInterpreter.asm:
  • parser/Parser.cpp:

(JSC::::Parser):

  • parser/Parser.h:

(JSC::Parser::canRecurse):

  • runtime/CommonSlowPaths.h:
  • runtime/Completion.cpp:

(JSC::evaluate):

  • runtime/FunctionConstructor.cpp:

(JSC::constructFunctionSkippingEvalEnabledCheck):

  • runtime/JSGlobalObject.cpp:
  • runtime/JSGlobalObject.h:
  • runtime/StringRecursionChecker.h:

(JSC::StringRecursionChecker::performCheck):

  • runtime/VM.cpp:

(JSC::VM::VM):
(JSC::VM::releaseExecutableMemory):
(JSC::VM::throwException):

  • runtime/VM.h:

(JSC::VM::addressOfJSStackLimit):
(JSC::VM::jsStackLimit):
(JSC::VM::setJSStackLimit):
(JSC::VM::stackLimit):
(JSC::VM::setStackLimit):
(JSC::VM::isSafeToRecurse):

  • runtime/VMEntryScope.cpp: Added.

(JSC::VMEntryScope::VMEntryScope):
(JSC::VMEntryScope::~VMEntryScope):
(JSC::VMEntryScope::requiredCapacity):

  • runtime/VMEntryScope.h: Added.

(JSC::VMEntryScope::globalObject):

  • runtime/VMStackBounds.h: Removed.

Source/WebCore:

No new tests.

Renamed dynamicGlobalObject() to vmEntryGlobalObject().
Replaced uses of DynamicGlobalObjectScope with VMEntryScope.

  • ForwardingHeaders/runtime/VMEntryScope.h: Added.
  • WebCore.vcxproj/WebCore.vcxproj:
  • WebCore.vcxproj/WebCore.vcxproj.filters:
  • bindings/js/JSCryptoAlgorithmBuilder.cpp:

(WebCore::JSCryptoAlgorithmBuilder::add):

  • bindings/js/JSCustomXPathNSResolver.cpp:

(WebCore::JSCustomXPathNSResolver::create):

  • bindings/js/JSDOMBinding.cpp:

(WebCore::firstDOMWindow):

  • bindings/js/JSErrorHandler.cpp:

(WebCore::JSErrorHandler::handleEvent):

  • bindings/js/JSEventListener.cpp:

(WebCore::JSEventListener::handleEvent):

  • bindings/js/JavaScriptCallFrame.h:

(WebCore::JavaScriptCallFrame::vmEntryGlobalObject):

  • bindings/js/PageScriptDebugServer.cpp:

(WebCore::PageScriptDebugServer::recompileAllJSFunctions):

  • bindings/js/ScriptDebugServer.cpp:

(WebCore::ScriptDebugServer::evaluateBreakpointAction):
(WebCore::ScriptDebugServer::handlePause):

  • bindings/js/WorkerScriptDebugServer.cpp:

(WebCore::WorkerScriptDebugServer::recompileAllJSFunctions):

  • bindings/objc/WebScriptObject.mm:

(WebCore::addExceptionToConsole):

  • bridge/c/c_utility.cpp:

(JSC::Bindings::convertValueToNPVariant):

  • bridge/objc/objc_instance.mm:

(ObjcInstance::moveGlobalExceptionToExecState):

  • bridge/objc/objc_runtime.mm:

(JSC::Bindings::convertValueToObjcObject):

  • bridge/objc/objc_utility.mm:

(JSC::Bindings::convertValueToObjcValue):

Source/WebKit/mac:

  • WebView/WebScriptDebugger.mm:

(WebScriptDebugger::sourceParsed):

Source/WTF:

  • wtf/Platform.h:
  • wtf/StackBounds.h:

(WTF::StackBounds::StackBounds):

Location:
trunk/Source
Files:
3 added
1 deleted
63 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSBase.cpp

    r157794 r159605  
    11/*
    2  * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
     2 * Copyright (C) 2006, 2007, 2013 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    5555
    5656    // evaluate sets "this" to the global object if it is NULL
    57     JSGlobalObject* globalObject = exec->dynamicGlobalObject();
     57    JSGlobalObject* globalObject = exec->vmEntryGlobalObject();
    5858    SourceCode source = makeSource(script->string(), sourceURL->string(), TextPosition(OrdinalNumber::fromOneBasedInt(startingLineNumber), OrdinalNumber::first()));
    5959
     
    8686   
    8787    JSValue syntaxException;
    88     bool isValidSyntax = checkSyntax(exec->dynamicGlobalObject()->globalExec(), source, &syntaxException);
     88    bool isValidSyntax = checkSyntax(exec->vmEntryGlobalObject()->globalExec(), source, &syntaxException);
    8989
    9090    if (!isValidSyntax) {
  • trunk/Source/JavaScriptCore/API/JSContextRef.cpp

    r159531 r159605  
    11/*
    2  * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
     2 * Copyright (C) 2006, 2007, 2013 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    156156
    157157    VM& vm = exec->vm();
    158     gcProtect(exec->dynamicGlobalObject());
     158    gcProtect(exec->vmEntryGlobalObject());
    159159    vm.ref();
    160160    return ctx;
     
    171171        savedIdentifierTable = wtfThreadData().setCurrentIdentifierTable(vm.identifierTable);
    172172
    173         bool protectCountIsZero = Heap::heap(exec->dynamicGlobalObject())->unprotect(exec->dynamicGlobalObject());
     173        bool protectCountIsZero = Heap::heap(exec->vmEntryGlobalObject())->unprotect(exec->vmEntryGlobalObject());
    174174        if (protectCountIsZero)
    175175            vm.heap.reportAbandonedObjectGraph();
  • trunk/Source/JavaScriptCore/CMakeLists.txt

    r159394 r159605  
    423423    runtime/TypedArrayType.cpp
    424424    runtime/VM.cpp
     425    runtime/VMEntryScope.cpp
    425426    runtime/Watchdog.cpp
    426427    runtime/WatchdogNone.cpp
  • trunk/Source/JavaScriptCore/ChangeLog

    r159593 r159605  
     12013-11-20  Mark Lam  <mark.lam@apple.com>
     2
     3        Introducing VMEntryScope to update the VM stack limit.
     4        https://bugs.webkit.org/show_bug.cgi?id=124634.
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        1. Introduced USE(SEPARATE_C_AND_JS_STACK) (defined in Platform.h).
     9           Currently, it is hardcoded to use separate C and JS stacks. Once we
     10           switch to using the C stack for JS frames, we'll need to fix this to
     11           only be enabled when ENABLE(LLINT_C_LOOP).
     12
     13        2. Stack limits are now tracked in the VM.
     14
     15           Logically, there are 2 stack limits:
     16           a. m_stackLimit for the native C stack, and
     17           b. m_jsStackLimit for the JS stack.
     18
     19           If USE(SEPARATE_C_AND_JS_STACK), then the 2 limits are the same
     20           value, and are implemented as 2 fields in a union.
     21
     22        3. The VM native stackLimit is set as follows:
     23           a. Initially, the VM sets it to the limit of the stack of the thread that
     24              instantiated the VM. This allows the parser and bytecode generator to
     25              run before we enter the VM to execute JS code.
     26
     27           b. Upon entry into the VM to execute JS code (via one of the
     28              Interpreter::execute...() functions), we instantiate a VMEntryScope
     29              that sets the VM's stackLimit to the limit of the current thread's
     30              stack. The VMEntryScope will automatically restore the previous
     31              entryScope and stack limit upon destruction.
     32
     33           If USE(SEPARATE_C_AND_JS_STACK), the JSStack's methods will set the VM's
     34           jsStackLimit whenever it grows or shrinks.
     35
     36        4. The VM now provides a isSafeToRecurse() function that compares the
     37           current stack pointer against its native stackLimit. This subsumes and
     38           obsoletes the VMStackBounds class.
     39
     40        5. The VMEntryScope class also subsumes DynamicGlobalObjectScope for
     41           tracking the JSGlobalObject that we last entered the VM with.
     42
     43        6. Renamed dynamicGlobalObject() to vmEntryGlobalObject() since that is
     44           the value that the function retrieves.
     45
     46        7. Changed JIT and LLINT code to do stack checks against the jsStackLimit
     47           in the VM class instead of the JSStack.
     48
     49        * API/JSBase.cpp:
     50        (JSEvaluateScript):
     51        (JSCheckScriptSyntax):
     52        * API/JSContextRef.cpp:
     53        (JSGlobalContextRetain):
     54        (JSGlobalContextRelease):
     55        * CMakeLists.txt:
     56        * GNUmakefile.list.am:
     57        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
     58        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
     59        * JavaScriptCore.xcodeproj/project.pbxproj:
     60        * bytecompiler/BytecodeGenerator.cpp:
     61        (JSC::BytecodeGenerator::BytecodeGenerator):
     62        * bytecompiler/BytecodeGenerator.h:
     63        (JSC::BytecodeGenerator::emitNode):
     64        (JSC::BytecodeGenerator::emitNodeInConditionContext):
     65        * debugger/Debugger.cpp:
     66        (JSC::Debugger::detach):
     67        (JSC::Debugger::recompileAllJSFunctions):
     68        (JSC::Debugger::pauseIfNeeded):
     69        * debugger/DebuggerCallFrame.cpp:
     70        (JSC::DebuggerCallFrame::vmEntryGlobalObject):
     71        * debugger/DebuggerCallFrame.h:
     72        * dfg/DFGJITCompiler.cpp:
     73        (JSC::DFG::JITCompiler::compileFunction):
     74        * dfg/DFGOSREntry.cpp:
     75        * ftl/FTLLink.cpp:
     76        (JSC::FTL::link):
     77        * ftl/FTLOSREntry.cpp:
     78        * heap/Heap.cpp:
     79        (JSC::Heap::lastChanceToFinalize):
     80        (JSC::Heap::deleteAllCompiledCode):
     81        * interpreter/CachedCall.h:
     82        (JSC::CachedCall::CachedCall):
     83        * interpreter/CallFrame.cpp:
     84        (JSC::CallFrame::vmEntryGlobalObject):
     85        * interpreter/CallFrame.h:
     86        * interpreter/Interpreter.cpp:
     87        (JSC::unwindCallFrame):
     88        (JSC::Interpreter::unwind):
     89        (JSC::Interpreter::execute):
     90        (JSC::Interpreter::executeCall):
     91        (JSC::Interpreter::executeConstruct):
     92        (JSC::Interpreter::prepareForRepeatCall):
     93        (JSC::Interpreter::debug):
     94        * interpreter/JSStack.cpp:
     95        (JSC::JSStack::JSStack):
     96        (JSC::JSStack::growSlowCase):
     97        * interpreter/JSStack.h:
     98        * interpreter/JSStackInlines.h:
     99        (JSC::JSStack::shrink):
     100        (JSC::JSStack::grow):
     101        - Moved these inlined functions here from JSStack.h. It reduces some
     102          #include dependencies of JSSTack.h which had previously resulted
     103          in some EWS bots' unhappiness with this patch.
     104        (JSC::JSStack::updateStackLimit):
     105        * jit/JIT.cpp:
     106        (JSC::JIT::privateCompile):
     107        * jit/JITCall.cpp:
     108        (JSC::JIT::compileLoadVarargs):
     109        * jit/JITCall32_64.cpp:
     110        (JSC::JIT::compileLoadVarargs):
     111        * jit/JITOperations.cpp:
     112        * llint/LLIntSlowPaths.cpp:
     113        * llint/LowLevelInterpreter.asm:
     114        * parser/Parser.cpp:
     115        (JSC::::Parser):
     116        * parser/Parser.h:
     117        (JSC::Parser::canRecurse):
     118        * runtime/CommonSlowPaths.h:
     119        * runtime/Completion.cpp:
     120        (JSC::evaluate):
     121        * runtime/FunctionConstructor.cpp:
     122        (JSC::constructFunctionSkippingEvalEnabledCheck):
     123        * runtime/JSGlobalObject.cpp:
     124        * runtime/JSGlobalObject.h:
     125        * runtime/StringRecursionChecker.h:
     126        (JSC::StringRecursionChecker::performCheck):
     127        * runtime/VM.cpp:
     128        (JSC::VM::VM):
     129        (JSC::VM::releaseExecutableMemory):
     130        (JSC::VM::throwException):
     131        * runtime/VM.h:
     132        (JSC::VM::addressOfJSStackLimit):
     133        (JSC::VM::jsStackLimit):
     134        (JSC::VM::setJSStackLimit):
     135        (JSC::VM::stackLimit):
     136        (JSC::VM::setStackLimit):
     137        (JSC::VM::isSafeToRecurse):
     138        * runtime/VMEntryScope.cpp: Added.
     139        (JSC::VMEntryScope::VMEntryScope):
     140        (JSC::VMEntryScope::~VMEntryScope):
     141        (JSC::VMEntryScope::requiredCapacity):
     142        * runtime/VMEntryScope.h: Added.
     143        (JSC::VMEntryScope::globalObject):
     144        * runtime/VMStackBounds.h: Removed.
     145
    11462013-11-20  Michael Saboff  <msaboff@apple.com>
    2147
  • trunk/Source/JavaScriptCore/GNUmakefile.list.am

    r159394 r159605  
    914914        Source/JavaScriptCore/runtime/VM.cpp \
    915915        Source/JavaScriptCore/runtime/VM.h \
     916        Source/JavaScriptCore/runtime/VMEntryScope.cpp \
     917        Source/JavaScriptCore/runtime/VMEntryScope.h \
    916918        Source/JavaScriptCore/runtime/JSFunctionInlines.h \
    917919        Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h \
     
    11281130        Source/JavaScriptCore/runtime/Uint8Array.h \
    11291131        Source/JavaScriptCore/runtime/Uint8ClampedArray.h \
    1130         Source/JavaScriptCore/runtime/VMStackBounds.h \
    11311132        Source/JavaScriptCore/runtime/Watchdog.cpp \
    11321133        Source/JavaScriptCore/runtime/Watchdog.h \
  • trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj

    r159499 r159605  
    663663    <ClCompile Include="..\runtime\TypedArrayType.cpp" />
    664664    <ClCompile Include="..\runtime\VM.cpp" />
     665    <ClCompile Include="..\runtime\VMEntryScope.cpp" />
    665666    <ClCompile Include="..\runtime\Watchdog.cpp" />
    666667    <ClCompile Include="..\runtime\WatchdogNone.cpp" />
     
    12901291    <ClInclude Include="..\runtime\Uint8Array.h" />
    12911292    <ClInclude Include="..\runtime\VM.h" />
     1293    <ClInclude Include="..\runtime\VMEntryScope.h" />
    12921294    <ClInclude Include="..\runtime\Watchdog.h" />
    12931295    <ClInclude Include="..\runtime\WeakGCMap.h" />
  • trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters

    r159499 r159605  
    802802      <Filter>runtime</Filter>
    803803    </ClCompile>
     804    <ClCompile Include="..\runtime\VMEntryScope.cpp">
     805      <Filter>runtime</Filter>
     806    </ClCompile>
    804807    <ClCompile Include="..\parser\SourceCode.cpp">
    805808      <Filter>parser</Filter>
     
    24172420    </ClInclude>
    24182421    <ClInclude Include="..\runtime\VM.h">
     2422      <Filter>runtime</Filter>
     2423    </ClInclude>
     2424    <ClInclude Include="..\runtime\VMEntryScope.h">
    24192425      <Filter>runtime</Filter>
    24202426    </ClInclude>
  • trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r159520 r159605  
    12391239                FE4A331F15BD2E07006F54F3 /* VMInspector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE4A331D15BD2E07006F54F3 /* VMInspector.cpp */; };
    12401240                FE4A332015BD2E07006F54F3 /* VMInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = FE4A331E15BD2E07006F54F3 /* VMInspector.h */; settings = {ATTRIBUTES = (Private, ); }; };
    1241                 FE6617281774E03500495B00 /* VMStackBounds.h in Headers */ = {isa = PBXBuildFile; fileRef = FE6617271774E03500495B00 /* VMStackBounds.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1241                FE5932A7183C5A2600A1ECCC /* VMEntryScope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE5932A5183C5A2600A1ECCC /* VMEntryScope.cpp */; };
     1242                FE5932A8183C5A2600A1ECCC /* VMEntryScope.h in Headers */ = {isa = PBXBuildFile; fileRef = FE5932A6183C5A2600A1ECCC /* VMEntryScope.h */; settings = {ATTRIBUTES = (Private, ); }; };
    12421243                FEA08620182B7A0400F6D851 /* Breakpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = FEA0861E182B7A0400F6D851 /* Breakpoint.h */; settings = {ATTRIBUTES = (Private, ); }; };
    12431244                FEA08621182B7A0400F6D851 /* DebuggerPrimitives.h in Headers */ = {isa = PBXBuildFile; fileRef = FEA0861F182B7A0400F6D851 /* DebuggerPrimitives.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    25672568                FE4A331D15BD2E07006F54F3 /* VMInspector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VMInspector.cpp; sourceTree = "<group>"; };
    25682569                FE4A331E15BD2E07006F54F3 /* VMInspector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VMInspector.h; sourceTree = "<group>"; };
    2569                 FE6617271774E03500495B00 /* VMStackBounds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VMStackBounds.h; sourceTree = "<group>"; };
     2570                FE5932A5183C5A2600A1ECCC /* VMEntryScope.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VMEntryScope.cpp; sourceTree = "<group>"; };
     2571                FE5932A6183C5A2600A1ECCC /* VMEntryScope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VMEntryScope.h; sourceTree = "<group>"; };
    25702572                FEA0861E182B7A0400F6D851 /* Breakpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Breakpoint.h; sourceTree = "<group>"; };
    25712573                FEA0861F182B7A0400F6D851 /* DebuggerPrimitives.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebuggerPrimitives.h; sourceTree = "<group>"; };
     
    33173319                        isa = PBXGroup;
    33183320                        children = (
     3321                                FE5932A5183C5A2600A1ECCC /* VMEntryScope.cpp */,
     3322                                FE5932A6183C5A2600A1ECCC /* VMEntryScope.h */,
    33193323                                BCF605110E203EF800B9A64D /* ArgList.cpp */,
    33203324                                BCF605120E203EF800B9A64D /* ArgList.h */,
     
    36633667                                E18E3A570DF9278C00D90B34 /* VM.cpp */,
    36643668                                E18E3A560DF9278C00D90B34 /* VM.h */,
    3665                                 FE6617271774E03500495B00 /* VMStackBounds.h */,
    36663669                                FED94F2B171E3E2300BE77A4 /* Watchdog.cpp */,
    36673670                                FED94F2C171E3E2300BE77A4 /* Watchdog.h */,
     
    41784181                                86ADD1450FDDEA980006EEC2 /* ARMv7Assembler.h in Headers */,
    41794182                                65C0285D1717966800351E35 /* ARMv7DOpcode.h in Headers */,
     4183                                FE5932A8183C5A2600A1ECCC /* VMEntryScope.h in Headers */,
    41804184                                0F24E54F17EE274900ABB217 /* TempRegisterSet.h in Headers */,
    41814185                                A7BFF3C0179868940002F462 /* DFGFiltrationResult.h in Headers */,
     
    48294833                                BC18C4200E16F5CD00B34460 /* VM.h in Headers */,
    48304834                                FE4A332015BD2E07006F54F3 /* VMInspector.h in Headers */,
    4831                                 FE6617281774E03500495B00 /* VMStackBounds.h in Headers */,
    48324835                                FED94F2F171E3E2300BE77A4 /* Watchdog.h in Headers */,
    48334836                                0F919D2615853CE3004A4E7D /* Watchpoint.h in Headers */,
     
    55675570                                147F39D7107EC37600427A48 /* JSVariableObject.cpp in Sources */,
    55685571                                86E3C61C167BABEE006D760A /* JSVirtualMachine.mm in Sources */,
     5572                                FE5932A7183C5A2600A1ECCC /* VMEntryScope.cpp in Sources */,
    55695573                                A7CA3AE717DA41AE006538AF /* JSWeakMap.cpp in Sources */,
    55705574                                A7482B9411671147003B0712 /* JSWeakObjectMapRefPrivate.cpp in Sources */,
  • trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp

    r158793 r159605  
    160160    , m_lastOpcodePosition(0)
    161161#endif
    162     , m_stack(vm, wtfThreadData().stack())
    163162    , m_usesExceptions(false)
    164163    , m_expressionTooDeep(false)
     
    208207    , m_lastOpcodePosition(0)
    209208#endif
    210     , m_stack(vm, wtfThreadData().stack())
    211209    , m_usesExceptions(false)
    212210    , m_expressionTooDeep(false)
     
    422420    , m_lastOpcodePosition(0)
    423421#endif
    424     , m_stack(vm, wtfThreadData().stack())
    425422    , m_usesExceptions(false)
    426423    , m_expressionTooDeep(false)
  • trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h

    r157656 r159605  
    4545#include "StaticPropertyAnalyzer.h"
    4646#include "UnlinkedCodeBlock.h"
    47 #include "VMStackBounds.h"
    4847
    4948#include <functional>
     
    234233            // Node::emitCode assumes that dst, if provided, is either a local or a referenced temporary.
    235234            ASSERT(!dst || dst == ignoredResult() || !dst->isTemporary() || dst->refCount());
    236             if (!m_stack.isSafeToRecurse()) {
     235            if (!m_vm->isSafeToRecurse()) {
    237236                emitThrowExpressionTooDeepException();
    238237                return;
     
    250249            // Node::emitCode assumes that dst, if provided, is either a local or a referenced temporary.
    251250            ASSERT(!dst || dst == ignoredResult() || !dst->isTemporary() || dst->refCount());
    252             if (!m_stack.isSafeToRecurse())
     251            if (!m_vm->isSafeToRecurse())
    253252                return emitThrowExpressionTooDeepException();
    254253            return n->emitBytecode(*this, dst);
     
    262261        void emitNodeInConditionContext(ExpressionNode* n, Label* trueTarget, Label* falseTarget, FallThroughMode fallThroughMode)
    263262        {
    264             if (!m_stack.isSafeToRecurse()) {
     263            if (!m_vm->isSafeToRecurse()) {
    265264                emitThrowExpressionTooDeepException();
    266265                return;
     
    640639#endif
    641640
    642         VMStackBounds m_stack;
    643 
    644641        bool m_usesExceptions;
    645642        bool m_expressionTooDeep;
  • trunk/Source/JavaScriptCore/debugger/Debugger.cpp

    r159110 r159605  
    3333#include "Parser.h"
    3434#include "Protect.h"
     35#include "VMEntryScope.h"
    3536
    3637namespace {
     
    173174    // stack, since we won't get further debugger callbacks to do so. Also, resume execution,
    174175    // since there's no point in staying paused once a window closes.
    175     if (m_currentCallFrame && m_currentCallFrame->dynamicGlobalObject() == globalObject) {
     176    if (m_currentCallFrame && m_currentCallFrame->vmEntryGlobalObject() == globalObject) {
    176177        m_currentCallFrame = 0;
    177178        m_pauseOnCallFrame = 0;
     
    194195    // If JavaScript is running, it's not safe to recompile, since we'll end
    195196    // up throwing away code that is live on the stack.
    196     ASSERT(!vm->dynamicGlobalObject);
    197     if (vm->dynamicGlobalObject)
     197    ASSERT(!vm->entryScope);
     198    if (vm->entryScope)
    198199        return;
    199200   
     
    439440        return;
    440441
    441     JSGlobalObject* dynamicGlobalObject = callFrame->dynamicGlobalObject();
    442     if (!needPauseHandling(dynamicGlobalObject))
     442    JSGlobalObject* vmEntryGlobalObject = callFrame->vmEntryGlobalObject();
     443    if (!needPauseHandling(vmEntryGlobalObject))
    443444        return;
    444445
     
    471472    }
    472473
    473     handlePause(m_reasonForPause, dynamicGlobalObject);
     474    handlePause(m_reasonForPause, vmEntryGlobalObject);
    474475
    475476    if (!m_pauseOnNextStatement && !m_pauseOnCallFrame) {
  • trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp

    r158937 r159605  
    3636#include "Parser.h"
    3737#include "StackVisitor.h"
     38#include "VMEntryScope.h"
    3839
    3940namespace JSC {
     
    7879}
    7980
    80 JSC::JSGlobalObject* DebuggerCallFrame::dynamicGlobalObject() const
    81 {
    82     ASSERT(isValid());
    83     if (!isValid())
    84         return 0;
    85     return m_callFrame->dynamicGlobalObject();
     81JSC::JSGlobalObject* DebuggerCallFrame::vmEntryGlobalObject() const
     82{
     83    ASSERT(isValid());
     84    if (!isValid())
     85        return 0;
     86    return m_callFrame->vmEntryGlobalObject();
    8687}
    8788
  • trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.h

    r158937 r159605  
    5959    JS_EXPORT_PRIVATE const TextPosition& position() const { return m_position; }
    6060
    61     JS_EXPORT_PRIVATE JSGlobalObject* dynamicGlobalObject() const;
     61    JS_EXPORT_PRIVATE JSGlobalObject* vmEntryGlobalObject() const;
    6262    JS_EXPORT_PRIVATE JSScope* scope() const;
    6363    JS_EXPORT_PRIVATE String functionName() const;
  • trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp

    r159577 r159605  
    332332    Label fromArityCheck(this);
    333333    // Plant a check that sufficient space is available in the JSStack.
    334     // FIXME: https://bugs.webkit.org/show_bug.cgi?id=56291
    335334    addPtr(TrustedImm32(virtualRegisterForLocal(m_codeBlock->m_numCalleeRegisters).offset() * sizeof(Register)), GPRInfo::callFrameRegister, GPRInfo::regT1);
    336     Jump stackCheck = branchPtr(Above, AbsoluteAddress(m_vm->interpreter->stack().addressOfEnd()), GPRInfo::regT1);
     335    Jump stackCheck = branchPtr(Above, AbsoluteAddress(m_vm->addressOfJSStackLimit()), GPRInfo::regT1);
    337336    // Return here after stack check.
    338337    Label fromStackCheck = label();
  • trunk/Source/JavaScriptCore/dfg/DFGOSREntry.cpp

    r156984 r159605  
    3434#include "DFGNode.h"
    3535#include "JIT.h"
     36#include "JSStackInlines.h"
    3637#include "Operations.h"
    3738
  • trunk/Source/JavaScriptCore/ftl/FTLLink.cpp

    r158315 r159605  
    8585        CCallHelpers::Jump stackCheck = jit.branchPtr(
    8686            CCallHelpers::Above,
    87             CCallHelpers::AbsoluteAddress(state.graph.m_vm.interpreter->stack().addressOfEnd()),
     87            CCallHelpers::AbsoluteAddress(state.graph.m_vm.addressOfJSStackLimit()),
    8888            GPRInfo::regT1);
    8989        CCallHelpers::Label fromStackCheck = jit.label();
  • trunk/Source/JavaScriptCore/ftl/FTLOSREntry.cpp

    r156511 r159605  
    3131#include "DFGJITCode.h"
    3232#include "FTLForOSREntryJITCode.h"
     33#include "JSStackInlines.h"
    3334
    3435#if ENABLE(FTL_JIT)
  • trunk/Source/JavaScriptCore/heap/Heap.cpp

    r159360 r159605  
    292292void Heap::lastChanceToFinalize()
    293293{
    294     RELEASE_ASSERT(!m_vm->dynamicGlobalObject);
     294    RELEASE_ASSERT(!m_vm->entryScope);
    295295    RELEASE_ASSERT(m_operationInProgress == NoOperation);
    296296
     
    690690    // If JavaScript is running, it's not safe to delete code, since we'll end
    691691    // up deleting code that is live on the stack.
    692     if (m_vm->dynamicGlobalObject)
     692    if (m_vm->entryScope)
    693693        return;
    694694
  • trunk/Source/JavaScriptCore/interpreter/CachedCall.h

    r148696 r159605  
    2828
    2929#include "CallFrameClosure.h"
     30#include "ExceptionHelpers.h"
    3031#include "JSFunction.h"
    3132#include "JSGlobalObject.h"
    3233#include "Interpreter.h"
     34#include "VMEntryScope.h"
    3335
    3436namespace JSC {
     
    3941            : m_valid(false)
    4042            , m_interpreter(callFrame->interpreter())
    41             , m_globalObjectScope(callFrame->vm(), function->scope()->globalObject())
     43            , m_entryScope(callFrame->vm(), function->scope()->globalObject())
    4244        {
    4345            ASSERT(!function->isHostFunction());
    44             m_closure = m_interpreter->prepareForRepeatCall(function->jsExecutable(), callFrame, function, argumentCount + 1, function->scope());
     46            if (callFrame->vm().isSafeToRecurse())
     47                m_closure = m_interpreter->prepareForRepeatCall(function->jsExecutable(), callFrame, function, argumentCount + 1, function->scope());
     48            else
     49                throwStackOverflowError(callFrame);
    4550            m_valid = !callFrame->hadException();
    4651        }
     
    7075        bool m_valid;
    7176        Interpreter* m_interpreter;
    72         DynamicGlobalObjectScope m_globalObjectScope;
     77        VMEntryScope m_entryScope;
    7378        CallFrameClosure m_closure;
    7479    };
  • trunk/Source/JavaScriptCore/interpreter/CallFrame.cpp

    r158237 r159605  
    3131#include "Interpreter.h"
    3232#include "Operations.h"
     33#include "VMEntryScope.h"
    3334
    3435namespace JSC {
     
    123124}
    124125
     126JSGlobalObject* CallFrame::vmEntryGlobalObject()
     127{
     128    if (this == lexicalGlobalObject()->globalExec())
     129        return lexicalGlobalObject();
     130
     131    // For any ExecState that's not a globalExec, the
     132    // dynamic global object must be set since code is running
     133    ASSERT(vm().entryScope);
     134    return vm().entryScope->globalObject();
     135}
     136
    125137} // namespace JSC
  • trunk/Source/JavaScriptCore/interpreter/CallFrame.h

    r158586 r159605  
    5252
    5353        // Global object in which execution began.
    54         JSGlobalObject* dynamicGlobalObject();
     54        JS_EXPORT_PRIVATE JSGlobalObject* vmEntryGlobalObject();
    5555
    5656        // Global object in which the currently executing code was defined.
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp

    r159528 r159605  
    6767#include "StrictEvalActivation.h"
    6868#include "StrongInlines.h"
    69 #include "VMStackBounds.h"
     69#include "VMEntryScope.h"
    7070#include "VirtualRegister.h"
    7171
     
    396396    JSScope* scope = callFrame->scope();
    397397
    398     if (Debugger* debugger = callFrame->dynamicGlobalObject()->debugger()) {
     398    if (Debugger* debugger = callFrame->vmEntryGlobalObject()->debugger()) {
    399399        if (callFrame->callee())
    400400            debugger->returnEvent(callFrame);
     
    651651    ASSERT(!exceptionValue.isObject() || asObject(exceptionValue)->hasProperty(callFrame, callFrame->vm().propertyNames->stack));
    652652
    653     Debugger* debugger = callFrame->dynamicGlobalObject()->debugger();
     653    Debugger* debugger = callFrame->vmEntryGlobalObject()->debugger();
    654654    if (debugger && debugger->needsExceptionCallbacks()) {
    655655        // We need to clear the exception and the exception stack here in order to see if a new exception happens.
     
    740740        return jsNull();
    741741
    742     StackStats::CheckPoint stackCheckPoint;
    743     const VMStackBounds vmStackBounds(vm, wtfThreadData().stack());
    744     if (!vmStackBounds.isSafeToRecurse())
     742    VMEntryScope entryScope(vm, scope->globalObject());
     743    if (!vm.isSafeToRecurse())
    745744        return checkedReturn(throwStackOverflowError(callFrame));
    746745
     
    748747    // we'll handle the JSON object here. Else, we'll handle real JS code
    749748    // below at failedJSONP.
    750     DynamicGlobalObjectScope globalObjectScope(vm, scope->globalObject());
     749
    751750    Vector<JSONPData> JSONPData;
    752751    bool parseResult;
     
    901900        return jsNull();
    902901
    903     StackStats::CheckPoint stackCheckPoint;
    904     const VMStackBounds vmStackBounds(vm, wtfThreadData().stack());
    905     if (!vmStackBounds.isSafeToRecurse())
    906         return checkedReturn(throwStackOverflowError(callFrame));
    907 
    908902    bool isJSCall = (callType == CallTypeJS);
    909903    JSScope* scope;
     
    917911        scope = callFrame->scope();
    918912    }
    919     DynamicGlobalObjectScope globalObjectScope(vm, scope->globalObject());
     913
     914    VMEntryScope entryScope(vm, scope->globalObject());
     915    if (!vm.isSafeToRecurse())
     916        return checkedReturn(throwStackOverflowError(callFrame));
    920917
    921918    if (isJSCall) {
     
    979976        return checkedReturn(throwStackOverflowError(callFrame));
    980977
    981     StackStats::CheckPoint stackCheckPoint;
    982     const VMStackBounds vmStackBounds(vm, wtfThreadData().stack());
    983     if (!vmStackBounds.isSafeToRecurse())
    984         return checkedReturn(throwStackOverflowError(callFrame));
    985 
    986978    bool isJSConstruct = (constructType == ConstructTypeJS);
    987979    JSScope* scope;
     
    996988    }
    997989
    998     DynamicGlobalObjectScope globalObjectScope(vm, scope->globalObject());
     990    VMEntryScope entryScope(vm, scope->globalObject());
     991    if (!vm.isSafeToRecurse())
     992        return checkedReturn(throwStackOverflowError(callFrame));
    999993
    1000994    if (isJSConstruct) {
     
    10661060        return CallFrameClosure();
    10671061
    1068     StackStats::CheckPoint stackCheckPoint;
    1069     const VMStackBounds vmStackBounds(vm, wtfThreadData().stack());
    1070     if (!vmStackBounds.isSafeToRecurse()) {
    1071         throwStackOverflowError(callFrame);
    1072         return CallFrameClosure();
    1073     }
    1074 
    10751062    // Compile the callee:
    10761063    JSObject* error = functionExecutable->prepareForExecution(callFrame, scope, CodeForCall);
     
    11661153        return jsNull();
    11671154
    1168     DynamicGlobalObjectScope globalObjectScope(vm, scope->globalObject());
    1169 
    1170     StackStats::CheckPoint stackCheckPoint;
    1171     const VMStackBounds vmStackBounds(vm, wtfThreadData().stack());
    1172     if (!vmStackBounds.isSafeToRecurse())
    1173         return checkedReturn(throwStackOverflowError(callFrame));
     1155    VMEntryScope entryScope(vm, scope->globalObject());
     1156    if (!vm.isSafeToRecurse())
     1157        return checkedReturn(throwStackOverflowError(callFrame));       
    11741158
    11751159    unsigned numVariables = eval->numVariables();
     
    12521236NEVER_INLINE void Interpreter::debug(CallFrame* callFrame, DebugHookID debugHookID)
    12531237{
    1254     Debugger* debugger = callFrame->dynamicGlobalObject()->debugger();
     1238    Debugger* debugger = callFrame->vmEntryGlobalObject()->debugger();
    12551239    if (!debugger || !debugger->needsOpDebugCallbacks())
    12561240        return;
  • trunk/Source/JavaScriptCore/interpreter/JSStack.cpp

    r158586 r159605  
    11/*
    2  * Copyright (C) 2008 Apple Inc. All rights reserved.
     2 * Copyright (C) 2008, 2013 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2828
    2929#include "config.h"
    30 #include "JSStack.h"
    3130#include "JSStackInlines.h"
    3231
     
    4544
    4645JSStack::JSStack(VM& vm, size_t capacity)
    47     : m_end(0)
     46    : m_vm(vm)
     47    , m_end(0)
    4848    , m_topCallFrame(vm.topCallFrame)
    4949{
     
    5151
    5252    m_reservation = PageReservation::reserve(roundUpAllocationSize(capacity * sizeof(Register), commitSize), OSAllocator::JSVMStackPages);
    53     m_end = highAddress();
     53    updateStackLimit(highAddress());
    5454    m_commitEnd = highAddress();
    5555
     
    7272    // just update the end pointer and return.
    7373    if (newEnd >= m_commitEnd) {
    74         m_end = newEnd;
     74        updateStackLimit(newEnd);
    7575        return true;
    7676    }
     
    8888    addToCommittedByteCount(delta);
    8989    m_commitEnd = reinterpret_cast_ptr<Register*>(reinterpret_cast<char*>(m_commitEnd) - delta);
    90     m_end = newEnd;
     90    updateStackLimit(newEnd);
    9191    return true;
    9292}
  • trunk/Source/JavaScriptCore/interpreter/JSStack.h

    r158315 r159605  
    11/*
    2  * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
     2 * Copyright (C) 2008, 2009, 2013 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    8888        }
    8989
    90         Register* getLimitOfStack() const { return m_end; }
    9190        size_t size() const { return highAddress() - lowAddress(); }
    9291
     
    9695        static void initializeThreading();
    9796
    98         Register* const * addressOfEnd() const
    99         {
    100             return &m_end;
    101         }
    102 
    10397        Register* getTopOfFrame(CallFrame*);
    10498        Register* getStartOfFrame(CallFrame*);
    10599        Register* getTopOfStack();
    106         Register* end() const { return m_end; }
    107100
    108101        CallFrame* pushFrame(CallFrame* callerFrame, class CodeBlock*,
     
    154147        void addToCommittedByteCount(long);
    155148
     149        void updateStackLimit(Register* newEnd);
     150
     151        VM& m_vm;
    156152        Register* m_end;
    157153        Register* m_commitEnd;
     
    163159    };
    164160
    165     inline void JSStack::shrink(Register* newEnd)
    166     {
    167         if (newEnd >= m_end)
    168             return;
    169         m_end = newEnd;
    170         if (m_end == getBaseOfStack() && (m_commitEnd - getBaseOfStack()) >= maxExcessCapacity)
    171             releaseExcessCapacity();
    172     }
    173 
    174     inline bool JSStack::grow(Register* newEnd)
    175     {
    176         if (newEnd >= m_end)
    177             return true;
    178         return growSlowCase(newEnd);
    179     }
    180 
    181161} // namespace JSC
    182162
  • trunk/Source/JavaScriptCore/interpreter/JSStackInlines.h

    r158648 r159605  
    11/*
    2  * Copyright (C) 2012 Apple Inc. All rights reserved.
     2 * Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3030#include "CodeBlock.h"
    3131#include "JSStack.h"
     32#include "VM.h"
    3233
    3334namespace JSC {
     
    136137}
    137138
     139inline void JSStack::shrink(Register* newEnd)
     140{
     141    if (newEnd >= m_end)
     142        return;
     143    updateStackLimit(newEnd);
     144    if (m_end == getBaseOfStack() && (m_commitEnd - getBaseOfStack()) >= maxExcessCapacity)
     145        releaseExcessCapacity();
     146}
     147
     148inline bool JSStack::grow(Register* newEnd)
     149{
     150    if (newEnd >= m_end)
     151        return true;
     152    return growSlowCase(newEnd);
     153}
     154
     155inline void JSStack::updateStackLimit(Register* newEnd)
     156{
     157    m_end = newEnd;
     158#if USE(SEPARATE_C_AND_JS_STACK)
     159    m_vm.setJSStackLimit(newEnd);
     160#endif
     161}
    138162
    139163#if ENABLE(DEBUG_JSSTACK)
  • trunk/Source/JavaScriptCore/jit/JIT.cpp

    r159091 r159605  
    569569
    570570        addPtr(TrustedImm32(virtualRegisterForLocal(m_codeBlock->m_numCalleeRegisters).offset() * sizeof(Register)), callFrameRegister, regT1);
    571         stackCheck = branchPtr(Above, AbsoluteAddress(m_vm->interpreter->stack().addressOfEnd()), regT1);
     571        stackCheck = branchPtr(Above, AbsoluteAddress(m_vm->addressOfJSStackLimit()), regT1);
    572572    }
    573573
  • trunk/Source/JavaScriptCore/jit/JITCall.cpp

    r159091 r159605  
    8585        // regT1: newCallFrame
    8686
    87         slowCase.append(branchPtr(Above, AbsoluteAddress(m_vm->interpreter->stack().addressOfEnd()), regT1));
     87        slowCase.append(branchPtr(Above, AbsoluteAddress(m_vm->addressOfJSStackLimit()), regT1));
    8888
    8989        // Initialize ArgumentCount.
  • trunk/Source/JavaScriptCore/jit/JITCall32_64.cpp

    r158901 r159605  
    163163        // regT3: newCallFrame
    164164
    165         slowCase.append(branchPtr(Above, AbsoluteAddress(m_vm->interpreter->stack().addressOfEnd()), regT3));
     165        slowCase.append(branchPtr(Above, AbsoluteAddress(m_vm->addressOfJSStackLimit()), regT3));
    166166
    167167        // Initialize ArgumentCount.
  • trunk/Source/JavaScriptCore/jit/JITOperations.cpp

    r159466 r159605  
    4545#include "JSNameScope.h"
    4646#include "JSPropertyNameIterator.h"
     47#include "JSStackInlines.h"
    4748#include "JSWithScope.h"
    4849#include "ObjectConstructor.h"
  • trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp

    r158237 r159605  
    4444#include "JSNameScope.h"
    4545#include "JSPropertyNameIterator.h"
     46#include "JSStackInlines.h"
    4647#include "JSString.h"
    4748#include "JSWithScope.h"
  • trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm

    r159422 r159605  
    384384    addi 1, t0 # Account that local0 goes at slot -1
    385385    loadp CodeBlock::m_vm[t1], t2
    386     loadp VM::interpreter[t2], t2
    387386    lshiftp 3, t0
    388387    subp cfr, t0, t0
    389     bpbeq Interpreter::m_stack + JSStack::m_end[t2], t0, .stackHeightOK
     388    bpbeq VM::m_jsStackLimit[t2], t0, .stackHeightOK
    390389
    391390    # Stack height check failed - need to call a slow_path.
  • trunk/Source/JavaScriptCore/parser/Parser.cpp

    r159520 r159605  
    194194    : m_vm(vm)
    195195    , m_source(&source)
    196     , m_stack(*vm, wtfThreadData().stack())
    197196    , m_hasStackOverflow(false)
    198197    , m_allowsIn(true)
  • trunk/Source/JavaScriptCore/parser/Parser.h

    r159520 r159605  
    3636#include "SourceProviderCache.h"
    3737#include "SourceProviderCacheItem.h"
    38 #include "VMStackBounds.h"
    3938#include <wtf/Forward.h>
    4039#include <wtf/Noncopyable.h>
     
    759758    bool canRecurse()
    760759    {
    761         return m_stack.isSafeToRecurse();
     760        return m_vm->isSafeToRecurse();
    762761    }
    763762   
     
    828827    OwnPtr<LexerType> m_lexer;
    829828   
    830     VMStackBounds m_stack;
    831829    bool m_hasStackOverflow;
    832830    String m_errorMessage;
  • trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h

    r158237 r159605  
    3030#include "CodeSpecializationKind.h"
    3131#include "ExceptionHelpers.h"
     32#include "JSStackInlines.h"
    3233#include "NameInstance.h"
    3334#include <wtf/Platform.h>
  • trunk/Source/JavaScriptCore/runtime/Completion.cpp

    r154797 r159605  
    22 *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
    33 *  Copyright (C) 2001 Peter Kelly (pmk@post.com)
    4  *  Copyright (C) 2003, 2007 Apple Inc.
     4 *  Copyright (C) 2003, 2007, 2013 Apple Inc.
    55 *
    66 *  This library is free software; you can redistribute it and/or
     
    7979
    8080    if (!thisValue || thisValue.isUndefinedOrNull())
    81         thisValue = exec->dynamicGlobalObject();
     81        thisValue = exec->vmEntryGlobalObject();
    8282    JSObject* thisObj = jsCast<JSObject*>(thisValue.toThis(exec, NotStrictMode));
    8383    JSValue result = exec->interpreter()->execute(program, exec, thisObj);
  • trunk/Source/JavaScriptCore/runtime/FunctionConstructor.cpp

    r159520 r159605  
    11/*
    22 *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
    3  *  Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
     3 *  Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2013 Apple Inc. All rights reserved.
    44 *
    55 *  This library is free software; you can redistribute it and/or
     
    113113    SourceCode source = makeSource(program, sourceURL, position);
    114114    JSObject* exception = 0;
    115     FunctionExecutable* function = FunctionExecutable::fromGlobalCode(functionName, exec, exec->dynamicGlobalObject()->debugger(), source, &exception);
     115    FunctionExecutable* function = FunctionExecutable::fromGlobalCode(functionName, exec, exec->vmEntryGlobalObject()->debugger(), source, &exception);
    116116    if (!function) {
    117117        ASSERT(exception);
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r159547 r159605  
    717717}
    718718
    719 DynamicGlobalObjectScope::DynamicGlobalObjectScope(VM& vm, JSGlobalObject* dynamicGlobalObject)
    720     : m_dynamicGlobalObjectSlot(vm.dynamicGlobalObject)
    721     , m_savedDynamicGlobalObject(m_dynamicGlobalObjectSlot)
    722 {
    723     if (!m_dynamicGlobalObjectSlot) {
    724 #if ENABLE(ASSEMBLER)
    725         if (ExecutableAllocator::underMemoryPressure())
    726             vm.heap.deleteAllCompiledCode();
    727 #endif
    728 
    729         m_dynamicGlobalObjectSlot = dynamicGlobalObject;
    730 
    731         // Reset the date cache between JS invocations to force the VM
    732         // to observe time zone changes.
    733         vm.resetDateCache();
    734     }
    735     // Clear the exception stack between entries
    736     vm.clearExceptionStack();
    737 }
    738 
    739719void slowValidateCell(JSGlobalObject* globalObject)
    740720{
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h

    r159545 r159605  
    585585}
    586586
    587 inline JSGlobalObject* ExecState::dynamicGlobalObject()
    588 {
    589     if (this == lexicalGlobalObject()->globalExec())
    590         return lexicalGlobalObject();
    591 
    592     // For any ExecState that's not a globalExec, the
    593     // dynamic global object must be set since code is running
    594     ASSERT(vm().dynamicGlobalObject);
    595     return vm().dynamicGlobalObject;
    596 }
    597 
    598587inline JSArray* constructEmptyArray(ExecState* exec, ArrayAllocationProfile* profile, JSGlobalObject* globalObject, unsigned initialLength = 0)
    599588{
     
    635624    return constructArrayNegativeIndexed(exec, profile, exec->lexicalGlobalObject(), values, length);
    636625}
    637 
    638 class DynamicGlobalObjectScope {
    639     WTF_MAKE_NONCOPYABLE(DynamicGlobalObjectScope);
    640 public:
    641     JS_EXPORT_PRIVATE DynamicGlobalObjectScope(VM&, JSGlobalObject*);
    642 
    643     ~DynamicGlobalObjectScope()
    644     {
    645         m_dynamicGlobalObjectSlot = m_savedDynamicGlobalObject;
    646     }
    647 
    648 private:
    649     JSGlobalObject*& m_dynamicGlobalObjectSlot;
    650     JSGlobalObject* m_savedDynamicGlobalObject;
    651 };
    652626
    653627inline JSObject* JSScope::globalThis()
  • trunk/Source/JavaScriptCore/runtime/StringRecursionChecker.h

    r151869 r159605  
    2222
    2323#include "Interpreter.h"
    24 #include "VMStackBounds.h"
    2524#include <wtf/StackStats.h>
    2625#include <wtf/WTFThreadData.h>
     
    5251{
    5352    VM& vm = m_exec->vm();
    54     const VMStackBounds nativeStack(vm, wtfThreadData().stack());
    55     if (!nativeStack.isSafeToRecurse())
     53    if (!vm.isSafeToRecurse())
    5654        return throwStackOverflowError();
    5755    bool alreadyVisited = !vm.stringRecursionCheckVisitedObjects.add(m_thisObject).isNewEntry;
  • trunk/Source/JavaScriptCore/runtime/VM.cpp

    r159276 r159605  
    196196    , jsFinalObjectClassInfo(JSFinalObject::info())
    197197    , sizeOfLastScratchBuffer(0)
    198     , dynamicGlobalObject(0)
     198    , entryScope(0)
    199199    , m_enabledProfiler(0)
    200200    , m_regExpCache(new RegExpCache(this))
     
    216216    , m_initializingObjectClass(0)
    217217#endif
     218    , m_stackLimit(0)
     219#if USE(SEPARATE_C_AND_JS_STACK)
     220    , m_jsStackLimit(0)
     221#endif
    218222    , m_inDefineOwnProperty(false)
    219223    , m_codeCache(CodeCache::create())
    220224{
    221225    interpreter = new Interpreter(*this);
     226    StackBounds stack = wtfThreadData().stack();
     227    setStackLimit(stack.recursionLimit());
    222228
    223229    // Need to be careful to keep everything consistent here
     
    533539    prepareToDiscardCode();
    534540   
    535     if (dynamicGlobalObject) {
     541    if (entryScope) {
    536542        StackPreservingRecompiler recompiler;
    537543        HeapIterationScope iterationScope(heap);
     
    619625JSValue VM::throwException(ExecState* exec, JSValue error)
    620626{
    621     ASSERT(exec == topCallFrame || exec == exec->lexicalGlobalObject()->globalExec() || exec == exec->dynamicGlobalObject()->globalExec());
     627    ASSERT(exec == topCallFrame || exec == exec->lexicalGlobalObject()->globalExec() || exec == exec->vmEntryGlobalObject()->globalExec());
    622628   
    623629    Vector<StackFrame> stackTrace;
  • trunk/Source/JavaScriptCore/runtime/VM.h

    r159276 r159605  
    5555#include <wtf/RefCountedArray.h>
    5656#include <wtf/SimpleStats.h>
     57#include <wtf/StackBounds.h>
    5758#include <wtf/ThreadSafeRefCounted.h>
    5859#include <wtf/ThreadSpecific.h>
     
    9192    class UnlinkedFunctionExecutable;
    9293    class UnlinkedProgramCodeBlock;
     94    class VMEntryScope;
    9395
    9496#if ENABLE(DFG_JIT)
     
    362364        JS_EXPORT_PRIVATE JSObject* throwException(ExecState*, JSObject*);
    363365       
     366        void** addressOfJSStackLimit() { return &m_jsStackLimit; }
     367        void* jsStackLimit() { return m_jsStackLimit; }
     368        void setJSStackLimit(void* limit) { m_jsStackLimit = limit; }
     369
     370        void* stackLimit() { return m_stackLimit; }
     371        void setStackLimit(void* limit) { m_stackLimit = limit; }
     372        bool isSafeToRecurse() const
     373        {
     374            ASSERT(wtfThreadData().stack().isGrowingDownward());
     375            void* curr;
     376            return &curr >= m_stackLimit;
     377        }
     378
    364379        const ClassInfo* const jsArrayClassInfo;
    365380        const ClassInfo* const jsFinalObjectClassInfo;
     
    397412        void gatherConservativeRoots(ConservativeRoots&);
    398413
    399         JSGlobalObject* dynamicGlobalObject;
     414        VMEntryScope* entryScope;
    400415
    401416        HashSet<JSObject*> stringRecursionCheckVisitedObjects;
     
    476491        const ClassInfo* m_initializingObjectClass;
    477492#endif
     493
     494#if USE(SEPARATE_C_AND_JS_STACK)
     495        struct {
     496            void* m_stackLimit;
     497            void* m_jsStackLimit;
     498        };
     499#else
     500        union {
     501            void* m_stackLimit;
     502            void* m_jsStackLimit;
     503        };
     504#endif
    478505        JSValue m_exception;
    479506        bool m_inDefineOwnProperty;
  • trunk/Source/WTF/ChangeLog

    r159448 r159605  
     12013-11-20  Mark Lam  <mark.lam@apple.com>
     2
     3        Introducing VMEntryScope to update the VM stack limit.
     4        https://bugs.webkit.org/show_bug.cgi?id=124634.
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        * wtf/Platform.h:
     9        * wtf/StackBounds.h:
     10        (WTF::StackBounds::StackBounds):
     11
    1122013-11-18  Filip Pizlo  <fpizlo@apple.com>
    213
  • trunk/Source/WTF/wtf/Platform.h

    r159360 r159605  
    869869#endif
    870870
     871/* FIXME: We currently unconditionally use spearate stacks. When we switch to using the
     872   C stack for JS frames, we'll need to make the following conditional on ENABLE(LLINT_CLOOP)
     873   only.
     874*/
     875#if ENABLE(LLINT_CLOOP) || 1
     876#define WTF_USE_SEPARATE_C_AND_JS_STACK 1
     877#endif
     878
    871879/* Pick which allocator to use; we only need an executable allocator if the assembler is compiled in.
    872880   On x86-64 we use a single fixed mmap, on other platforms we mmap on demand. */
  • trunk/Source/WTF/wtf/StackBounds.h

    r150995 r159605  
    3131
    3232class StackBounds {
    33     // isSafeToRecurse() / recursionLimit() tests (by default)
    34     // that we are at least this far from the end of the stack.
    35     //
    3633    // This 64k number was picked because a sampling of stack usage differences
    3734    // between consecutive entries into one of the Interpreter::execute...()
     
    5047    }
    5148
    52     bool isSafeToRecurse(size_t minAvailableDelta = s_defaultAvailabilityDelta) const
    53     {
    54         checkConsistency();
    55         if (isGrowingDownward())
    56             return current() >= recursionLimit(minAvailableDelta);
    57         return current() <= recursionLimit(minAvailableDelta);
    58     }
    59 
    6049    void* origin() const
    6150    {
     
    6958            return static_cast<char*>(m_origin) - static_cast<char*>(m_bound);
    7059        return static_cast<char*>(m_bound) - static_cast<char*>(m_origin);
    71     }
    72 
    73 private:
    74     StackBounds()
    75         : m_origin(0)
    76         , m_bound(0)
    77     {
    78     }
    79 
    80     WTF_EXPORT_PRIVATE void initialize();
    81 
    82     void* current() const
    83     {
    84         checkConsistency();
    85         void* currentPosition = &currentPosition;
    86         return currentPosition;
    8760    }
    8861
     
    10477#endif
    10578    }
     79
     80private:
     81    StackBounds()
     82        : m_origin(0)
     83        , m_bound(0)
     84    {
     85    }
     86
     87    WTF_EXPORT_PRIVATE void initialize();
    10688
    10789    void checkConsistency() const
  • trunk/Source/WebCore/ChangeLog

    r159604 r159605  
     12013-11-20  Mark Lam  <mark.lam@apple.com>
     2
     3        Introducing VMEntryScope to update the VM stack limit.
     4        https://bugs.webkit.org/show_bug.cgi?id=124634.
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        No new tests.
     9
     10        Renamed dynamicGlobalObject() to vmEntryGlobalObject().
     11        Replaced uses of DynamicGlobalObjectScope with VMEntryScope.
     12
     13        * ForwardingHeaders/runtime/VMEntryScope.h: Added.
     14        * WebCore.vcxproj/WebCore.vcxproj:
     15        * WebCore.vcxproj/WebCore.vcxproj.filters:
     16        * bindings/js/JSCryptoAlgorithmBuilder.cpp:
     17        (WebCore::JSCryptoAlgorithmBuilder::add):
     18        * bindings/js/JSCustomXPathNSResolver.cpp:
     19        (WebCore::JSCustomXPathNSResolver::create):
     20        * bindings/js/JSDOMBinding.cpp:
     21        (WebCore::firstDOMWindow):
     22        * bindings/js/JSErrorHandler.cpp:
     23        (WebCore::JSErrorHandler::handleEvent):
     24        * bindings/js/JSEventListener.cpp:
     25        (WebCore::JSEventListener::handleEvent):
     26        * bindings/js/JavaScriptCallFrame.h:
     27        (WebCore::JavaScriptCallFrame::vmEntryGlobalObject):
     28        * bindings/js/PageScriptDebugServer.cpp:
     29        (WebCore::PageScriptDebugServer::recompileAllJSFunctions):
     30        * bindings/js/ScriptDebugServer.cpp:
     31        (WebCore::ScriptDebugServer::evaluateBreakpointAction):
     32        (WebCore::ScriptDebugServer::handlePause):
     33        * bindings/js/WorkerScriptDebugServer.cpp:
     34        (WebCore::WorkerScriptDebugServer::recompileAllJSFunctions):
     35        * bindings/objc/WebScriptObject.mm:
     36        (WebCore::addExceptionToConsole):
     37        * bridge/c/c_utility.cpp:
     38        (JSC::Bindings::convertValueToNPVariant):
     39        * bridge/objc/objc_instance.mm:
     40        (ObjcInstance::moveGlobalExceptionToExecState):
     41        * bridge/objc/objc_runtime.mm:
     42        (JSC::Bindings::convertValueToObjcObject):
     43        * bridge/objc/objc_utility.mm:
     44        (JSC::Bindings::convertValueToObjcValue):
     45
    1462013-11-20  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
    247
  • trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj

    r159587 r159605  
    1859118591    <ClInclude Include="..\ForwardingHeaders\runtime\JSFunction.h" />
    1859218592    <ClInclude Include="..\ForwardingHeaders\runtime\VM.h" />
     18593    <ClInclude Include="..\ForwardingHeaders\runtime\VMEntryScope.h" />
    1859318594    <ClInclude Include="..\ForwardingHeaders\runtime\JSGlobalObject.h" />
    1859418595    <ClInclude Include="..\ForwardingHeaders\runtime\JSProxy.h" />
  • trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters

    r159587 r159605  
    1265612656      <Filter>ForwardingHeaders\runtime</Filter>
    1265712657    </ClInclude>
     12658    <ClInclude Include="..\ForwardingHeaders\runtime\VMEntryScope.h">
     12659      <Filter>ForwardingHeaders\runtime</Filter>
     12660    </ClInclude>
    1265812661    <ClInclude Include="..\ForwardingHeaders\runtime\JSGlobalObject.h">
    1265912662      <Filter>ForwardingHeaders\runtime</Filter>
  • trunk/Source/WebCore/bindings/js/JSCryptoAlgorithmBuilder.cpp

    r159180 r159605  
    7272    Identifier identifier(&vm, key);
    7373    RefPtr<Uint8Array> arrayView = Uint8Array::create(buffer.data(), buffer.size());
    74     m_dictionary->putDirect(vm, identifier, arrayView->wrap(m_exec, vm.dynamicGlobalObject));
     74    m_dictionary->putDirect(vm, identifier, arrayView->wrap(m_exec, vm.entryScope->globalObject()));
    7575}
    7676
  • trunk/Source/WebCore/bindings/js/JSCustomXPathNSResolver.cpp

    r157215 r159605  
    11/*
    2  * Copyright (C) 2007 Alexey Proskuryakov (ap@nypop.com)
     2 * Copyright (C) 2007, 2013 Alexey Proskuryakov (ap@nypop.com)
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    5353    }
    5454
    55     return adoptRef(new JSCustomXPathNSResolver(exec, resolverObject, asJSDOMWindow(exec->dynamicGlobalObject())));
     55    return adoptRef(new JSCustomXPathNSResolver(exec, resolverObject, asJSDOMWindow(exec->vmEntryGlobalObject())));
    5656}
    5757
  • trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp

    r158997 r159605  
    11/*
    22 *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
    3  *  Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
     3 *  Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 Apple Inc. All rights reserved.
    44 *  Copyright (C) 2007 Samuel Weinig <sam@webkit.org>
    55 *  Copyright (C) 2013 Michael Pruett <michael@68k.org>
     
    495495DOMWindow& firstDOMWindow(ExecState* exec)
    496496{
    497     return asJSDOMWindow(exec->dynamicGlobalObject())->impl();
     497    return asJSDOMWindow(exec->vmEntryGlobalObject())->impl();
    498498}
    499499
  • trunk/Source/WebCore/bindings/js/JSErrorHandler.cpp

    r156769 r159605  
    11/*
    22 * Copyright (C) 2010 Google Inc. All rights reserved.
     3 * Copyright (C) 2013 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    4041#include "JSMainThreadExecState.h"
    4142#include <runtime/JSLock.h>
     43#include <runtime/VMEntryScope.h>
    4244#include <wtf/Ref.h>
    4345
     
    9597
    9698        VM& vm = globalObject->vm();
    97         DynamicGlobalObjectScope globalObjectScope(vm, vm.dynamicGlobalObject ? vm.dynamicGlobalObject : globalObject);
     99        VMEntryScope entryScope(vm, vm.entryScope ? vm.entryScope->globalObject() : globalObject);
    98100
    99101        JSValue returnValue = scriptExecutionContext->isDocument()
  • trunk/Source/WebCore/bindings/js/JSEventListener.cpp

    r157215 r159605  
    11/*
    22 *  Copyright (C) 2001 Peter Kelly (pmk@post.com)
    3  *  Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All Rights Reserved.
     3 *  Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All Rights Reserved.
    44 *
    55 *  This library is free software; you can redistribute it and/or
     
    3333#include <runtime/ExceptionHelpers.h>
    3434#include <runtime/JSLock.h>
     35#include <runtime/VMEntryScope.h>
    3536#include <wtf/Ref.h>
    3637#include <wtf/RefCountedLeakCounter.h>
     
    124125
    125126        VM& vm = globalObject->vm();
    126         DynamicGlobalObjectScope globalObjectScope(vm, vm.dynamicGlobalObject ? vm.dynamicGlobalObject : globalObject);
     127        VMEntryScope entryScope(vm, vm.entryScope ? vm.entryScope->globalObject() : globalObject);
    127128
    128129        InspectorInstrumentationCookie cookie = JSMainThreadExecState::instrumentFunctionCall(scriptExecutionContext, callType, callData);
  • trunk/Source/WebCore/bindings/js/JavaScriptCallFrame.h

    r158862 r159605  
    5454    JSC::DebuggerCallFrame::Type type() const { return m_debuggerCallFrame->type(); }
    5555    JSC::JSScope* scopeChain() const { return m_debuggerCallFrame->scope(); }
    56     JSC::JSGlobalObject* dynamicGlobalObject() const { return m_debuggerCallFrame->dynamicGlobalObject(); }
     56    JSC::JSGlobalObject* vmEntryGlobalObject() const { return m_debuggerCallFrame->vmEntryGlobalObject(); }
    5757
    5858    JSC::JSValue thisValue() const { return m_debuggerCallFrame->thisValue(); }
  • trunk/Source/WebCore/bindings/js/PageScriptDebugServer.cpp

    r157215 r159605  
    11/*
    22 * Copyright (c) 2011 Google Inc. All rights reserved.
     3 * Copyright (C) 2013 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    116117    JSLockHolder lock(JSDOMWindow::commonVM());
    117118    // If JavaScript stack is not empty postpone recompilation.
    118     if (JSDOMWindow::commonVM()->dynamicGlobalObject)
     119    if (JSDOMWindow::commonVM()->entryScope)
    119120        recompileAllJSFunctionsSoon();
    120121    else
  • trunk/Source/WebCore/bindings/js/ScriptDebugServer.cpp

    r158937 r159605  
    100100    switch (breakpointAction.type) {
    101101    case ScriptBreakpointActionTypeLog: {
    102         DOMWindow& window = asJSDOMWindow(debuggerCallFrame->dynamicGlobalObject())->impl();
     102        DOMWindow& window = asJSDOMWindow(debuggerCallFrame->vmEntryGlobalObject())->impl();
    103103        if (PageConsole* console = window.pageConsole())
    104104            console->addMessage(JSMessageSource, LogMessageLevel, breakpointAction.data);
     
    289289}
    290290
    291 void ScriptDebugServer::handlePause(Debugger::ReasonForPause, JSGlobalObject* dynamicGlobalObject)
    292 {
    293     dispatchFunctionToListeners(&ScriptDebugServer::dispatchDidPause, dynamicGlobalObject);
    294     didPause(dynamicGlobalObject);
     291void ScriptDebugServer::handlePause(Debugger::ReasonForPause, JSGlobalObject* vmEntryGlobalObject)
     292{
     293    dispatchFunctionToListeners(&ScriptDebugServer::dispatchDidPause, vmEntryGlobalObject);
     294    didPause(vmEntryGlobalObject);
    295295
    296296    TimerBase::fireTimersInNestedEventLoop();
     
    301301    m_runningNestedMessageLoop = false;
    302302
    303     didContinue(dynamicGlobalObject);
    304     dispatchFunctionToListeners(&ScriptDebugServer::dispatchDidContinue, dynamicGlobalObject);
    305 }
     303    didContinue(vmEntryGlobalObject);
     304    dispatchFunctionToListeners(&ScriptDebugServer::dispatchDidContinue, vmEntryGlobalObject);
     305}
     306
    306307void ScriptDebugServer::recompileAllJSFunctionsSoon()
    307308{
  • trunk/Source/WebCore/bindings/js/WorkerScriptDebugServer.cpp

    r158937 r159605  
    6868    JSC::JSLockHolder lock(vm);
    6969    // If JavaScript stack is not empty postpone recompilation.
    70     if (vm->dynamicGlobalObject)
     70    if (vm->entryScope)
    7171        recompileAllJSFunctionsSoon();
    7272    else
  • trunk/Source/WebCore/bindings/objc/WebScriptObject.mm

    r158997 r159605  
    11/*
    2  * Copyright (C) 2004, 2006, 2007, 2008 Apple Inc. All rights reserved.
     2 * Copyright (C) 2004, 2006, 2007, 2008, 2013 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    125125static void addExceptionToConsole(ExecState* exec)
    126126{
    127     JSDOMWindow* window = asJSDOMWindow(exec->dynamicGlobalObject());
     127    JSDOMWindow* window = asJSDOMWindow(exec->vmEntryGlobalObject());
    128128    if (!window || !exec->hadException())
    129129        return;
  • trunk/Source/WebCore/bridge/c/c_utility.cpp

    r154038 r159605  
    11/*
    2  * Copyright (C) 2004, 2006 Apple Computer, Inc.  All rights reserved.
     2 * Copyright (C) 2004, 2006, 2013 Apple Computer, Inc.  All rights reserved.
    33 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
    44 *
     
    9595            }
    9696        } else {
    97             JSGlobalObject* globalObject = exec->dynamicGlobalObject();
     97            JSGlobalObject* globalObject = exec->vmEntryGlobalObject();
    9898
    9999            RootObject* rootObject = findRootObject(globalObject);
  • trunk/Source/WebCore/bridge/objc/objc_instance.mm

    r156485 r159605  
    11/*
    2  * Copyright (C) 2004, 2008, 2009 Apple Inc. All rights reserved.
     2 * Copyright (C) 2004, 2008, 2009, 2013 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    9393    }
    9494
    95     if (!s_exceptionEnvironment || s_exceptionEnvironment == exec->dynamicGlobalObject()) {
     95    if (!s_exceptionEnvironment || s_exceptionEnvironment == exec->vmEntryGlobalObject()) {
    9696        JSLockHolder lock(exec);
    9797        throwError(exec, s_exception);
  • trunk/Source/WebCore/bridge/objc/objc_runtime.mm

    r154797 r159605  
    11/*
    2  * Copyright (C) 2004, 2008 Apple Inc. All rights reserved.
     2 * Copyright (C) 2004, 2008, 2013 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    114114static id convertValueToObjcObject(ExecState* exec, JSValue value)
    115115{
    116     RefPtr<RootObject> rootObject = findRootObject(exec->dynamicGlobalObject());
     116    RefPtr<RootObject> rootObject = findRootObject(exec->vmEntryGlobalObject());
    117117    if (!rootObject)
    118118        return nil;
  • trunk/Source/WebCore/bridge/objc/objc_utility.mm

    r154797 r159605  
    11/*
    2  * Copyright (C) 2004 Apple Computer, Inc.  All rights reserved.
     2 * Copyright (C) 2004, 2013 Apple Computer, Inc.  All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    8989            JSLockHolder lock(exec);
    9090           
    91             JSGlobalObject *originGlobalObject = exec->dynamicGlobalObject();
     91            JSGlobalObject *originGlobalObject = exec->vmEntryGlobalObject();
    9292            RootObject* originRootObject = findRootObject(originGlobalObject);
    9393
  • trunk/Source/WebKit/mac/ChangeLog

    r159550 r159605  
     12013-11-20  Mark Lam  <mark.lam@apple.com>
     2
     3        Introducing VMEntryScope to update the VM stack limit.
     4        https://bugs.webkit.org/show_bug.cgi?id=124634.
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        * WebView/WebScriptDebugger.mm:
     9        (WebScriptDebugger::sourceParsed):
     10
    1112013-11-19  Ryosuke Niwa  <rniwa@webkit.org>
    212
  • trunk/Source/WebKit/mac/WebView/WebScriptDebugger.mm

    r158937 r159605  
    9393    int firstLine = sourceProvider->startPosition().m_line.oneBasedInt();
    9494
    95     WebFrame *webFrame = toWebFrame(exec->dynamicGlobalObject());
     95    WebFrame *webFrame = toWebFrame(exec->vmEntryGlobalObject());
    9696    WebView *webView = [webFrame webView];
    9797    WebScriptDebugDelegateImplementationCache* implementations = WebViewGetScriptDebugDelegateImplementations(webView);
Note: See TracChangeset for help on using the changeset viewer.