v8/test/mjsunit/regress/regress-crbug-774459.js
Benedikt Meurer 49e87d2fea [turbofan] Re-enable FindOrderedHashMapEntryForInt32Key optimization.
This optimization was disabled because 32-bit builds didn't properly
find certain integer keys in maps anymore. The reason was that the
runtime wasn't using ComputeIntegerHash for the full Signed32 range,
but only for the SignedSmall range.

This change improves the ARES-6 Basic test by around 6-7% on the steady
state.

Bug: chromium:77459, v8:6410, v8:6354, v8:6278, v8:6344
Change-Id: Ifae64e6b23ca8acee4c792be299f64caf951242f
Reviewed-on: https://chromium-review.googlesource.com/737871
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48905}
2017-10-25 09:36:56 +00:00

21 lines
473 B
JavaScript

// Copyright 2017 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.
// Flags: --allow-natives-syntax
(function() {
const m = new Map();
const k = Math.pow(2, 31) - 1;
m.set(k, 1);
function foo(m, k) {
return m.get(k | 0);
}
assertEquals(1, foo(m, k));
assertEquals(1, foo(m, k));
%OptimizeFunctionOnNextCall(foo);
assertEquals(1, foo(m, k));
})();