Get rid of HLinkObjectInList.

R=mvstanton@chromium.org

Review URL: https://codereview.chromium.org/21345002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15983 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
bmeurer@chromium.org 2013-07-31 10:47:44 +00:00
parent 3143f5f88b
commit 8823e8e89f
15 changed files with 13 additions and 267 deletions

View File

@ -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 =

View File

@ -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) {

View File

@ -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());

View File

@ -477,8 +477,14 @@ HValue* CodeStubGraphBuilder<CreateAllocationSiteStub>::BuildCodeStub() {
HObjectAccess::ForAllocationSiteTransitionInfo(),
initial_elements_kind);
Add<HLinkObjectInList>(object, HObjectAccess::ForAllocationSiteWeakNext(),
HLinkObjectInList::ALLOCATION_SITE_LIST);
// Link the object to the allocation site list
HValue* site_list = Add<HConstant>(
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<CreateAllocationSiteStub>::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;
}

View File

@ -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());

View File

@ -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,

View File

@ -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());

View File

@ -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 =

View File

@ -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) {

View File

@ -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());

View File

@ -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 =

View File

@ -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) {

View File

@ -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());

View File

@ -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 =

View File

@ -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) {