Title: [91817] trunk/Source/_javascript_Core
Revision
91817
Author
[email protected]
Date
2011-07-26 19:56:25 -0700 (Tue, 26 Jul 2011)

Log Message

JSC command-line tool does not come with any facility for
measuring time precisely.
https://bugs.webkit.org/show_bug.cgi?id=65223

Patch by Filip Pizlo <[email protected]> on 2011-07-26
Reviewed by Gavin Barraclough.

Exposed WTF::currentTime() as currentTimePrecise().

* jsc.cpp:
(GlobalObject::GlobalObject):
(functionPreciseTime):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (91816 => 91817)


--- trunk/Source/_javascript_Core/ChangeLog	2011-07-27 02:48:04 UTC (rev 91816)
+++ trunk/Source/_javascript_Core/ChangeLog	2011-07-27 02:56:25 UTC (rev 91817)
@@ -1,5 +1,19 @@
 2011-07-26  Filip Pizlo  <[email protected]>
 
+        JSC command-line tool does not come with any facility for
+        measuring time precisely.
+        https://bugs.webkit.org/show_bug.cgi?id=65223
+
+        Reviewed by Gavin Barraclough.
+        
+        Exposed WTF::currentTime() as currentTimePrecise().
+
+        * jsc.cpp:
+        (GlobalObject::GlobalObject):
+        (functionPreciseTime):
+
+2011-07-26  Filip Pizlo  <[email protected]>
+
         DFG speculative JIT never emits inline double comparisons, even when it
         would be obvious more efficient to do so.
         https://bugs.webkit.org/show_bug.cgi?id=65212

Modified: trunk/Source/_javascript_Core/jsc.cpp (91816 => 91817)


--- trunk/Source/_javascript_Core/jsc.cpp	2011-07-27 02:48:04 UTC (rev 91816)
+++ trunk/Source/_javascript_Core/jsc.cpp	2011-07-27 02:56:25 UTC (rev 91817)
@@ -82,6 +82,7 @@
 static EncodedJSValue JSC_HOST_CALL functionLoad(ExecState*);
 static EncodedJSValue JSC_HOST_CALL functionCheckSyntax(ExecState*);
 static EncodedJSValue JSC_HOST_CALL functionReadline(ExecState*);
+static EncodedJSValue JSC_HOST_CALL functionPreciseTime(ExecState*);
 static NO_RETURN_WITH_VALUE EncodedJSValue JSC_HOST_CALL functionQuit(ExecState*);
 
 #if ENABLE(SAMPLING_FLAGS)
@@ -171,6 +172,7 @@
     putDirectFunction(globalExec(), JSFunction::create(globalExec(), this, functionStructure(), 1, Identifier(globalExec(), "load"), functionLoad));
     putDirectFunction(globalExec(), JSFunction::create(globalExec(), this, functionStructure(), 1, Identifier(globalExec(), "checkSyntax"), functionCheckSyntax));
     putDirectFunction(globalExec(), JSFunction::create(globalExec(), this, functionStructure(), 0, Identifier(globalExec(), "readline"), functionReadline));
+    putDirectFunction(globalExec(), JSFunction::create(globalExec(), this, functionStructure(), 0, Identifier(globalExec(), "preciseTime"), functionPreciseTime));
 
 #if ENABLE(SAMPLING_FLAGS)
     putDirectFunction(globalExec(), JSFunction::create(globalExec(), this, functionStructure(), 1, Identifier(globalExec(), "setSamplingFlags"), functionSetSamplingFlags));
@@ -312,6 +314,11 @@
     return JSValue::encode(jsString(exec, line.data()));
 }
 
+EncodedJSValue JSC_HOST_CALL functionPreciseTime(ExecState*)
+{
+    return JSValue::encode(jsNumber(currentTime()));
+}
+
 EncodedJSValue JSC_HOST_CALL functionQuit(ExecState* exec)
 {
     // Technically, destroying the heap in the middle of JS execution is a no-no,
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to