Ignore:
Timestamp:
Oct 23, 2019, 10:34:21 PM (6 years ago)
Author:
[email protected]
Message:

[JSC] Remove wasmAwareLexicalGlobalObject
https://bugs.webkit.org/show_bug.cgi?id=203351

Reviewed by Mark Lam.

Source/JavaScriptCore:

CallFrame::lexicalGlobalObject() is no longer called frequently. We can just make the current wasmAwareLexicalGlobalObject as CallFrame::lexicalGlobalObject,
and remove wasmAwareLexicalGlobalObject function.

  • debugger/Debugger.cpp:

(JSC::Debugger::hasBreakpoint):
(JSC::Debugger::breakProgram):
(JSC::lexicalGlobalObjectForCallFrame):

  • debugger/DebuggerCallFrame.cpp:

(JSC::DebuggerCallFrame::deprecatedVMEntryGlobalObject const):
(JSC::DebuggerCallFrame::scope):
(JSC::DebuggerCallFrame::thisValue const):
(JSC::DebuggerCallFrame::evaluateWithScopeExtension):

  • debugger/DebuggerCallFrame.h:
  • inspector/JSJavaScriptCallFrame.cpp:

(Inspector::JSJavaScriptCallFrame::thisObject const):

  • inspector/JavaScriptCallFrame.h:

(Inspector::JavaScriptCallFrame::thisValue const):

  • interpreter/CallFrame.cpp:

(JSC::CallFrame::lexicalGlobalObjectFromWasmCallee const):
(JSC::CallFrame::wasmAwareLexicalGlobalObject): Deleted.

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

(JSC::notifyDebuggerOfUnwinding):
(JSC::Interpreter::debug):

  • interpreter/StackVisitor.cpp:

(JSC::StackVisitor::Frame::createArguments):

  • interpreter/StackVisitor.h:
  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::llint_throw_stack_overflow_error):

  • runtime/JSFunction.cpp:

(JSC::RetrieveArgumentsFunctor::RetrieveArgumentsFunctor):
(JSC::RetrieveArgumentsFunctor::operator() const):
(JSC::retrieveArguments):

  • runtime/JSScope.h:

(JSC::CallFrame::lexicalGlobalObject const):

  • runtime/RegExpInlines.h:

(JSC::RegExp::matchInline):

  • wasm/js/WasmToJS.cpp:

(JSC::Wasm::wasmToJS):

Source/WebCore:

  • bindings/js/CommonVM.cpp:

(WebCore::lexicalFrameFromCommonVM):

  • bindings/js/JSDOMWindowBase.cpp:

(WebCore::responsibleDocument):

  • bindings/js/StructuredClone.cpp:

(WebCore::cloneArrayBufferImpl):

  • dom/Document.cpp:

(WebCore::Document::shouldBypassMainWorldContentSecurityPolicy const):

  • testing/Internals.cpp:

(WebCore::Internals::parserMetaData):
(WebCore::Internals::isFromCurrentWorld const):

Location:
trunk/Source/JavaScriptCore/interpreter
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/interpreter/CallFrame.cpp

    r251475 r251529  
    191191}
    192192
    193 JSGlobalObject* CallFrame::wasmAwareLexicalGlobalObject(VM& vm)
    194 {
    195 #if ENABLE(WEBASSEMBLY)
    196     if (!callee().isWasm())
    197         return lexicalGlobalObject();
    198     return vm.wasmContext.load()->owner<JSWebAssemblyInstance>()->globalObject();
    199 #else
    200     UNUSED_PARAM(vm);
    201     return lexicalGlobalObject();
    202 #endif
    203 }
    204 
    205193bool CallFrame::isAnyWasmCallee()
    206194{
     
    358346}
    359347
     348#if ENABLE(WEBASSEMBLY)
     349JSGlobalObject* CallFrame::lexicalGlobalObjectFromWasmCallee(VM& vm) const
     350{
     351    return vm.wasmContext.load()->owner<JSWebAssemblyInstance>()->globalObject();
     352}
     353#endif
     354
    360355bool isFromJSCode(void* returnAddress)
    361356{
  • trunk/Source/JavaScriptCore/interpreter/CallFrame.h

    r251475 r251529  
    126126        }
    127127
    128         JSGlobalObject* wasmAwareLexicalGlobalObject(VM&);
    129 
    130128        JS_EXPORT_PRIVATE bool isAnyWasmCallee();
    131129
    132130        // Global object in which the currently executing code was defined.
    133131        // Differs from VM::deprecatedVMEntryGlobalObject() during function calls across web browser frames.
    134         JSGlobalObject* lexicalGlobalObject() const;
     132        JSGlobalObject* lexicalGlobalObject(VM&) const;
    135133
    136134        // FIXME: Remove this function
     
    170168    private:
    171169        unsigned callSiteBitsAsBytecodeOffset() const;
     170#if ENABLE(WEBASSEMBLY)
     171        JS_EXPORT_PRIVATE JSGlobalObject* lexicalGlobalObjectFromWasmCallee(VM&) const;
     172#endif
    172173    public:
    173174
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp

    r251468 r251529  
    516516ALWAYS_INLINE static void notifyDebuggerOfUnwinding(VM& vm, CallFrame* callFrame)
    517517{
    518     JSGlobalObject* globalObject = callFrame->wasmAwareLexicalGlobalObject(vm);
     518    JSGlobalObject* globalObject = callFrame->lexicalGlobalObject(vm);
    519519    auto catchScope = DECLARE_CATCH_SCOPE(vm);
    520520    if (Debugger* debugger = globalObject->debugger()) {
     
    12171217    VM& vm = callFrame->deprecatedVM();
    12181218    auto scope = DECLARE_CATCH_SCOPE(vm);
    1219     Debugger* debugger = callFrame->lexicalGlobalObject()->debugger();
     1219    Debugger* debugger = callFrame->lexicalGlobalObject(vm)->debugger();
    12201220    if (!debugger)
    12211221        return;
  • trunk/Source/JavaScriptCore/interpreter/StackVisitor.cpp

    r251468 r251529  
    370370}
    371371
    372 ClonedArguments* StackVisitor::Frame::createArguments()
     372ClonedArguments* StackVisitor::Frame::createArguments(VM& vm)
    373373{
    374374    ASSERT(m_callFrame);
     
    376376    // FIXME: Revisit JSGlobalObject.
    377377    // https://bugs.webkit.org/show_bug.cgi?id=203204
    378     JSGlobalObject* globalObject = physicalFrame->lexicalGlobalObject();
     378    JSGlobalObject* globalObject = physicalFrame->lexicalGlobalObject(vm);
    379379    ClonedArguments* arguments;
    380380    ArgumentsMode mode;
  • trunk/Source/JavaScriptCore/interpreter/StackVisitor.h

    r251468 r251529  
    9898#endif
    9999
    100         ClonedArguments* createArguments();
     100        ClonedArguments* createArguments(VM&);
    101101        CallFrame* callFrame() const { return m_callFrame; }
    102102       
Note: See TracChangeset for help on using the changeset viewer.