Index: src/x64/lithium-x64.cc |
diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc |
index 9c6efed3d2f57ea37a8a1ed37aaeb5be97c8918c..5b483baf40c7c4625cddfb7fc3988c2e171a6fbf 100644 |
--- a/src/x64/lithium-x64.cc |
+++ b/src/x64/lithium-x64.cc |
@@ -275,24 +275,6 @@ void LCallConstantFunction::PrintDataTo(StringStream* stream) { |
} |
-ExternalReference LLinkObjectInList::GetReference(Isolate* isolate) { |
- switch (hydrogen()->known_list()) { |
- case HLinkObjectInList::ALLOCATION_SITE_LIST: |
- return ExternalReference::allocation_sites_list_address(isolate); |
- } |
- |
- UNREACHABLE(); |
- // Return a dummy value |
- return ExternalReference::isolate_address(isolate); |
-} |
- |
- |
-void LLinkObjectInList::PrintDataTo(StringStream* stream) { |
- object()->PrintTo(stream); |
- stream->Add(" offset %d", hydrogen()->store_field().offset()); |
-} |
- |
- |
void LLoadContextSlot::PrintDataTo(StringStream* stream) { |
context()->PrintTo(stream); |
stream->Add("[%d]", slot_index()); |
@@ -461,7 +443,7 @@ LPlatformChunk* LChunkBuilder::Build() { |
} |
-void LCodeGen::Abort(const char* reason) { |
+void LCodeGen::Abort(BailoutReason reason) { |
info()->set_bailout_reason(reason); |
status_ = ABORTED; |
} |
@@ -672,7 +654,7 @@ LUnallocated* LChunkBuilder::TempRegister() { |
new(zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER); |
int vreg = allocator_->GetVirtualRegister(); |
if (!allocator_->AllocationOk()) { |
- Abort("Out of virtual registers while trying to allocate temp register."); |
+ Abort(kOutOfVirtualRegistersWhileTryingToAllocateTempRegister); |
vreg = 0; |
} |
operand->set_virtual_register(vreg); |
@@ -1997,6 +1979,8 @@ LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { |
} else if (r.IsDouble()) { |
LOperand* temp = TempRegister(); |
return DefineAsRegister(new(zone()) LConstantD(temp)); |
+ } else if (r.IsExternal()) { |
+ return DefineAsRegister(new(zone()) LConstantE); |
} else if (r.IsTagged()) { |
return DefineAsRegister(new(zone()) LConstantT); |
} else { |
@@ -2040,13 +2024,6 @@ LInstruction* LChunkBuilder::DoStoreGlobalGeneric(HStoreGlobalGeneric* instr) { |
} |
-LInstruction* LChunkBuilder::DoLinkObjectInList(HLinkObjectInList* instr) { |
- LOperand* object = UseRegister(instr->value()); |
- LLinkObjectInList* result = new(zone()) LLinkObjectInList(object); |
- return result; |
-} |
- |
- |
LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { |
LOperand* context = UseRegisterAtStart(instr->value()); |
LInstruction* result = |
@@ -2074,6 +2051,10 @@ LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) { |
LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { |
+ if (instr->access().IsExternalMemory() && instr->access().offset() == 0) { |
+ LOperand* obj = UseRegisterOrConstantAtStart(instr->object()); |
+ return DefineFixed(new(zone()) LLoadNamedField(obj), rax); |
+ } |
LOperand* obj = UseRegisterAtStart(instr->object()); |
return DefineAsRegister(new(zone()) LLoadNamedField(obj)); |
} |
@@ -2249,6 +2230,8 @@ LInstruction* LChunkBuilder::DoTrapAllocationMemento( |
LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { |
bool is_in_object = instr->access().IsInobject(); |
+ bool is_external_location = instr->access().IsExternalMemory() && |
+ instr->access().offset() == 0; |
bool needs_write_barrier = instr->NeedsWriteBarrier(); |
bool needs_write_barrier_for_map = !instr->transition().is_null() && |
instr->NeedsWriteBarrierForMap(); |
@@ -2258,6 +2241,11 @@ LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { |
obj = is_in_object |
? UseRegister(instr->object()) |
: UseTempRegister(instr->object()); |
+ } else if (is_external_location) { |
+ ASSERT(!is_in_object); |
+ ASSERT(!needs_write_barrier); |
+ ASSERT(!needs_write_barrier_for_map); |
+ obj = UseRegisterOrConstant(instr->object()); |
} else { |
obj = needs_write_barrier_for_map |
? UseRegister(instr->object()) |
@@ -2271,6 +2259,8 @@ LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { |
LOperand* val; |
if (needs_write_barrier) { |
val = UseTempRegister(instr->value()); |
+ } else if (is_external_location) { |
+ val = UseFixed(instr->value(), rax); |
} else if (can_be_constant) { |
val = UseRegisterOrConstant(instr->value()); |
} else if (FLAG_track_fields && instr->field_representation().IsSmi()) { |
@@ -2330,12 +2320,6 @@ LInstruction* LChunkBuilder::DoStringCharFromCode(HStringCharFromCode* instr) { |
} |
-LInstruction* LChunkBuilder::DoStringLength(HStringLength* instr) { |
- LOperand* string = UseRegisterAtStart(instr->value()); |
- return DefineAsRegister(new(zone()) LStringLength(string)); |
-} |
- |
- |
LInstruction* LChunkBuilder::DoAllocate(HAllocate* instr) { |
info()->MarkAsDeferredCalling(); |
LOperand* size = instr->size()->IsConstant() |
@@ -2384,7 +2368,7 @@ LInstruction* LChunkBuilder::DoParameter(HParameter* instr) { |
LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { |
int spill_index = chunk()->GetNextSpillIndex(false); // Not double-width. |
if (spill_index > LUnallocated::kMaxFixedSlotIndex) { |
- Abort("Too many spill slots needed for OSR"); |
+ Abort(kTooManySpillSlotsNeededForOSR); |
spill_index = 0; |
} |
return DefineAsSpilled(new(zone()) LUnknownOSRValue, spill_index); |