From 722c61922d4d68e29a2db8c2e1547f50b30d1a2b Mon Sep 17 00:00:00 2001 From: "bmeurer@chromium.org" Date: Tue, 17 Sep 2013 11:27:24 +0000 Subject: [PATCH] Remove unused HIsNumberAndBranch instruction. R=svenpanne@chromium.org Review URL: https://codereview.chromium.org/23691067 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16761 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/lithium-arm.cc | 6 ------ src/arm/lithium-arm.h | 14 -------------- src/arm/lithium-codegen-arm.cc | 19 ------------------- src/hydrogen-instructions.h | 16 ---------------- src/ia32/lithium-codegen-ia32.cc | 19 ------------------- src/ia32/lithium-ia32.cc | 6 ------ src/ia32/lithium-ia32.h | 14 -------------- src/mips/lithium-codegen-mips.cc | 19 ------------------- src/mips/lithium-mips.cc | 6 ------ src/mips/lithium-mips.h | 14 -------------- src/x64/lithium-codegen-x64.cc | 19 ------------------- src/x64/lithium-x64.cc | 6 ------ src/x64/lithium-x64.h | 14 -------------- 13 files changed, 172 deletions(-) diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc index 8d08df4..5859ae2 100644 --- a/src/arm/lithium-arm.cc +++ b/src/arm/lithium-arm.cc @@ -2020,12 +2020,6 @@ LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) { } -LInstruction* LChunkBuilder::DoIsNumberAndBranch(HIsNumberAndBranch* instr) { - return new(zone()) - LIsNumberAndBranch(UseRegisterOrConstantAtStart(instr->value())); -} - - LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) { LOperand* value = UseRegisterAtStart(instr->value()); LInstruction* result = new(zone()) LCheckInstanceType(value); diff --git a/src/arm/lithium-arm.h b/src/arm/lithium-arm.h index 94b5e2a..5eab354 100644 --- a/src/arm/lithium-arm.h +++ b/src/arm/lithium-arm.h @@ -113,7 +113,6 @@ class LCodeGen; V(IsConstructCallAndBranch) \ V(IsObjectAndBranch) \ V(IsStringAndBranch) \ - V(IsNumberAndBranch) \ V(IsSmiAndBranch) \ V(IsUndetectableAndBranch) \ V(Label) \ @@ -939,19 +938,6 @@ class LIsObjectAndBranch V8_FINAL : public LControlInstruction<1, 1> { }; -class LIsNumberAndBranch V8_FINAL : public LControlInstruction<1, 0> { - public: - explicit LIsNumberAndBranch(LOperand* value) { - inputs_[0] = value; - } - - LOperand* value() { return inputs_[0]; } - - DECLARE_CONCRETE_INSTRUCTION(IsNumberAndBranch, "is-number-and-branch") - DECLARE_HYDROGEN_ACCESSOR(IsNumberAndBranch) -}; - - class LIsStringAndBranch V8_FINAL : public LControlInstruction<1, 1> { public: LIsStringAndBranch(LOperand* value, LOperand* temp) { diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc index 059aa13..e47dfb0 100644 --- a/src/arm/lithium-codegen-arm.cc +++ b/src/arm/lithium-codegen-arm.cc @@ -2217,25 +2217,6 @@ void LCodeGen::DoDebugBreak(LDebugBreak* instr) { } -void LCodeGen::DoIsNumberAndBranch(LIsNumberAndBranch* instr) { - Representation r = instr->hydrogen()->value()->representation(); - if (r.IsSmiOrInteger32() || r.IsDouble()) { - EmitBranch(instr, al); - } else { - ASSERT(r.IsTagged()); - Register reg = ToRegister(instr->value()); - HType type = instr->hydrogen()->value()->type(); - if (type.IsTaggedNumber()) { - EmitBranch(instr, al); - } - __ JumpIfSmi(reg, instr->TrueLabel(chunk_)); - __ ldr(scratch0(), FieldMemOperand(reg, HeapObject::kMapOffset)); - __ CompareRoot(scratch0(), Heap::kHeapNumberMapRootIndex); - EmitBranch(instr, eq); - } -} - - void LCodeGen::DoBranch(LBranch* instr) { Representation r = instr->hydrogen()->value()->representation(); if (r.IsInteger32() || r.IsSmi()) { diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h index 4a502ba..aed2b4b 100644 --- a/src/hydrogen-instructions.h +++ b/src/hydrogen-instructions.h @@ -128,7 +128,6 @@ class LChunkBuilder; V(InvokeFunction) \ V(IsConstructCallAndBranch) \ V(IsObjectAndBranch) \ - V(IsNumberAndBranch) \ V(IsStringAndBranch) \ V(IsSmiAndBranch) \ V(IsUndetectableAndBranch) \ @@ -2790,21 +2789,6 @@ class HCheckSmi V8_FINAL : public HUnaryOperation { }; -class HIsNumberAndBranch V8_FINAL : public HUnaryControlInstruction { - public: - explicit HIsNumberAndBranch(HValue* value) - : HUnaryControlInstruction(value, NULL, NULL) { - SetFlag(kFlexibleRepresentation); - } - - virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { - return Representation::None(); - } - - DECLARE_CONCRETE_INSTRUCTION(IsNumberAndBranch) -}; - - class HCheckHeapObject V8_FINAL : public HUnaryOperation { public: DECLARE_INSTRUCTION_FACTORY_P1(HCheckHeapObject, HValue*); diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc index d119111..06628ff 100644 --- a/src/ia32/lithium-codegen-ia32.cc +++ b/src/ia32/lithium-codegen-ia32.cc @@ -2338,25 +2338,6 @@ void LCodeGen::EmitFalseBranch(InstrType instr, Condition cc) { } -void LCodeGen::DoIsNumberAndBranch(LIsNumberAndBranch* instr) { - Representation r = instr->hydrogen()->value()->representation(); - if (r.IsSmiOrInteger32() || r.IsDouble()) { - EmitBranch(instr, no_condition); - } else { - ASSERT(r.IsTagged()); - Register reg = ToRegister(instr->value()); - HType type = instr->hydrogen()->value()->type(); - if (type.IsTaggedNumber()) { - EmitBranch(instr, no_condition); - } - __ JumpIfSmi(reg, instr->TrueLabel(chunk_)); - __ cmp(FieldOperand(reg, HeapObject::kMapOffset), - factory()->heap_number_map()); - EmitBranch(instr, equal); - } -} - - void LCodeGen::DoBranch(LBranch* instr) { Representation r = instr->hydrogen()->value()->representation(); if (r.IsSmiOrInteger32()) { diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc index 77f5706..a47b525 100644 --- a/src/ia32/lithium-ia32.cc +++ b/src/ia32/lithium-ia32.cc @@ -2024,12 +2024,6 @@ LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) { } -LInstruction* LChunkBuilder::DoIsNumberAndBranch(HIsNumberAndBranch* instr) { - return new(zone()) - LIsNumberAndBranch(UseRegisterOrConstantAtStart(instr->value())); -} - - LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) { LOperand* value = UseRegisterAtStart(instr->value()); LOperand* temp = TempRegister(); diff --git a/src/ia32/lithium-ia32.h b/src/ia32/lithium-ia32.h index 0e615f2..7fbcad9 100644 --- a/src/ia32/lithium-ia32.h +++ b/src/ia32/lithium-ia32.h @@ -116,7 +116,6 @@ class LCodeGen; V(IsObjectAndBranch) \ V(IsStringAndBranch) \ V(IsSmiAndBranch) \ - V(IsNumberAndBranch) \ V(IsUndetectableAndBranch) \ V(Label) \ V(LazyBailout) \ @@ -922,19 +921,6 @@ class LIsObjectAndBranch V8_FINAL : public LControlInstruction<1, 1> { }; -class LIsNumberAndBranch V8_FINAL : public LControlInstruction<1, 0> { - public: - explicit LIsNumberAndBranch(LOperand* value) { - inputs_[0] = value; - } - - LOperand* value() { return inputs_[0]; } - - DECLARE_CONCRETE_INSTRUCTION(IsNumberAndBranch, "is-number-and-branch") - DECLARE_HYDROGEN_ACCESSOR(IsNumberAndBranch) -}; - - class LIsStringAndBranch V8_FINAL : public LControlInstruction<1, 1> { public: LIsStringAndBranch(LOperand* value, LOperand* temp) { diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc index 3518f13..a50fe5a 100644 --- a/src/mips/lithium-codegen-mips.cc +++ b/src/mips/lithium-codegen-mips.cc @@ -2067,25 +2067,6 @@ void LCodeGen::DoDebugBreak(LDebugBreak* instr) { } -void LCodeGen::DoIsNumberAndBranch(LIsNumberAndBranch* instr) { - Representation r = instr->hydrogen()->value()->representation(); - if (r.IsSmiOrInteger32() || r.IsDouble()) { - EmitBranch(instr, al, zero_reg, Operand(zero_reg)); - } else { - ASSERT(r.IsTagged()); - Register reg = ToRegister(instr->value()); - HType type = instr->hydrogen()->value()->type(); - if (type.IsTaggedNumber()) { - EmitBranch(instr, al, zero_reg, Operand(zero_reg)); - } - __ JumpIfSmi(reg, instr->TrueLabel(chunk_)); - __ lw(scratch0(), FieldMemOperand(reg, HeapObject::kMapOffset)); - __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); - EmitBranch(instr, eq, scratch0(), Operand(at)); - } -} - - void LCodeGen::DoBranch(LBranch* instr) { Representation r = instr->hydrogen()->value()->representation(); if (r.IsInteger32() || r.IsSmi()) { diff --git a/src/mips/lithium-mips.cc b/src/mips/lithium-mips.cc index 6bb8bbe..ad3b854 100644 --- a/src/mips/lithium-mips.cc +++ b/src/mips/lithium-mips.cc @@ -1921,12 +1921,6 @@ LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) { } -LInstruction* LChunkBuilder::DoIsNumberAndBranch(HIsNumberAndBranch* instr) { - return new(zone()) - LIsNumberAndBranch(UseRegisterOrConstantAtStart(instr->value())); -} - - LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) { LOperand* value = UseRegisterAtStart(instr->value()); LInstruction* result = new(zone()) LCheckInstanceType(value); diff --git a/src/mips/lithium-mips.h b/src/mips/lithium-mips.h index 4b14327..3ab8f37 100644 --- a/src/mips/lithium-mips.h +++ b/src/mips/lithium-mips.h @@ -113,7 +113,6 @@ class LCodeGen; V(IsConstructCallAndBranch) \ V(IsObjectAndBranch) \ V(IsStringAndBranch) \ - V(IsNumberAndBranch) \ V(IsSmiAndBranch) \ V(IsUndetectableAndBranch) \ V(Label) \ @@ -936,19 +935,6 @@ class LIsObjectAndBranch V8_FINAL : public LControlInstruction<1, 1> { }; -class LIsNumberAndBranch V8_FINAL : public LControlInstruction<1, 0> { - public: - explicit LIsNumberAndBranch(LOperand* value) { - inputs_[0] = value; - } - - LOperand* value() { return inputs_[0]; } - - DECLARE_CONCRETE_INSTRUCTION(IsNumberAndBranch, "is-number-and-branch") - DECLARE_HYDROGEN_ACCESSOR(IsNumberAndBranch) -}; - - class LIsStringAndBranch V8_FINAL : public LControlInstruction<1, 1> { public: LIsStringAndBranch(LOperand* value, LOperand* temp) { diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc index 5584e39..3c6187d 100644 --- a/src/x64/lithium-codegen-x64.cc +++ b/src/x64/lithium-codegen-x64.cc @@ -1947,25 +1947,6 @@ void LCodeGen::DoDebugBreak(LDebugBreak* instr) { } -void LCodeGen::DoIsNumberAndBranch(LIsNumberAndBranch* instr) { - Representation r = instr->hydrogen()->value()->representation(); - if (r.IsSmiOrInteger32() || r.IsDouble()) { - EmitBranch(instr, no_condition); - } else { - ASSERT(r.IsTagged()); - Register reg = ToRegister(instr->value()); - HType type = instr->hydrogen()->value()->type(); - if (type.IsTaggedNumber()) { - EmitBranch(instr, no_condition); - } - __ JumpIfSmi(reg, instr->TrueLabel(chunk_)); - __ CompareRoot(FieldOperand(reg, HeapObject::kMapOffset), - Heap::kHeapNumberMapRootIndex); - EmitBranch(instr, equal); - } -} - - void LCodeGen::DoBranch(LBranch* instr) { Representation r = instr->hydrogen()->value()->representation(); if (r.IsInteger32()) { diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc index 3a7366e..fcf2862 100644 --- a/src/x64/lithium-x64.cc +++ b/src/x64/lithium-x64.cc @@ -1911,12 +1911,6 @@ LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) { } -LInstruction* LChunkBuilder::DoIsNumberAndBranch(HIsNumberAndBranch* instr) { - return new(zone()) LIsNumberAndBranch( - UseRegisterOrConstantAtStart(instr->value())); -} - - LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) { LOperand* value = UseRegisterAtStart(instr->value()); LCheckInstanceType* result = new(zone()) LCheckInstanceType(value); diff --git a/src/x64/lithium-x64.h b/src/x64/lithium-x64.h index 8496deb..e3faa89 100644 --- a/src/x64/lithium-x64.h +++ b/src/x64/lithium-x64.h @@ -114,7 +114,6 @@ class LCodeGen; V(IsObjectAndBranch) \ V(IsStringAndBranch) \ V(IsSmiAndBranch) \ - V(IsNumberAndBranch) \ V(IsUndetectableAndBranch) \ V(Label) \ V(LazyBailout) \ @@ -883,19 +882,6 @@ class LIsObjectAndBranch V8_FINAL : public LControlInstruction<1, 0> { }; -class LIsNumberAndBranch V8_FINAL : public LControlInstruction<1, 0> { - public: - explicit LIsNumberAndBranch(LOperand* value) { - inputs_[0] = value; - } - - LOperand* value() { return inputs_[0]; } - - DECLARE_CONCRETE_INSTRUCTION(IsNumberAndBranch, "is-number-and-branch") - DECLARE_HYDROGEN_ACCESSOR(IsNumberAndBranch) -}; - - class LIsStringAndBranch V8_FINAL : public LControlInstruction<1, 1> { public: explicit LIsStringAndBranch(LOperand* value, LOperand* temp) { -- 2.7.4