diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc index b55679ee01..04e26bb1a3 100644 --- a/src/arm/lithium-arm.cc +++ b/src/arm/lithium-arm.cc @@ -272,24 +272,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()); @@ -2140,13 +2122,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 = diff --git a/src/arm/lithium-arm.h b/src/arm/lithium-arm.h index eecacec1a8..42bec14572 100644 --- a/src/arm/lithium-arm.h +++ b/src/arm/lithium-arm.h @@ -119,7 +119,6 @@ class LCodeGen; V(IsUndetectableAndBranch) \ V(Label) \ V(LazyBailout) \ - V(LinkObjectInList) \ V(LoadContextSlot) \ V(LoadExternalArrayPointer) \ V(LoadFieldByIndex) \ @@ -1676,23 +1675,6 @@ class LStoreGlobalGeneric: public LTemplateInstruction<0, 2, 0> { }; -class LLinkObjectInList: public LTemplateInstruction<0, 1, 0> { - public: - explicit LLinkObjectInList(LOperand* object) { - inputs_[0] = object; - } - - LOperand* object() { return inputs_[0]; } - - ExternalReference GetReference(Isolate* isolate); - - DECLARE_CONCRETE_INSTRUCTION(LinkObjectInList, "link-object-in-list") - DECLARE_HYDROGEN_ACCESSOR(LinkObjectInList) - - virtual void PrintDataTo(StringStream* stream); -}; - - class LLoadContextSlot: public LTemplateInstruction<1, 1, 0> { public: explicit LLoadContextSlot(LOperand* context) { diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc index c8545e873c..974bcccb11 100644 --- a/src/arm/lithium-codegen-arm.cc +++ b/src/arm/lithium-codegen-arm.cc @@ -2938,19 +2938,6 @@ void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) { } -void LCodeGen::DoLinkObjectInList(LLinkObjectInList* instr) { - Register object = ToRegister(instr->object()); - ExternalReference sites_list_address = instr->GetReference(isolate()); - - __ mov(ip, Operand(sites_list_address)); - __ ldr(ip, MemOperand(ip)); - __ str(ip, FieldMemOperand(object, - instr->hydrogen()->store_field().offset())); - __ mov(ip, Operand(sites_list_address)); - __ str(object, MemOperand(ip)); -} - - void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { Register context = ToRegister(instr->context()); Register result = ToRegister(instr->result()); diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc index 2fbb9b2f6e..151f2de737 100644 --- a/src/code-stubs-hydrogen.cc +++ b/src/code-stubs-hydrogen.cc @@ -477,8 +477,14 @@ HValue* CodeStubGraphBuilder::BuildCodeStub() { HObjectAccess::ForAllocationSiteTransitionInfo(), initial_elements_kind); - Add(object, HObjectAccess::ForAllocationSiteWeakNext(), - HLinkObjectInList::ALLOCATION_SITE_LIST); + // Link the object to the allocation site list + HValue* site_list = Add( + ExternalReference::allocation_sites_list_address(isolate())); + HValue* site = AddLoad(site_list, HObjectAccess::ForAllocationSiteList()); + HStoreNamedField* store = + AddStore(object, HObjectAccess::ForAllocationSiteWeakNext(), site); + store->SkipWriteBarrier(); + AddStore(site_list, HObjectAccess::ForAllocationSiteList(), object); // We use a hammer (SkipWriteBarrier()) to indicate that we know the input // cell is really a Cell, and so no write barrier is needed. @@ -486,7 +492,7 @@ HValue* CodeStubGraphBuilder::BuildCodeStub() { // a cell. (perhaps with a new instruction, HAssert). HInstruction* cell = GetParameter(0); HObjectAccess access = HObjectAccess::ForCellValue(); - HStoreNamedField* store = AddStore(cell, access, object); + store = AddStore(cell, access, object); store->SkipWriteBarrier(); return cell; } diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc index 01b6e70ad8..68499c8fd0 100644 --- a/src/hydrogen-instructions.cc +++ b/src/hydrogen-instructions.cc @@ -3600,12 +3600,6 @@ void HStoreGlobalGeneric::PrintDataTo(StringStream* stream) { } -void HLinkObjectInList::PrintDataTo(StringStream* stream) { - value()->PrintNameTo(stream); - stream->Add(" offset %d", store_field_.offset()); -} - - void HLoadContextSlot::PrintDataTo(StringStream* stream) { value()->PrintNameTo(stream); stream->Add("[%d]", slot_index()); diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h index 1b9af5372c..ed09f39ec6 100644 --- a/src/hydrogen-instructions.h +++ b/src/hydrogen-instructions.h @@ -135,7 +135,6 @@ class LChunkBuilder; V(IsSmiAndBranch) \ V(IsUndetectableAndBranch) \ V(LeaveInlined) \ - V(LinkObjectInList) \ V(LoadContextSlot) \ V(LoadExternalArrayPointer) \ V(LoadFieldByIndex) \ @@ -5627,6 +5626,10 @@ class HObjectAccess { return HObjectAccess(kInobject, AllocationSite::kWeakNextOffset); } + static HObjectAccess ForAllocationSiteList() { + return HObjectAccess(kExternalMemory, 0, Representation::Tagged()); + } + static HObjectAccess ForFixedArrayLength() { return HObjectAccess( kArrayLengths, @@ -5733,38 +5736,6 @@ class HObjectAccess { }; -class HLinkObjectInList: public HUnaryOperation { - public: - // There needs to be a mapping from every KnownList to an external reference - enum KnownList { - ALLOCATION_SITE_LIST - }; - - HLinkObjectInList(HValue* object, HObjectAccess store_field, - KnownList known_list) - : HUnaryOperation(object), - store_field_(store_field), - known_list_(known_list) { - set_representation(Representation::Tagged()); - } - - HObjectAccess store_field() const { return store_field_; } - KnownList known_list() const { return known_list_; } - - virtual Representation RequiredInputRepresentation(int index) { - return Representation::Tagged(); - } - - virtual void PrintDataTo(StringStream* stream); - - DECLARE_CONCRETE_INSTRUCTION(LinkObjectInList) - - private: - HObjectAccess store_field_; - KnownList known_list_; -}; - - class HLoadNamedField: public HTemplateInstruction<2> { public: HLoadNamedField(HValue* object, diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc index ed9d3ff290..0d20dea90a 100644 --- a/src/ia32/lithium-codegen-ia32.cc +++ b/src/ia32/lithium-codegen-ia32.cc @@ -2991,20 +2991,6 @@ void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) { } -void LCodeGen::DoLinkObjectInList(LLinkObjectInList* instr) { - Register object = ToRegister(instr->object()); - Register temp = ToRegister(instr->temp()); - ExternalReference sites_list_address = instr->GetReference(isolate()); - - __ mov(temp, Immediate(sites_list_address)); - __ mov(temp, Operand(temp, 0)); - __ mov(FieldOperand(object, instr->hydrogen()->store_field().offset()), - temp); - __ mov(temp, Immediate(sites_list_address)); - __ mov(Operand(temp, 0), object); -} - - void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { Register context = ToRegister(instr->context()); Register result = ToRegister(instr->result()); diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc index 8c8103f619..7edf2d9f3e 100644 --- a/src/ia32/lithium-ia32.cc +++ b/src/ia32/lithium-ia32.cc @@ -302,24 +302,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()); @@ -2191,14 +2173,6 @@ LInstruction* LChunkBuilder::DoStoreGlobalGeneric(HStoreGlobalGeneric* instr) { } -LInstruction* LChunkBuilder::DoLinkObjectInList(HLinkObjectInList* instr) { - LOperand* object = UseRegister(instr->value()); - LOperand* temp = TempRegister(); - LLinkObjectInList* result = new(zone()) LLinkObjectInList(object, temp); - return result; -} - - LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { LOperand* context = UseRegisterAtStart(instr->value()); LInstruction* result = diff --git a/src/ia32/lithium-ia32.h b/src/ia32/lithium-ia32.h index 6a2aa00654..e81cc27e2c 100644 --- a/src/ia32/lithium-ia32.h +++ b/src/ia32/lithium-ia32.h @@ -120,7 +120,6 @@ class LCodeGen; V(IsUndetectableAndBranch) \ V(Label) \ V(LazyBailout) \ - V(LinkObjectInList) \ V(LoadContextSlot) \ V(LoadExternalArrayPointer) \ V(LoadFieldByIndex) \ @@ -1705,25 +1704,6 @@ class LStoreGlobalGeneric: public LTemplateInstruction<0, 3, 0> { }; -class LLinkObjectInList: public LTemplateInstruction<0, 1, 1> { - public: - explicit LLinkObjectInList(LOperand* object, LOperand* temp) { - inputs_[0] = object; - temps_[0] = temp; - } - - LOperand* object() { return inputs_[0]; } - LOperand* temp() { return temps_[0]; } - - ExternalReference GetReference(Isolate* isolate); - - DECLARE_CONCRETE_INSTRUCTION(LinkObjectInList, "link-object-in-list") - DECLARE_HYDROGEN_ACCESSOR(LinkObjectInList) - - virtual void PrintDataTo(StringStream* stream); -}; - - class LLoadContextSlot: public LTemplateInstruction<1, 1, 0> { public: explicit LLoadContextSlot(LOperand* context) { diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc index 640b4982fa..85528f0ab2 100644 --- a/src/mips/lithium-codegen-mips.cc +++ b/src/mips/lithium-codegen-mips.cc @@ -2810,19 +2810,6 @@ void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) { } -void LCodeGen::DoLinkObjectInList(LLinkObjectInList* instr) { - Register object = ToRegister(instr->object()); - ExternalReference sites_list_address = instr->GetReference(isolate()); - - __ li(at, Operand(sites_list_address)); - __ lw(at, MemOperand(at)); - __ sw(at, FieldMemOperand(object, - instr->hydrogen()->store_field().offset())); - __ li(at, Operand(sites_list_address)); - __ sw(object, MemOperand(at)); -} - - void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { Register context = ToRegister(instr->context()); Register result = ToRegister(instr->result()); diff --git a/src/mips/lithium-mips.cc b/src/mips/lithium-mips.cc index 5cfca00010..b75a43f69e 100644 --- a/src/mips/lithium-mips.cc +++ b/src/mips/lithium-mips.cc @@ -277,24 +277,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()); @@ -2062,13 +2044,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 = diff --git a/src/mips/lithium-mips.h b/src/mips/lithium-mips.h index 2618c46992..d4735ce682 100644 --- a/src/mips/lithium-mips.h +++ b/src/mips/lithium-mips.h @@ -119,7 +119,6 @@ class LCodeGen; V(IsUndetectableAndBranch) \ V(Label) \ V(LazyBailout) \ - V(LinkObjectInList) \ V(LoadContextSlot) \ V(LoadExternalArrayPointer) \ V(LoadFieldByIndex) \ @@ -1654,23 +1653,6 @@ class LStoreGlobalGeneric: public LTemplateInstruction<0, 2, 0> { }; -class LLinkObjectInList: public LTemplateInstruction<0, 1, 0> { - public: - explicit LLinkObjectInList(LOperand* object) { - inputs_[0] = object; - } - - LOperand* object() { return inputs_[0]; } - - ExternalReference GetReference(Isolate* isolate); - - DECLARE_CONCRETE_INSTRUCTION(LinkObjectInList, "link-object-in-list") - DECLARE_HYDROGEN_ACCESSOR(LinkObjectInList) - - virtual void PrintDataTo(StringStream* stream); -}; - - class LLoadContextSlot: public LTemplateInstruction<1, 1, 0> { public: explicit LLoadContextSlot(LOperand* context) { diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc index 0bd9b16639..58dd5157a9 100644 --- a/src/x64/lithium-codegen-x64.cc +++ b/src/x64/lithium-codegen-x64.cc @@ -2634,16 +2634,6 @@ void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) { } -void LCodeGen::DoLinkObjectInList(LLinkObjectInList* instr) { - Register object = ToRegister(instr->object()); - ExternalReference sites_list_address = instr->GetReference(isolate()); - __ Load(kScratchRegister, sites_list_address); - __ movq(FieldOperand(object, instr->hydrogen()->store_field().offset()), - kScratchRegister); - __ Store(sites_list_address, object); -} - - void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { Register context = ToRegister(instr->context()); Register result = ToRegister(instr->result()); diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc index 4153417473..4ecb733508 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()); @@ -2042,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 = diff --git a/src/x64/lithium-x64.h b/src/x64/lithium-x64.h index cb3a2b05d7..b5d01c8fa8 100644 --- a/src/x64/lithium-x64.h +++ b/src/x64/lithium-x64.h @@ -119,7 +119,6 @@ class LCodeGen; V(IsUndetectableAndBranch) \ V(Label) \ V(LazyBailout) \ - V(LinkObjectInList) \ V(LoadContextSlot) \ V(LoadExternalArrayPointer) \ V(LoadFieldByIndex) \ @@ -1613,23 +1612,6 @@ class LStoreGlobalGeneric: public LTemplateInstruction<0, 2, 0> { }; -class LLinkObjectInList: public LTemplateInstruction<0, 1, 0> { - public: - explicit LLinkObjectInList(LOperand* object) { - inputs_[0] = object; - } - - LOperand* object() { return inputs_[0]; } - - ExternalReference GetReference(Isolate* isolate); - - DECLARE_CONCRETE_INSTRUCTION(LinkObjectInList, "link-object-in-list") - DECLARE_HYDROGEN_ACCESSOR(LinkObjectInList) - - virtual void PrintDataTo(StringStream* stream); -}; - - class LLoadContextSlot: public LTemplateInstruction<1, 1, 0> { public: explicit LLoadContextSlot(LOperand* context) {