| // Copyright 2016 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 |
| var body = "function f(x) {" + |
| " if (x < 0) return x;" + |
| for (var i = 0; i < size; i++) { |
| // Length must be big enough to make the backing store's size not fit into |
| // a single instruction's immediate field (2^12). |
| %PrepareFunctionForOptimization(f); |
| %OptimizeFunctionOnNextCall(f); |
| // Allocating something else should not disturb |a|. |
| for (var i = 0; i < kLength; i++) { |
| // Allocating more should not crash. |
| for (var i = 0; i < 300; i++) { |