v8/test/mjsunit/regress/regress-612146.js
jarin 0d4c526a1d [crankshaft] Reland "Only exclude explicit 'arguments' (and 'this') from liveness analysis."
Reland of https://codereview.chromium.org/2026173003 (reverted by
https://codereview.chromium.org/2029563002).

Additionally, we need to record environment markers even for the
case of a.length, where a is aliased arguments (which crankshaft
optimizes to constant for the inlined case or to HArgumentsLength
when not inlined).

BUG=chromium:612146

Review-Url: https://codereview.chromium.org/2028243002
Cr-Commit-Position: refs/heads/master@{#36662}
2016-06-02 04:30:17 +00:00

34 lines
598 B
JavaScript

// 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
function f() {
var arguments_ = arguments;
if (undefined) {
while (true) {
arguments_[0];
}
} else {
%DeoptimizeNow();
return arguments_[0];
}
};
f(0);
f(0);
%OptimizeFunctionOnNextCall(f);
assertEquals(1, f(1));
function g() {
var a = arguments;
%DeoptimizeNow();
return a.length;
}
g(1);
g(1);
%OptimizeFunctionOnNextCall(g);
assertEquals(1, g(1));