There is no definition for HArgumentsObject, so LDummyUse confuses the register alloc...
authorjarin@chromium.org <jarin@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 11 Apr 2014 06:29:51 +0000 (06:29 +0000)
committerjarin@chromium.org <jarin@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 11 Apr 2014 06:29:51 +0000 (06:29 +0000)
BUG=
R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/226613007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20663 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/hydrogen-instructions.cc
test/mjsunit/regress/regress-no-dummy-use-for-arguments-object.js [new file with mode: 0644]

index 4f728c6..1db86e8 100644 (file)
@@ -509,6 +509,7 @@ bool HValue::CanReplaceWithDummyUses() {
       !(block()->IsReachable() ||
         IsBlockEntry() ||
         IsControlInstruction() ||
+        IsArgumentsObject() ||
         IsCapturedObject() ||
         IsSimulate() ||
         IsEnterInlined() ||
diff --git a/test/mjsunit/regress/regress-no-dummy-use-for-arguments-object.js b/test/mjsunit/regress/regress-no-dummy-use-for-arguments-object.js
new file mode 100644 (file)
index 0000000..658d776
--- /dev/null
@@ -0,0 +1,21 @@
+// Copyright 2014 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 g() {
+  arguments.length;
+}
+
+var global = "";
+
+function f() {
+  global.dummy = this;
+  g({});
+}
+
+f();
+f();
+%OptimizeFunctionOnNextCall(f);
+f();