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

Unified Diff: test/mjsunit/mjsunit.js

Issue 19807002: Turn on parallel recompilation for tests that assert optimization status. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix small details. no logic change. Created 7 years, 5 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/math-floor-of-div-minus-zero.js ('k') | test/mjsunit/never-optimize.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/mjsunit.js
diff --git a/test/mjsunit/mjsunit.js b/test/mjsunit/mjsunit.js
index 25d7c004326ce3df03ebe83edb2f0becd5336bba..83449cc1e692e8d0754e49ac8d4122ea39662186 100644
--- a/test/mjsunit/mjsunit.js
+++ b/test/mjsunit/mjsunit.js
@@ -99,6 +99,14 @@ var assertInstanceof;
// Assert that this code is never executed (i.e., always fails if executed).
var assertUnreachable;
+// Assert that the function code is (not) optimized. If "no sync" is passed
+// as second argument, we do not wait for the parallel optimization thread to
+// finish when polling for optimization status.
+// Only works with --allow-natives-syntax.
+var assertOptimized;
+var assertUnoptimized;
+
+
(function () { // Scope for utility functions.
function classOf(object) {
@@ -353,5 +361,26 @@ var assertUnreachable;
throw new MjsUnitAssertionError(message);
};
+
+ var OptimizationStatus;
+ try {
+ OptimizationStatus =
+ new Function("fun", "sync", "return %GetOptimizationStatus(fun, sync);");
+ } catch (e) {
+ OptimizationStatus = function() {
+ throw new Error("natives syntax not allowed");
+ }
+ }
+
+ assertUnoptimized = function assertUnoptimized(fun, sync_opt, name_opt) {
+ if (sync_opt === undefined) sync_opt = "";
+ assertTrue(OptimizationStatus(fun, sync_opt) != 1, name_opt);
+ }
+
+ assertOptimized = function assertOptimized(fun, sync_opt, name_opt) {
+ if (sync_opt === undefined) sync_opt = "";
+ assertTrue(OptimizationStatus(fun, sync_opt) != 2, name_opt);
+ }
+
})();
« no previous file with comments | « test/mjsunit/math-floor-of-div-minus-zero.js ('k') | test/mjsunit/never-optimize.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698