Ignore:
Timestamp:
May 2, 2018, 10:05:50 AM (7 years ago)
Author:
[email protected]
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):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jsc.cpp

    r231194 r231238  
    8383#include <wtf/CommaPrinter.h>
    8484#include <wtf/MainThread.h>
     85#include <wtf/MonotonicTime.h>
    8586#include <wtf/NeverDestroyed.h>
    8687#include <wtf/StringPrintStream.h>
     
    341342static EncodedJSValue JSC_HOST_CALL functionDollarAgentGetReport(ExecState*);
    342343static EncodedJSValue JSC_HOST_CALL functionDollarAgentLeaving(ExecState*);
     344static EncodedJSValue JSC_HOST_CALL functionDollarAgentMonotonicNow(ExecState*);
    343345static EncodedJSValue JSC_HOST_CALL functionWaitForReport(ExecState*);
    344346static EncodedJSValue JSC_HOST_CALL functionHeapCapacity(ExecState*);
     
    596598        addFunction(vm, agent, "getReport", functionDollarAgentGetReport, 0);
    597599        addFunction(vm, agent, "leaving", functionDollarAgentLeaving, 0);
    598        
     600        addFunction(vm, agent, "monotonicNow", functionDollarAgentMonotonicNow, 0);
     601
    599602        addFunction(vm, "waitForReport", functionWaitForReport, 0);
    600603
     
    17471750}
    17481751
     1752EncodedJSValue JSC_HOST_CALL functionDollarAgentMonotonicNow(ExecState*)
     1753{
     1754    return JSValue::encode(jsNumber(MonotonicTime::now().secondsSinceEpoch().milliseconds()));
     1755}
     1756
    17491757EncodedJSValue JSC_HOST_CALL functionWaitForReport(ExecState* exec)
    17501758{
Note: See TracChangeset for help on using the changeset viewer.