Title: [273641] trunk
Revision
273641
Author
[email protected]
Date
2021-02-28 16:47:26 -0800 (Sun, 28 Feb 2021)

Log Message

[JSC] Add gc and clearKeptObjects to $262
https://bugs.webkit.org/show_bug.cgi?id=222527

Reviewed by Ross Kirsling.

JSTests:

* test262/config.yaml:

Source/_javascript_Core:

Add $262.gc and $262.clearKeptObjects functions. They are required for test262 host-gc-required.
Since all the tests using "host-gc-required" are currently also marked with cleanupSome, we are currently not running them.
But if some more tests are landed in test262 with "host-gc-required", we will run them with these functions.

* jsc.cpp:
(JSC_DEFINE_HOST_FUNCTION):

Modified Paths

Diff

Modified: trunk/JSTests/ChangeLog (273640 => 273641)


--- trunk/JSTests/ChangeLog	2021-03-01 00:13:12 UTC (rev 273640)
+++ trunk/JSTests/ChangeLog	2021-03-01 00:47:26 UTC (rev 273641)
@@ -1,5 +1,14 @@
 2021-02-28  Yusuke Suzuki  <[email protected]>
 
+        [JSC] Add gc and clearKeptObjects to $262
+        https://bugs.webkit.org/show_bug.cgi?id=222527
+
+        Reviewed by Ross Kirsling.
+
+        * test262/config.yaml:
+
+2021-02-28  Yusuke Suzuki  <[email protected]>
+
         [JSC] Update test262 host environments
         https://bugs.webkit.org/show_bug.cgi?id=222525
 

Modified: trunk/JSTests/test262/config.yaml (273640 => 273641)


--- trunk/JSTests/test262/config.yaml	2021-03-01 00:13:12 UTC (rev 273640)
+++ trunk/JSTests/test262/config.yaml	2021-03-01 00:47:26 UTC (rev 273641)
@@ -23,7 +23,6 @@
     - legacy-regexp
 
     - cleanupSome
-    - host-gc-required
   paths:
   files:
     # Slightly different formatting. We should update test262 side.

Modified: trunk/Source/_javascript_Core/ChangeLog (273640 => 273641)


--- trunk/Source/_javascript_Core/ChangeLog	2021-03-01 00:13:12 UTC (rev 273640)
+++ trunk/Source/_javascript_Core/ChangeLog	2021-03-01 00:47:26 UTC (rev 273641)
@@ -1,5 +1,19 @@
 2021-02-28  Yusuke Suzuki  <[email protected]>
 
+        [JSC] Add gc and clearKeptObjects to $262
+        https://bugs.webkit.org/show_bug.cgi?id=222527
+
+        Reviewed by Ross Kirsling.
+
+        Add $262.gc and $262.clearKeptObjects functions. They are required for test262 host-gc-required.
+        Since all the tests using "host-gc-required" are currently also marked with cleanupSome, we are currently not running them.
+        But if some more tests are landed in test262 with "host-gc-required", we will run them with these functions.
+
+        * jsc.cpp:
+        (JSC_DEFINE_HOST_FUNCTION):
+
+2021-02-28  Yusuke Suzuki  <[email protected]>
+
         [JSC] Update test262 host environments
         https://bugs.webkit.org/show_bug.cgi?id=222525
 

Modified: trunk/Source/_javascript_Core/jsc.cpp (273640 => 273641)


--- trunk/Source/_javascript_Core/jsc.cpp	2021-03-01 00:13:12 UTC (rev 273640)
+++ trunk/Source/_javascript_Core/jsc.cpp	2021-03-01 00:47:26 UTC (rev 273641)
@@ -351,6 +351,8 @@
 static JSC_DECLARE_HOST_FUNCTION(functionCallerSourceOrigin);
 static JSC_DECLARE_HOST_FUNCTION(functionDollarCreateRealm);
 static JSC_DECLARE_HOST_FUNCTION(functionDollarEvalScript);
+static JSC_DECLARE_HOST_FUNCTION(functionDollarGC);
+static JSC_DECLARE_HOST_FUNCTION(functionDollarClearKeptObjects);
 static JSC_DECLARE_HOST_FUNCTION(functionDollarAgentStart);
 static JSC_DECLARE_HOST_FUNCTION(functionDollarAgentReceiveBroadcast);
 static JSC_DECLARE_HOST_FUNCTION(functionDollarAgentReport);
@@ -628,6 +630,8 @@
         addFunction(vm, dollar, "createRealm", functionDollarCreateRealm, 0);
         addFunction(vm, dollar, "detachArrayBuffer", functionTransferArrayBuffer, 1);
         addFunction(vm, dollar, "evalScript", functionDollarEvalScript, 1);
+        addFunction(vm, dollar, "gc", functionDollarGC, 0);
+        addFunction(vm, dollar, "clearKeptObjects", functionDollarClearKeptObjects, 0);
         
         dollar->putDirect(vm, Identifier::fromString(vm, "global"), globalThis(), DontEnum);
         dollar->putDirectCustomAccessor(vm, Identifier::fromString(vm, "IsHTMLDDA"),
@@ -1921,6 +1925,20 @@
     return JSValue::encode(result);
 }
 
+JSC_DEFINE_HOST_FUNCTION(functionDollarGC, (JSGlobalObject* globalObject, CallFrame*))
+{
+    VM& vm = globalObject->vm();
+    vm.heap.collectNow(Sync, CollectionScope::Full);
+    return JSValue::encode(jsUndefined());
+}
+
+JSC_DEFINE_HOST_FUNCTION(functionDollarClearKeptObjects, (JSGlobalObject* globalObject, CallFrame*))
+{
+    VM& vm = globalObject->vm();
+    vm.finalizeSynchronousJSExecution();
+    return JSValue::encode(jsUndefined());
+}
+
 JSC_DEFINE_HOST_FUNCTION(functionDollarAgentStart, (JSGlobalObject* globalObject, CallFrame* callFrame))
 {
     VM& vm = globalObject->vm();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to