From c12593cf2bff85ec0ea5ad37d5100a09167241db Mon Sep 17 00:00:00 2001 From: "bmeurer@chromium.org" Date: Wed, 29 Jan 2014 07:27:35 +0000 Subject: [PATCH] Kill obsolete HLoadExternalArrayPointer instruction. R=svenpanne@chromium.org Review URL: https://codereview.chromium.org/141583011 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18893 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/lithium-arm.cc | 7 ------- src/arm/lithium-arm.h | 15 --------------- src/arm/lithium-codegen-arm.cc | 9 --------- src/hydrogen-instructions.h | 33 -------------------------------- src/hydrogen.cc | 4 ++-- src/ia32/lithium-codegen-ia32.cc | 9 --------- src/ia32/lithium-ia32.cc | 7 ------- src/ia32/lithium-ia32.h | 15 --------------- src/mips/lithium-codegen-mips.cc | 9 --------- src/mips/lithium-mips.cc | 7 ------- src/mips/lithium-mips.h | 15 --------------- src/x64/lithium-codegen-x64.cc | 10 ---------- src/x64/lithium-x64.cc | 7 ------- src/x64/lithium-x64.h | 15 --------------- 14 files changed, 2 insertions(+), 160 deletions(-) diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc index 2de0fa138f..85a2cc784a 100644 --- a/src/arm/lithium-arm.cc +++ b/src/arm/lithium-arm.cc @@ -2051,13 +2051,6 @@ LInstruction* LChunkBuilder::DoLoadRoot(HLoadRoot* instr) { } -LInstruction* LChunkBuilder::DoLoadExternalArrayPointer( - HLoadExternalArrayPointer* instr) { - LOperand* input = UseRegisterAtStart(instr->value()); - return DefineAsRegister(new(zone()) LLoadExternalArrayPointer(input)); -} - - LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { ASSERT(instr->key()->representation().IsSmiOrInteger32()); ElementsKind elements_kind = instr->elements_kind(); diff --git a/src/arm/lithium-arm.h b/src/arm/lithium-arm.h index 6769513ce5..f52e3f713a 100644 --- a/src/arm/lithium-arm.h +++ b/src/arm/lithium-arm.h @@ -114,7 +114,6 @@ class LCodeGen; V(Label) \ V(LazyBailout) \ V(LoadContextSlot) \ - V(LoadExternalArrayPointer) \ V(LoadRoot) \ V(LoadFieldByIndex) \ V(LoadFunctionPrototype) \ @@ -1564,20 +1563,6 @@ class LLoadRoot V8_FINAL : public LTemplateInstruction<1, 0, 0> { }; -class LLoadExternalArrayPointer V8_FINAL - : public LTemplateInstruction<1, 1, 0> { - public: - explicit LLoadExternalArrayPointer(LOperand* object) { - inputs_[0] = object; - } - - LOperand* object() { return inputs_[0]; } - - DECLARE_CONCRETE_INSTRUCTION(LoadExternalArrayPointer, - "load-external-array-pointer") -}; - - class LLoadKeyed V8_FINAL : public LTemplateInstruction<1, 2, 0> { public: LLoadKeyed(LOperand* elements, LOperand* key) { diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc index 164f77736b..77900968df 100644 --- a/src/arm/lithium-codegen-arm.cc +++ b/src/arm/lithium-codegen-arm.cc @@ -3147,15 +3147,6 @@ void LCodeGen::DoLoadRoot(LLoadRoot* instr) { } -void LCodeGen::DoLoadExternalArrayPointer( - LLoadExternalArrayPointer* instr) { - Register to_reg = ToRegister(instr->result()); - Register from_reg = ToRegister(instr->object()); - __ ldr(to_reg, FieldMemOperand(from_reg, - ExternalArray::kExternalPointerOffset)); -} - - void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { Register arguments = ToRegister(instr->arguments()); Register result = ToRegister(instr->result()); diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h index 68e07d0983..a4580922d0 100644 --- a/src/hydrogen-instructions.h +++ b/src/hydrogen-instructions.h @@ -131,7 +131,6 @@ class LChunkBuilder; V(IsUndetectableAndBranch) \ V(LeaveInlined) \ V(LoadContextSlot) \ - V(LoadExternalArrayPointer) \ V(LoadFieldByIndex) \ V(LoadFunctionPrototype) \ V(LoadGlobalCell) \ @@ -2687,38 +2686,6 @@ class HLoadRoot V8_FINAL : public HTemplateInstruction<0> { }; -class HLoadExternalArrayPointer V8_FINAL : public HUnaryOperation { - public: - DECLARE_INSTRUCTION_FACTORY_P1(HLoadExternalArrayPointer, HValue*); - - virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { - return Representation::Tagged(); - } - - virtual HType CalculateInferredType() V8_OVERRIDE { - return HType::None(); - } - - DECLARE_CONCRETE_INSTRUCTION(LoadExternalArrayPointer) - - protected: - virtual bool DataEquals(HValue* other) V8_OVERRIDE { return true; } - - private: - explicit HLoadExternalArrayPointer(HValue* value) - : HUnaryOperation(value) { - set_representation(Representation::External()); - // The result of this instruction is idempotent as long as its inputs don't - // change. The external array of a specialized array elements object cannot - // change once set, so it's no necessary to introduce any additional - // dependencies on top of the inputs. - SetFlag(kUseGVN); - } - - virtual bool IsDeletable() const V8_OVERRIDE { return true; } -}; - - class HCheckMaps V8_FINAL : public HTemplateInstruction<2> { public: static HCheckMaps* New(Zone* zone, HValue* context, HValue* value, diff --git a/src/hydrogen.cc b/src/hydrogen.cc index 9cfb4f0f08..e46fa966b2 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -2121,8 +2121,8 @@ HInstruction* HGraphBuilder::BuildUncheckedMonomorphicElementAccess( IsFixedTypedArrayElementsKind(elements_kind)) { HValue* backing_store; if (IsExternalArrayElementsKind(elements_kind)) { - backing_store = - Add(elements); + backing_store = Add( + elements, HObjectAccess::ForExternalArrayExternalPointer()); } else { backing_store = elements; } diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc index ef83dc9e59..21a0c32908 100644 --- a/src/ia32/lithium-codegen-ia32.cc +++ b/src/ia32/lithium-codegen-ia32.cc @@ -3365,15 +3365,6 @@ void LCodeGen::DoLoadRoot(LLoadRoot* instr) { } -void LCodeGen::DoLoadExternalArrayPointer( - LLoadExternalArrayPointer* instr) { - Register result = ToRegister(instr->result()); - Register input = ToRegister(instr->object()); - __ mov(result, FieldOperand(input, - ExternalArray::kExternalPointerOffset)); -} - - void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { Register arguments = ToRegister(instr->arguments()); Register result = ToRegister(instr->result()); diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc index 4d47bc64bb..80e3d4ad7e 100644 --- a/src/ia32/lithium-ia32.cc +++ b/src/ia32/lithium-ia32.cc @@ -2089,13 +2089,6 @@ LInstruction* LChunkBuilder::DoLoadRoot(HLoadRoot* instr) { } -LInstruction* LChunkBuilder::DoLoadExternalArrayPointer( - HLoadExternalArrayPointer* instr) { - LOperand* input = UseRegisterAtStart(instr->value()); - return DefineAsRegister(new(zone()) LLoadExternalArrayPointer(input)); -} - - LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { ASSERT(instr->key()->representation().IsSmiOrInteger32()); ElementsKind elements_kind = instr->elements_kind(); diff --git a/src/ia32/lithium-ia32.h b/src/ia32/lithium-ia32.h index 0ccc175720..a0b750f5c4 100644 --- a/src/ia32/lithium-ia32.h +++ b/src/ia32/lithium-ia32.h @@ -116,7 +116,6 @@ class LCodeGen; V(Label) \ V(LazyBailout) \ V(LoadContextSlot) \ - V(LoadExternalArrayPointer) \ V(LoadFieldByIndex) \ V(LoadFunctionPrototype) \ V(LoadGlobalCell) \ @@ -1549,20 +1548,6 @@ class LLoadRoot V8_FINAL : public LTemplateInstruction<1, 0, 0> { }; -class LLoadExternalArrayPointer V8_FINAL - : public LTemplateInstruction<1, 1, 0> { - public: - explicit LLoadExternalArrayPointer(LOperand* object) { - inputs_[0] = object; - } - - LOperand* object() { return inputs_[0]; } - - DECLARE_CONCRETE_INSTRUCTION(LoadExternalArrayPointer, - "load-external-array-pointer") -}; - - class LLoadKeyed V8_FINAL : public LTemplateInstruction<1, 2, 0> { public: LLoadKeyed(LOperand* elements, LOperand* key) { diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc index 3b53e9a234..8074366c72 100644 --- a/src/mips/lithium-codegen-mips.cc +++ b/src/mips/lithium-codegen-mips.cc @@ -3000,15 +3000,6 @@ void LCodeGen::DoLoadRoot(LLoadRoot* instr) { } -void LCodeGen::DoLoadExternalArrayPointer( - LLoadExternalArrayPointer* instr) { - Register to_reg = ToRegister(instr->result()); - Register from_reg = ToRegister(instr->object()); - __ lw(to_reg, FieldMemOperand(from_reg, - ExternalArray::kExternalPointerOffset)); -} - - void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { Register arguments = ToRegister(instr->arguments()); Register result = ToRegister(instr->result()); diff --git a/src/mips/lithium-mips.cc b/src/mips/lithium-mips.cc index 3accfc177c..8a0414aeb9 100644 --- a/src/mips/lithium-mips.cc +++ b/src/mips/lithium-mips.cc @@ -1980,13 +1980,6 @@ LInstruction* LChunkBuilder::DoLoadRoot(HLoadRoot* instr) { } -LInstruction* LChunkBuilder::DoLoadExternalArrayPointer( - HLoadExternalArrayPointer* instr) { - LOperand* input = UseRegisterAtStart(instr->value()); - return DefineAsRegister(new(zone()) LLoadExternalArrayPointer(input)); -} - - LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { ASSERT(instr->key()->representation().IsSmiOrInteger32()); ElementsKind elements_kind = instr->elements_kind(); diff --git a/src/mips/lithium-mips.h b/src/mips/lithium-mips.h index 7fa71b2cce..5250c63c45 100644 --- a/src/mips/lithium-mips.h +++ b/src/mips/lithium-mips.h @@ -114,7 +114,6 @@ class LCodeGen; V(Label) \ V(LazyBailout) \ V(LoadContextSlot) \ - V(LoadExternalArrayPointer) \ V(LoadRoot) \ V(LoadFieldByIndex) \ V(LoadFunctionPrototype) \ @@ -1542,20 +1541,6 @@ class LLoadRoot V8_FINAL : public LTemplateInstruction<1, 0, 0> { }; -class LLoadExternalArrayPointer V8_FINAL - : public LTemplateInstruction<1, 1, 0> { - public: - explicit LLoadExternalArrayPointer(LOperand* object) { - inputs_[0] = object; - } - - LOperand* object() { return inputs_[0]; } - - DECLARE_CONCRETE_INSTRUCTION(LoadExternalArrayPointer, - "load-external-array-pointer") -}; - - class LLoadKeyed V8_FINAL : public LTemplateInstruction<1, 2, 0> { public: LLoadKeyed(LOperand* elements, LOperand* key) { diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc index b747856e03..cbc6ebaff4 100644 --- a/src/x64/lithium-codegen-x64.cc +++ b/src/x64/lithium-codegen-x64.cc @@ -2899,16 +2899,6 @@ void LCodeGen::DoLoadRoot(LLoadRoot* instr) { } -void LCodeGen::DoLoadExternalArrayPointer( - LLoadExternalArrayPointer* instr) { - Register result = ToRegister(instr->result()); - Register input = ToRegister(instr->object()); - __ movp(result, - FieldOperand(input, - ExternalUint8ClampedArray::kExternalPointerOffset)); -} - - void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { Register arguments = ToRegister(instr->arguments()); Register result = ToRegister(instr->result()); diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc index 4a1d9264f7..4ef7082eae 100644 --- a/src/x64/lithium-x64.cc +++ b/src/x64/lithium-x64.cc @@ -1973,13 +1973,6 @@ LInstruction* LChunkBuilder::DoLoadRoot(HLoadRoot* instr) { } -LInstruction* LChunkBuilder::DoLoadExternalArrayPointer( - HLoadExternalArrayPointer* instr) { - LOperand* input = UseRegisterAtStart(instr->value()); - return DefineAsRegister(new(zone()) LLoadExternalArrayPointer(input)); -} - - LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { ASSERT(instr->key()->representation().IsInteger32()); ElementsKind elements_kind = instr->elements_kind(); diff --git a/src/x64/lithium-x64.h b/src/x64/lithium-x64.h index 6da20849c2..5d85b398cf 100644 --- a/src/x64/lithium-x64.h +++ b/src/x64/lithium-x64.h @@ -114,7 +114,6 @@ class LCodeGen; V(Label) \ V(LazyBailout) \ V(LoadContextSlot) \ - V(LoadExternalArrayPointer) \ V(LoadRoot) \ V(LoadFieldByIndex) \ V(LoadFunctionPrototype) \ @@ -1509,20 +1508,6 @@ class LLoadRoot V8_FINAL : public LTemplateInstruction<1, 0, 0> { }; -class LLoadExternalArrayPointer V8_FINAL - : public LTemplateInstruction<1, 1, 0> { - public: - explicit LLoadExternalArrayPointer(LOperand* object) { - inputs_[0] = object; - } - - LOperand* object() { return inputs_[0]; } - - DECLARE_CONCRETE_INSTRUCTION(LoadExternalArrayPointer, - "load-external-array-pointer") -}; - - class LLoadKeyed V8_FINAL : public LTemplateInstruction<1, 2, 0> { public: LLoadKeyed(LOperand* elements, LOperand* key) {