Commit a8183a63 authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

[foozzie] Add suppression for Math.pow

Bug: chromium:1063568
Change-Id: I69ae644cc02549eb6c8c3b6169e9b1db2ee4e27e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2144067
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67220}
parent df4df031
......@@ -80,3 +80,12 @@ else {
// Realm.eval is just eval.
assertEquals(1477662728716, Realm.eval(Realm.create(), `Date.now()`));
// Test suppressions when Math.pow is optimized.
function callPow(v) {
return Math.pow(v, -0.5);
}
%PrepareFunctionForOptimization(callPow);
const unoptimized = callPow(6996);
%OptimizeFunctionOnNextCall(callPow);
assertEquals(unoptimized, callPow(6996));
......@@ -21,6 +21,19 @@ var prettyPrinted = function prettyPrinted(msg) { return msg; };
}
})();
// Mock Math.pow. Work around an optimization for -0.5.
(function() {
const origMathPow = Math.pow;
Math.pow = function(a, b) {
if (b === -0.5) {
return 0;
} else {
return origMathPow(a, b);
}
}
})();
// Mock Date.
(function() {
let index = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment