Ignore:
Timestamp:
Apr 14, 2022, 2:56:27 PM (3 years ago)
Author:
[email protected]
Message:

[JSC] Reduce use of CallFrame::deprecatedVM
https://bugs.webkit.org/show_bug.cgi?id=239326

Reviewed by Devin Rousso.

Reduce use of CallFrame::deprecatedVM, mainly in inspector related code to eventually remove CallFrame::deprecatedVM.

  • Source/JavaScriptCore/debugger/Debugger.cpp:

(JSC::Debugger::evaluateBreakpointCondition):
(JSC::Debugger::evaluateBreakpointActions):
(JSC::Debugger::exceptionOrCaughtValue):

  • Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp:

(JSC::DebuggerCallFrame::globalObject):
(JSC::DebuggerCallFrame::functionName const):
(JSC::DebuggerCallFrame::scope):
(JSC::DebuggerCallFrame::type const):
(JSC::DebuggerCallFrame::evaluateWithScopeExtension):
(JSC::DebuggerCallFrame::deprecatedVMEntryGlobalObject const): Deleted.

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

(Inspector::JSJavaScriptCallFrame::evaluateWithScopeExtension):
(Inspector::JSJavaScriptCallFrame::scopeDescriptions):
(Inspector::JSJavaScriptCallFrame::functionName const):
(Inspector::JSJavaScriptCallFrame::scopeChain const):
(Inspector::JSJavaScriptCallFrame::type const):

  • Source/JavaScriptCore/inspector/JavaScriptCallFrame.h:

(Inspector::JavaScriptCallFrame::functionName const):
(Inspector::JavaScriptCallFrame::type const):
(Inspector::JavaScriptCallFrame::scopeChain const):
(Inspector::JavaScriptCallFrame::evaluateWithScopeExtension const):
(Inspector::JavaScriptCallFrame::deprecatedVMEntryGlobalObject const): Deleted.

  • Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp:

(Inspector::InspectorDebuggerAgent::debuggerScopeExtensionObject):
(Inspector::InspectorDebuggerAgent::didPause):

  • Source/JavaScriptCore/interpreter/Interpreter.cpp:

(JSC::Interpreter::debug):

Canonical link: https://commits.webkit.org/249661@main

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/debugger/Debugger.cpp

    r292830 r292891  
    608608    ASSERT(isAttached(globalObject));
    609609
     610    VM& vm = globalObject->vm();
    610611    const String& condition = breakpoint.condition();
    611612    if (condition.isEmpty())
     
    615616    DebuggerCallFrame& debuggerCallFrame = currentDebuggerCallFrame();
    616617    JSObject* scopeExtensionObject = m_client ? m_client->debuggerScopeExtensionObject(*this, globalObject, debuggerCallFrame) : nullptr;
    617     JSValue result = debuggerCallFrame.evaluateWithScopeExtension(condition, scopeExtensionObject, exception);
     618    JSValue result = debuggerCallFrame.evaluateWithScopeExtension(vm, condition, scopeExtensionObject, exception);
    618619
    619620    // We can lose the debugger while executing JavaScript.
     
    634635    ASSERT(isAttached(globalObject));
    635636
     637    VM& vm = globalObject->vm();
     638
    636639    m_currentProbeBatchId++;
    637640
     
    645648        case Breakpoint::Action::Type::Log:
    646649            dispatchFunctionToObservers([&] (Observer& observer) {
    647                 observer.breakpointActionLog(debuggerCallFrame.globalObject(), action.data);
     650                observer.breakpointActionLog(debuggerCallFrame.globalObject(vm), action.data);
    648651            });
    649652            break;
     
    652655            NakedPtr<Exception> exception;
    653656            JSObject* scopeExtensionObject = m_client ? m_client->debuggerScopeExtensionObject(*this, globalObject, debuggerCallFrame) : nullptr;
    654             debuggerCallFrame.evaluateWithScopeExtension(action.data, scopeExtensionObject, exception);
     657            debuggerCallFrame.evaluateWithScopeExtension(vm, action.data, scopeExtensionObject, exception);
    655658            if (exception)
    656                 reportException(debuggerCallFrame.globalObject(), exception);
     659                reportException(debuggerCallFrame.globalObject(vm), exception);
    657660            break;
    658661        }
     
    667670            NakedPtr<Exception> exception;
    668671            JSObject* scopeExtensionObject = m_client ? m_client->debuggerScopeExtensionObject(*this, globalObject, debuggerCallFrame) : nullptr;
    669             JSValue result = debuggerCallFrame.evaluateWithScopeExtension(action.data, scopeExtensionObject, exception);
    670             JSC::JSGlobalObject* debuggerGlobalObject = debuggerCallFrame.globalObject();
     672            JSValue result = debuggerCallFrame.evaluateWithScopeExtension(vm, action.data, scopeExtensionObject, exception);
     673            JSC::JSGlobalObject* debuggerGlobalObject = debuggerCallFrame.globalObject(vm);
    671674            if (exception)
    672675                reportException(debuggerGlobalObject, exception);
     
    10271030        return currentException();
    10281031
     1032    VM& vm = globalObject->vm();
    10291033    for (RefPtr<DebuggerCallFrame> frame = &currentDebuggerCallFrame(); frame; frame = frame->callerFrame()) {
    1030         DebuggerScope& scope = *frame->scope();
     1034        DebuggerScope& scope = *frame->scope(vm);
    10311035        if (scope.isCatchScope())
    10321036            return scope.caughtValue(globalObject);
Note: See TracChangeset for help on using the changeset viewer.