<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[188846] trunk/Source/JavaScriptCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/188846">188846</a></dd>
<dt>Author</dt> <dd>ggaren@apple.com</dd>
<dt>Date</dt> <dd>2015-08-23 19:07:27 -0700 (Sun, 23 Aug 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Unreviewed, rolling back in <a href="http://trac.webkit.org/projects/webkit/changeset/188792">r188792</a>.
https://bugs.webkit.org/show_bug.cgi?id=148347
Previously reverted changesets:
"Unify code paths for manually deleting all code"
https://bugs.webkit.org/show_bug.cgi?id=148280
http://trac.webkit.org/changeset/188792
The previous patch caused some inspector tests to hang because it
introduced extra calls to sourceParsed, and sourceParsed is
pathologically slow in WK1 debug builds. This patch restores pre-existing
code to limit calls to sourceParsed, excluding code not being debugged
(i.e., inspector code).</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoredebuggerDebuggercpp">trunk/Source/JavaScriptCore/debugger/Debugger.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapHeaph">trunk/Source/JavaScriptCore/heap/Heap.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgentcpp">trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeVMcpp">trunk/Source/JavaScriptCore/runtime/VM.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeVMh">trunk/Source/JavaScriptCore/runtime/VM.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeVMEntryScopecpp">trunk/Source/JavaScriptCore/runtime/VMEntryScope.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeVMEntryScopeh">trunk/Source/JavaScriptCore/runtime/VMEntryScope.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (188845 => 188846)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-08-23 22:51:28 UTC (rev 188845)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-08-24 02:07:27 UTC (rev 188846)
</span><span class="lines">@@ -1,7 +1,26 @@
</span><span class="cx"> 2015-08-23 Geoffrey Garen <ggaren@apple.com>
</span><span class="cx">
</span><ins>+ Unreviewed, rolling back in r188792.
+ https://bugs.webkit.org/show_bug.cgi?id=148347
+
+ Previously reverted changesets:
+
+ "Unify code paths for manually deleting all code"
+ https://bugs.webkit.org/show_bug.cgi?id=148280
+ http://trac.webkit.org/changeset/188792
+
+ The previous patch caused some inspector tests to hang because it
+ introduced extra calls to sourceParsed, and sourceParsed is
+ pathologically slow in WK1 debug builds. This patch restores pre-existing
+ code to limit calls to sourceParsed, excluding code not being debugged
+ (i.e., inspector code).
+
+2015-08-23 Geoffrey Garen <ggaren@apple.com>
+
</ins><span class="cx"> Unreviewed, rolling back in r188803.
</span><span class="cx">
</span><ins>+ Previously reverted changesets:
+
</ins><span class="cx"> "Debugger's VM should never be null"
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=148341
</span><span class="cx"> http://trac.webkit.org/changeset/188803
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredebuggerDebuggercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/debugger/Debugger.cpp (188845 => 188846)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/debugger/Debugger.cpp        2015-08-23 22:51:28 UTC (rev 188845)
+++ trunk/Source/JavaScriptCore/debugger/Debugger.cpp        2015-08-24 02:07:27 UTC (rev 188846)
</span><span class="lines">@@ -39,66 +39,31 @@
</span><span class="cx">
</span><span class="cx"> using namespace JSC;
</span><span class="cx">
</span><del>-class Recompiler : public MarkedBlock::VoidFunctor {
-public:
- Recompiler(JSC::Debugger*);
- ~Recompiler();
- IterationStatus operator()(JSCell*);
-
-private:
- typedef HashSet<FunctionExecutable*> FunctionExecutableSet;
- typedef HashMap<SourceProvider*, ExecState*> SourceProviderMap;
-
- void visit(JSCell*);
-
</del><ins>+struct GatherSourceProviders : public MarkedBlock::VoidFunctor {
+ HashSet<SourceProvider*> sourceProviders;
</ins><span class="cx"> JSC::Debugger* m_debugger;
</span><del>- FunctionExecutableSet m_functionExecutables;
- SourceProviderMap m_sourceProviders;
-};
</del><span class="cx">
</span><del>-inline Recompiler::Recompiler(JSC::Debugger* debugger)
- : m_debugger(debugger)
-{
-}
</del><ins>+ GatherSourceProviders(JSC::Debugger* debugger)
+ : m_debugger(debugger) { }
</ins><span class="cx">
</span><del>-inline Recompiler::~Recompiler()
-{
- // Call sourceParsed() after reparsing all functions because it will execute
- // JavaScript in the inspector.
- SourceProviderMap::const_iterator end = m_sourceProviders.end();
- for (SourceProviderMap::const_iterator iter = m_sourceProviders.begin(); iter != end; ++iter)
- m_debugger->sourceParsed(iter->value, iter->key, -1, String());
-}
</del><ins>+ IterationStatus operator()(JSCell* cell)
+ {
+ JSFunction* function = jsDynamicCast<JSFunction*>(cell);
+ if (!function)
+ return IterationStatus::Continue;
</ins><span class="cx">
</span><del>-inline void Recompiler::visit(JSCell* cell)
-{
- if (!cell->inherits(JSFunction::info()))
- return;
</del><ins>+ if (function->scope()->globalObject()->debugger() != m_debugger)
+ return IterationStatus::Continue;
</ins><span class="cx">
</span><del>- JSFunction* function = jsCast<JSFunction*>(cell);
- if (function->executable()->isHostFunction())
- return;
</del><ins>+ if (!function->executable()->isFunctionExecutable())
+ return IterationStatus::Continue;
</ins><span class="cx">
</span><del>- FunctionExecutable* executable = function->jsExecutable();
</del><ins>+ sourceProviders.add(
+ jsCast<FunctionExecutable*>(function->executable())->source().provider());
+ return IterationStatus::Continue;
+ }
+};
</ins><span class="cx">
</span><del>- // Check if the function is already in the set - if so,
- // we've already retranslated it, nothing to do here.
- if (!m_functionExecutables.add(executable).isNewEntry)
- return;
-
- ExecState* exec = function->scope()->globalObject()->JSGlobalObject::globalExec();
- executable->clearCode();
- executable->clearUnlinkedCodeForRecompilation();
- if (m_debugger == function->scope()->globalObject()->debugger())
- m_sourceProviders.add(executable->source().provider(), exec);
-}
-
-inline IterationStatus Recompiler::operator()(JSCell* cell)
-{
- visit(cell);
- return IterationStatus::Continue;
-}
-
</del><span class="cx"> } // namespace
</span><span class="cx">
</span><span class="cx"> namespace JSC {
</span><span class="lines">@@ -176,6 +141,15 @@
</span><span class="cx"> ASSERT(!globalObject->debugger());
</span><span class="cx"> globalObject->setDebugger(this);
</span><span class="cx"> m_globalObjects.add(globalObject);
</span><ins>+
+ // Call sourceParsed() because it will execute JavaScript in the inspector.
+ GatherSourceProviders gatherSourceProviders(this);
+ {
+ HeapIterationScope iterationScope(m_vm.heap);
+ m_vm.heap.objectSpace().forEachLiveCell(iterationScope, gatherSourceProviders);
+ }
+ for (auto* sourceProvider : gatherSourceProviders.sourceProviders)
+ sourceParsed(globalObject->globalExec(), sourceProvider, -1, String());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Debugger::detach(JSGlobalObject* globalObject, ReasonForDetach reason)
</span><span class="lines">@@ -328,26 +302,7 @@
</span><span class="cx">
</span><span class="cx"> void Debugger::recompileAllJSFunctions()
</span><span class="cx"> {
</span><del>- // If JavaScript is running, it's not safe to recompile, since we'll end
- // up throwing away code that is live on the stack.
- if (m_vm.entryScope) {
- auto listener = [] (VM&, JSGlobalObject* globalObject)
- {
- if (Debugger* debugger = globalObject->debugger())
- debugger->recompileAllJSFunctions();
- };
-
- m_vm.entryScope->setEntryScopeDidPopListener(this, listener);
- return;
- }
-
-#if ENABLE(DFG_JIT)
- DFG::completeAllPlansForVM(m_vm);
-#endif
-
- Recompiler recompiler(this);
- HeapIterationScope iterationScope(m_vm.heap);
- m_vm.heap.objectSpace().forEachLiveCell(iterationScope, recompiler);
</del><ins>+ m_vm.deleteAllCode();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> BreakpointID Debugger::setBreakpoint(Breakpoint breakpoint, unsigned& actualLine, unsigned& actualColumn)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapHeaph"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/Heap.h (188845 => 188846)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/Heap.h        2015-08-23 22:51:28 UTC (rev 188845)
+++ trunk/Source/JavaScriptCore/heap/Heap.h        2015-08-24 02:07:27 UTC (rev 188846)
</span><span class="lines">@@ -237,6 +237,8 @@
</span><span class="cx">
</span><span class="cx"> void addLogicallyEmptyWeakBlock(WeakBlock*);
</span><span class="cx">
</span><ins>+ Vector<ExecutableBase*>& compiledCode() { return m_compiledCode; }
+
</ins><span class="cx"> private:
</span><span class="cx"> friend class CodeBlock;
</span><span class="cx"> friend class CopiedBlock;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp (188845 => 188846)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp        2015-08-23 22:51:28 UTC (rev 188845)
+++ trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp        2015-08-24 02:07:27 UTC (rev 188846)
</span><span class="lines">@@ -308,40 +308,6 @@
</span><span class="cx"> dataLogF("Inspector::getRuntimeTypesForVariablesAtOffsets took %lfms\n", end - start);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-class TypeRecompiler : public MarkedBlock::VoidFunctor {
-public:
- inline void visit(JSCell* cell)
- {
- if (!cell->inherits(FunctionExecutable::info()))
- return;
-
- FunctionExecutable* executable = jsCast<FunctionExecutable*>(cell);
- executable->clearCode();
- executable->clearUnlinkedCodeForRecompilation();
- }
- inline IterationStatus operator()(JSCell* cell)
- {
- visit(cell);
- return IterationStatus::Continue;
- }
-};
-
-static void recompileAllJSFunctionsForTypeProfiling(VM& vm, bool shouldEnableTypeProfiling)
-{
- bool shouldRecompileFromTypeProfiler = (shouldEnableTypeProfiling ? vm.enableTypeProfiler() : vm.disableTypeProfiler());
- bool shouldRecompileFromControlFlowProfiler = (shouldEnableTypeProfiling ? vm.enableControlFlowProfiler() : vm.disableControlFlowProfiler());
- bool needsToRecompile = shouldRecompileFromTypeProfiler || shouldRecompileFromControlFlowProfiler;
-
- if (needsToRecompile) {
-#if ENABLE(DFG_JIT)
- DFG::completeAllPlansForVM(vm);
-#endif
- TypeRecompiler recompiler;
- HeapIterationScope iterationScope(vm.heap);
- vm.heap.objectSpace().forEachLiveCell(iterationScope, recompiler);
- }
-}
-
</del><span class="cx"> void InspectorRuntimeAgent::willDestroyFrontendAndBackend(DisconnectReason reason)
</span><span class="cx"> {
</span><span class="cx"> if (reason != DisconnectReason::InspectedTargetDestroyed && m_isTypeProfilingEnabled)
</span><span class="lines">@@ -358,25 +324,21 @@
</span><span class="cx"> setTypeProfilerEnabledState(false);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void InspectorRuntimeAgent::setTypeProfilerEnabledState(bool shouldEnableTypeProfiling)
</del><ins>+void InspectorRuntimeAgent::setTypeProfilerEnabledState(bool isTypeProfilingEnabled)
</ins><span class="cx"> {
</span><del>- if (m_isTypeProfilingEnabled == shouldEnableTypeProfiling)
</del><ins>+ if (m_isTypeProfilingEnabled == isTypeProfilingEnabled)
</ins><span class="cx"> return;
</span><ins>+ m_isTypeProfilingEnabled = isTypeProfilingEnabled;
</ins><span class="cx">
</span><del>- m_isTypeProfilingEnabled = shouldEnableTypeProfiling;
-
</del><span class="cx"> VM& vm = globalVM();
</span><ins>+ vm.whenIdle([&vm, isTypeProfilingEnabled] () {
+ bool shouldRecompileFromTypeProfiler = (isTypeProfilingEnabled ? vm.enableTypeProfiler() : vm.disableTypeProfiler());
+ bool shouldRecompileFromControlFlowProfiler = (isTypeProfilingEnabled ? vm.enableControlFlowProfiler() : vm.disableControlFlowProfiler());
+ bool needsToRecompile = shouldRecompileFromTypeProfiler || shouldRecompileFromControlFlowProfiler;
</ins><span class="cx">
</span><del>- // If JavaScript is running, it's not safe to recompile, since we'll end
- // up throwing away code that is live on the stack.
- if (vm.entryScope) {
- vm.entryScope->setEntryScopeDidPopListener(this,
- [=] (VM& vm, JSGlobalObject*) {
- recompileAllJSFunctionsForTypeProfiling(vm, shouldEnableTypeProfiling);
- }
- );
- } else
- recompileAllJSFunctionsForTypeProfiling(vm, shouldEnableTypeProfiling);
</del><ins>+ if (needsToRecompile)
+ vm.deleteAllCode();
+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InspectorRuntimeAgent::getBasicBlocks(ErrorString& errorString, const String& sourceIDAsString, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::BasicBlock>>& basicBlocks)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VM.cpp (188845 => 188846)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VM.cpp        2015-08-23 22:51:28 UTC (rev 188845)
+++ trunk/Source/JavaScriptCore/runtime/VM.cpp        2015-08-24 02:07:27 UTC (rev 188846)
</span><span class="lines">@@ -86,6 +86,7 @@
</span><span class="cx"> #include "TypeProfiler.h"
</span><span class="cx"> #include "TypeProfilerLog.h"
</span><span class="cx"> #include "UnlinkedCodeBlock.h"
</span><ins>+#include "VMEntryScope.h"
</ins><span class="cx"> #include "Watchdog.h"
</span><span class="cx"> #include "WeakGCMapInlines.h"
</span><span class="cx"> #include "WeakMapData.h"
</span><span class="lines">@@ -470,16 +471,28 @@
</span><span class="cx"> interpreter->stopSampling();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void VM::whenIdle(std::function<void()> callback)
+{
+ if (!entryScope) {
+ callback();
+ return;
+ }
+
+ entryScope->addDidPopListener(callback);
+}
+
</ins><span class="cx"> void VM::deleteAllCode()
</span><span class="cx"> {
</span><del>- m_codeCache->clear();
- m_regExpCache->deleteAllCode();
</del><ins>+ whenIdle([this]() {
+ m_codeCache->clear();
+ m_regExpCache->deleteAllCode();
</ins><span class="cx"> #if ENABLE(DFG_JIT)
</span><del>- DFG::completeAllPlansForVM(*this);
</del><ins>+ DFG::completeAllPlansForVM(*this);
</ins><span class="cx"> #endif
</span><del>- heap.deleteAllCompiledCode();
- heap.deleteAllUnlinkedFunctionCode();
- heap.reportAbandonedObjectGraph();
</del><ins>+ heap.deleteAllCompiledCode();
+ heap.deleteAllUnlinkedFunctionCode();
+ heap.reportAbandonedObjectGraph();
+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void VM::dumpSampleData(ExecState* exec)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VM.h (188845 => 188846)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VM.h        2015-08-23 22:51:28 UTC (rev 188845)
+++ trunk/Source/JavaScriptCore/runtime/VM.h        2015-08-24 02:07:27 UTC (rev 188846)
</span><span class="lines">@@ -539,6 +539,8 @@
</span><span class="cx"> JSLock& apiLock() { return *m_apiLock; }
</span><span class="cx"> CodeCache* codeCache() { return m_codeCache.get(); }
</span><span class="cx">
</span><ins>+ void whenIdle(std::function<void()>);
+
</ins><span class="cx"> JS_EXPORT_PRIVATE void deleteAllCode();
</span><span class="cx">
</span><span class="cx"> void registerWatchpointForImpureProperty(const Identifier&, Watchpoint*);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMEntryScopecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VMEntryScope.cpp (188845 => 188846)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VMEntryScope.cpp        2015-08-23 22:51:28 UTC (rev 188845)
+++ trunk/Source/JavaScriptCore/runtime/VMEntryScope.cpp        2015-08-24 02:07:27 UTC (rev 188846)
</span><span class="lines">@@ -57,9 +57,9 @@
</span><span class="cx"> vm.clearLastException();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void VMEntryScope::setEntryScopeDidPopListener(void* key, EntryScopeDidPopListener listener)
</del><ins>+void VMEntryScope::addDidPopListener(std::function<void ()> listener)
</ins><span class="cx"> {
</span><del>- m_allEntryScopeDidPopListeners.set(key, listener);
</del><ins>+ m_didPopListeners.append(listener);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> VMEntryScope::~VMEntryScope()
</span><span class="lines">@@ -72,8 +72,8 @@
</span><span class="cx">
</span><span class="cx"> m_vm.entryScope = nullptr;
</span><span class="cx">
</span><del>- for (auto& listener : m_allEntryScopeDidPopListeners.values())
- listener(m_vm, m_globalObject);
</del><ins>+ for (auto& listener : m_didPopListeners)
+ listener();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMEntryScopeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VMEntryScope.h (188845 => 188846)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VMEntryScope.h        2015-08-23 22:51:28 UTC (rev 188845)
+++ trunk/Source/JavaScriptCore/runtime/VMEntryScope.h        2015-08-24 02:07:27 UTC (rev 188846)
</span><span class="lines">@@ -27,9 +27,9 @@
</span><span class="cx"> #define VMEntryScope_h
</span><span class="cx">
</span><span class="cx"> #include "Interpreter.h"
</span><del>-#include <wtf/HashMap.h>
</del><span class="cx"> #include <wtf/StackBounds.h>
</span><span class="cx"> #include <wtf/StackStats.h>
</span><ins>+#include <wtf/Vector.h>
</ins><span class="cx">
</span><span class="cx"> namespace JSC {
</span><span class="cx">
</span><span class="lines">@@ -43,13 +43,12 @@
</span><span class="cx">
</span><span class="cx"> JSGlobalObject* globalObject() const { return m_globalObject; }
</span><span class="cx">
</span><del>- typedef std::function<void (VM&, JSGlobalObject*)> EntryScopeDidPopListener;
- void setEntryScopeDidPopListener(void*, EntryScopeDidPopListener);
</del><ins>+ void addDidPopListener(std::function<void ()>);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> VM& m_vm;
</span><span class="cx"> JSGlobalObject* m_globalObject;
</span><del>- HashMap<void*, EntryScopeDidPopListener> m_allEntryScopeDidPopListeners;
</del><ins>+ Vector<std::function<void ()>> m_didPopListeners;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace JSC
</span></span></pre>
</div>
</div>
</body>
</html>