summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/mjsunit.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/mjsunit/mjsunit.js')
-rw-r--r--deps/v8/test/mjsunit/mjsunit.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/deps/v8/test/mjsunit/mjsunit.js b/deps/v8/test/mjsunit/mjsunit.js
index 23b846bf7d..144579703a 100644
--- a/deps/v8/test/mjsunit/mjsunit.js
+++ b/deps/v8/test/mjsunit/mjsunit.js
@@ -175,6 +175,7 @@ var V8OptimizationStatus = {
kTopmostFrameIsTurboFanned: 1 << 11,
kLiteMode: 1 << 12,
kMarkedForDeoptimization: 1 << 13,
+ kBaseline: 1 << 14,
};
// Returns true if --lite-mode is on and we can't ever turn on optimization.
@@ -189,6 +190,9 @@ var isAlwaysOptimize;
// Returns true if given function in interpreted.
var isInterpreted;
+// Returns true if given function in baseline.
+var isBaseline;
+
// Returns true if given function is optimized.
var isOptimized;
@@ -676,7 +680,9 @@ var prettyPrinted;
// to stress test the deoptimizer.
return;
}
- assertFalse((opt_status & V8OptimizationStatus.kOptimized) !== 0, name_opt);
+ var is_optimized = (opt_status & V8OptimizationStatus.kOptimized) !== 0;
+ var is_baseline = (opt_status & V8OptimizationStatus.kBaseline) !== 0;
+ assertFalse(is_optimized && !is_baseline, name_opt);
}
assertOptimized = function assertOptimized(
@@ -731,6 +737,14 @@ var prettyPrinted;
(opt_status & V8OptimizationStatus.kInterpreted) !== 0;
}
+ isBaseline = function isBaseline(fun) {
+ var opt_status = OptimizationStatus(fun, "");
+ assertTrue((opt_status & V8OptimizationStatus.kIsFunction) !== 0,
+ "not a function");
+ return (opt_status & V8OptimizationStatus.kOptimized) === 0 &&
+ (opt_status & V8OptimizationStatus.kBaseline) !== 0;
+ }
+
isOptimized = function isOptimized(fun) {
var opt_status = OptimizationStatus(fun, "");
assertTrue((opt_status & V8OptimizationStatus.kIsFunction) !== 0,