v8/test/mjsunit/regress/regress-v8-5848.js

18 lines
558 B
JavaScript
Raw Normal View History

Reland^2 "[builtins] [turbofan] Refactor Float64Pow to use single implementation" This is a reland of d7def9003df0e30f8a3eed2594f5101dac7e2b5a Original change's description: > Reland "[builtins] [turbofan] Refactor Float64Pow to use single implementation" > > This is a reland of I968a08cef6a6d49350aa79185b2c6fb856d15f23 > > Original change's description: > > [builtins] [turbofan] Refactor Float64Pow to use single implementation > > > > Remove platform-specific Float64Pow implementations and utils Pow in > > favor of a base::ieee754::pow implementation. > > > > This unifies the implementation of pow for the compiler, wasm, and > > runtime. > > > > Bug: v8:5848, v8:5086 > > Change-Id: I968a08cef6a6d49350aa79185b2c6fb856d15f23 > > Reviewed-on: https://chromium-review.googlesource.com/c/1403018 > > Commit-Queue: Clemens Hammacher <clemensh@chromium.org> > > Reviewed-by: Clemens Hammacher <clemensh@chromium.org> > > Reviewed-by: Georg Neis <neis@chromium.org> > > Reviewed-by: Yang Guo <yangguo@chromium.org> > > Reviewed-by: Jaroslav Sevcik <jarin@chromium.org> > > Cr-Commit-Position: refs/heads/master@{#59229} > > Bug: v8:5848, v8:5086 > Change-Id: I92f22ae03adafd9ad042e8d4bb406cbd5b5fb51e > Cq-Include-Trybots: luci.chromium.try:linux_chromium_ubsan_rel_ng > Reviewed-on: https://chromium-review.googlesource.com/c/1447854 > Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> > Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> > Reviewed-by: Clemens Hammacher <clemensh@chromium.org> > Reviewed-by: Georg Neis <neis@chromium.org> > Cr-Commit-Position: refs/heads/master@{#59411} Tbr: neis@chromium.org, bmeurer@chromium.org, jkummerow@chromium.org Bug: v8:5848, v8:5086 Change-Id: I42972b29b8830ed47a00b2b1d408d3005a810c0e Cq-Include-Trybots: luci.chromium.try:linux_chromium_ubsan_rel_ng Cq-Include-Trybots: luci.v8.try:v8_linux64_ubsan_rel_ng Reviewed-on: https://chromium-review.googlesource.com/c/1456302 Reviewed-by: Clemens Hammacher <clemensh@chromium.org> Commit-Queue: Clemens Hammacher <clemensh@chromium.org> Cr-Commit-Position: refs/heads/master@{#59454}
2019-02-08 00:32:59 +00:00
// Copyright 2018 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
const inlineFromParser = 50 ** 50;
const i = 50;
const fromRuntimePowOp = i ** i;
const fromRuntimeMath = Math.pow(i, i);
// inlineFromParser === fromRuntimeOp === fromRuntimeMath
assertEquals(inlineFromParser, fromRuntimePowOp);
assertEquals(inlineFromParser - fromRuntimePowOp, 0);
assertEquals(inlineFromParser, fromRuntimeMath);
assertEquals(inlineFromParser - fromRuntimeMath, 0);