| // Copyright 2019 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 NoStoreBecauseReadonlyLength() { |
| Object.defineProperty(a, 'length', { writable: false }); |
| %PrepareFunctionForOptimization(f); |
| %OptimizeFunctionOnNextCall(f); |
| assertEquals(undefined, a[0]); |
| (function NoStoreBecauseTypedArrayProto() { |
| const arr_proto = [].__proto__; |
| const i32arr = new Int32Array(); |
| arr_proto.__proto__ = i32arr; |
| arr_proto.__proto__ = i32arr; |
| %PrepareFunctionForOptimization(f); |
| %OptimizeFunctionOnNextCall(f); |
| assertEquals(undefined, arr[1024]); |