Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Unified Diff: test/mjsunit/timer.js

Issue 153953005: A64: Synchronize with r16993. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/regress/regress-embedded-cons-string.js ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/timer.js
diff --git a/test/mjsunit/regress/regress-grow-store-smi-check.js b/test/mjsunit/timer.js
similarity index 70%
copy from test/mjsunit/regress/regress-grow-store-smi-check.js
copy to test/mjsunit/timer.js
index 381141d52317c22cf19547a3626280fa2cb1ba9b..0b035501e7642963a20d134df20732ca44a66c44 100644
--- a/test/mjsunit/regress/regress-grow-store-smi-check.js
+++ b/test/mjsunit/timer.js
@@ -27,27 +27,27 @@
// Flags: --allow-natives-syntax
-// The below test function was generated from part of a WebKit layout
-// test library setup routine: fast/canvas/webgl/resources/pnglib.js
+// Tests timer milliseconds granularity.
-function test(crc32) {
- for (var i = 0; i < 256; i++) {
- var c = i;
- for (var j = 0; j < 8; j++) {
- if (c & 1) {
- c = -306674912 ^ ((c >> 1) & 0x7fffffff);
- } else {
- c = (c >> 1) & 0x7fffffff;
- }
+// Don't run this test in gc stress mode. Time differences may be long
+// due to garbage collections.
+%SetFlags("--gc-interval=-1");
+%SetFlags("--nostress-compaction");
+
+(function run() {
+ var start_test = Date.now();
+ // Let the retry run for maximum 100ms to reduce flakiness.
+ for (var start = Date.now(); start - start_test < 100; start = Date.now()) {
+ var end = Date.now();
+ while (end - start == 0) {
+ end = Date.now();
+ }
+ if (end - start == 1) {
+ // Found milliseconds granularity.
+ return;
+ } else {
+ print("Timer difference too big: " + (end - start) + "ms");
}
- crc32[i] = c;
}
-}
-
-var a = [0.5];
-for (var i = 0; i < 256; ++i) a[i] = i;
-
-test([0.5]);
-test(a);
-%OptimizeFunctionOnNextCall(test);
-test(a);
+ assertTrue(false);
+})()
« no previous file with comments | « test/mjsunit/regress/regress-embedded-cons-string.js ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698