Ignore:
Timestamp:
Aug 8, 2014, 11:50:19 PM (11 years ago)
Author:
[email protected]
Message:

REGRESSION: Inspector crashes when debugger is paused and injected scripts access window.screen().
<https://webkit.org/b/135656>

Not reviewed.

Rolling out r170680 which was merged to ToT in r172129.

Source/JavaScriptCore:

  • debugger/Debugger.h:
  • debugger/DebuggerCallFrame.cpp:

(JSC::DebuggerCallFrame::scope):
(JSC::DebuggerCallFrame::evaluate):
(JSC::DebuggerCallFrame::invalidate):

  • debugger/DebuggerCallFrame.h:
  • debugger/DebuggerScope.cpp:

(JSC::DebuggerScope::DebuggerScope):
(JSC::DebuggerScope::finishCreation):
(JSC::DebuggerScope::visitChildren):
(JSC::DebuggerScope::className):
(JSC::DebuggerScope::getOwnPropertySlot):
(JSC::DebuggerScope::put):
(JSC::DebuggerScope::deleteProperty):
(JSC::DebuggerScope::getOwnPropertyNames):
(JSC::DebuggerScope::defineOwnProperty):
(JSC::DebuggerScope::next): Deleted.
(JSC::DebuggerScope::invalidateChain): Deleted.
(JSC::DebuggerScope::isWithScope): Deleted.
(JSC::DebuggerScope::isGlobalScope): Deleted.
(JSC::DebuggerScope::isFunctionScope): Deleted.

  • debugger/DebuggerScope.h:

(JSC::DebuggerScope::create):
(JSC::DebuggerScope::Iterator::Iterator): Deleted.
(JSC::DebuggerScope::Iterator::get): Deleted.
(JSC::DebuggerScope::Iterator::operator++): Deleted.
(JSC::DebuggerScope::Iterator::operator==): Deleted.
(JSC::DebuggerScope::Iterator::operator!=): Deleted.
(JSC::DebuggerScope::isValid): Deleted.
(JSC::DebuggerScope::jsScope): Deleted.
(JSC::DebuggerScope::begin): Deleted.
(JSC::DebuggerScope::end): Deleted.

  • inspector/JSJavaScriptCallFrame.cpp:

(Inspector::JSJavaScriptCallFrame::scopeType):
(Inspector::JSJavaScriptCallFrame::scopeChain):

  • inspector/JavaScriptCallFrame.h:

(Inspector::JavaScriptCallFrame::scopeChain):

  • inspector/ScriptDebugServer.cpp:
  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::reset):
(JSC::JSGlobalObject::visitChildren):

  • runtime/JSGlobalObject.h:

(JSC::JSGlobalObject::debuggerScopeStructure): Deleted.

  • runtime/JSObject.h:

(JSC::JSObject::isWithScope): Deleted.

  • runtime/JSScope.h:
  • runtime/VM.cpp:

(JSC::VM::VM):

  • runtime/VM.h:

Source/WebCore:

  • bindings/js/ScriptController.cpp:

(WebCore::ScriptController::attachDebugger):

File:
1 edited

Legend:

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

    r172129 r172372  
    3131
    3232#include "CodeBlock.h"
    33 #include "DebuggerScope.h"
    3433#include "Interpreter.h"
    3534#include "JSActivation.h"
     
    3837#include "Parser.h"
    3938#include "StackVisitor.h"
    40 #include "StrongInlines.h"
    4139
    4240namespace JSC {
     
    109107}
    110108
    111 DebuggerScope* DebuggerCallFrame::scope()
    112 {
    113     ASSERT(isValid());
    114     if (!isValid())
    115         return 0;
    116 
    117     if (!m_scope) {
    118         VM& vm = m_callFrame->vm();
    119         CodeBlock* codeBlock = m_callFrame->codeBlock();
    120         if (codeBlock && codeBlock->needsActivation() && !m_callFrame->hasActivation()) {
    121             ASSERT(!m_callFrame->scope()->isWithScope());
    122             JSActivation* activation = JSActivation::create(vm, m_callFrame, codeBlock);
    123             m_callFrame->setActivation(activation);
    124             m_callFrame->setScope(activation);
    125         }
    126 
    127         m_scope.set(vm, DebuggerScope::create(vm, m_callFrame->scope()));
    128     }
    129     return m_scope.get();
     109JSScope* DebuggerCallFrame::scope() const
     110{
     111    ASSERT(isValid());
     112    if (!isValid())
     113        return 0;
     114
     115    CodeBlock* codeBlock = m_callFrame->codeBlock();
     116    if (codeBlock && codeBlock->needsActivation() && !m_callFrame->hasActivation()) {
     117        JSActivation* activation = JSActivation::create(*codeBlock->vm(), m_callFrame, codeBlock);
     118        m_callFrame->setActivation(activation);
     119        m_callFrame->setScope(activation);
     120    }
     121
     122    return m_callFrame->scope();
    130123}
    131124
     
    170163
    171164    JSValue thisValue = thisValueForCallFrame(callFrame);
    172     JSValue result = vm.interpreter->execute(eval, callFrame, thisValue, scope()->jsScope());
     165    JSValue result = vm.interpreter->execute(eval, callFrame, thisValue, scope());
    173166    if (vm.exception()) {
    174167        exception = vm.exception();
     
    182175{
    183176    m_callFrame = nullptr;
    184     if (m_scope) {
    185         m_scope->invalidateChain();
    186         m_scope.clear();
    187     }
    188177    RefPtr<DebuggerCallFrame> frame = m_caller.release();
    189178    while (frame) {
Note: See TracChangeset for help on using the changeset viewer.