Ignore:
Timestamp:
Aug 4, 2014, 3:04:39 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-04
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::addEntryScopeDidPopListener):
(JSC::VMEntryScope::~VMEntryScope):

  • runtime/VMEntryScope.h:

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

File:
1 edited

Legend:

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

    r170677 r172009  
    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            Debugger* debugger = globalObject->debugger();
     341            if (debugger)
     342                debugger->recompileAllJSFunctions(vm);
     343        };
     344
     345        vm->entryScope->addEntryScopeDidPopListener(this, listener);
    339346        return;
    340347    }
Note: See TracChangeset for help on using the changeset viewer.