Title: [231238] trunk/Source/_javascript_Core
Revision
231238
Author
[email protected]
Date
2018-05-02 10:05:50 -0700 (Wed, 02 May 2018)

Log Message

Expose "$262.agent.monotonicNow()" for use in testing Atomic operation timeouts
https://bugs.webkit.org/show_bug.cgi?id=185043

Patch by Rick Waldron <[email protected]> on 2018-05-02
Reviewed by Filip Pizlo.

* jsc.cpp:
(GlobalObject::finishCreation):
(functionDollarAgentMonotonicNow):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (231237 => 231238)


--- trunk/Source/_javascript_Core/ChangeLog	2018-05-02 16:49:57 UTC (rev 231237)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-05-02 17:05:50 UTC (rev 231238)
@@ -1,3 +1,14 @@
+2018-05-02  Rick Waldron  <[email protected]>
+
+        Expose "$262.agent.monotonicNow()" for use in testing Atomic operation timeouts
+        https://bugs.webkit.org/show_bug.cgi?id=185043
+
+        Reviewed by Filip Pizlo.
+
+        * jsc.cpp:
+        (GlobalObject::finishCreation):
+        (functionDollarAgentMonotonicNow):
+
 2018-05-02  Dominik Infuehr  <[email protected]>
 
         [ARM] Implement and16 and store16 for MacroAssemblerARMv7

Modified: trunk/Source/_javascript_Core/jsc.cpp (231237 => 231238)


--- trunk/Source/_javascript_Core/jsc.cpp	2018-05-02 16:49:57 UTC (rev 231237)
+++ trunk/Source/_javascript_Core/jsc.cpp	2018-05-02 17:05:50 UTC (rev 231238)
@@ -82,6 +82,7 @@
 #include <type_traits>
 #include <wtf/CommaPrinter.h>
 #include <wtf/MainThread.h>
+#include <wtf/MonotonicTime.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/StringPrintStream.h>
 #include <wtf/WallTime.h>
@@ -340,6 +341,7 @@
 static EncodedJSValue JSC_HOST_CALL functionDollarAgentBroadcast(ExecState*);
 static EncodedJSValue JSC_HOST_CALL functionDollarAgentGetReport(ExecState*);
 static EncodedJSValue JSC_HOST_CALL functionDollarAgentLeaving(ExecState*);
+static EncodedJSValue JSC_HOST_CALL functionDollarAgentMonotonicNow(ExecState*);
 static EncodedJSValue JSC_HOST_CALL functionWaitForReport(ExecState*);
 static EncodedJSValue JSC_HOST_CALL functionHeapCapacity(ExecState*);
 static EncodedJSValue JSC_HOST_CALL functionFlashHeapAccess(ExecState*);
@@ -595,7 +597,8 @@
         addFunction(vm, agent, "broadcast", functionDollarAgentBroadcast, 1);
         addFunction(vm, agent, "getReport", functionDollarAgentGetReport, 0);
         addFunction(vm, agent, "leaving", functionDollarAgentLeaving, 0);
-        
+        addFunction(vm, agent, "monotonicNow", functionDollarAgentMonotonicNow, 0);
+
         addFunction(vm, "waitForReport", functionWaitForReport, 0);
 
         addFunction(vm, "heapCapacity", functionHeapCapacity, 0);
@@ -1746,6 +1749,11 @@
     return JSValue::encode(jsUndefined());
 }
 
+EncodedJSValue JSC_HOST_CALL functionDollarAgentMonotonicNow(ExecState*)
+{
+    return JSValue::encode(jsNumber(MonotonicTime::now().secondsSinceEpoch().milliseconds()));
+}
+
 EncodedJSValue JSC_HOST_CALL functionWaitForReport(ExecState* exec)
 {
     VM& vm = exec->vm();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to