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

Unified Diff: test/mjsunit/mjsunit.js

Issue 2655223003: Revert of [tests] Make assertOptimized()/assertUnoptimized() great again. (Closed)
Patch Set: Created 3 years, 11 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/keyed-load-with-symbol-key.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 435b5c7543600b2524a330ca6dd536aacb4d01b1..88d4d3677c4edc84fc2e9128737083cb246a64bb 100644
--- a/test/mjsunit/mjsunit.js
+++ b/test/mjsunit/mjsunit.js
@@ -119,38 +119,6 @@
// Assert that a string matches a given regex.
var assertMatches;
-
-// These bits must be in sync with bits defined in Runtime_GetOptimizationStatus
-var V8OptimizationStatus = {
- kIsFunction: 1 << 0,
- kNeverOptimize: 1 << 1,
- kAlwaysOptimize: 1 << 2,
- kMaybeDeopted: 1 << 3,
- kOptimized: 1 << 4,
- kTurboFanned: 1 << 5,
- kInterpreted: 1 << 6
-};
-
-// Returns true if --no-crankshaft mode is on.
-var isNeverOptimize;
-
-// Returns true if --always-opt mode is on.
-var isAlwaysOptimize;
-
-// Returns true if given function in interpreted.
-var isInterpreted;
-
-// Returns true if given function is compiled by a base-line compiler.
-var isBaselined;
-
-// Returns true if given function is optimized.
-var isOptimized;
-
-// Returns true if given function is compiled by Crankshaft.
-var isCrankshafted;
-
-// Returns true if given function is compiled by TurboFan.
-var isTurboFanned;
(function () { // Scope for utility functions.
@@ -494,72 +462,12 @@
assertUnoptimized = function assertUnoptimized(fun, sync_opt, name_opt) {
if (sync_opt === undefined) sync_opt = "";
- var opt_status = OptimizationStatus(fun, sync_opt);
- assertTrue((opt_status & V8OptimizationStatus.kIsFunction) !== 0, name_opt);
- assertFalse((opt_status & V8OptimizationStatus.kOptimized) !== 0, name_opt);
+ assertTrue(OptimizationStatus(fun, sync_opt) !== 1, name_opt);
}
assertOptimized = function assertOptimized(fun, sync_opt, name_opt) {
if (sync_opt === undefined) sync_opt = "";
- var opt_status = OptimizationStatus(fun, sync_opt);
- assertTrue((opt_status & V8OptimizationStatus.kIsFunction) !== 0, name_opt);
- if ((opt_status & V8OptimizationStatus.kNeverOptimize) !== 0) {
- // TODO(ishell): every test that calls %OptimizeFunctionOnNextCall()
- // does not make sense when --no-crankshaft option is provided.
- return;
- }
- assertTrue((opt_status & V8OptimizationStatus.kOptimized) !== 0, name_opt);
- }
-
- isNeverOptimize = function isNeverOptimize() {
- var opt_status = OptimizationStatus(undefined, "");
- return (opt_status & V8OptimizationStatus.kNeverOptimize) !== 0;
- }
-
- isAlwaysOptimize = function isAlwaysOptimize() {
- var opt_status = OptimizationStatus(undefined, "");
- return (opt_status & V8OptimizationStatus.kAlwaysOptimize) !== 0;
- }
-
- isInterpreted = function isInterpreted(fun) {
- var opt_status = OptimizationStatus(fun, "");
- assertTrue((opt_status & V8OptimizationStatus.kIsFunction) !== 0,
- "not a function");
- return (opt_status & V8OptimizationStatus.kOptimized) === 0 &&
- (opt_status & V8OptimizationStatus.kInterpreted) !== 0;
- }
-
- // NOTE: This predicate also returns true for functions that have never
- // been compiled (i.e. that have LazyCompile stub as a code).
- isBaselined = function isBaselined(fun) {
- var opt_status = OptimizationStatus(fun, "");
- assertTrue((opt_status & V8OptimizationStatus.kIsFunction) !== 0,
- "not a function");
- return (opt_status & V8OptimizationStatus.kOptimized) === 0 &&
- (opt_status & V8OptimizationStatus.kInterpreted) === 0;
- }
-
- isOptimized = function isOptimized(fun) {
- var opt_status = OptimizationStatus(fun, "");
- assertTrue((opt_status & V8OptimizationStatus.kIsFunction) !== 0,
- "not a function");
- return (opt_status & V8OptimizationStatus.kOptimized) !== 0;
- }
-
- isCrankshafted = function isCrankshafted(fun) {
- var opt_status = OptimizationStatus(fun, "");
- assertTrue((opt_status & V8OptimizationStatus.kIsFunction) !== 0,
- "not a function");
- return (opt_status & V8OptimizationStatus.kOptimized) !== 0 &&
- (opt_status & V8OptimizationStatus.kTurboFanned) === 0;
- }
-
- isTurboFanned = function isTurboFanned(fun) {
- var opt_status = OptimizationStatus(fun, "");
- assertTrue((opt_status & V8OptimizationStatus.kIsFunction) !== 0,
- "not a function");
- return (opt_status & V8OptimizationStatus.kOptimized) !== 0 &&
- (opt_status & V8OptimizationStatus.kTurboFanned) !== 0;
+ assertTrue(OptimizationStatus(fun, sync_opt) !== 2, name_opt);
}
})();
« no previous file with comments | « test/mjsunit/keyed-load-with-symbol-key.js ('k') | test/mjsunit/never-optimize.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698