Title: [218619] trunk/Source/_javascript_Core
Revision
218619
Author
[email protected]
Date
2017-06-20 17:32:25 -0700 (Tue, 20 Jun 2017)

Log Message

Fix leak of ModuleInformations in BBQPlan constructors.
https://bugs.webkit.org/show_bug.cgi?id=173577

Reviewed by Saam Barati.

This patch fixes a leak in the BBQPlan constructiors. Previously,
the plans were calling makeRef on the newly constructed objects.
This patch fixes the issue and uses adoptRef instead. Additionally,
an old, incorrect, attempt to fix the leak is removed.

* inspector/remote/cocoa/RemoteInspectorXPCConnection.mm:
(Inspector::RemoteInspectorXPCConnection::RemoteInspectorXPCConnection):
* jit/JITWorklist.cpp:
(JSC::JITWorklist::Thread::Thread):
* runtime/PromiseDeferredTimer.cpp:
(JSC::PromiseDeferredTimer::addPendingPromise):
* runtime/VM.cpp:
(JSC::VM::VM):
* wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::BBQPlan):
* wasm/WasmPlan.cpp:
(JSC::Wasm::Plan::Plan):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (218618 => 218619)


--- trunk/Source/_javascript_Core/ChangeLog	2017-06-21 00:07:41 UTC (rev 218618)
+++ trunk/Source/_javascript_Core/ChangeLog	2017-06-21 00:32:25 UTC (rev 218619)
@@ -1,3 +1,28 @@
+2017-06-20  Keith Miller  <[email protected]>
+
+        Fix leak of ModuleInformations in BBQPlan constructors.
+        https://bugs.webkit.org/show_bug.cgi?id=173577
+
+        Reviewed by Saam Barati.
+
+        This patch fixes a leak in the BBQPlan constructiors. Previously,
+        the plans were calling makeRef on the newly constructed objects.
+        This patch fixes the issue and uses adoptRef instead. Additionally,
+        an old, incorrect, attempt to fix the leak is removed.
+
+        * inspector/remote/cocoa/RemoteInspectorXPCConnection.mm:
+        (Inspector::RemoteInspectorXPCConnection::RemoteInspectorXPCConnection):
+        * jit/JITWorklist.cpp:
+        (JSC::JITWorklist::Thread::Thread):
+        * runtime/PromiseDeferredTimer.cpp:
+        (JSC::PromiseDeferredTimer::addPendingPromise):
+        * runtime/VM.cpp:
+        (JSC::VM::VM):
+        * wasm/WasmBBQPlan.cpp:
+        (JSC::Wasm::BBQPlan::BBQPlan):
+        * wasm/WasmPlan.cpp:
+        (JSC::Wasm::Plan::Plan):
+
 2017-06-20  Devin Rousso  <[email protected]>
 
         Web Inspector: Send context attributes for tracked canvases

Modified: trunk/Source/_javascript_Core/runtime/PromiseDeferredTimer.cpp (218618 => 218619)


--- trunk/Source/_javascript_Core/runtime/PromiseDeferredTimer.cpp	2017-06-21 00:07:41 UTC (rev 218618)
+++ trunk/Source/_javascript_Core/runtime/PromiseDeferredTimer.cpp	2017-06-21 00:32:25 UTC (rev 218619)
@@ -109,10 +109,8 @@
         dependencies.append(Strong<JSCell>(*m_vm, ticket));
         result.iterator->value = WTFMove(dependencies);
     } else {
-        // We need to make sure we move dependencies into a non-reference type so we actually destruct it.
-        Vector<Strong<JSCell>> deps = WTFMove(dependencies);
         dataLogLnIf(verbose, "Adding new dependencies for promise: ", RawPointer(ticket));
-        result.iterator->value.appendVector(deps);
+        result.iterator->value.appendVector(dependencies);
     }
 
 #ifndef NDEBUG

Modified: trunk/Source/_javascript_Core/wasm/WasmBBQPlan.cpp (218618 => 218619)


--- trunk/Source/_javascript_Core/wasm/WasmBBQPlan.cpp	2017-06-21 00:07:41 UTC (rev 218618)
+++ trunk/Source/_javascript_Core/wasm/WasmBBQPlan.cpp	2017-06-21 00:32:25 UTC (rev 218619)
@@ -59,7 +59,7 @@
 }
 
 BBQPlan::BBQPlan(VM* vm, Vector<uint8_t>&& source, AsyncWork work, CompletionTask&& task)
-    : BBQPlan(vm, makeRef(*new ModuleInformation(WTFMove(source))), work, WTFMove(task))
+    : BBQPlan(vm, adoptRef(*new ModuleInformation(WTFMove(source))), work, WTFMove(task))
 {
     m_state = State::Initial;
 }

Modified: trunk/Source/_javascript_Core/wasm/WasmPlan.cpp (218618 => 218619)


--- trunk/Source/_javascript_Core/wasm/WasmPlan.cpp	2017-06-21 00:07:41 UTC (rev 218618)
+++ trunk/Source/_javascript_Core/wasm/WasmPlan.cpp	2017-06-21 00:32:25 UTC (rev 218619)
@@ -59,7 +59,7 @@
 }
 
 Plan::Plan(VM* vm, const uint8_t* source, size_t sourceLength, CompletionTask&& task)
-    : m_moduleInformation(makeRef(*new ModuleInformation(Vector<uint8_t>())))
+    : m_moduleInformation(adoptRef(*new ModuleInformation(Vector<uint8_t>())))
     , m_source(source)
     , m_sourceLength(sourceLength)
 {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to