Ignore:
Timestamp:
Aug 7, 2014, 7:29:22 PM (11 years ago)
Author:
[email protected]
Message:

Create a more generic way for VMEntryScope to notify those interested that it will be destroyed
https://bugs.webkit.org/show_bug.cgi?id=135358

Patch by Saam Barati <[email protected]> on 2014-08-07
Reviewed by Geoffrey Garen.

When VMEntryScope is destroyed, and it has a flag set indicating that the
Debugger needs to recompile all functions, it calls Debugger::recompileAllJSFunctions.
This flag is only used by Debugger to have VMEntryScope notify it when the
Debugger is safe to recompile all functions. This patch will substitute this
Debugger-specific recompilation flag with a list of callbacks that are notified
when the outermost VMEntryScope dies. This creates a general purpose interface
for being notified when the VM stops executing code via the event of the outermost
VMEntryScope dying.

  • debugger/Debugger.cpp:

(JSC::Debugger::recompileAllJSFunctions):

  • runtime/VMEntryScope.cpp:

(JSC::VMEntryScope::VMEntryScope):
(JSC::VMEntryScope::setEntryScopeDidPopListener):
(JSC::VMEntryScope::~VMEntryScope):

  • runtime/VMEntryScope.h:

(JSC::VMEntryScope::setRecompilationNeeded): Deleted.

File:
1 edited

Legend:

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

    r172098 r172324  
    336336    // up throwing away code that is live on the stack.
    337337    if (vm->entryScope) {
    338         vm->entryScope->setRecompilationNeeded(true);
     338        auto listener = [] (VM& vm, JSGlobalObject* globalObject)
     339        {
     340            if (Debugger* debugger = globalObject->debugger())
     341                debugger->recompileAllJSFunctions(&vm);
     342        };
     343
     344        vm->entryScope->setEntryScopeDidPopListener(this, listener);
    339345        return;
    340346    }
Note: See TracChangeset for help on using the changeset viewer.