From e0844a24d35c03c6971b8beb633c3506c212179a Mon Sep 17 00:00:00 2001 From: mvstanton Date: Mon, 13 Apr 2015 09:23:24 -0700 Subject: [PATCH] Remove unnecessary options from HTailCallThroughMegamorphicCache These options were added for a hydrogen code stub version of the VectorIC dispatcher, which was discontinued. R=verwaest@chromium.org BUG= Review URL: https://codereview.chromium.org/1081883002 Cr-Commit-Position: refs/heads/master@{#27793} --- src/arm/lithium-arm.cc | 9 +---- src/arm/lithium-arm.h | 9 +---- src/arm/lithium-codegen-arm.cc | 29 +++------------ src/arm64/lithium-arm64.cc | 9 +---- src/arm64/lithium-arm64.h | 9 +---- src/arm64/lithium-codegen-arm64.cc | 25 +++---------- src/code-stubs-hydrogen.cc | 4 ++ src/hydrogen-instructions.h | 55 ++-------------------------- src/ia32/lithium-codegen-ia32.cc | 38 +++---------------- src/ia32/lithium-ia32.cc | 9 +---- src/ia32/lithium-ia32.h | 9 +---- src/mips/lithium-codegen-mips.cc | 28 +++----------- src/mips/lithium-mips.cc | 9 +---- src/mips/lithium-mips.h | 9 +---- src/mips64/lithium-codegen-mips64.cc | 28 +++----------- src/mips64/lithium-mips64.cc | 9 +---- src/mips64/lithium-mips64.h | 9 +---- src/x64/lithium-codegen-x64.cc | 25 +++---------- src/x64/lithium-x64.cc | 9 +---- src/x64/lithium-x64.h | 10 ++--- 20 files changed, 57 insertions(+), 284 deletions(-) diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc index b45e1c5226..30301f9f32 100644 --- a/src/arm/lithium-arm.cc +++ b/src/arm/lithium-arm.cc @@ -1112,17 +1112,10 @@ LInstruction* LChunkBuilder::DoTailCallThroughMegamorphicCache( UseFixed(instr->receiver(), LoadDescriptor::ReceiverRegister()); LOperand* name_register = UseFixed(instr->name(), LoadDescriptor::NameRegister()); - LOperand* slot = NULL; - LOperand* vector = NULL; - if (FLAG_vector_ics) { - slot = UseFixed(instr->slot(), VectorLoadICDescriptor::SlotRegister()); - vector = - UseFixed(instr->vector(), VectorLoadICDescriptor::VectorRegister()); - } // Not marked as call. It can't deoptimize, and it never returns. return new (zone()) LTailCallThroughMegamorphicCache( - context, receiver_register, name_register, slot, vector); + context, receiver_register, name_register); } diff --git a/src/arm/lithium-arm.h b/src/arm/lithium-arm.h index fbf648f0e4..fc42f084fe 100644 --- a/src/arm/lithium-arm.h +++ b/src/arm/lithium-arm.h @@ -474,23 +474,18 @@ class LCallStub FINAL : public LTemplateInstruction<1, 1, 0> { class LTailCallThroughMegamorphicCache FINAL - : public LTemplateInstruction<0, 5, 0> { + : public LTemplateInstruction<0, 3, 0> { public: LTailCallThroughMegamorphicCache(LOperand* context, LOperand* receiver, - LOperand* name, LOperand* slot, - LOperand* vector) { + LOperand* name) { inputs_[0] = context; inputs_[1] = receiver; inputs_[2] = name; - inputs_[3] = slot; - inputs_[4] = vector; } LOperand* context() { return inputs_[0]; } LOperand* receiver() { return inputs_[1]; } LOperand* name() { return inputs_[2]; } - LOperand* slot() { return inputs_[3]; } - LOperand* vector() { return inputs_[4]; } DECLARE_CONCRETE_INSTRUCTION(TailCallThroughMegamorphicCache, "tail-call-through-megamorphic-cache") diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc index 8a647d880b..2453509c2d 100644 --- a/src/arm/lithium-codegen-arm.cc +++ b/src/arm/lithium-codegen-arm.cc @@ -3957,32 +3957,13 @@ void LCodeGen::DoTailCallThroughMegamorphicCache( Register extra2 = r6; Register extra3 = r9; -#ifdef DEBUG - Register slot = FLAG_vector_ics ? ToRegister(instr->slot()) : no_reg; - Register vector = FLAG_vector_ics ? ToRegister(instr->vector()) : no_reg; - DCHECK(!FLAG_vector_ics || - !AreAliased(slot, vector, scratch, extra, extra2, extra3)); -#endif - - // Important for the tail-call. - bool must_teardown_frame = NeedsEagerFrame(); - - if (!instr->hydrogen()->is_just_miss()) { - DCHECK(!instr->hydrogen()->is_keyed_load()); - - // The probe will tail call to a handler if found. - isolate()->stub_cache()->GenerateProbe( - masm(), Code::LOAD_IC, instr->hydrogen()->flags(), must_teardown_frame, - receiver, name, scratch, extra, extra2, extra3); - } + // The probe will tail call to a handler if found. + isolate()->stub_cache()->GenerateProbe( + masm(), Code::LOAD_IC, instr->hydrogen()->flags(), false, receiver, name, + scratch, extra, extra2, extra3); // Tail call to miss if we ended up here. - if (must_teardown_frame) __ LeaveFrame(StackFrame::INTERNAL); - if (instr->hydrogen()->is_keyed_load()) { - KeyedLoadIC::GenerateMiss(masm()); - } else { - LoadIC::GenerateMiss(masm()); - } + LoadIC::GenerateMiss(masm()); } diff --git a/src/arm64/lithium-arm64.cc b/src/arm64/lithium-arm64.cc index 4a89fc4344..c57cb689a0 100644 --- a/src/arm64/lithium-arm64.cc +++ b/src/arm64/lithium-arm64.cc @@ -1586,17 +1586,10 @@ LInstruction* LChunkBuilder::DoTailCallThroughMegamorphicCache( UseFixed(instr->receiver(), LoadDescriptor::ReceiverRegister()); LOperand* name_register = UseFixed(instr->name(), LoadDescriptor::NameRegister()); - LOperand* slot = NULL; - LOperand* vector = NULL; - if (FLAG_vector_ics) { - slot = UseFixed(instr->slot(), VectorLoadICDescriptor::SlotRegister()); - vector = - UseFixed(instr->vector(), VectorLoadICDescriptor::VectorRegister()); - } // Not marked as call. It can't deoptimize, and it never returns. return new (zone()) LTailCallThroughMegamorphicCache( - context, receiver_register, name_register, slot, vector); + context, receiver_register, name_register); } diff --git a/src/arm64/lithium-arm64.h b/src/arm64/lithium-arm64.h index 0549689e79..1afed1a607 100644 --- a/src/arm64/lithium-arm64.h +++ b/src/arm64/lithium-arm64.h @@ -318,23 +318,18 @@ class LTemplateInstruction : public LTemplateResultInstruction { class LTailCallThroughMegamorphicCache FINAL - : public LTemplateInstruction<0, 5, 0> { + : public LTemplateInstruction<0, 3, 0> { public: LTailCallThroughMegamorphicCache(LOperand* context, LOperand* receiver, - LOperand* name, LOperand* slot, - LOperand* vector) { + LOperand* name) { inputs_[0] = context; inputs_[1] = receiver; inputs_[2] = name; - inputs_[3] = slot; - inputs_[4] = vector; } LOperand* context() { return inputs_[0]; } LOperand* receiver() { return inputs_[1]; } LOperand* name() { return inputs_[2]; } - LOperand* slot() { return inputs_[3]; } - LOperand* vector() { return inputs_[4]; } DECLARE_CONCRETE_INSTRUCTION(TailCallThroughMegamorphicCache, "tail-call-through-megamorphic-cache") diff --git a/src/arm64/lithium-codegen-arm64.cc b/src/arm64/lithium-codegen-arm64.cc index 8f32bdd678..0cc1dfc5bc 100644 --- a/src/arm64/lithium-codegen-arm64.cc +++ b/src/arm64/lithium-codegen-arm64.cc @@ -2024,29 +2024,14 @@ void LCodeGen::DoTailCallThroughMegamorphicCache( Register extra = x5; Register extra2 = x6; Register extra3 = x7; - DCHECK(!FLAG_vector_ics || - !AreAliased(ToRegister(instr->slot()), ToRegister(instr->vector()), - scratch, extra, extra2, extra3)); - // Important for the tail-call. - bool must_teardown_frame = NeedsEagerFrame(); - - if (!instr->hydrogen()->is_just_miss()) { - DCHECK(!instr->hydrogen()->is_keyed_load()); - - // The probe will tail call to a handler if found. - isolate()->stub_cache()->GenerateProbe( - masm(), Code::LOAD_IC, instr->hydrogen()->flags(), must_teardown_frame, - receiver, name, scratch, extra, extra2, extra3); - } + // The probe will tail call to a handler if found. + isolate()->stub_cache()->GenerateProbe( + masm(), Code::LOAD_IC, instr->hydrogen()->flags(), false, receiver, name, + scratch, extra, extra2, extra3); // Tail call to miss if we ended up here. - if (must_teardown_frame) __ LeaveFrame(StackFrame::INTERNAL); - if (instr->hydrogen()->is_keyed_load()) { - KeyedLoadIC::GenerateMiss(masm()); - } else { - LoadIC::GenerateMiss(masm()); - } + LoadIC::GenerateMiss(masm()); } diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc index 8168aac4b8..3ca301ca6c 100644 --- a/src/code-stubs-hydrogen.cc +++ b/src/code-stubs-hydrogen.cc @@ -2029,6 +2029,10 @@ HValue* CodeStubGraphBuilder::BuildCodeStub() { // megamorphic case is handled as part of the default stub. DCHECK(!FLAG_vector_ics); + // This stub tail calls, and an erected frame presents complications we don't + // need. + info()->MarkMustNotHaveEagerFrame(); + // Probe the stub cache. Add(receiver, name); diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h index 64a0516721..8c42e021c6 100644 --- a/src/hydrogen-instructions.h +++ b/src/hydrogen-instructions.h @@ -5291,28 +5291,6 @@ class HCallStub FINAL : public HUnaryCall { class HTailCallThroughMegamorphicCache FINAL : public HInstruction { public: - enum Flags { - NONE = 0, - CALLED_FROM_KEYED_LOAD = 1 << 0, - PERFORM_MISS_ONLY = 1 << 1 - }; - - static Flags ComputeFlags(bool called_from_keyed_load, - bool perform_miss_only) { - Flags flags = NONE; - if (called_from_keyed_load) { - flags = static_cast(flags | CALLED_FROM_KEYED_LOAD); - } - if (perform_miss_only) { - flags = static_cast(flags | PERFORM_MISS_ONLY); - } - return flags; - } - - DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P5( - HTailCallThroughMegamorphicCache, HValue*, HValue*, HValue*, HValue*, - HTailCallThroughMegamorphicCache::Flags); - DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HTailCallThroughMegamorphicCache, HValue*, HValue*); @@ -5320,27 +5298,14 @@ class HTailCallThroughMegamorphicCache FINAL : public HInstruction { return Representation::Tagged(); } - virtual int OperandCount() const FINAL OVERRIDE { - return FLAG_vector_ics ? 5 : 3; - } + virtual int OperandCount() const FINAL OVERRIDE { return 3; } virtual HValue* OperandAt(int i) const FINAL OVERRIDE { return inputs_[i]; } HValue* context() const { return OperandAt(0); } HValue* receiver() const { return OperandAt(1); } HValue* name() const { return OperandAt(2); } - HValue* slot() const { - DCHECK(FLAG_vector_ics); - return OperandAt(3); - } - HValue* vector() const { - DCHECK(FLAG_vector_ics); - return OperandAt(4); - } Code::Flags flags() const; - bool is_keyed_load() const { return flags_ & CALLED_FROM_KEYED_LOAD; } - bool is_just_miss() const { return flags_ & PERFORM_MISS_ONLY; } - std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT DECLARE_CONCRETE_INSTRUCTION(TailCallThroughMegamorphicCache) @@ -5352,27 +5317,13 @@ class HTailCallThroughMegamorphicCache FINAL : public HInstruction { private: HTailCallThroughMegamorphicCache(HValue* context, HValue* receiver, - HValue* name, HValue* slot, HValue* vector, - Flags flags) - : flags_(flags) { - DCHECK(FLAG_vector_ics); - SetOperandAt(0, context); - SetOperandAt(1, receiver); - SetOperandAt(2, name); - SetOperandAt(3, slot); - SetOperandAt(4, vector); - } - - HTailCallThroughMegamorphicCache(HValue* context, HValue* receiver, - HValue* name) - : flags_(NONE) { + HValue* name) { SetOperandAt(0, context); SetOperandAt(1, receiver); SetOperandAt(2, name); } - EmbeddedContainer inputs_; - Flags flags_; + EmbeddedContainer inputs_; }; diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc index 72bb270e7a..6d26fde270 100644 --- a/src/ia32/lithium-codegen-ia32.cc +++ b/src/ia32/lithium-codegen-ia32.cc @@ -3473,44 +3473,18 @@ void LCodeGen::DoTailCallThroughMegamorphicCache( Register name = ToRegister(instr->name()); DCHECK(receiver.is(LoadDescriptor::ReceiverRegister())); DCHECK(name.is(LoadDescriptor::NameRegister())); - Register slot = FLAG_vector_ics ? ToRegister(instr->slot()) : no_reg; - Register vector = FLAG_vector_ics ? ToRegister(instr->vector()) : no_reg; - Register scratch = ebx; Register extra = edi; - DCHECK(!extra.is(slot) && !extra.is(vector)); DCHECK(!scratch.is(receiver) && !scratch.is(name)); DCHECK(!extra.is(receiver) && !extra.is(name)); - // Important for the tail-call. - bool must_teardown_frame = NeedsEagerFrame(); + // The probe will tail call to a handler if found. + // If --vector-ics is on, then it knows to pop the two args first. + isolate()->stub_cache()->GenerateProbe(masm(), Code::LOAD_IC, + instr->hydrogen()->flags(), false, + receiver, name, scratch, extra); - if (!instr->hydrogen()->is_just_miss()) { - if (FLAG_vector_ics) { - __ push(slot); - __ push(vector); - } - - // The probe will tail call to a handler if found. - // If --vector-ics is on, then it knows to pop the two args first. - DCHECK(!instr->hydrogen()->is_keyed_load()); - isolate()->stub_cache()->GenerateProbe( - masm(), Code::LOAD_IC, instr->hydrogen()->flags(), must_teardown_frame, - receiver, name, scratch, extra); - - if (FLAG_vector_ics) { - __ pop(vector); - __ pop(slot); - } - } - - // Tail call to miss if we ended up here. - if (must_teardown_frame) __ leave(); - if (instr->hydrogen()->is_keyed_load()) { - KeyedLoadIC::GenerateMiss(masm()); - } else { - LoadIC::GenerateMiss(masm()); - } + LoadIC::GenerateMiss(masm()); } diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc index 0bda914f6d..d0ca2a847c 100644 --- a/src/ia32/lithium-ia32.cc +++ b/src/ia32/lithium-ia32.cc @@ -1153,17 +1153,10 @@ LInstruction* LChunkBuilder::DoTailCallThroughMegamorphicCache( UseFixed(instr->receiver(), LoadDescriptor::ReceiverRegister()); LOperand* name_register = UseFixed(instr->name(), LoadDescriptor::NameRegister()); - LOperand* slot = NULL; - LOperand* vector = NULL; - if (FLAG_vector_ics) { - slot = UseFixed(instr->slot(), VectorLoadICDescriptor::SlotRegister()); - vector = - UseFixed(instr->vector(), VectorLoadICDescriptor::VectorRegister()); - } // Not marked as call. It can't deoptimize, and it never returns. return new (zone()) LTailCallThroughMegamorphicCache( - context, receiver_register, name_register, slot, vector); + context, receiver_register, name_register); } diff --git a/src/ia32/lithium-ia32.h b/src/ia32/lithium-ia32.h index 4ea444a665..6d9e3b31ee 100644 --- a/src/ia32/lithium-ia32.h +++ b/src/ia32/lithium-ia32.h @@ -469,23 +469,18 @@ class LCallStub FINAL : public LTemplateInstruction<1, 1, 0> { class LTailCallThroughMegamorphicCache FINAL - : public LTemplateInstruction<0, 5, 0> { + : public LTemplateInstruction<0, 3, 0> { public: LTailCallThroughMegamorphicCache(LOperand* context, LOperand* receiver, - LOperand* name, LOperand* slot, - LOperand* vector) { + LOperand* name) { inputs_[0] = context; inputs_[1] = receiver; inputs_[2] = name; - inputs_[3] = slot; - inputs_[4] = vector; } LOperand* context() { return inputs_[0]; } LOperand* receiver() { return inputs_[1]; } LOperand* name() { return inputs_[2]; } - LOperand* slot() { return inputs_[3]; } - LOperand* vector() { return inputs_[4]; } DECLARE_CONCRETE_INSTRUCTION(TailCallThroughMegamorphicCache, "tail-call-through-megamorphic-cache") diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc index 6293b2cb10..6431100e5f 100644 --- a/src/mips/lithium-codegen-mips.cc +++ b/src/mips/lithium-codegen-mips.cc @@ -3948,32 +3948,14 @@ void LCodeGen::DoTailCallThroughMegamorphicCache( Register extra = t1; Register extra2 = t2; Register extra3 = t5; -#ifdef DEBUG - Register slot = FLAG_vector_ics ? ToRegister(instr->slot()) : no_reg; - Register vector = FLAG_vector_ics ? ToRegister(instr->vector()) : no_reg; - DCHECK(!FLAG_vector_ics || - !AreAliased(slot, vector, scratch, extra, extra2, extra3)); -#endif - // Important for the tail-call. - bool must_teardown_frame = NeedsEagerFrame(); - - if (!instr->hydrogen()->is_just_miss()) { - DCHECK(!instr->hydrogen()->is_keyed_load()); - - // The probe will tail call to a handler if found. - isolate()->stub_cache()->GenerateProbe( - masm(), Code::LOAD_IC, instr->hydrogen()->flags(), must_teardown_frame, - receiver, name, scratch, extra, extra2, extra3); - } + // The probe will tail call to a handler if found. + isolate()->stub_cache()->GenerateProbe( + masm(), Code::LOAD_IC, instr->hydrogen()->flags(), false, receiver, name, + scratch, extra, extra2, extra3); // Tail call to miss if we ended up here. - if (must_teardown_frame) __ LeaveFrame(StackFrame::INTERNAL); - if (instr->hydrogen()->is_keyed_load()) { - KeyedLoadIC::GenerateMiss(masm()); - } else { - LoadIC::GenerateMiss(masm()); - } + LoadIC::GenerateMiss(masm()); } diff --git a/src/mips/lithium-mips.cc b/src/mips/lithium-mips.cc index b710ef9fde..330262f391 100644 --- a/src/mips/lithium-mips.cc +++ b/src/mips/lithium-mips.cc @@ -1117,17 +1117,10 @@ LInstruction* LChunkBuilder::DoTailCallThroughMegamorphicCache( UseFixed(instr->receiver(), LoadDescriptor::ReceiverRegister()); LOperand* name_register = UseFixed(instr->name(), LoadDescriptor::NameRegister()); - LOperand* slot = NULL; - LOperand* vector = NULL; - if (FLAG_vector_ics) { - slot = UseFixed(instr->slot(), VectorLoadICDescriptor::SlotRegister()); - vector = - UseFixed(instr->vector(), VectorLoadICDescriptor::VectorRegister()); - } // Not marked as call. It can't deoptimize, and it never returns. return new (zone()) LTailCallThroughMegamorphicCache( - context, receiver_register, name_register, slot, vector); + context, receiver_register, name_register); } diff --git a/src/mips/lithium-mips.h b/src/mips/lithium-mips.h index ede4cbed91..46ed444e5b 100644 --- a/src/mips/lithium-mips.h +++ b/src/mips/lithium-mips.h @@ -471,23 +471,18 @@ class LCallStub FINAL : public LTemplateInstruction<1, 1, 0> { class LTailCallThroughMegamorphicCache FINAL - : public LTemplateInstruction<0, 5, 0> { + : public LTemplateInstruction<0, 3, 0> { public: LTailCallThroughMegamorphicCache(LOperand* context, LOperand* receiver, - LOperand* name, LOperand* slot, - LOperand* vector) { + LOperand* name) { inputs_[0] = context; inputs_[1] = receiver; inputs_[2] = name; - inputs_[3] = slot; - inputs_[4] = vector; } LOperand* context() { return inputs_[0]; } LOperand* receiver() { return inputs_[1]; } LOperand* name() { return inputs_[2]; } - LOperand* slot() { return inputs_[3]; } - LOperand* vector() { return inputs_[4]; } DECLARE_CONCRETE_INSTRUCTION(TailCallThroughMegamorphicCache, "tail-call-through-megamorphic-cache") diff --git a/src/mips64/lithium-codegen-mips64.cc b/src/mips64/lithium-codegen-mips64.cc index fb3bda8df5..d1e9d217aa 100644 --- a/src/mips64/lithium-codegen-mips64.cc +++ b/src/mips64/lithium-codegen-mips64.cc @@ -4010,32 +4010,14 @@ void LCodeGen::DoTailCallThroughMegamorphicCache( Register extra = a5; Register extra2 = a6; Register extra3 = t1; -#ifdef DEBUG - Register slot = FLAG_vector_ics ? ToRegister(instr->slot()) : no_reg; - Register vector = FLAG_vector_ics ? ToRegister(instr->vector()) : no_reg; - DCHECK(!FLAG_vector_ics || - !AreAliased(slot, vector, scratch, extra, extra2, extra3)); -#endif - // Important for the tail-call. - bool must_teardown_frame = NeedsEagerFrame(); - - if (!instr->hydrogen()->is_just_miss()) { - DCHECK(!instr->hydrogen()->is_keyed_load()); - - // The probe will tail call to a handler if found. - isolate()->stub_cache()->GenerateProbe( - masm(), Code::LOAD_IC, instr->hydrogen()->flags(), must_teardown_frame, - receiver, name, scratch, extra, extra2, extra3); - } + // The probe will tail call to a handler if found. + isolate()->stub_cache()->GenerateProbe( + masm(), Code::LOAD_IC, instr->hydrogen()->flags(), false, receiver, name, + scratch, extra, extra2, extra3); // Tail call to miss if we ended up here. - if (must_teardown_frame) __ LeaveFrame(StackFrame::INTERNAL); - if (instr->hydrogen()->is_keyed_load()) { - KeyedLoadIC::GenerateMiss(masm()); - } else { - LoadIC::GenerateMiss(masm()); - } + LoadIC::GenerateMiss(masm()); } diff --git a/src/mips64/lithium-mips64.cc b/src/mips64/lithium-mips64.cc index 60a837e7c5..0c01128d57 100644 --- a/src/mips64/lithium-mips64.cc +++ b/src/mips64/lithium-mips64.cc @@ -1117,17 +1117,10 @@ LInstruction* LChunkBuilder::DoTailCallThroughMegamorphicCache( UseFixed(instr->receiver(), LoadDescriptor::ReceiverRegister()); LOperand* name_register = UseFixed(instr->name(), LoadDescriptor::NameRegister()); - LOperand* slot = NULL; - LOperand* vector = NULL; - if (FLAG_vector_ics) { - slot = UseFixed(instr->slot(), VectorLoadICDescriptor::SlotRegister()); - vector = - UseFixed(instr->vector(), VectorLoadICDescriptor::VectorRegister()); - } // Not marked as call. It can't deoptimize, and it never returns. return new (zone()) LTailCallThroughMegamorphicCache( - context, receiver_register, name_register, slot, vector); + context, receiver_register, name_register); } diff --git a/src/mips64/lithium-mips64.h b/src/mips64/lithium-mips64.h index 6eed2c2391..e859f7e5ff 100644 --- a/src/mips64/lithium-mips64.h +++ b/src/mips64/lithium-mips64.h @@ -470,23 +470,18 @@ class LCallStub FINAL : public LTemplateInstruction<1, 1, 0> { class LTailCallThroughMegamorphicCache FINAL - : public LTemplateInstruction<0, 5, 0> { + : public LTemplateInstruction<0, 3, 0> { public: LTailCallThroughMegamorphicCache(LOperand* context, LOperand* receiver, - LOperand* name, LOperand* slot, - LOperand* vector) { + LOperand* name) { inputs_[0] = context; inputs_[1] = receiver; inputs_[2] = name; - inputs_[3] = slot; - inputs_[4] = vector; } LOperand* context() { return inputs_[0]; } LOperand* receiver() { return inputs_[1]; } LOperand* name() { return inputs_[2]; } - LOperand* slot() { return inputs_[3]; } - LOperand* vector() { return inputs_[4]; } DECLARE_CONCRETE_INSTRUCTION(TailCallThroughMegamorphicCache, "tail-call-through-megamorphic-cache") diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc index 3b72d690fe..245ca5ce96 100644 --- a/src/x64/lithium-codegen-x64.cc +++ b/src/x64/lithium-codegen-x64.cc @@ -3553,28 +3553,13 @@ void LCodeGen::DoTailCallThroughMegamorphicCache( DCHECK(name.is(LoadDescriptor::NameRegister())); Register scratch = rdi; DCHECK(!scratch.is(receiver) && !scratch.is(name)); - DCHECK(!FLAG_vector_ics || - !AreAliased(ToRegister(instr->slot()), ToRegister(instr->vector()), - scratch)); - // Important for the tail-call. - bool must_teardown_frame = NeedsEagerFrame(); + // The probe will tail call to a handler if found. + isolate()->stub_cache()->GenerateProbe(masm(), Code::LOAD_IC, + instr->hydrogen()->flags(), false, + receiver, name, scratch, no_reg); - if (!instr->hydrogen()->is_just_miss()) { - // The probe will tail call to a handler if found. - DCHECK(!instr->hydrogen()->is_keyed_load()); - isolate()->stub_cache()->GenerateProbe( - masm(), Code::LOAD_IC, instr->hydrogen()->flags(), must_teardown_frame, - receiver, name, scratch, no_reg); - } - - // Tail call to miss if we ended up here. - if (must_teardown_frame) __ leave(); - if (instr->hydrogen()->is_keyed_load()) { - KeyedLoadIC::GenerateMiss(masm()); - } else { - LoadIC::GenerateMiss(masm()); - } + LoadIC::GenerateMiss(masm()); } diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc index 9e6a65526b..87c4a64bbb 100644 --- a/src/x64/lithium-x64.cc +++ b/src/x64/lithium-x64.cc @@ -1133,17 +1133,10 @@ LInstruction* LChunkBuilder::DoTailCallThroughMegamorphicCache( UseFixed(instr->receiver(), LoadDescriptor::ReceiverRegister()); LOperand* name_register = UseFixed(instr->name(), LoadDescriptor::NameRegister()); - LOperand* slot = NULL; - LOperand* vector = NULL; - if (FLAG_vector_ics) { - slot = UseFixed(instr->slot(), VectorLoadICDescriptor::SlotRegister()); - vector = - UseFixed(instr->vector(), VectorLoadICDescriptor::VectorRegister()); - } // Not marked as call. It can't deoptimize, and it never returns. return new (zone()) LTailCallThroughMegamorphicCache( - context, receiver_register, name_register, slot, vector); + context, receiver_register, name_register); } diff --git a/src/x64/lithium-x64.h b/src/x64/lithium-x64.h index a7a1fe8796..fa307cfd3e 100644 --- a/src/x64/lithium-x64.h +++ b/src/x64/lithium-x64.h @@ -478,23 +478,19 @@ class LCallStub FINAL : public LTemplateInstruction<1, 1, 0> { class LTailCallThroughMegamorphicCache FINAL - : public LTemplateInstruction<0, 5, 0> { + : public LTemplateInstruction<0, 3, 0> { public: explicit LTailCallThroughMegamorphicCache(LOperand* context, - LOperand* receiver, LOperand* name, - LOperand* slot, LOperand* vector) { + LOperand* receiver, + LOperand* name) { inputs_[0] = context; inputs_[1] = receiver; inputs_[2] = name; - inputs_[3] = slot; - inputs_[4] = vector; } LOperand* context() { return inputs_[0]; } LOperand* receiver() { return inputs_[1]; } LOperand* name() { return inputs_[2]; } - LOperand* slot() { return inputs_[3]; } - LOperand* vector() { return inputs_[4]; } DECLARE_CONCRETE_INSTRUCTION(TailCallThroughMegamorphicCache, "tail-call-through-megamorphic-cache")