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

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

Issue 25696004: Add support to load/store byte fields. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Also adjust HLoadNamedField::InferRange. Created 7 years, 2 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
Index: src/x64/lithium-codegen-x64.cc
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index a5f24c211f174dbcbce07e1da1342ea2eb30fd04..ab192d683daf74329c1377ce7e90afd2982da1c7 100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -2726,14 +2726,13 @@ 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));
__ load_rax(ToExternalReference(LConstantOperand::cast(instr->object())));
} else {
Register object = ToRegister(instr->object());
- __ movq(result, MemOperand(object, offset));
+ __ Load(result, MemOperand(object, offset), access.representation());
}
return;
}
@@ -2747,20 +2746,11 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
}
Register result = ToRegister(instr->result());
- if (access.IsInobject()) {
- if (access.representation().IsInteger32()) {
- __ movl(result, FieldOperand(object, offset));
- } else {
- __ movq(result, FieldOperand(object, offset));
- }
- } else {
+ if (!access.IsInobject()) {
__ movq(result, FieldOperand(object, JSObject::kPropertiesOffset));
- if (access.representation().IsInteger32()) {
- __ movl(result, FieldOperand(result, offset));
- } else {
- __ movq(result, FieldOperand(result, offset));
- }
+ object = result;
}
+ __ Load(result, FieldOperand(object, offset), access.representation());
}
@@ -3878,16 +3868,16 @@ 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()) {
ASSERT(value.is(rax));
+ ASSERT(!access.representation().IsSpecialization());
LConstantOperand* object = LConstantOperand::cast(instr->object());
__ store_rax(ToExternalReference(object));
} else {
Register object = ToRegister(instr->object());
- __ movq(MemOperand(object, offset), value);
+ __ Store(MemOperand(object, offset), value, representation);
}
return;
}
@@ -3956,24 +3946,16 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
if (instr->value()->IsConstantOperand()) {
LConstantOperand* operand_value = LConstantOperand::cast(instr->value());
if (operand_value->IsRegister()) {
- if (access.representation().IsInteger32()) {
- __ movl(FieldOperand(write_register, offset),
- ToRegister(operand_value));
- } else {
- __ movq(FieldOperand(write_register, offset),
- ToRegister(operand_value));
- }
+ Register value = ToRegister(operand_value);
+ __ Store(FieldOperand(write_register, offset), value, representation);
} else {
Handle<Object> handle_value = ToHandle(operand_value);
ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
__ Move(FieldOperand(write_register, offset), handle_value);
}
} else {
- if (access.representation().IsInteger32()) {
- __ movl(FieldOperand(write_register, offset), ToRegister(instr->value()));
- } else {
- __ movq(FieldOperand(write_register, offset), ToRegister(instr->value()));
- }
+ Register value = ToRegister(instr->value());
+ __ Store(FieldOperand(write_register, offset), value, representation);
}
if (instr->hydrogen()->NeedsWriteBarrier()) {

Powered by Google App Engine
This is Rietveld 408576698