Chromium Code Reviews| Index: src/x64/lithium-codegen-x64.cc |
| diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc |
| index 364c3a1824ef671ee44dcd8f984d4be0363da993..254956daa5b35a1c7178f400c96461cba830b095 100644 |
| --- a/src/x64/lithium-codegen-x64.cc |
| +++ b/src/x64/lithium-codegen-x64.cc |
| @@ -429,6 +429,13 @@ double LCodeGen::ToDouble(LConstantOperand* op) const { |
| } |
| +ExternalReference LCodeGen::ToExternalReference(LConstantOperand* op) const { |
| + HConstant* constant = chunk_->LookupConstant(op); |
| + ASSERT(constant->HasExternalReferenceValue()); |
| + return constant->ExternalReferenceValue(); |
| +} |
| + |
| + |
| Handle<Object> LCodeGen::ToHandle(LConstantOperand* op) const { |
| HConstant* constant = chunk_->LookupConstant(op); |
| ASSERT(chunk_->LookupLiteralRepresentation(op).IsSmiOrTagged()); |
| @@ -1519,6 +1526,11 @@ void LCodeGen::DoConstantD(LConstantD* instr) { |
| } |
| +void LCodeGen::DoConstantE(LConstantE* instr) { |
| + __ LoadAddress(ToRegister(instr->result()), instr->value()); |
| +} |
| + |
| + |
| void LCodeGen::DoConstantT(LConstantT* instr) { |
| Handle<Object> value = instr->value(); |
| AllowDeferredHandleDereference smi_check; |
| @@ -2676,6 +2688,19 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
| void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
| HObjectAccess access = instr->hydrogen()->access(); |
| int offset = access.offset(); |
| + |
| + if (access.IsExternalMemory()) { |
| + 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)); |
| + } |
| + return; |
| + } |
| + |
| Register object = ToRegister(instr->object()); |
| if (FLAG_track_double_fields && |
| instr->hydrogen()->representation().IsDouble()) { |
| @@ -3913,11 +3938,23 @@ void LCodeGen::DoInnerAllocatedObject(LInnerAllocatedObject* instr) { |
| void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
| Representation representation = instr->representation(); |
| - Register object = ToRegister(instr->object()); |
| - |
| HObjectAccess access = instr->hydrogen()->access(); |
| int offset = access.offset(); |
| + if (access.IsExternalMemory()) { |
| + Register value = ToRegister(instr->value()); |
| + if (instr->object()->IsConstantOperand()) { |
| + ASSERT(value.is(rax)); |
| + __ store_rax(ToExternalReference( |
| + LConstantOperand::cast(instr->object()))); |
|
danno
2013/07/29 10:40:14
nit: funky indentatoin
Benedikt Meurer
2013/07/29 13:57:51
Done.
|
| + } else { |
| + Register object = ToRegister(instr->object()); |
| + __ movq(MemOperand(object, offset), value); |
| + } |
| + return; |
| + } |
| + |
| + Register object = ToRegister(instr->object()); |
| Handle<Map> transition = instr->transition(); |
| if (FLAG_track_fields && representation.IsSmi()) { |