2d856544e5
Ensure source map is not stable if elements kind transitions are expected. BUG=chromium:700733 Change-Id: Ie937e7064127250b1100109986c3e9b411fae1d6 Reviewed-on: https://chromium-review.googlesource.com/483442 Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Igor Sheludko <ishell@chromium.org> Cr-Commit-Position: refs/heads/master@{#44780}
67 lines
1.3 KiB
JavaScript
67 lines
1.3 KiB
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 --verify-heap --expose-gc
|
|
|
|
(function test_keyed_load() {
|
|
var smi_arr = [0];
|
|
smi_arr.load = 42;
|
|
|
|
var double_arr = [0.5];
|
|
double_arr.load = 42;
|
|
|
|
var obj_arr = [{}];
|
|
obj_arr.load = 42;
|
|
|
|
var arrs = [smi_arr, double_arr, obj_arr];
|
|
|
|
var tmp;
|
|
function do_keyed_load(arrs) {
|
|
for (var i = 0; i < arrs.length; i++) {
|
|
var arr = arrs[i];
|
|
tmp = arr[0];
|
|
}
|
|
}
|
|
|
|
var obj = {};
|
|
obj.load_boom = smi_arr;
|
|
|
|
do_keyed_load(arrs);
|
|
do_keyed_load(arrs);
|
|
%OptimizeFunctionOnNextCall(do_keyed_load);
|
|
do_keyed_load(arrs);
|
|
|
|
gc();
|
|
})();
|
|
|
|
(function test_keyed_store() {
|
|
var smi_arr = [0];
|
|
smi_arr.store = 42;
|
|
|
|
var double_arr = [0.5];
|
|
double_arr.store = 42;
|
|
|
|
var obj_arr = [{}];
|
|
obj_arr.store = 42;
|
|
|
|
var arrs = [smi_arr, double_arr, obj_arr];
|
|
|
|
function do_keyed_store(arrs) {
|
|
for (var i = 0; i < arrs.length; i++) {
|
|
var arr = arrs[i];
|
|
arr[0] = 0;
|
|
}
|
|
}
|
|
|
|
var obj = {};
|
|
obj.store_boom = smi_arr;
|
|
|
|
do_keyed_store(arrs);
|
|
do_keyed_store(arrs);
|
|
%OptimizeFunctionOnNextCall(do_keyed_store);
|
|
do_keyed_store(arrs);
|
|
|
|
gc();
|
|
})();
|