blob: 1bd3f0b1f0ccab43a6103715f69e69fa409d51b3 [file] [log] [blame]
Ben Murdoch61f157c2016-09-16 13:49:30 +01001// Copyright 2016 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Flags: --allow-natives-syntax
6
7function f() {
8 var arguments_ = arguments;
9 if (undefined) {
10 while (true) {
11 arguments_[0];
12 }
13 } else {
14 %DeoptimizeNow();
15 return arguments_[0];
16 }
17};
18
19f(0);
20f(0);
21%OptimizeFunctionOnNextCall(f);
22assertEquals(1, f(1));
23
24function g() {
25 var a = arguments;
26 %DeoptimizeNow();
27 return a.length;
28}
29
30g(1);
31g(1);
32%OptimizeFunctionOnNextCall(g);
33assertEquals(1, g(1));