Title: [222186] trunk/Source/_javascript_Core
Revision
222186
Author
[email protected]
Date
2017-09-18 15:41:04 -0700 (Mon, 18 Sep 2017)

Log Message

ErrorInstance and Exception need destroy methods
https://bugs.webkit.org/show_bug.cgi?id=177095

Reviewed by Saam Barati.
        
When I made ErrorInstance and Exception into JSDestructibleObjects, I forgot to make them
follow that type's protocol.

* runtime/ErrorInstance.cpp:
(JSC::ErrorInstance::destroy): Implement this to fix leaks.
* runtime/ErrorInstance.h:
* runtime/Exception.h: Change how this is declared now that this is a DestructibleObject.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (222185 => 222186)


--- trunk/Source/_javascript_Core/ChangeLog	2017-09-18 22:39:30 UTC (rev 222185)
+++ trunk/Source/_javascript_Core/ChangeLog	2017-09-18 22:41:04 UTC (rev 222186)
@@ -1,3 +1,18 @@
+2017-09-18  Filip Pizlo  <[email protected]>
+
+        ErrorInstance and Exception need destroy methods
+        https://bugs.webkit.org/show_bug.cgi?id=177095
+
+        Reviewed by Saam Barati.
+        
+        When I made ErrorInstance and Exception into JSDestructibleObjects, I forgot to make them
+        follow that type's protocol.
+
+        * runtime/ErrorInstance.cpp:
+        (JSC::ErrorInstance::destroy): Implement this to fix leaks.
+        * runtime/ErrorInstance.h:
+        * runtime/Exception.h: Change how this is declared now that this is a DestructibleObject.
+
 2017-09-18  Yusuke Suzuki  <[email protected]>
 
         [JSC] Consider dropping JSObjectSetPrototype feature for JSGlobalObject

Modified: trunk/Source/_javascript_Core/runtime/ErrorInstance.cpp (222185 => 222186)


--- trunk/Source/_javascript_Core/runtime/ErrorInstance.cpp	2017-09-18 22:39:30 UTC (rev 222185)
+++ trunk/Source/_javascript_Core/runtime/ErrorInstance.cpp	2017-09-18 22:41:04 UTC (rev 222186)
@@ -127,6 +127,11 @@
     }
 }
 
+void ErrorInstance::destroy(JSCell* cell)
+{
+    static_cast<ErrorInstance*>(cell)->ErrorInstance::~ErrorInstance();
+}
+
 // Based on ErrorPrototype's errorProtoFuncToString(), but is modified to
 // have no observable side effects to the user (i.e. does not call proxies,
 // and getters).

Modified: trunk/Source/_javascript_Core/runtime/ErrorInstance.h (222185 => 222186)


--- trunk/Source/_javascript_Core/runtime/ErrorInstance.h	2017-09-18 22:39:30 UTC (rev 222185)
+++ trunk/Source/_javascript_Core/runtime/ErrorInstance.h	2017-09-18 22:41:04 UTC (rev 222186)
@@ -76,6 +76,7 @@
     explicit ErrorInstance(VM&, Structure*);
 
     void finishCreation(ExecState*, VM&, const String&, bool useCurrentFrame = true);
+    static void destroy(JSCell*);
 
     static void visitChildren(JSCell*, SlotVisitor&);
 

Modified: trunk/Source/_javascript_Core/runtime/Exception.h (222185 => 222186)


--- trunk/Source/_javascript_Core/runtime/Exception.h	2017-09-18 22:39:30 UTC (rev 222185)
+++ trunk/Source/_javascript_Core/runtime/Exception.h	2017-09-18 22:41:04 UTC (rev 222186)
@@ -42,9 +42,6 @@
     };
     JS_EXPORT_PRIVATE static Exception* create(VM&, JSValue thrownValue, StackCaptureAction = CaptureStack);
 
-    static const bool needsDestruction = true;
-    static void destroy(JSCell*);
-
     static Structure* createStructure(VM&, JSGlobalObject*, JSValue prototype);
 
     static void visitChildren(JSCell*, SlotVisitor&);
@@ -67,6 +64,7 @@
 private:
     Exception(VM&);
     void finishCreation(VM&, JSValue thrownValue, StackCaptureAction);
+    static void destroy(JSCell*);
 
     WriteBarrier<Unknown> m_value;
     Vector<StackFrame> m_stack;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to