Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(610)

Unified Diff: src/x64/lithium-codegen-x64.cc

Issue 23548039: Fix handling of Integer32 in HLoadNamedField and HStoreNamedField on x64. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/lithium-codegen-x64.cc
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index e224fba9b67d833e9c93eda7edbd424756660de3..5584e39c5f1e93245d4f50e7c2c53be5d593d261 100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -2799,6 +2799,7 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
int offset = access.offset();
if (access.IsExternalMemory()) {
+ ASSERT(!access.representation().IsInteger32());
Register result = ToRegister(instr->result());
if (instr->object()->IsConstantOperand()) {
ASSERT(result.is(rax));
@@ -2820,10 +2821,18 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
Register result = ToRegister(instr->result());
if (access.IsInobject()) {
- __ movq(result, FieldOperand(object, offset));
+ if (access.representation().IsInteger32()) {
+ __ movl(result, FieldOperand(object, offset));
+ } else {
+ __ movq(result, FieldOperand(object, offset));
+ }
} else {
__ movq(result, FieldOperand(object, JSObject::kPropertiesOffset));
- __ movq(result, FieldOperand(result, offset));
+ if (access.representation().IsInteger32()) {
+ __ movl(result, FieldOperand(result, offset));
+ } else {
+ __ movq(result, FieldOperand(result, offset));
+ }
}
}
@@ -3936,6 +3945,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
int offset = access.offset();
if (access.IsExternalMemory()) {
+ ASSERT(!access.representation().IsInteger32());
ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
Register value = ToRegister(instr->value());
if (instr->object()->IsConstantOperand()) {
@@ -4013,15 +4023,24 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
if (instr->value()->IsConstantOperand()) {
LConstantOperand* operand_value = LConstantOperand::cast(instr->value());
if (operand_value->IsRegister()) {
- __ movq(FieldOperand(write_register, offset),
- ToRegister(operand_value));
+ if (access.representation().IsInteger32()) {
+ __ movl(FieldOperand(write_register, offset),
+ ToRegister(operand_value));
+ } else {
+ __ movq(FieldOperand(write_register, offset),
+ ToRegister(operand_value));
+ }
} else {
Handle<Object> handle_value = ToHandle(operand_value);
ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
__ Move(FieldOperand(write_register, offset), handle_value);
}
} else {
- __ movq(FieldOperand(write_register, offset), ToRegister(instr->value()));
+ if (access.representation().IsInteger32()) {
+ __ movl(FieldOperand(write_register, offset), ToRegister(instr->value()));
+ } else {
+ __ movq(FieldOperand(write_register, offset), ToRegister(instr->value()));
+ }
}
if (instr->hydrogen()->NeedsWriteBarrier()) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698