Commit 8999a006 authored by ulan@chromium.org's avatar ulan@chromium.org

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

This instruciton clobbers the index register.

BUG=368243
LOG=N
TEST=mjsunit/regress/regress-368243
R=jkummerow@chromium.org

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21196 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 967a79d2
...@@ -2556,7 +2556,7 @@ LInstruction* LChunkBuilder::DoCheckMapValue(HCheckMapValue* instr) { ...@@ -2556,7 +2556,7 @@ LInstruction* LChunkBuilder::DoCheckMapValue(HCheckMapValue* instr) {
LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
LOperand* object = UseRegister(instr->object()); LOperand* object = UseRegister(instr->object());
LOperand* index = UseRegister(instr->index()); LOperand* index = UseTempRegister(instr->index());
LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index);
LInstruction* result = DefineSameAsFirst(load); LInstruction* result = DefineSameAsFirst(load);
return AssignPointerMap(result); return AssignPointerMap(result);
......
...@@ -2686,7 +2686,7 @@ LInstruction* LChunkBuilder::DoCheckMapValue(HCheckMapValue* instr) { ...@@ -2686,7 +2686,7 @@ LInstruction* LChunkBuilder::DoCheckMapValue(HCheckMapValue* instr) {
LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
LOperand* object = UseRegisterAtStart(instr->object()); LOperand* object = UseRegisterAtStart(instr->object());
LOperand* index = UseRegister(instr->index()); LOperand* index = UseRegisterAndClobber(instr->index());
LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index);
LInstruction* result = DefineSameAsFirst(load); LInstruction* result = DefineSameAsFirst(load);
return AssignPointerMap(result); return AssignPointerMap(result);
......
...@@ -2507,7 +2507,7 @@ LInstruction* LChunkBuilder::DoCheckMapValue(HCheckMapValue* instr) { ...@@ -2507,7 +2507,7 @@ LInstruction* LChunkBuilder::DoCheckMapValue(HCheckMapValue* instr) {
LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
LOperand* object = UseRegister(instr->object()); LOperand* object = UseRegister(instr->object());
LOperand* index = UseRegister(instr->index()); LOperand* index = UseTempRegister(instr->index());
LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index);
LInstruction* result = DefineSameAsFirst(load); LInstruction* result = DefineSameAsFirst(load);
return AssignPointerMap(result); return AssignPointerMap(result);
......
// 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 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({}, c);
foo({}, c);
%OptimizeFunctionOnNextCall(foo);
foo({}, c);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment