Reviewers: Michael Achenbach,

Description:
Version 3.26.31.1 (merged r21196)

Fix index register assignment in LoadFieldByIndex for arm, arm64, and mips.

BUG=368243
LOG=N
[email protected]

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

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

Affected files (+20, -15 lines):
  M src/arm/lithium-arm.cc
  M src/arm64/lithium-arm64.cc
  M src/mips/lithium-mips.cc
  M src/version.cc
  A + test/mjsunit/regress/regress-368243.js


Index: src/arm/lithium-arm.cc
diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc
index 0c10a65c217f7841fa70c5ba780ec84bc633a787..c9201a80708139b6b4c2922c0a09945cd9bdcf92 100644
--- a/src/arm/lithium-arm.cc
+++ b/src/arm/lithium-arm.cc
@@ -2556,7 +2556,7 @@ LInstruction* LChunkBuilder::DoCheckMapValue(HCheckMapValue* instr) {

 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
   LOperand* object = UseRegister(instr->object());
-  LOperand* index = UseRegister(instr->index());
+  LOperand* index = UseTempRegister(instr->index());
   LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index);
   LInstruction* result = DefineSameAsFirst(load);
   return AssignPointerMap(result);
Index: src/arm64/lithium-arm64.cc
diff --git a/src/arm64/lithium-arm64.cc b/src/arm64/lithium-arm64.cc
index d31750df27a0212059cccc8ef568ade439f00826..3eb2778764796335a88dd7b28ddd998339006cde 100644
--- a/src/arm64/lithium-arm64.cc
+++ b/src/arm64/lithium-arm64.cc
@@ -2545,7 +2545,7 @@ LInstruction* LChunkBuilder::DoCheckMapValue(HCheckMapValue* instr) {

 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
   LOperand* object = UseRegisterAtStart(instr->object());
-  LOperand* index = UseRegister(instr->index());
+  LOperand* index = UseRegisterAndClobber(instr->index());
   LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index);
   LInstruction* result = DefineSameAsFirst(load);
   return AssignPointerMap(result);
Index: src/mips/lithium-mips.cc
diff --git a/src/mips/lithium-mips.cc b/src/mips/lithium-mips.cc
index eb960a4bb2c06629272c6e81c19ae1a1adb69c37..e882655d21501d6cf94718cdff670f5a457ed6b2 100644
--- a/src/mips/lithium-mips.cc
+++ b/src/mips/lithium-mips.cc
@@ -2507,7 +2507,7 @@ LInstruction* LChunkBuilder::DoCheckMapValue(HCheckMapValue* instr) {

 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
   LOperand* object = UseRegister(instr->object());
-  LOperand* index = UseRegister(instr->index());
+  LOperand* index = UseTempRegister(instr->index());
   LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index);
   LInstruction* result = DefineSameAsFirst(load);
   return AssignPointerMap(result);
Index: src/version.cc
diff --git a/src/version.cc b/src/version.cc
index 6e6cef59dce073dadb15caccb3486a62b4b7a42b..e4de36a69d029fa5afda0a85af7d63b4d0100795 100644
--- a/src/version.cc
+++ b/src/version.cc
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     26
 #define BUILD_NUMBER      31
-#define PATCH_LEVEL       0
+#define PATCH_LEVEL       1
 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
 #define IS_CANDIDATE_VERSION 0
Index: test/mjsunit/regress/regress-368243.js
diff --git a/test/mjsunit/regress/regress-361608.js b/test/mjsunit/regress/regress-368243.js
similarity index 50%
copy from test/mjsunit/regress/regress-361608.js
copy to test/mjsunit/regress/regress-368243.js
index b3cc90cfd4b06afb3c7424758e23f91d685e3aa2..6647d1228685ddd7596438305fa63dfe6a28e7a0 100644
--- a/test/mjsunit/regress/regress-361608.js
+++ b/test/mjsunit/regress/regress-368243.js
@@ -4,17 +4,22 @@

 // Flags: --allow-natives-syntax

-function f() {};
-int_array = [1];
-
-function foo() {
-  var x;
-  for (var i = -1; i < 0; i++) {
-    x = int_array[i + 1];
-    f(function() { x = i; });
+function foo(a, c){
+  for(var f in c) {
+    if ("object" === typeof c[f]) {
+      a[f] = c[f];
+      foo(a[f], c[f]);
+    }
   }
-}
+};
+
+c = {
+  "one" : { x : 1},
+  "two" : { x : 2},
+  "thr" : { x : 3, z : 4},
+};

-foo();
+foo({}, c);
+foo({}, c);
 %OptimizeFunctionOnNextCall(foo);
-foo();
+foo({}, c);


--
--
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