2023-10-05 08:46:07 +02:00
|
|
|
// Copyright 2023 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.
|
2024-06-23 23:31:33 +01:00
|
|
|
|
|
|
|
// Flags: --allow-natives-syntax
|
2023-10-05 08:46:07 +02:00
|
|
|
|
|
|
|
const ab = new ArrayBuffer(100, {maxByteLength: 200});
|
|
|
|
var dv = new DataView(ab, 0, 8); // "var" is important
|
|
|
|
|
|
|
|
function foo() {
|
|
|
|
return dv.getInt8(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
%PrepareFunctionForOptimization(foo);
|
|
|
|
foo();
|
|
|
|
|
|
|
|
%OptimizeFunctionOnNextCall(foo);
|
|
|
|
foo();
|
|
|
|
|
|
|
|
ab.resize(0);
|
|
|
|
|
|
|
|
try {
|
|
|
|
foo();
|
|
|
|
} catch {
|
|
|
|
}
|