v8/test/mjsunit/compiler/regress-1177368.js
Mike Stanton 3393378b3b [compiler] Create canonical handles in JSTypedArrayRef::buffer()
Bug: chromium:1177368, chromium:1177369, v8:7790
Change-Id: Ice0b1b3fbc0b15d2b0b80255b7bb4a8c61f855e3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2692246
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72702}
2021-02-12 14:52:35 +00:00

21 lines
484 B
JavaScript

// Copyright 2021 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
let __v_20 = new Int32Array();
__v_20.set({
get length() {
%ArrayBufferDetach(__v_20.buffer);
}
});
function bar() { return array[0]; }
var array = new Float32Array(1000);
%PrepareFunctionForOptimization(bar);
bar();
bar();
%OptimizeFunctionOnNextCall(bar);
bar();