From 4286f2c0bd5905c9696e682758ca95794df5e1bb Mon Sep 17 00:00:00 2001 From: ishell Date: Tue, 20 Sep 2016 04:11:32 -0700 Subject: [PATCH] [crankshaft] Remove HStoreKeyedGeneric and use HCallWithDescriptor instead to call KeyedStoreIC. ... because the latter automatically respects the desired calling convention. BUG=v8:5407 Review-Url: https://codereview.chromium.org/2350423002 Cr-Commit-Position: refs/heads/master@{#39543} --- src/crankshaft/arm/lithium-arm.cc | 29 ------------ src/crankshaft/arm/lithium-arm.h | 29 ------------ src/crankshaft/arm/lithium-codegen-arm.cc | 29 ------------ src/crankshaft/arm/lithium-codegen-arm.h | 2 - src/crankshaft/arm64/lithium-arm64.cc | 29 ------------ src/crankshaft/arm64/lithium-arm64.h | 29 ------------ src/crankshaft/arm64/lithium-codegen-arm64.cc | 29 ------------ src/crankshaft/arm64/lithium-codegen-arm64.h | 2 - src/crankshaft/hydrogen-instructions.cc | 8 ---- src/crankshaft/hydrogen-instructions.h | 45 ------------------- src/crankshaft/hydrogen.cc | 32 ++++++++----- src/crankshaft/ia32/lithium-codegen-ia32.cc | 29 ------------ src/crankshaft/ia32/lithium-codegen-ia32.h | 2 - src/crankshaft/ia32/lithium-ia32.cc | 29 ------------ src/crankshaft/ia32/lithium-ia32.h | 29 ------------ src/crankshaft/mips/lithium-codegen-mips.cc | 29 ------------ src/crankshaft/mips/lithium-codegen-mips.h | 2 - src/crankshaft/mips/lithium-mips.cc | 29 ------------ src/crankshaft/mips/lithium-mips.h | 29 ------------ .../mips64/lithium-codegen-mips64.cc | 29 ------------ .../mips64/lithium-codegen-mips64.h | 2 - src/crankshaft/mips64/lithium-mips64.cc | 29 ------------ src/crankshaft/mips64/lithium-mips64.h | 29 ------------ src/crankshaft/ppc/lithium-codegen-ppc.cc | 29 ------------ src/crankshaft/ppc/lithium-codegen-ppc.h | 2 - src/crankshaft/ppc/lithium-ppc.cc | 29 ------------ src/crankshaft/ppc/lithium-ppc.h | 29 ------------ src/crankshaft/s390/lithium-codegen-s390.cc | 27 ----------- src/crankshaft/s390/lithium-codegen-s390.h | 2 - src/crankshaft/s390/lithium-s390.cc | 27 ----------- src/crankshaft/s390/lithium-s390.h | 28 ------------ src/crankshaft/x64/lithium-codegen-x64.cc | 29 ------------ src/crankshaft/x64/lithium-codegen-x64.h | 2 - src/crankshaft/x64/lithium-x64.cc | 29 ------------ src/crankshaft/x64/lithium-x64.h | 29 ------------ src/crankshaft/x87/lithium-codegen-x87.cc | 29 ------------ src/crankshaft/x87/lithium-codegen-x87.h | 2 - src/crankshaft/x87/lithium-x87.cc | 29 ------------ src/crankshaft/x87/lithium-x87.h | 29 ------------ 39 files changed, 21 insertions(+), 860 deletions(-) diff --git a/src/crankshaft/arm/lithium-arm.cc b/src/crankshaft/arm/lithium-arm.cc index 73906010a8..5273c48a8b 100644 --- a/src/crankshaft/arm/lithium-arm.cc +++ b/src/crankshaft/arm/lithium-arm.cc @@ -336,15 +336,6 @@ void LStoreKeyed::PrintDataTo(StringStream* stream) { } -void LStoreKeyedGeneric::PrintDataTo(StringStream* stream) { - object()->PrintTo(stream); - stream->Add("["); - key()->PrintTo(stream); - stream->Add("] <- "); - value()->PrintTo(stream); -} - - void LTransitionElementsKind::PrintDataTo(StringStream* stream) { object()->PrintTo(stream); stream->Add(" %p -> %p", *original_map(), *transitioned_map()); @@ -2171,26 +2162,6 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { } -LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { - LOperand* context = UseFixed(instr->context(), cp); - LOperand* obj = - UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); - LOperand* key = UseFixed(instr->key(), StoreDescriptor::NameRegister()); - LOperand* val = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); - - DCHECK(instr->object()->representation().IsTagged()); - DCHECK(instr->key()->representation().IsTagged()); - DCHECK(instr->value()->representation().IsTagged()); - - LOperand* slot = FixedTemp(StoreWithVectorDescriptor::SlotRegister()); - LOperand* vector = FixedTemp(StoreWithVectorDescriptor::VectorRegister()); - - LStoreKeyedGeneric* result = - new (zone()) LStoreKeyedGeneric(context, obj, key, val, slot, vector); - return MarkAsCall(result, instr); -} - - LInstruction* LChunkBuilder::DoTransitionElementsKind( HTransitionElementsKind* instr) { if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { diff --git a/src/crankshaft/arm/lithium-arm.h b/src/crankshaft/arm/lithium-arm.h index f193cf83b4..abdfbddf4d 100644 --- a/src/crankshaft/arm/lithium-arm.h +++ b/src/crankshaft/arm/lithium-arm.h @@ -132,7 +132,6 @@ class LCodeGen; V(StoreCodeEntry) \ V(StoreContextSlot) \ V(StoreKeyed) \ - V(StoreKeyedGeneric) \ V(StoreNamedField) \ V(StringAdd) \ V(StringCharCodeAt) \ @@ -2040,34 +2039,6 @@ class LStoreKeyed final : public LTemplateInstruction<0, 4, 0> { }; -class LStoreKeyedGeneric final : public LTemplateInstruction<0, 4, 2> { - public: - LStoreKeyedGeneric(LOperand* context, LOperand* object, LOperand* key, - LOperand* value, LOperand* slot, LOperand* vector) { - inputs_[0] = context; - inputs_[1] = object; - inputs_[2] = key; - inputs_[3] = value; - temps_[0] = slot; - temps_[1] = vector; - } - - LOperand* context() { return inputs_[0]; } - LOperand* object() { return inputs_[1]; } - LOperand* key() { return inputs_[2]; } - LOperand* value() { return inputs_[3]; } - LOperand* temp_slot() { return temps_[0]; } - LOperand* temp_vector() { return temps_[1]; } - - DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") - DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) - - void PrintDataTo(StringStream* stream) override; - - LanguageMode language_mode() { return hydrogen()->language_mode(); } -}; - - class LTransitionElementsKind final : public LTemplateInstruction<0, 2, 1> { public: LTransitionElementsKind(LOperand* object, diff --git a/src/crankshaft/arm/lithium-codegen-arm.cc b/src/crankshaft/arm/lithium-codegen-arm.cc index 281ea8ceb5..4ff8ba84ed 100644 --- a/src/crankshaft/arm/lithium-codegen-arm.cc +++ b/src/crankshaft/arm/lithium-codegen-arm.cc @@ -2596,20 +2596,6 @@ void LCodeGen::EmitVectorLoadICRegisters(T* instr) { } -template -void LCodeGen::EmitVectorStoreICRegisters(T* instr) { - Register vector_register = ToRegister(instr->temp_vector()); - Register slot_register = ToRegister(instr->temp_slot()); - - AllowDeferredHandleDereference vector_structure_check; - Handle vector = instr->hydrogen()->feedback_vector(); - __ Move(vector_register, vector); - FeedbackVectorSlot slot = instr->hydrogen()->slot(); - int index = vector->GetIndex(slot); - __ mov(slot_register, Operand(Smi::FromInt(index))); -} - - void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { DCHECK(ToRegister(instr->context()).is(cp)); DCHECK(ToRegister(instr->result()).is(r0)); @@ -4050,21 +4036,6 @@ void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) { } -void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { - DCHECK(ToRegister(instr->context()).is(cp)); - DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); - DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); - DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); - - EmitVectorStoreICRegisters(instr); - - Handle ic = CodeFactory::KeyedStoreICInOptimizedCode( - isolate(), instr->language_mode()) - .code(); - CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); -} - - void LCodeGen::DoMaybeGrowElements(LMaybeGrowElements* instr) { class DeferredMaybeGrowElements final : public LDeferredCode { public: diff --git a/src/crankshaft/arm/lithium-codegen-arm.h b/src/crankshaft/arm/lithium-codegen-arm.h index 533f4c8cca..26b7fb50a8 100644 --- a/src/crankshaft/arm/lithium-codegen-arm.h +++ b/src/crankshaft/arm/lithium-codegen-arm.h @@ -311,8 +311,6 @@ class LCodeGen: public LCodeGenBase { template void EmitVectorLoadICRegisters(T* instr); - template - void EmitVectorStoreICRegisters(T* instr); ZoneList jump_table_; Scope* const scope_; diff --git a/src/crankshaft/arm64/lithium-arm64.cc b/src/crankshaft/arm64/lithium-arm64.cc index 329161a086..c12fab833a 100644 --- a/src/crankshaft/arm64/lithium-arm64.cc +++ b/src/crankshaft/arm64/lithium-arm64.cc @@ -252,15 +252,6 @@ void LStoreContextSlot::PrintDataTo(StringStream* stream) { } -void LStoreKeyedGeneric::PrintDataTo(StringStream* stream) { - object()->PrintTo(stream); - stream->Add("["); - key()->PrintTo(stream); - stream->Add("] <- "); - value()->PrintTo(stream); -} - - void LStoreNamedField::PrintDataTo(StringStream* stream) { object()->PrintTo(stream); std::ostringstream os; @@ -2200,26 +2191,6 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { } -LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { - LOperand* context = UseFixed(instr->context(), cp); - LOperand* object = - UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); - LOperand* key = UseFixed(instr->key(), StoreDescriptor::NameRegister()); - LOperand* value = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); - - DCHECK(instr->object()->representation().IsTagged()); - DCHECK(instr->key()->representation().IsTagged()); - DCHECK(instr->value()->representation().IsTagged()); - - LOperand* slot = FixedTemp(StoreWithVectorDescriptor::SlotRegister()); - LOperand* vector = FixedTemp(StoreWithVectorDescriptor::VectorRegister()); - - LStoreKeyedGeneric* result = new (zone()) - LStoreKeyedGeneric(context, object, key, value, slot, vector); - return MarkAsCall(result, instr); -} - - LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { // TODO(jbramley): It might be beneficial to allow value to be a constant in // some cases. x64 makes use of this with FLAG_track_fields, for example. diff --git a/src/crankshaft/arm64/lithium-arm64.h b/src/crankshaft/arm64/lithium-arm64.h index ee6ffb1dcf..9891f9ee49 100644 --- a/src/crankshaft/arm64/lithium-arm64.h +++ b/src/crankshaft/arm64/lithium-arm64.h @@ -143,7 +143,6 @@ class LCodeGen; V(StoreKeyedExternal) \ V(StoreKeyedFixed) \ V(StoreKeyedFixedDouble) \ - V(StoreKeyedGeneric) \ V(StoreNamedField) \ V(StringAdd) \ V(StringCharCodeAt) \ @@ -2335,34 +2334,6 @@ class LStoreKeyedFixedDouble final : public LStoreKeyed<1> { }; -class LStoreKeyedGeneric final : public LTemplateInstruction<0, 4, 2> { - public: - LStoreKeyedGeneric(LOperand* context, LOperand* object, LOperand* key, - LOperand* value, LOperand* slot, LOperand* vector) { - inputs_[0] = context; - inputs_[1] = object; - inputs_[2] = key; - inputs_[3] = value; - temps_[0] = slot; - temps_[1] = vector; - } - - LOperand* context() { return inputs_[0]; } - LOperand* object() { return inputs_[1]; } - LOperand* key() { return inputs_[2]; } - LOperand* value() { return inputs_[3]; } - LOperand* temp_slot() { return temps_[0]; } - LOperand* temp_vector() { return temps_[1]; } - - DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") - DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) - - void PrintDataTo(StringStream* stream) override; - - LanguageMode language_mode() { return hydrogen()->language_mode(); } -}; - - class LStoreNamedField final : public LTemplateInstruction<0, 2, 2> { public: LStoreNamedField(LOperand* object, LOperand* value, diff --git a/src/crankshaft/arm64/lithium-codegen-arm64.cc b/src/crankshaft/arm64/lithium-codegen-arm64.cc index d8c2e544ce..5c65c5a9e4 100644 --- a/src/crankshaft/arm64/lithium-codegen-arm64.cc +++ b/src/crankshaft/arm64/lithium-codegen-arm64.cc @@ -3016,20 +3016,6 @@ void LCodeGen::EmitVectorLoadICRegisters(T* instr) { } -template -void LCodeGen::EmitVectorStoreICRegisters(T* instr) { - Register vector_register = ToRegister(instr->temp_vector()); - Register slot_register = ToRegister(instr->temp_slot()); - - AllowDeferredHandleDereference vector_structure_check; - Handle vector = instr->hydrogen()->feedback_vector(); - __ Mov(vector_register, vector); - FeedbackVectorSlot slot = instr->hydrogen()->slot(); - int index = vector->GetIndex(slot); - __ Mov(slot_register, Smi::FromInt(index)); -} - - void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { DCHECK(ToRegister(instr->context()).is(cp)); DCHECK(ToRegister(instr->result()).Is(x0)); @@ -4928,21 +4914,6 @@ void LCodeGen::DoStoreKeyedFixed(LStoreKeyedFixed* instr) { } -void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { - DCHECK(ToRegister(instr->context()).is(cp)); - DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); - DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); - DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); - - EmitVectorStoreICRegisters(instr); - - Handle ic = CodeFactory::KeyedStoreICInOptimizedCode( - isolate(), instr->language_mode()) - .code(); - CallCode(ic, RelocInfo::CODE_TARGET, instr); -} - - void LCodeGen::DoMaybeGrowElements(LMaybeGrowElements* instr) { class DeferredMaybeGrowElements final : public LDeferredCode { public: diff --git a/src/crankshaft/arm64/lithium-codegen-arm64.h b/src/crankshaft/arm64/lithium-codegen-arm64.h index 2fc6f96d7a..ca04fa27c0 100644 --- a/src/crankshaft/arm64/lithium-codegen-arm64.h +++ b/src/crankshaft/arm64/lithium-codegen-arm64.h @@ -186,8 +186,6 @@ class LCodeGen: public LCodeGenBase { template void EmitVectorLoadICRegisters(T* instr); - template - void EmitVectorStoreICRegisters(T* instr); // Emits optimized code for %_IsString(x). Preserves input register. // Returns the condition on which a final split to diff --git a/src/crankshaft/hydrogen-instructions.cc b/src/crankshaft/hydrogen-instructions.cc index 6d3b07c483..0e56d757fd 100644 --- a/src/crankshaft/hydrogen-instructions.cc +++ b/src/crankshaft/hydrogen-instructions.cc @@ -864,7 +864,6 @@ bool HInstruction::CanDeoptimize() { case HValue::kSimulate: case HValue::kStackCheck: case HValue::kStoreContextSlot: - case HValue::kStoreKeyedGeneric: case HValue::kStringAdd: case HValue::kStringCompareAndBranch: case HValue::kSub: @@ -3045,13 +3044,6 @@ std::ostream& HStoreKeyed::PrintDataTo(std::ostream& os) const { // NOLINT } -std::ostream& HStoreKeyedGeneric::PrintDataTo( - std::ostream& os) const { // NOLINT - return os << NameOf(object()) << "[" << NameOf(key()) - << "] = " << NameOf(value()); -} - - std::ostream& HTransitionElementsKind::PrintDataTo( std::ostream& os) const { // NOLINT os << NameOf(object()); diff --git a/src/crankshaft/hydrogen-instructions.h b/src/crankshaft/hydrogen-instructions.h index 782fa42058..5401315074 100644 --- a/src/crankshaft/hydrogen-instructions.h +++ b/src/crankshaft/hydrogen-instructions.h @@ -133,7 +133,6 @@ class SmallMapList; V(StoreCodeEntry) \ V(StoreContextSlot) \ V(StoreKeyed) \ - V(StoreKeyedGeneric) \ V(StoreNamedField) \ V(StringAdd) \ V(StringCharCodeAt) \ @@ -6509,50 +6508,6 @@ class HStoreKeyed final : public HTemplateInstruction<4>, HValue* dominator_; }; -class HStoreKeyedGeneric final : public HTemplateInstruction<4> { - public: - DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P6(HStoreKeyedGeneric, HValue*, - HValue*, HValue*, LanguageMode, - Handle, - FeedbackVectorSlot); - - HValue* object() const { return OperandAt(0); } - HValue* key() const { return OperandAt(1); } - HValue* value() const { return OperandAt(2); } - HValue* context() const { return OperandAt(3); } - LanguageMode language_mode() const { return language_mode_; } - - Representation RequiredInputRepresentation(int index) override { - // tagged[tagged] = tagged - return Representation::Tagged(); - } - - FeedbackVectorSlot slot() const { return slot_; } - Handle feedback_vector() const { - return feedback_vector_; - } - - std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT - - DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric) - - private: - HStoreKeyedGeneric(HValue* context, HValue* object, HValue* key, - HValue* value, LanguageMode language_mode, - Handle vector, FeedbackVectorSlot slot) - : feedback_vector_(vector), slot_(slot), language_mode_(language_mode) { - SetOperandAt(0, object); - SetOperandAt(1, key); - SetOperandAt(2, value); - SetOperandAt(3, context); - SetAllSideEffects(); - } - - Handle feedback_vector_; - FeedbackVectorSlot slot_; - LanguageMode language_mode_; -}; - class HTransitionElementsKind final : public HTemplateInstruction<2> { public: inline static HTransitionElementsKind* New(Isolate* isolate, Zone* zone, diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc index cb5385086b..7d00b2043f 100644 --- a/src/crankshaft/hydrogen.cc +++ b/src/crankshaft/hydrogen.cc @@ -7200,26 +7200,28 @@ HInstruction* HOptimizedGraphBuilder::BuildNamedGeneric( Handle vector = handle(current_feedback_vector(), isolate()); + HValue* key = Add(name); + HValue* vector_value = Add(vector); + HValue* slot_value = Add(vector->GetIndex(slot)); + HValue* values[] = {context(), object, key, + value, slot_value, vector_value}; + if (current_feedback_vector()->GetKind(slot) == FeedbackVectorSlotKind::KEYED_STORE_IC) { // It's possible that a keyed store of a constant string was converted // to a named store. Here, at the last minute, we need to make sure to // use a generic Keyed Store if we are using the type vector, because // it has to share information with full code. - HConstant* key = Add(name); - HStoreKeyedGeneric* result = New( - object, key, value, function_language_mode(), vector, slot); + Callable callable = CodeFactory::KeyedStoreICInOptimizedCode( + isolate(), function_language_mode()); + HValue* stub = Add(callable.code()); + HCallWithDescriptor* result = New( + stub, 0, callable.descriptor(), ArrayVector(values)); return result; } - - HValue* name_value = Add(name); - HValue* vector_value = Add(vector); - HValue* slot_value = Add(vector->GetIndex(slot)); Callable callable = CodeFactory::StoreICInOptimizedCode( isolate(), function_language_mode()); HValue* stub = Add(callable.code()); - HValue* values[] = {context(), object, name_value, - value, slot_value, vector_value}; HCallWithDescriptor* result = New( stub, 0, callable.descriptor(), ArrayVector(values)); return result; @@ -7237,8 +7239,16 @@ HInstruction* HOptimizedGraphBuilder::BuildKeyedGeneric( New(object, key, vector, slot); return result; } else { - HStoreKeyedGeneric* result = New( - object, key, value, function_language_mode(), vector, slot); + HValue* vector_value = Add(vector); + HValue* slot_value = Add(vector->GetIndex(slot)); + HValue* values[] = {context(), object, key, + value, slot_value, vector_value}; + + Callable callable = CodeFactory::KeyedStoreICInOptimizedCode( + isolate(), function_language_mode()); + HValue* stub = Add(callable.code()); + HCallWithDescriptor* result = New( + stub, 0, callable.descriptor(), ArrayVector(values)); return result; } } diff --git a/src/crankshaft/ia32/lithium-codegen-ia32.cc b/src/crankshaft/ia32/lithium-codegen-ia32.cc index 25cb04750a..df6c29e174 100644 --- a/src/crankshaft/ia32/lithium-codegen-ia32.cc +++ b/src/crankshaft/ia32/lithium-codegen-ia32.cc @@ -2392,20 +2392,6 @@ void LCodeGen::EmitVectorLoadICRegisters(T* instr) { } -template -void LCodeGen::EmitVectorStoreICRegisters(T* instr) { - Register vector_register = ToRegister(instr->temp_vector()); - Register slot_register = ToRegister(instr->temp_slot()); - - AllowDeferredHandleDereference vector_structure_check; - Handle vector = instr->hydrogen()->feedback_vector(); - __ mov(vector_register, vector); - FeedbackVectorSlot slot = instr->hydrogen()->slot(); - int index = vector->GetIndex(slot); - __ mov(slot_register, Immediate(Smi::FromInt(index))); -} - - void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { DCHECK(ToRegister(instr->context()).is(esi)); DCHECK(ToRegister(instr->result()).is(eax)); @@ -3857,21 +3843,6 @@ void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) { } -void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { - DCHECK(ToRegister(instr->context()).is(esi)); - DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); - DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); - DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); - - EmitVectorStoreICRegisters(instr); - - Handle ic = CodeFactory::KeyedStoreICInOptimizedCode( - isolate(), instr->language_mode()) - .code(); - CallCode(ic, RelocInfo::CODE_TARGET, instr); -} - - void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) { Register object = ToRegister(instr->object()); Register temp = ToRegister(instr->temp()); diff --git a/src/crankshaft/ia32/lithium-codegen-ia32.h b/src/crankshaft/ia32/lithium-codegen-ia32.h index 38a493dbb4..8e16d9c5fc 100644 --- a/src/crankshaft/ia32/lithium-codegen-ia32.h +++ b/src/crankshaft/ia32/lithium-codegen-ia32.h @@ -294,8 +294,6 @@ class LCodeGen: public LCodeGenBase { template void EmitVectorLoadICRegisters(T* instr); - template - void EmitVectorStoreICRegisters(T* instr); void EmitReturn(LReturn* instr); diff --git a/src/crankshaft/ia32/lithium-ia32.cc b/src/crankshaft/ia32/lithium-ia32.cc index f7aa899200..a9f219c8b8 100644 --- a/src/crankshaft/ia32/lithium-ia32.cc +++ b/src/crankshaft/ia32/lithium-ia32.cc @@ -383,15 +383,6 @@ void LStoreKeyed::PrintDataTo(StringStream* stream) { } -void LStoreKeyedGeneric::PrintDataTo(StringStream* stream) { - object()->PrintTo(stream); - stream->Add("["); - key()->PrintTo(stream); - stream->Add("] <- "); - value()->PrintTo(stream); -} - - void LTransitionElementsKind::PrintDataTo(StringStream* stream) { object()->PrintTo(stream); stream->Add(" %p -> %p", *original_map(), *transitioned_map()); @@ -2202,26 +2193,6 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { } -LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { - LOperand* context = UseFixed(instr->context(), esi); - LOperand* object = - UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); - LOperand* key = UseFixed(instr->key(), StoreDescriptor::NameRegister()); - LOperand* value = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); - - DCHECK(instr->object()->representation().IsTagged()); - DCHECK(instr->key()->representation().IsTagged()); - DCHECK(instr->value()->representation().IsTagged()); - - LOperand* slot = FixedTemp(StoreWithVectorDescriptor::SlotRegister()); - LOperand* vector = FixedTemp(StoreWithVectorDescriptor::VectorRegister()); - - LStoreKeyedGeneric* result = new (zone()) - LStoreKeyedGeneric(context, object, key, value, slot, vector); - return MarkAsCall(result, instr); -} - - LInstruction* LChunkBuilder::DoTransitionElementsKind( HTransitionElementsKind* instr) { if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { diff --git a/src/crankshaft/ia32/lithium-ia32.h b/src/crankshaft/ia32/lithium-ia32.h index d02c4fcf21..816d8fd2c1 100644 --- a/src/crankshaft/ia32/lithium-ia32.h +++ b/src/crankshaft/ia32/lithium-ia32.h @@ -136,7 +136,6 @@ class LCodeGen; V(StoreCodeEntry) \ V(StoreContextSlot) \ V(StoreKeyed) \ - V(StoreKeyedGeneric) \ V(StoreNamedField) \ V(StringAdd) \ V(StringCharCodeAt) \ @@ -2051,34 +2050,6 @@ class LStoreKeyed final : public LTemplateInstruction<0, 4, 0> { }; -class LStoreKeyedGeneric final : public LTemplateInstruction<0, 4, 2> { - public: - LStoreKeyedGeneric(LOperand* context, LOperand* object, LOperand* key, - LOperand* value, LOperand* slot, LOperand* vector) { - inputs_[0] = context; - inputs_[1] = object; - inputs_[2] = key; - inputs_[3] = value; - temps_[0] = slot; - temps_[1] = vector; - } - - LOperand* context() { return inputs_[0]; } - LOperand* object() { return inputs_[1]; } - LOperand* key() { return inputs_[2]; } - LOperand* value() { return inputs_[3]; } - LOperand* temp_slot() { return temps_[0]; } - LOperand* temp_vector() { return temps_[1]; } - - DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") - DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) - - void PrintDataTo(StringStream* stream) override; - - LanguageMode language_mode() { return hydrogen()->language_mode(); } -}; - - class LTransitionElementsKind final : public LTemplateInstruction<0, 2, 2> { public: LTransitionElementsKind(LOperand* object, diff --git a/src/crankshaft/mips/lithium-codegen-mips.cc b/src/crankshaft/mips/lithium-codegen-mips.cc index 23c1c671d7..c634d6b264 100644 --- a/src/crankshaft/mips/lithium-codegen-mips.cc +++ b/src/crankshaft/mips/lithium-codegen-mips.cc @@ -2493,20 +2493,6 @@ void LCodeGen::EmitVectorLoadICRegisters(T* instr) { } -template -void LCodeGen::EmitVectorStoreICRegisters(T* instr) { - Register vector_register = ToRegister(instr->temp_vector()); - Register slot_register = ToRegister(instr->temp_slot()); - - AllowDeferredHandleDereference vector_structure_check; - Handle vector = instr->hydrogen()->feedback_vector(); - __ li(vector_register, vector); - FeedbackVectorSlot slot = instr->hydrogen()->slot(); - int index = vector->GetIndex(slot); - __ li(slot_register, Operand(Smi::FromInt(index))); -} - - void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { DCHECK(ToRegister(instr->context()).is(cp)); DCHECK(ToRegister(instr->result()).is(v0)); @@ -4006,21 +3992,6 @@ void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) { } -void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { - DCHECK(ToRegister(instr->context()).is(cp)); - DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); - DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); - DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); - - EmitVectorStoreICRegisters(instr); - - Handle ic = CodeFactory::KeyedStoreICInOptimizedCode( - isolate(), instr->language_mode()) - .code(); - CallCode(ic, RelocInfo::CODE_TARGET, instr); -} - - void LCodeGen::DoMaybeGrowElements(LMaybeGrowElements* instr) { class DeferredMaybeGrowElements final : public LDeferredCode { public: diff --git a/src/crankshaft/mips/lithium-codegen-mips.h b/src/crankshaft/mips/lithium-codegen-mips.h index d51f62c90f..bb09abc1df 100644 --- a/src/crankshaft/mips/lithium-codegen-mips.h +++ b/src/crankshaft/mips/lithium-codegen-mips.h @@ -340,8 +340,6 @@ class LCodeGen: public LCodeGenBase { template void EmitVectorLoadICRegisters(T* instr); - template - void EmitVectorStoreICRegisters(T* instr); ZoneList jump_table_; Scope* const scope_; diff --git a/src/crankshaft/mips/lithium-mips.cc b/src/crankshaft/mips/lithium-mips.cc index 57cc0ca90c..86ef8f8a9c 100644 --- a/src/crankshaft/mips/lithium-mips.cc +++ b/src/crankshaft/mips/lithium-mips.cc @@ -343,15 +343,6 @@ void LStoreKeyed::PrintDataTo(StringStream* stream) { } -void LStoreKeyedGeneric::PrintDataTo(StringStream* stream) { - object()->PrintTo(stream); - stream->Add("["); - key()->PrintTo(stream); - stream->Add("] <- "); - value()->PrintTo(stream); -} - - void LTransitionElementsKind::PrintDataTo(StringStream* stream) { object()->PrintTo(stream); stream->Add(" %p -> %p", *original_map(), *transitioned_map()); @@ -2118,26 +2109,6 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { } -LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { - LOperand* context = UseFixed(instr->context(), cp); - LOperand* obj = - UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); - LOperand* key = UseFixed(instr->key(), StoreDescriptor::NameRegister()); - LOperand* val = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); - - DCHECK(instr->object()->representation().IsTagged()); - DCHECK(instr->key()->representation().IsTagged()); - DCHECK(instr->value()->representation().IsTagged()); - - LOperand* slot = FixedTemp(StoreWithVectorDescriptor::SlotRegister()); - LOperand* vector = FixedTemp(StoreWithVectorDescriptor::VectorRegister()); - - LStoreKeyedGeneric* result = - new (zone()) LStoreKeyedGeneric(context, obj, key, val, slot, vector); - return MarkAsCall(result, instr); -} - - LInstruction* LChunkBuilder::DoTransitionElementsKind( HTransitionElementsKind* instr) { if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { diff --git a/src/crankshaft/mips/lithium-mips.h b/src/crankshaft/mips/lithium-mips.h index a92bbb1430..f49fb93c59 100644 --- a/src/crankshaft/mips/lithium-mips.h +++ b/src/crankshaft/mips/lithium-mips.h @@ -131,7 +131,6 @@ class LCodeGen; V(StoreCodeEntry) \ V(StoreContextSlot) \ V(StoreKeyed) \ - V(StoreKeyedGeneric) \ V(StoreNamedField) \ V(StringAdd) \ V(StringCharCodeAt) \ @@ -1998,34 +1997,6 @@ class LStoreKeyed final : public LTemplateInstruction<0, 4, 0> { }; -class LStoreKeyedGeneric final : public LTemplateInstruction<0, 4, 2> { - public: - LStoreKeyedGeneric(LOperand* context, LOperand* object, LOperand* key, - LOperand* value, LOperand* slot, LOperand* vector) { - inputs_[0] = context; - inputs_[1] = object; - inputs_[2] = key; - inputs_[3] = value; - temps_[0] = slot; - temps_[1] = vector; - } - - LOperand* context() { return inputs_[0]; } - LOperand* object() { return inputs_[1]; } - LOperand* key() { return inputs_[2]; } - LOperand* value() { return inputs_[3]; } - LOperand* temp_slot() { return temps_[0]; } - LOperand* temp_vector() { return temps_[1]; } - - DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") - DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) - - void PrintDataTo(StringStream* stream) override; - - LanguageMode language_mode() { return hydrogen()->language_mode(); } -}; - - class LTransitionElementsKind final : public LTemplateInstruction<0, 2, 1> { public: LTransitionElementsKind(LOperand* object, diff --git a/src/crankshaft/mips64/lithium-codegen-mips64.cc b/src/crankshaft/mips64/lithium-codegen-mips64.cc index 16d19e2acb..4ff61eefc9 100644 --- a/src/crankshaft/mips64/lithium-codegen-mips64.cc +++ b/src/crankshaft/mips64/lithium-codegen-mips64.cc @@ -2617,20 +2617,6 @@ void LCodeGen::EmitVectorLoadICRegisters(T* instr) { } -template -void LCodeGen::EmitVectorStoreICRegisters(T* instr) { - Register vector_register = ToRegister(instr->temp_vector()); - Register slot_register = ToRegister(instr->temp_slot()); - - AllowDeferredHandleDereference vector_structure_check; - Handle vector = instr->hydrogen()->feedback_vector(); - __ li(vector_register, vector); - FeedbackVectorSlot slot = instr->hydrogen()->slot(); - int index = vector->GetIndex(slot); - __ li(slot_register, Operand(Smi::FromInt(index))); -} - - void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { DCHECK(ToRegister(instr->context()).is(cp)); DCHECK(ToRegister(instr->result()).is(v0)); @@ -4241,21 +4227,6 @@ void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) { } -void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { - DCHECK(ToRegister(instr->context()).is(cp)); - DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); - DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); - DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); - - EmitVectorStoreICRegisters(instr); - - Handle ic = CodeFactory::KeyedStoreICInOptimizedCode( - isolate(), instr->language_mode()) - .code(); - CallCode(ic, RelocInfo::CODE_TARGET, instr); -} - - void LCodeGen::DoMaybeGrowElements(LMaybeGrowElements* instr) { class DeferredMaybeGrowElements final : public LDeferredCode { public: diff --git a/src/crankshaft/mips64/lithium-codegen-mips64.h b/src/crankshaft/mips64/lithium-codegen-mips64.h index 41d8b2c031..aaa2e6be17 100644 --- a/src/crankshaft/mips64/lithium-codegen-mips64.h +++ b/src/crankshaft/mips64/lithium-codegen-mips64.h @@ -343,8 +343,6 @@ class LCodeGen: public LCodeGenBase { template void EmitVectorLoadICRegisters(T* instr); - template - void EmitVectorStoreICRegisters(T* instr); ZoneList jump_table_; Scope* const scope_; diff --git a/src/crankshaft/mips64/lithium-mips64.cc b/src/crankshaft/mips64/lithium-mips64.cc index 28a4f684b8..41eced1802 100644 --- a/src/crankshaft/mips64/lithium-mips64.cc +++ b/src/crankshaft/mips64/lithium-mips64.cc @@ -343,15 +343,6 @@ void LStoreKeyed::PrintDataTo(StringStream* stream) { } -void LStoreKeyedGeneric::PrintDataTo(StringStream* stream) { - object()->PrintTo(stream); - stream->Add("["); - key()->PrintTo(stream); - stream->Add("] <- "); - value()->PrintTo(stream); -} - - void LTransitionElementsKind::PrintDataTo(StringStream* stream) { object()->PrintTo(stream); stream->Add(" %p -> %p", *original_map(), *transitioned_map()); @@ -2123,26 +2114,6 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { } -LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { - LOperand* context = UseFixed(instr->context(), cp); - LOperand* obj = - UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); - LOperand* key = UseFixed(instr->key(), StoreDescriptor::NameRegister()); - LOperand* val = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); - - DCHECK(instr->object()->representation().IsTagged()); - DCHECK(instr->key()->representation().IsTagged()); - DCHECK(instr->value()->representation().IsTagged()); - - LOperand* slot = FixedTemp(StoreWithVectorDescriptor::SlotRegister()); - LOperand* vector = FixedTemp(StoreWithVectorDescriptor::VectorRegister()); - - LStoreKeyedGeneric* result = - new (zone()) LStoreKeyedGeneric(context, obj, key, val, slot, vector); - return MarkAsCall(result, instr); -} - - LInstruction* LChunkBuilder::DoTransitionElementsKind( HTransitionElementsKind* instr) { if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { diff --git a/src/crankshaft/mips64/lithium-mips64.h b/src/crankshaft/mips64/lithium-mips64.h index 97714ea56a..7bc89afd46 100644 --- a/src/crankshaft/mips64/lithium-mips64.h +++ b/src/crankshaft/mips64/lithium-mips64.h @@ -133,7 +133,6 @@ class LCodeGen; V(StoreCodeEntry) \ V(StoreContextSlot) \ V(StoreKeyed) \ - V(StoreKeyedGeneric) \ V(StoreNamedField) \ V(StringAdd) \ V(StringCharCodeAt) \ @@ -2044,34 +2043,6 @@ class LStoreKeyed final : public LTemplateInstruction<0, 4, 0> { }; -class LStoreKeyedGeneric final : public LTemplateInstruction<0, 4, 2> { - public: - LStoreKeyedGeneric(LOperand* context, LOperand* object, LOperand* key, - LOperand* value, LOperand* slot, LOperand* vector) { - inputs_[0] = context; - inputs_[1] = object; - inputs_[2] = key; - inputs_[3] = value; - temps_[0] = slot; - temps_[1] = vector; - } - - LOperand* context() { return inputs_[0]; } - LOperand* object() { return inputs_[1]; } - LOperand* key() { return inputs_[2]; } - LOperand* value() { return inputs_[3]; } - LOperand* temp_slot() { return temps_[0]; } - LOperand* temp_vector() { return temps_[1]; } - - DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") - DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) - - void PrintDataTo(StringStream* stream) override; - - LanguageMode language_mode() { return hydrogen()->language_mode(); } -}; - - class LTransitionElementsKind final : public LTemplateInstruction<0, 2, 1> { public: LTransitionElementsKind(LOperand* object, diff --git a/src/crankshaft/ppc/lithium-codegen-ppc.cc b/src/crankshaft/ppc/lithium-codegen-ppc.cc index 1b1433f50d..e40252d027 100644 --- a/src/crankshaft/ppc/lithium-codegen-ppc.cc +++ b/src/crankshaft/ppc/lithium-codegen-ppc.cc @@ -2671,20 +2671,6 @@ void LCodeGen::EmitVectorLoadICRegisters(T* instr) { } -template -void LCodeGen::EmitVectorStoreICRegisters(T* instr) { - Register vector_register = ToRegister(instr->temp_vector()); - Register slot_register = ToRegister(instr->temp_slot()); - - AllowDeferredHandleDereference vector_structure_check; - Handle vector = instr->hydrogen()->feedback_vector(); - __ Move(vector_register, vector); - FeedbackVectorSlot slot = instr->hydrogen()->slot(); - int index = vector->GetIndex(slot); - __ LoadSmiLiteral(slot_register, Smi::FromInt(index)); -} - - void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { DCHECK(ToRegister(instr->context()).is(cp)); DCHECK(ToRegister(instr->result()).is(r3)); @@ -4323,21 +4309,6 @@ void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) { } -void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { - DCHECK(ToRegister(instr->context()).is(cp)); - DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); - DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); - DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); - - EmitVectorStoreICRegisters(instr); - - Handle ic = CodeFactory::KeyedStoreICInOptimizedCode( - isolate(), instr->language_mode()) - .code(); - CallCode(ic, RelocInfo::CODE_TARGET, instr); -} - - void LCodeGen::DoMaybeGrowElements(LMaybeGrowElements* instr) { class DeferredMaybeGrowElements final : public LDeferredCode { public: diff --git a/src/crankshaft/ppc/lithium-codegen-ppc.h b/src/crankshaft/ppc/lithium-codegen-ppc.h index fe212d4034..a4a90a7184 100644 --- a/src/crankshaft/ppc/lithium-codegen-ppc.h +++ b/src/crankshaft/ppc/lithium-codegen-ppc.h @@ -277,8 +277,6 @@ class LCodeGen : public LCodeGenBase { template void EmitVectorLoadICRegisters(T* instr); - template - void EmitVectorStoreICRegisters(T* instr); ZoneList jump_table_; Scope* const scope_; diff --git a/src/crankshaft/ppc/lithium-ppc.cc b/src/crankshaft/ppc/lithium-ppc.cc index e1e87dba00..3aa7cba8ee 100644 --- a/src/crankshaft/ppc/lithium-ppc.cc +++ b/src/crankshaft/ppc/lithium-ppc.cc @@ -349,15 +349,6 @@ void LStoreKeyed::PrintDataTo(StringStream* stream) { } -void LStoreKeyedGeneric::PrintDataTo(StringStream* stream) { - object()->PrintTo(stream); - stream->Add("["); - key()->PrintTo(stream); - stream->Add("] <- "); - value()->PrintTo(stream); -} - - void LTransitionElementsKind::PrintDataTo(StringStream* stream) { object()->PrintTo(stream); stream->Add(" %p -> %p", *original_map(), *transitioned_map()); @@ -2141,26 +2132,6 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { } -LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { - LOperand* context = UseFixed(instr->context(), cp); - LOperand* obj = - UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); - LOperand* key = UseFixed(instr->key(), StoreDescriptor::NameRegister()); - LOperand* val = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); - - DCHECK(instr->object()->representation().IsTagged()); - DCHECK(instr->key()->representation().IsTagged()); - DCHECK(instr->value()->representation().IsTagged()); - - LOperand* slot = FixedTemp(StoreWithVectorDescriptor::SlotRegister()); - LOperand* vector = FixedTemp(StoreWithVectorDescriptor::VectorRegister()); - - LStoreKeyedGeneric* result = - new (zone()) LStoreKeyedGeneric(context, obj, key, val, slot, vector); - return MarkAsCall(result, instr); -} - - LInstruction* LChunkBuilder::DoTransitionElementsKind( HTransitionElementsKind* instr) { if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { diff --git a/src/crankshaft/ppc/lithium-ppc.h b/src/crankshaft/ppc/lithium-ppc.h index 5d5edf571d..626f00ab8e 100644 --- a/src/crankshaft/ppc/lithium-ppc.h +++ b/src/crankshaft/ppc/lithium-ppc.h @@ -134,7 +134,6 @@ class LCodeGen; V(StoreCodeEntry) \ V(StoreContextSlot) \ V(StoreKeyed) \ - V(StoreKeyedGeneric) \ V(StoreNamedField) \ V(StringAdd) \ V(StringCharCodeAt) \ @@ -1987,34 +1986,6 @@ class LStoreKeyed final : public LTemplateInstruction<0, 4, 0> { }; -class LStoreKeyedGeneric final : public LTemplateInstruction<0, 4, 2> { - public: - LStoreKeyedGeneric(LOperand* context, LOperand* object, LOperand* key, - LOperand* value, LOperand* slot, LOperand* vector) { - inputs_[0] = context; - inputs_[1] = object; - inputs_[2] = key; - inputs_[3] = value; - temps_[0] = slot; - temps_[1] = vector; - } - - LOperand* context() { return inputs_[0]; } - LOperand* object() { return inputs_[1]; } - LOperand* key() { return inputs_[2]; } - LOperand* value() { return inputs_[3]; } - LOperand* temp_slot() { return temps_[0]; } - LOperand* temp_vector() { return temps_[1]; } - - DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") - DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) - - void PrintDataTo(StringStream* stream) override; - - LanguageMode language_mode() { return hydrogen()->language_mode(); } -}; - - class LTransitionElementsKind final : public LTemplateInstruction<0, 2, 1> { public: LTransitionElementsKind(LOperand* object, LOperand* context, diff --git a/src/crankshaft/s390/lithium-codegen-s390.cc b/src/crankshaft/s390/lithium-codegen-s390.cc index 4e34205f3a..7f34821286 100644 --- a/src/crankshaft/s390/lithium-codegen-s390.cc +++ b/src/crankshaft/s390/lithium-codegen-s390.cc @@ -2646,19 +2646,6 @@ void LCodeGen::EmitVectorLoadICRegisters(T* instr) { __ LoadSmiLiteral(slot_register, Smi::FromInt(index)); } -template -void LCodeGen::EmitVectorStoreICRegisters(T* instr) { - Register vector_register = ToRegister(instr->temp_vector()); - Register slot_register = ToRegister(instr->temp_slot()); - - AllowDeferredHandleDereference vector_structure_check; - Handle vector = instr->hydrogen()->feedback_vector(); - __ Move(vector_register, vector); - FeedbackVectorSlot slot = instr->hydrogen()->slot(); - int index = vector->GetIndex(slot); - __ LoadSmiLiteral(slot_register, Smi::FromInt(index)); -} - void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { DCHECK(ToRegister(instr->context()).is(cp)); DCHECK(ToRegister(instr->result()).is(r2)); @@ -4266,20 +4253,6 @@ void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) { } } -void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { - DCHECK(ToRegister(instr->context()).is(cp)); - DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); - DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); - DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); - - EmitVectorStoreICRegisters(instr); - - Handle ic = CodeFactory::KeyedStoreICInOptimizedCode( - isolate(), instr->language_mode()) - .code(); - CallCode(ic, RelocInfo::CODE_TARGET, instr); -} - void LCodeGen::DoMaybeGrowElements(LMaybeGrowElements* instr) { class DeferredMaybeGrowElements final : public LDeferredCode { public: diff --git a/src/crankshaft/s390/lithium-codegen-s390.h b/src/crankshaft/s390/lithium-codegen-s390.h index e5df255f4d..30e9d2b997 100644 --- a/src/crankshaft/s390/lithium-codegen-s390.h +++ b/src/crankshaft/s390/lithium-codegen-s390.h @@ -276,8 +276,6 @@ class LCodeGen : public LCodeGenBase { template void EmitVectorLoadICRegisters(T* instr); - template - void EmitVectorStoreICRegisters(T* instr); ZoneList jump_table_; Scope* const scope_; diff --git a/src/crankshaft/s390/lithium-s390.cc b/src/crankshaft/s390/lithium-s390.cc index feebe0bbac..44bf00be40 100644 --- a/src/crankshaft/s390/lithium-s390.cc +++ b/src/crankshaft/s390/lithium-s390.cc @@ -317,14 +317,6 @@ void LStoreKeyed::PrintDataTo(StringStream* stream) { } } -void LStoreKeyedGeneric::PrintDataTo(StringStream* stream) { - object()->PrintTo(stream); - stream->Add("["); - key()->PrintTo(stream); - stream->Add("] <- "); - value()->PrintTo(stream); -} - void LTransitionElementsKind::PrintDataTo(StringStream* stream) { object()->PrintTo(stream); stream->Add(" %p -> %p", *original_map(), *transitioned_map()); @@ -1960,25 +1952,6 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { return new (zone()) LStoreKeyed(backing_store, key, val, backing_store_owner); } -LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { - LOperand* context = UseFixed(instr->context(), cp); - LOperand* obj = - UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); - LOperand* key = UseFixed(instr->key(), StoreDescriptor::NameRegister()); - LOperand* val = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); - - DCHECK(instr->object()->representation().IsTagged()); - DCHECK(instr->key()->representation().IsTagged()); - DCHECK(instr->value()->representation().IsTagged()); - - LOperand* slot = FixedTemp(StoreWithVectorDescriptor::SlotRegister()); - LOperand* vector = FixedTemp(StoreWithVectorDescriptor::VectorRegister()); - - LStoreKeyedGeneric* result = - new (zone()) LStoreKeyedGeneric(context, obj, key, val, slot, vector); - return MarkAsCall(result, instr); -} - LInstruction* LChunkBuilder::DoTransitionElementsKind( HTransitionElementsKind* instr) { if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { diff --git a/src/crankshaft/s390/lithium-s390.h b/src/crankshaft/s390/lithium-s390.h index cb991a567d..70670ac3e8 100644 --- a/src/crankshaft/s390/lithium-s390.h +++ b/src/crankshaft/s390/lithium-s390.h @@ -132,7 +132,6 @@ class LCodeGen; V(StoreCodeEntry) \ V(StoreContextSlot) \ V(StoreKeyed) \ - V(StoreKeyedGeneric) \ V(StoreNamedField) \ V(StringAdd) \ V(StringCharCodeAt) \ @@ -1854,33 +1853,6 @@ class LStoreKeyed final : public LTemplateInstruction<0, 4, 0> { uint32_t base_offset() const { return hydrogen()->base_offset(); } }; -class LStoreKeyedGeneric final : public LTemplateInstruction<0, 4, 2> { - public: - LStoreKeyedGeneric(LOperand* context, LOperand* object, LOperand* key, - LOperand* value, LOperand* slot, LOperand* vector) { - inputs_[0] = context; - inputs_[1] = object; - inputs_[2] = key; - inputs_[3] = value; - temps_[0] = slot; - temps_[1] = vector; - } - - LOperand* context() { return inputs_[0]; } - LOperand* object() { return inputs_[1]; } - LOperand* key() { return inputs_[2]; } - LOperand* value() { return inputs_[3]; } - LOperand* temp_slot() { return temps_[0]; } - LOperand* temp_vector() { return temps_[1]; } - - DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") - DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) - - void PrintDataTo(StringStream* stream) override; - - LanguageMode language_mode() { return hydrogen()->language_mode(); } -}; - class LTransitionElementsKind final : public LTemplateInstruction<0, 2, 1> { public: LTransitionElementsKind(LOperand* object, LOperand* context, diff --git a/src/crankshaft/x64/lithium-codegen-x64.cc b/src/crankshaft/x64/lithium-codegen-x64.cc index bb4627673f..e6bdcef341 100644 --- a/src/crankshaft/x64/lithium-codegen-x64.cc +++ b/src/crankshaft/x64/lithium-codegen-x64.cc @@ -2534,20 +2534,6 @@ void LCodeGen::EmitVectorLoadICRegisters(T* instr) { } -template -void LCodeGen::EmitVectorStoreICRegisters(T* instr) { - Register vector_register = ToRegister(instr->temp_vector()); - Register slot_register = ToRegister(instr->temp_slot()); - - AllowDeferredHandleDereference vector_structure_check; - Handle vector = instr->hydrogen()->feedback_vector(); - __ Move(vector_register, vector); - FeedbackVectorSlot slot = instr->hydrogen()->slot(); - int index = vector->GetIndex(slot); - __ Move(slot_register, Smi::FromInt(index)); -} - - void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { DCHECK(ToRegister(instr->context()).is(rsi)); DCHECK(ToRegister(instr->result()).is(rax)); @@ -4138,21 +4124,6 @@ void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) { } -void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { - DCHECK(ToRegister(instr->context()).is(rsi)); - DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); - DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); - DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); - - EmitVectorStoreICRegisters(instr); - - Handle ic = CodeFactory::KeyedStoreICInOptimizedCode( - isolate(), instr->language_mode()) - .code(); - CallCode(ic, RelocInfo::CODE_TARGET, instr); -} - - void LCodeGen::DoMaybeGrowElements(LMaybeGrowElements* instr) { class DeferredMaybeGrowElements final : public LDeferredCode { public: diff --git a/src/crankshaft/x64/lithium-codegen-x64.h b/src/crankshaft/x64/lithium-codegen-x64.h index 22c39ad088..22a32a147d 100644 --- a/src/crankshaft/x64/lithium-codegen-x64.h +++ b/src/crankshaft/x64/lithium-codegen-x64.h @@ -297,8 +297,6 @@ class LCodeGen: public LCodeGenBase { template void EmitVectorLoadICRegisters(T* instr); - template - void EmitVectorStoreICRegisters(T* instr); #ifdef _MSC_VER // On windows, you may not access the stack more than one page below diff --git a/src/crankshaft/x64/lithium-x64.cc b/src/crankshaft/x64/lithium-x64.cc index 7032c712ca..06b5052a62 100644 --- a/src/crankshaft/x64/lithium-x64.cc +++ b/src/crankshaft/x64/lithium-x64.cc @@ -380,15 +380,6 @@ void LStoreKeyed::PrintDataTo(StringStream* stream) { } -void LStoreKeyedGeneric::PrintDataTo(StringStream* stream) { - object()->PrintTo(stream); - stream->Add("["); - key()->PrintTo(stream); - stream->Add("] <- "); - value()->PrintTo(stream); -} - - void LTransitionElementsKind::PrintDataTo(StringStream* stream) { object()->PrintTo(stream); stream->Add(" %p -> %p", *original_map(), *transitioned_map()); @@ -2214,26 +2205,6 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { } -LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { - LOperand* context = UseFixed(instr->context(), rsi); - LOperand* object = - UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); - LOperand* key = UseFixed(instr->key(), StoreDescriptor::NameRegister()); - LOperand* value = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); - - DCHECK(instr->object()->representation().IsTagged()); - DCHECK(instr->key()->representation().IsTagged()); - DCHECK(instr->value()->representation().IsTagged()); - - LOperand* slot = FixedTemp(StoreWithVectorDescriptor::SlotRegister()); - LOperand* vector = FixedTemp(StoreWithVectorDescriptor::VectorRegister()); - - LStoreKeyedGeneric* result = new (zone()) - LStoreKeyedGeneric(context, object, key, value, slot, vector); - return MarkAsCall(result, instr); -} - - LInstruction* LChunkBuilder::DoTransitionElementsKind( HTransitionElementsKind* instr) { if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { diff --git a/src/crankshaft/x64/lithium-x64.h b/src/crankshaft/x64/lithium-x64.h index 7ee4b7561c..e7eaa01529 100644 --- a/src/crankshaft/x64/lithium-x64.h +++ b/src/crankshaft/x64/lithium-x64.h @@ -132,7 +132,6 @@ class LCodeGen; V(StoreCodeEntry) \ V(StoreContextSlot) \ V(StoreKeyed) \ - V(StoreKeyedGeneric) \ V(StoreNamedField) \ V(StringAdd) \ V(StringCharCodeAt) \ @@ -2040,34 +2039,6 @@ class LStoreKeyed final : public LTemplateInstruction<0, 4, 0> { }; -class LStoreKeyedGeneric final : public LTemplateInstruction<0, 4, 2> { - public: - LStoreKeyedGeneric(LOperand* context, LOperand* object, LOperand* key, - LOperand* value, LOperand* slot, LOperand* vector) { - inputs_[0] = context; - inputs_[1] = object; - inputs_[2] = key; - inputs_[3] = value; - temps_[0] = slot; - temps_[1] = vector; - } - - LOperand* context() { return inputs_[0]; } - LOperand* object() { return inputs_[1]; } - LOperand* key() { return inputs_[2]; } - LOperand* value() { return inputs_[3]; } - LOperand* temp_slot() { return temps_[0]; } - LOperand* temp_vector() { return temps_[1]; } - - DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") - DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) - - void PrintDataTo(StringStream* stream) override; - - LanguageMode language_mode() { return hydrogen()->language_mode(); } -}; - - class LTransitionElementsKind final : public LTemplateInstruction<0, 2, 2> { public: LTransitionElementsKind(LOperand* object, diff --git a/src/crankshaft/x87/lithium-codegen-x87.cc b/src/crankshaft/x87/lithium-codegen-x87.cc index e069969695..85951b2d94 100644 --- a/src/crankshaft/x87/lithium-codegen-x87.cc +++ b/src/crankshaft/x87/lithium-codegen-x87.cc @@ -2676,20 +2676,6 @@ void LCodeGen::EmitVectorLoadICRegisters(T* instr) { } -template -void LCodeGen::EmitVectorStoreICRegisters(T* instr) { - Register vector_register = ToRegister(instr->temp_vector()); - Register slot_register = ToRegister(instr->temp_slot()); - - AllowDeferredHandleDereference vector_structure_check; - Handle vector = instr->hydrogen()->feedback_vector(); - __ mov(vector_register, vector); - FeedbackVectorSlot slot = instr->hydrogen()->slot(); - int index = vector->GetIndex(slot); - __ mov(slot_register, Immediate(Smi::FromInt(index))); -} - - void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { DCHECK(ToRegister(instr->context()).is(esi)); DCHECK(ToRegister(instr->result()).is(eax)); @@ -4179,21 +4165,6 @@ void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) { } -void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { - DCHECK(ToRegister(instr->context()).is(esi)); - DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); - DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); - DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); - - EmitVectorStoreICRegisters(instr); - - Handle ic = CodeFactory::KeyedStoreICInOptimizedCode( - isolate(), instr->language_mode()) - .code(); - CallCode(ic, RelocInfo::CODE_TARGET, instr); -} - - void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) { Register object = ToRegister(instr->object()); Register temp = ToRegister(instr->temp()); diff --git a/src/crankshaft/x87/lithium-codegen-x87.h b/src/crankshaft/x87/lithium-codegen-x87.h index cdf02f3f8c..850f330900 100644 --- a/src/crankshaft/x87/lithium-codegen-x87.h +++ b/src/crankshaft/x87/lithium-codegen-x87.h @@ -323,8 +323,6 @@ class LCodeGen: public LCodeGenBase { template void EmitVectorLoadICRegisters(T* instr); - template - void EmitVectorStoreICRegisters(T* instr); void EmitReturn(LReturn* instr); diff --git a/src/crankshaft/x87/lithium-x87.cc b/src/crankshaft/x87/lithium-x87.cc index 5ee11ffa24..68e2b32519 100644 --- a/src/crankshaft/x87/lithium-x87.cc +++ b/src/crankshaft/x87/lithium-x87.cc @@ -394,15 +394,6 @@ void LStoreKeyed::PrintDataTo(StringStream* stream) { } -void LStoreKeyedGeneric::PrintDataTo(StringStream* stream) { - object()->PrintTo(stream); - stream->Add("["); - key()->PrintTo(stream); - stream->Add("] <- "); - value()->PrintTo(stream); -} - - void LTransitionElementsKind::PrintDataTo(StringStream* stream) { object()->PrintTo(stream); stream->Add(" %p -> %p", *original_map(), *transitioned_map()); @@ -2204,26 +2195,6 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { } -LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { - LOperand* context = UseFixed(instr->context(), esi); - LOperand* object = - UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); - LOperand* key = UseFixed(instr->key(), StoreDescriptor::NameRegister()); - LOperand* value = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); - - DCHECK(instr->object()->representation().IsTagged()); - DCHECK(instr->key()->representation().IsTagged()); - DCHECK(instr->value()->representation().IsTagged()); - - LOperand* slot = FixedTemp(StoreWithVectorDescriptor::SlotRegister()); - LOperand* vector = FixedTemp(StoreWithVectorDescriptor::VectorRegister()); - - LStoreKeyedGeneric* result = new (zone()) - LStoreKeyedGeneric(context, object, key, value, slot, vector); - return MarkAsCall(result, instr); -} - - LInstruction* LChunkBuilder::DoTransitionElementsKind( HTransitionElementsKind* instr) { if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { diff --git a/src/crankshaft/x87/lithium-x87.h b/src/crankshaft/x87/lithium-x87.h index 0ef24c8189..e2b804322a 100644 --- a/src/crankshaft/x87/lithium-x87.h +++ b/src/crankshaft/x87/lithium-x87.h @@ -135,7 +135,6 @@ class LCodeGen; V(StoreCodeEntry) \ V(StoreContextSlot) \ V(StoreKeyed) \ - V(StoreKeyedGeneric) \ V(StoreNamedField) \ V(StringAdd) \ V(StringCharCodeAt) \ @@ -2037,34 +2036,6 @@ class LStoreKeyed final : public LTemplateInstruction<0, 4, 0> { }; -class LStoreKeyedGeneric final : public LTemplateInstruction<0, 4, 2> { - public: - LStoreKeyedGeneric(LOperand* context, LOperand* object, LOperand* key, - LOperand* value, LOperand* slot, LOperand* vector) { - inputs_[0] = context; - inputs_[1] = object; - inputs_[2] = key; - inputs_[3] = value; - temps_[0] = slot; - temps_[1] = vector; - } - - LOperand* context() { return inputs_[0]; } - LOperand* object() { return inputs_[1]; } - LOperand* key() { return inputs_[2]; } - LOperand* value() { return inputs_[3]; } - LOperand* temp_slot() { return temps_[0]; } - LOperand* temp_vector() { return temps_[1]; } - - DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") - DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) - - void PrintDataTo(StringStream* stream) override; - - LanguageMode language_mode() { return hydrogen()->language_mode(); } -}; - - class LTransitionElementsKind final : public LTemplateInstruction<0, 2, 2> { public: LTransitionElementsKind(LOperand* object,