Reviewers: Michael Starzinger,

Description:
Do not generate LDummyUse instruction for HCapturedObject

LDummyUse confuses the register allocator (since there is no definition
for the use).

[email protected]
BUG=

Please review this at https://codereview.chromium.org/222283002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+13, -3 lines):
  M src/hydrogen-instructions.cc
  A + test/mjsunit/regress/regress-captured-object-no-dummy-use.js


Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index 84dcb18248e113bad54db2d9dc60a403856e996c..daca55a356e3eb3d66601f31d27f1a4c636087d5 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -509,6 +509,7 @@ bool HValue::CanReplaceWithDummyUses() {
       !(block()->IsReachable() ||
         IsBlockEntry() ||
         IsControlInstruction() ||
+        IsCapturedObject() ||
         IsSimulate() ||
         IsEnterInlined() ||
         IsLeaveInlined());
Index: test/mjsunit/regress/regress-captured-object-no-dummy-use.js
diff --git a/test/mjsunit/neuter-twice.js b/test/mjsunit/regress/regress-captured-object-no-dummy-use.js
similarity index 51%
copy from test/mjsunit/neuter-twice.js
copy to test/mjsunit/regress/regress-captured-object-no-dummy-use.js
index 3501cee4330f966c1eeaf6f5b7ebdc6418f2bcec..cdf548d5fa6790a41237c9108a18731fc7e7b04d 100644
--- a/test/mjsunit/neuter-twice.js
+++ b/test/mjsunit/regress/regress-captured-object-no-dummy-use.js
@@ -4,6 +4,15 @@
 //
 // Flags: --allow-natives-syntax

-var ab = new ArrayBuffer(100);
-%ArrayBufferNeuter(ab);
-%ArrayBufferNeuter(ab);
+var global = "10.1";
+function f() { }
+function g(a) { this.d = a; }
+function h() {
+  var x = new f();
+  global.dummy = this;
+  var y = new g(x);
+}
+h();
+h();
+%OptimizeFunctionOnNextCall(h);
+h();


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to