From f80e76cd58fab30528e54ce5d7fb8b752ef6f13d Mon Sep 17 00:00:00 2001 From: "bmeurer@chromium.org" Date: Wed, 29 Jan 2014 13:44:50 +0000 Subject: [PATCH] Remove the unused HElementsKind instruction. R=svenpanne@chromium.org Review URL: https://codereview.chromium.org/136093004 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18906 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/lithium-arm.cc | 6 ------ src/arm/lithium-arm.h | 14 -------------- src/arm/lithium-codegen-arm.cc | 14 -------------- src/hydrogen-instructions.h | 23 ----------------------- src/ia32/lithium-codegen-ia32.cc | 15 --------------- src/ia32/lithium-ia32.cc | 6 ------ src/ia32/lithium-ia32.h | 14 -------------- src/mips/lithium-codegen-mips.cc | 14 -------------- src/mips/lithium-mips.cc | 6 ------ src/mips/lithium-mips.h | 14 -------------- src/x64/lithium-codegen-x64.cc | 14 -------------- src/x64/lithium-x64.cc | 6 ------ src/x64/lithium-x64.h | 14 -------------- 13 files changed, 160 deletions(-) diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc index 6c4ca28248..ee1a170074 100644 --- a/src/arm/lithium-arm.cc +++ b/src/arm/lithium-arm.cc @@ -1705,12 +1705,6 @@ LInstruction* LChunkBuilder::DoMapEnumLength(HMapEnumLength* instr) { } -LInstruction* LChunkBuilder::DoElementsKind(HElementsKind* instr) { - LOperand* object = UseRegisterAtStart(instr->value()); - return DefineAsRegister(new(zone()) LElementsKind(object)); -} - - LInstruction* LChunkBuilder::DoDateField(HDateField* instr) { LOperand* object = UseFixed(instr->value(), r0); LDateField* result = diff --git a/src/arm/lithium-arm.h b/src/arm/lithium-arm.h index 0e0792f050..53471cf952 100644 --- a/src/arm/lithium-arm.h +++ b/src/arm/lithium-arm.h @@ -91,7 +91,6 @@ class LCodeGen; V(Drop) \ V(Dummy) \ V(DummyUse) \ - V(ElementsKind) \ V(ForInCacheArray) \ V(ForInPrepareMap) \ V(FunctionLiteral) \ @@ -1294,19 +1293,6 @@ class LMapEnumLength V8_FINAL : public LTemplateInstruction<1, 1, 0> { }; -class LElementsKind V8_FINAL : public LTemplateInstruction<1, 1, 0> { - public: - explicit LElementsKind(LOperand* value) { - inputs_[0] = value; - } - - LOperand* value() { return inputs_[0]; } - - DECLARE_CONCRETE_INSTRUCTION(ElementsKind, "elements-kind") - DECLARE_HYDROGEN_ACCESSOR(ElementsKind) -}; - - class LDateField V8_FINAL : public LTemplateInstruction<1, 1, 1> { public: LDateField(LOperand* date, LOperand* temp, Smi* index) : index_(index) { diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc index c1ba193294..0ca7db4c26 100644 --- a/src/arm/lithium-codegen-arm.cc +++ b/src/arm/lithium-codegen-arm.cc @@ -1864,20 +1864,6 @@ void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { } -void LCodeGen::DoElementsKind(LElementsKind* instr) { - Register result = ToRegister(instr->result()); - Register input = ToRegister(instr->value()); - - // Load map into |result|. - __ ldr(result, FieldMemOperand(input, HeapObject::kMapOffset)); - // Load the map's "bit field 2" into |result|. We only need the first byte, - // but the following bit field extraction takes care of that anyway. - __ ldr(result, FieldMemOperand(result, Map::kBitField2Offset)); - // Retrieve elements_kind from bit field 2. - __ ubfx(result, result, Map::kElementsKindShift, Map::kElementsKindBitCount); -} - - void LCodeGen::DoDateField(LDateField* instr) { Register object = ToRegister(instr->date()); Register result = ToRegister(instr->result()); diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h index d599ab089a..8c8b6c535d 100644 --- a/src/hydrogen-instructions.h +++ b/src/hydrogen-instructions.h @@ -109,7 +109,6 @@ class LChunkBuilder; V(Deoptimize) \ V(Div) \ V(DummyUse) \ - V(ElementsKind) \ V(EnterInlined) \ V(EnvironmentMarker) \ V(ForceRepresentation) \ @@ -2538,28 +2537,6 @@ class HMapEnumLength V8_FINAL : public HUnaryOperation { }; -class HElementsKind V8_FINAL : public HUnaryOperation { - public: - explicit HElementsKind(HValue* value) : HUnaryOperation(value) { - set_representation(Representation::Integer32()); - SetFlag(kUseGVN); - SetGVNFlag(kDependsOnElementsKind); - } - - virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { - return Representation::Tagged(); - } - - DECLARE_CONCRETE_INSTRUCTION(ElementsKind) - - protected: - virtual bool DataEquals(HValue* other) V8_OVERRIDE { return true; } - - private: - virtual bool IsDeletable() const V8_OVERRIDE { return true; } -}; - - class HUnaryMathOperation V8_FINAL : public HTemplateInstruction<2> { public: static HInstruction* New(Zone* zone, diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc index 28ca344a45..b7cd7bb8ab 100644 --- a/src/ia32/lithium-codegen-ia32.cc +++ b/src/ia32/lithium-codegen-ia32.cc @@ -1968,21 +1968,6 @@ void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { } -void LCodeGen::DoElementsKind(LElementsKind* instr) { - Register result = ToRegister(instr->result()); - Register input = ToRegister(instr->value()); - - // Load map into |result|. - __ mov(result, FieldOperand(input, HeapObject::kMapOffset)); - // Load the map's "bit field 2" into |result|. We only need the first byte, - // but the following masking takes care of that anyway. - __ mov(result, FieldOperand(result, Map::kBitField2Offset)); - // Retrieve elements_kind from bit field 2. - __ and_(result, Map::kElementsKindMask); - __ shr(result, Map::kElementsKindShift); -} - - void LCodeGen::DoDateField(LDateField* instr) { Register object = ToRegister(instr->date()); Register result = ToRegister(instr->result()); diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc index 4f5c69f75f..c5e29726ca 100644 --- a/src/ia32/lithium-ia32.cc +++ b/src/ia32/lithium-ia32.cc @@ -1697,12 +1697,6 @@ LInstruction* LChunkBuilder::DoMapEnumLength(HMapEnumLength* instr) { } -LInstruction* LChunkBuilder::DoElementsKind(HElementsKind* instr) { - LOperand* object = UseRegisterAtStart(instr->value()); - return DefineAsRegister(new(zone()) LElementsKind(object)); -} - - LInstruction* LChunkBuilder::DoDateField(HDateField* instr) { LOperand* date = UseFixed(instr->value(), eax); LDateField* result = diff --git a/src/ia32/lithium-ia32.h b/src/ia32/lithium-ia32.h index 73a31d78f0..1f70291538 100644 --- a/src/ia32/lithium-ia32.h +++ b/src/ia32/lithium-ia32.h @@ -93,7 +93,6 @@ class LCodeGen; V(Drop) \ V(Dummy) \ V(DummyUse) \ - V(ElementsKind) \ V(ForInCacheArray) \ V(ForInPrepareMap) \ V(FunctionLiteral) \ @@ -1267,19 +1266,6 @@ class LMapEnumLength V8_FINAL : public LTemplateInstruction<1, 1, 0> { }; -class LElementsKind V8_FINAL : public LTemplateInstruction<1, 1, 0> { - public: - explicit LElementsKind(LOperand* value) { - inputs_[0] = value; - } - - LOperand* value() { return inputs_[0]; } - - DECLARE_CONCRETE_INSTRUCTION(ElementsKind, "elements-kind") - DECLARE_HYDROGEN_ACCESSOR(ElementsKind) -}; - - class LDateField V8_FINAL : public LTemplateInstruction<1, 1, 1> { public: LDateField(LOperand* date, LOperand* temp, Smi* index) diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc index da96eb24c9..ff6d4c4e93 100644 --- a/src/mips/lithium-codegen-mips.cc +++ b/src/mips/lithium-codegen-mips.cc @@ -1651,20 +1651,6 @@ void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { } -void LCodeGen::DoElementsKind(LElementsKind* instr) { - Register result = ToRegister(instr->result()); - Register input = ToRegister(instr->value()); - - // Load map into |result|. - __ lw(result, FieldMemOperand(input, HeapObject::kMapOffset)); - // Load the map's "bit field 2" into |result|. We only need the first byte, - // but the following bit field extraction takes care of that anyway. - __ lbu(result, FieldMemOperand(result, Map::kBitField2Offset)); - // Retrieve elements_kind from bit field 2. - __ Ext(result, result, Map::kElementsKindShift, Map::kElementsKindBitCount); -} - - void LCodeGen::DoValueOf(LValueOf* instr) { Register input = ToRegister(instr->value()); Register result = ToRegister(instr->result()); diff --git a/src/mips/lithium-mips.cc b/src/mips/lithium-mips.cc index 3be1313c07..ee2f63adfc 100644 --- a/src/mips/lithium-mips.cc +++ b/src/mips/lithium-mips.cc @@ -1633,12 +1633,6 @@ LInstruction* LChunkBuilder::DoMapEnumLength(HMapEnumLength* instr) { } -LInstruction* LChunkBuilder::DoElementsKind(HElementsKind* instr) { - LOperand* object = UseRegisterAtStart(instr->value()); - return DefineAsRegister(new(zone()) LElementsKind(object)); -} - - LInstruction* LChunkBuilder::DoDateField(HDateField* instr) { LOperand* object = UseFixed(instr->value(), a0); LDateField* result = diff --git a/src/mips/lithium-mips.h b/src/mips/lithium-mips.h index 33d0def145..a9ac04b702 100644 --- a/src/mips/lithium-mips.h +++ b/src/mips/lithium-mips.h @@ -91,7 +91,6 @@ class LCodeGen; V(Drop) \ V(Dummy) \ V(DummyUse) \ - V(ElementsKind) \ V(ForInCacheArray) \ V(ForInPrepareMap) \ V(FunctionLiteral) \ @@ -1274,19 +1273,6 @@ class LMapEnumLength V8_FINAL : public LTemplateInstruction<1, 1, 0> { }; -class LElementsKind V8_FINAL : public LTemplateInstruction<1, 1, 0> { - public: - explicit LElementsKind(LOperand* value) { - inputs_[0] = value; - } - - LOperand* value() { return inputs_[0]; } - - DECLARE_CONCRETE_INSTRUCTION(ElementsKind, "elements-kind") - DECLARE_HYDROGEN_ACCESSOR(ElementsKind) -}; - - class LDateField V8_FINAL : public LTemplateInstruction<1, 1, 1> { public: LDateField(LOperand* date, LOperand* temp, Smi* index) : index_(index) { diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc index d866059304..a7fea8c8f9 100644 --- a/src/x64/lithium-codegen-x64.cc +++ b/src/x64/lithium-codegen-x64.cc @@ -1574,20 +1574,6 @@ void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { } -void LCodeGen::DoElementsKind(LElementsKind* instr) { - Register result = ToRegister(instr->result()); - Register input = ToRegister(instr->value()); - - // Load map into |result|. - __ movp(result, FieldOperand(input, HeapObject::kMapOffset)); - // Load the map's "bit field 2" into |result|. We only need the first byte. - __ movzxbq(result, FieldOperand(result, Map::kBitField2Offset)); - // Retrieve elements_kind from bit field 2. - __ and_(result, Immediate(Map::kElementsKindMask)); - __ shr(result, Immediate(Map::kElementsKindShift)); -} - - void LCodeGen::DoDateField(LDateField* instr) { Register object = ToRegister(instr->date()); Register result = ToRegister(instr->result()); diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc index f07cb3ba5e..a5a06f03ae 100644 --- a/src/x64/lithium-x64.cc +++ b/src/x64/lithium-x64.cc @@ -1606,12 +1606,6 @@ LInstruction* LChunkBuilder::DoMapEnumLength(HMapEnumLength* instr) { } -LInstruction* LChunkBuilder::DoElementsKind(HElementsKind* instr) { - LOperand* object = UseRegisterAtStart(instr->value()); - return DefineAsRegister(new(zone()) LElementsKind(object)); -} - - LInstruction* LChunkBuilder::DoDateField(HDateField* instr) { LOperand* object = UseFixed(instr->value(), rax); LDateField* result = new(zone()) LDateField(object, instr->index()); diff --git a/src/x64/lithium-x64.h b/src/x64/lithium-x64.h index 8b1c055719..f57c244ac1 100644 --- a/src/x64/lithium-x64.h +++ b/src/x64/lithium-x64.h @@ -91,7 +91,6 @@ class LCodeGen; V(Drop) \ V(DummyUse) \ V(Dummy) \ - V(ElementsKind) \ V(ForInCacheArray) \ V(ForInPrepareMap) \ V(FunctionLiteral) \ @@ -1235,19 +1234,6 @@ class LMapEnumLength V8_FINAL : public LTemplateInstruction<1, 1, 0> { }; -class LElementsKind V8_FINAL : public LTemplateInstruction<1, 1, 0> { - public: - explicit LElementsKind(LOperand* value) { - inputs_[0] = value; - } - - LOperand* value() { return inputs_[0]; } - - DECLARE_CONCRETE_INSTRUCTION(ElementsKind, "elements-kind") - DECLARE_HYDROGEN_ACCESSOR(ElementsKind) -}; - - class LDateField V8_FINAL : public LTemplateInstruction<1, 1, 0> { public: LDateField(LOperand* date, Smi* index) : index_(index) {