From 12918397b4af7b2bede8b29e1e9b1940d5d5ad3b Mon Sep 17 00:00:00 2001 From: ishell Date: Fri, 23 Sep 2016 09:00:12 -0700 Subject: [PATCH] [fullcodegen] Refactor code that calls store ICs. Make FCG::CallStoreIC() load slot and name and make FCG::CallKeyedStoreIC() load slot according to store IC calling convention (StoreDescriptor). BUG=v8:5407 Review-Url: https://codereview.chromium.org/2363513003 Cr-Commit-Position: refs/heads/master@{#39679} --- src/full-codegen/arm/full-codegen-arm.cc | 45 +++++-------------- src/full-codegen/arm64/full-codegen-arm64.cc | 45 +++++-------------- src/full-codegen/full-codegen.cc | 32 ++++++++----- src/full-codegen/full-codegen.h | 10 +++-- src/full-codegen/ia32/full-codegen-ia32.cc | 44 +++++------------- src/full-codegen/mips/full-codegen-mips.cc | 45 +++++-------------- .../mips64/full-codegen-mips64.cc | 45 +++++-------------- src/full-codegen/ppc/full-codegen-ppc.cc | 45 +++++-------------- src/full-codegen/s390/full-codegen-s390.cc | 45 +++++-------------- src/full-codegen/x64/full-codegen-x64.cc | 44 +++++------------- src/full-codegen/x87/full-codegen-x87.cc | 44 +++++------------- 11 files changed, 127 insertions(+), 317 deletions(-) diff --git a/src/full-codegen/arm/full-codegen-arm.cc b/src/full-codegen/arm/full-codegen-arm.cc index 9ca85c607b..644938eea1 100644 --- a/src/full-codegen/arm/full-codegen-arm.cc +++ b/src/full-codegen/arm/full-codegen-arm.cc @@ -1168,12 +1168,9 @@ void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset, FeedbackVectorSlot slot) { DCHECK(NeedsHomeObject(initializer)); __ ldr(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); - __ mov(StoreDescriptor::NameRegister(), - Operand(isolate()->factory()->home_object_symbol())); __ ldr(StoreDescriptor::ValueRegister(), MemOperand(sp, offset * kPointerSize)); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, isolate()->factory()->home_object_symbol()); } @@ -1182,12 +1179,9 @@ void FullCodeGenerator::EmitSetHomeObjectAccumulator(Expression* initializer, FeedbackVectorSlot slot) { DCHECK(NeedsHomeObject(initializer)); __ Move(StoreDescriptor::ReceiverRegister(), r0); - __ mov(StoreDescriptor::NameRegister(), - Operand(isolate()->factory()->home_object_symbol())); __ ldr(StoreDescriptor::ValueRegister(), MemOperand(sp, offset * kPointerSize)); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, isolate()->factory()->home_object_symbol()); } @@ -1422,10 +1416,8 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { if (property->emit_store()) { VisitForAccumulatorValue(value); DCHECK(StoreDescriptor::ValueRegister().is(r0)); - __ mov(StoreDescriptor::NameRegister(), Operand(key->value())); __ ldr(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); - EmitLoadStoreICSlot(property->GetSlot(0)); - CallStoreIC(); + CallStoreIC(property->GetSlot(0), key->value()); PrepareForBailoutForId(key->id(), BailoutState::NO_REGISTERS); if (NeedsHomeObject(value)) { @@ -1623,8 +1615,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { __ mov(StoreDescriptor::NameRegister(), Operand(Smi::FromInt(array_index))); __ ldr(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0)); - EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); - CallKeyedStoreIC(); + CallKeyedStoreIC(expr->LiteralFeedbackSlot()); PrepareForBailoutForId(expr->GetIdForElement(array_index), BailoutState::NO_REGISTERS); @@ -2056,10 +2047,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, VisitForAccumulatorValue(prop->obj()); __ Move(StoreDescriptor::ReceiverRegister(), r0); PopOperand(StoreDescriptor::ValueRegister()); // Restore value. - __ mov(StoreDescriptor::NameRegister(), - Operand(prop->key()->AsLiteral()->value())); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, prop->key()->AsLiteral()->value()); break; } case NAMED_SUPER_PROPERTY: { @@ -2106,8 +2094,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, __ Move(StoreDescriptor::NameRegister(), r0); PopOperands(StoreDescriptor::ValueRegister(), StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(slot); - CallKeyedStoreIC(); + CallKeyedStoreIC(slot); break; } } @@ -2132,10 +2119,8 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, FeedbackVectorSlot slot) { if (var->IsUnallocated()) { // Global var, const, or let. - __ mov(StoreDescriptor::NameRegister(), Operand(var->name())); __ LoadGlobalObject(StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, var->name()); } else if (IsLexicalVariableMode(var->mode()) && op != Token::INIT) { DCHECK(!var->IsLookupSlot()); @@ -2203,11 +2188,8 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { DCHECK(prop != NULL); DCHECK(prop->key()->IsLiteral()); - __ mov(StoreDescriptor::NameRegister(), - Operand(prop->key()->AsLiteral()->value())); PopOperand(StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(expr->AssignmentSlot()); - CallStoreIC(); + CallStoreIC(expr->AssignmentSlot(), prop->key()->AsLiteral()->value()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(r0); @@ -2249,8 +2231,7 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { StoreDescriptor::NameRegister()); DCHECK(StoreDescriptor::ValueRegister().is(r0)); - EmitLoadStoreICSlot(expr->AssignmentSlot()); - CallKeyedStoreIC(); + CallKeyedStoreIC(expr->AssignmentSlot()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(r0); @@ -3304,11 +3285,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { } break; case NAMED_PROPERTY: { - __ mov(StoreDescriptor::NameRegister(), - Operand(prop->key()->AsLiteral()->value())); PopOperand(StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(expr->CountSlot()); - CallStoreIC(); + CallStoreIC(expr->CountSlot(), prop->key()->AsLiteral()->value()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); if (expr->is_postfix()) { if (!context()->IsEffect()) { @@ -3346,8 +3324,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { case KEYED_PROPERTY: { PopOperands(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister()); - EmitLoadStoreICSlot(expr->CountSlot()); - CallKeyedStoreIC(); + CallKeyedStoreIC(expr->CountSlot()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); if (expr->is_postfix()) { if (!context()->IsEffect()) { diff --git a/src/full-codegen/arm64/full-codegen-arm64.cc b/src/full-codegen/arm64/full-codegen-arm64.cc index 530d2bdeac..ce61808d3c 100644 --- a/src/full-codegen/arm64/full-codegen-arm64.cc +++ b/src/full-codegen/arm64/full-codegen-arm64.cc @@ -1158,11 +1158,8 @@ void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset, FeedbackVectorSlot slot) { DCHECK(NeedsHomeObject(initializer)); __ Peek(StoreDescriptor::ReceiverRegister(), 0); - __ Mov(StoreDescriptor::NameRegister(), - Operand(isolate()->factory()->home_object_symbol())); __ Peek(StoreDescriptor::ValueRegister(), offset * kPointerSize); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, isolate()->factory()->home_object_symbol()); } @@ -1171,11 +1168,8 @@ void FullCodeGenerator::EmitSetHomeObjectAccumulator(Expression* initializer, FeedbackVectorSlot slot) { DCHECK(NeedsHomeObject(initializer)); __ Move(StoreDescriptor::ReceiverRegister(), x0); - __ Mov(StoreDescriptor::NameRegister(), - Operand(isolate()->factory()->home_object_symbol())); __ Peek(StoreDescriptor::ValueRegister(), offset * kPointerSize); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, isolate()->factory()->home_object_symbol()); } @@ -1409,10 +1403,8 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { if (property->emit_store()) { VisitForAccumulatorValue(value); DCHECK(StoreDescriptor::ValueRegister().is(x0)); - __ Mov(StoreDescriptor::NameRegister(), Operand(key->value())); __ Peek(StoreDescriptor::ReceiverRegister(), 0); - EmitLoadStoreICSlot(property->GetSlot(0)); - CallStoreIC(); + CallStoreIC(property->GetSlot(0), key->value()); PrepareForBailoutForId(key->id(), BailoutState::NO_REGISTERS); if (NeedsHomeObject(value)) { @@ -1606,8 +1598,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { __ Mov(StoreDescriptor::NameRegister(), Smi::FromInt(array_index)); __ Peek(StoreDescriptor::ReceiverRegister(), 0); - EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); - CallKeyedStoreIC(); + CallKeyedStoreIC(expr->LiteralFeedbackSlot()); PrepareForBailoutForId(expr->GetIdForElement(array_index), BailoutState::NO_REGISTERS); @@ -1949,10 +1940,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, // this copy. __ Mov(StoreDescriptor::ReceiverRegister(), x0); PopOperand(StoreDescriptor::ValueRegister()); // Restore value. - __ Mov(StoreDescriptor::NameRegister(), - Operand(prop->key()->AsLiteral()->value())); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, prop->key()->AsLiteral()->value()); break; } case NAMED_SUPER_PROPERTY: { @@ -1999,8 +1987,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, __ Mov(StoreDescriptor::NameRegister(), x0); PopOperands(StoreDescriptor::ReceiverRegister(), StoreDescriptor::ValueRegister()); - EmitLoadStoreICSlot(slot); - CallKeyedStoreIC(); + CallKeyedStoreIC(slot); break; } } @@ -2026,10 +2013,8 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, ASM_LOCATION("FullCodeGenerator::EmitVariableAssignment"); if (var->IsUnallocated()) { // Global var, const, or let. - __ Mov(StoreDescriptor::NameRegister(), Operand(var->name())); __ LoadGlobalObject(StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, var->name()); } else if (IsLexicalVariableMode(var->mode()) && op != Token::INIT) { DCHECK(!var->IsLookupSlot()); @@ -2095,11 +2080,8 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { DCHECK(prop != NULL); DCHECK(prop->key()->IsLiteral()); - __ Mov(StoreDescriptor::NameRegister(), - Operand(prop->key()->AsLiteral()->value())); PopOperand(StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(expr->AssignmentSlot()); - CallStoreIC(); + CallStoreIC(expr->AssignmentSlot(), prop->key()->AsLiteral()->value()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(x0); @@ -2144,8 +2126,7 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { StoreDescriptor::ReceiverRegister()); DCHECK(StoreDescriptor::ValueRegister().is(x0)); - EmitLoadStoreICSlot(expr->AssignmentSlot()); - CallKeyedStoreIC(); + CallKeyedStoreIC(expr->AssignmentSlot()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(x0); @@ -3226,11 +3207,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { } break; case NAMED_PROPERTY: { - __ Mov(StoreDescriptor::NameRegister(), - Operand(prop->key()->AsLiteral()->value())); PopOperand(StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(expr->CountSlot()); - CallStoreIC(); + CallStoreIC(expr->CountSlot(), prop->key()->AsLiteral()->value()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); if (expr->is_postfix()) { if (!context()->IsEffect()) { @@ -3268,8 +3246,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { case KEYED_PROPERTY: { PopOperand(StoreDescriptor::NameRegister()); PopOperand(StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(expr->CountSlot()); - CallKeyedStoreIC(); + CallKeyedStoreIC(expr->CountSlot()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); if (expr->is_postfix()) { if (!context()->IsEffect()) { diff --git a/src/full-codegen/full-codegen.cc b/src/full-codegen/full-codegen.cc index fe073bdea6..15fe94c569 100644 --- a/src/full-codegen/full-codegen.cc +++ b/src/full-codegen/full-codegen.cc @@ -235,31 +235,37 @@ void FullCodeGenerator::CallLoadGlobalIC(TypeofMode typeof_mode, CallIC(ic, id); } -void FullCodeGenerator::CallStoreIC(TypeFeedbackId id) { - Handle ic = CodeFactory::StoreIC(isolate(), language_mode()).code(); +void FullCodeGenerator::CallStoreIC(FeedbackVectorSlot slot, + Handle name, TypeFeedbackId id) { + DCHECK(name->IsName()); + __ Move(StoreDescriptor::NameRegister(), name); STATIC_ASSERT(!StoreDescriptor::kPassLastArgsOnStack || StoreDescriptor::kStackArgumentsCount == 2); if (StoreDescriptor::kPassLastArgsOnStack) { __ Push(StoreDescriptor::ValueRegister()); - __ Push(StoreDescriptor::SlotRegister()); + EmitPushSlot(slot); + } else { + EmitLoadSlot(StoreDescriptor::SlotRegister(), slot); } + Handle ic = CodeFactory::StoreIC(isolate(), language_mode()).code(); CallIC(ic, id); RestoreContext(); } -void FullCodeGenerator::CallKeyedStoreIC() { - Handle ic = - CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); - +void FullCodeGenerator::CallKeyedStoreIC(FeedbackVectorSlot slot) { STATIC_ASSERT(!StoreDescriptor::kPassLastArgsOnStack || StoreDescriptor::kStackArgumentsCount == 2); if (StoreDescriptor::kPassLastArgsOnStack) { __ Push(StoreDescriptor::ValueRegister()); - __ Push(StoreDescriptor::SlotRegister()); + EmitPushSlot(slot); + } else { + EmitLoadSlot(StoreDescriptor::SlotRegister(), slot); } + Handle ic = + CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); CallIC(ic); RestoreContext(); } @@ -488,7 +494,6 @@ void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) { EmitVariableLoad(expr); } - void FullCodeGenerator::VisitSloppyBlockFunctionStatement( SloppyBlockFunctionStatement* declaration) { Visit(declaration->statement()); @@ -1129,9 +1134,14 @@ void FullCodeGenerator::EmitPropertyKey(LiteralProperty* property, PushOperand(result_register()); } -void FullCodeGenerator::EmitLoadStoreICSlot(FeedbackVectorSlot slot) { +void FullCodeGenerator::EmitLoadSlot(Register destination, + FeedbackVectorSlot slot) { DCHECK(!slot.IsInvalid()); - __ Move(StoreDescriptor::SlotRegister(), SmiFromSlot(slot)); + __ Move(destination, SmiFromSlot(slot)); +} + +void FullCodeGenerator::EmitPushSlot(FeedbackVectorSlot slot) { + __ Push(SmiFromSlot(slot)); } void FullCodeGenerator::VisitReturnStatement(ReturnStatement* stmt) { diff --git a/src/full-codegen/full-codegen.h b/src/full-codegen/full-codegen.h index c33685cfd1..7e00362937 100644 --- a/src/full-codegen/full-codegen.h +++ b/src/full-codegen/full-codegen.h @@ -613,7 +613,10 @@ class FullCodeGenerator final : public AstVisitor { void EmitSetHomeObjectAccumulator(Expression* initializer, int offset, FeedbackVectorSlot slot); - void EmitLoadStoreICSlot(FeedbackVectorSlot slot); + // Platform-specific code for loading a slot to a register. + void EmitLoadSlot(Register destination, FeedbackVectorSlot slot); + // Platform-specific code for pushing a slot to the stack. + void EmitPushSlot(FeedbackVectorSlot slot); void CallIC(Handle code, TypeFeedbackId id = TypeFeedbackId::None()); @@ -622,8 +625,9 @@ class FullCodeGenerator final : public AstVisitor { // Inside typeof reference errors are never thrown. void CallLoadGlobalIC(TypeofMode typeof_mode, TypeFeedbackId id = TypeFeedbackId::None()); - void CallStoreIC(TypeFeedbackId id = TypeFeedbackId::None()); - void CallKeyedStoreIC(); + void CallStoreIC(FeedbackVectorSlot slot, Handle name, + TypeFeedbackId id = TypeFeedbackId::None()); + void CallKeyedStoreIC(FeedbackVectorSlot slot); void SetFunctionPosition(FunctionLiteral* fun); void SetReturnPosition(FunctionLiteral* fun); diff --git a/src/full-codegen/ia32/full-codegen-ia32.cc b/src/full-codegen/ia32/full-codegen-ia32.cc index 28164bd80a..e7e6aa0fe2 100644 --- a/src/full-codegen/ia32/full-codegen-ia32.cc +++ b/src/full-codegen/ia32/full-codegen-ia32.cc @@ -1092,11 +1092,8 @@ void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset, FeedbackVectorSlot slot) { DCHECK(NeedsHomeObject(initializer)); __ mov(StoreDescriptor::ReceiverRegister(), Operand(esp, 0)); - __ mov(StoreDescriptor::NameRegister(), - Immediate(isolate()->factory()->home_object_symbol())); __ mov(StoreDescriptor::ValueRegister(), Operand(esp, offset * kPointerSize)); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, isolate()->factory()->home_object_symbol()); } @@ -1105,11 +1102,8 @@ void FullCodeGenerator::EmitSetHomeObjectAccumulator(Expression* initializer, FeedbackVectorSlot slot) { DCHECK(NeedsHomeObject(initializer)); __ mov(StoreDescriptor::ReceiverRegister(), eax); - __ mov(StoreDescriptor::NameRegister(), - Immediate(isolate()->factory()->home_object_symbol())); __ mov(StoreDescriptor::ValueRegister(), Operand(esp, offset * kPointerSize)); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, isolate()->factory()->home_object_symbol()); } @@ -1344,10 +1338,8 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { if (property->emit_store()) { VisitForAccumulatorValue(value); DCHECK(StoreDescriptor::ValueRegister().is(eax)); - __ mov(StoreDescriptor::NameRegister(), Immediate(key->value())); __ mov(StoreDescriptor::ReceiverRegister(), Operand(esp, 0)); - EmitLoadStoreICSlot(property->GetSlot(0)); - CallStoreIC(); + CallStoreIC(property->GetSlot(0), key->value()); PrepareForBailoutForId(key->id(), BailoutState::NO_REGISTERS); if (NeedsHomeObject(value)) { EmitSetHomeObjectAccumulator(value, 0, property->GetSlot(1)); @@ -1538,8 +1530,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { __ mov(StoreDescriptor::NameRegister(), Immediate(Smi::FromInt(array_index))); __ mov(StoreDescriptor::ReceiverRegister(), Operand(esp, 0)); - EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); - CallKeyedStoreIC(); + CallKeyedStoreIC(expr->LiteralFeedbackSlot()); PrepareForBailoutForId(expr->GetIdForElement(array_index), BailoutState::NO_REGISTERS); } @@ -1962,10 +1953,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, VisitForAccumulatorValue(prop->obj()); __ Move(StoreDescriptor::ReceiverRegister(), eax); PopOperand(StoreDescriptor::ValueRegister()); // Restore value. - __ mov(StoreDescriptor::NameRegister(), - prop->key()->AsLiteral()->value()); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, prop->key()->AsLiteral()->value()); break; } case NAMED_SUPER_PROPERTY: { @@ -2012,8 +2000,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, __ Move(StoreDescriptor::NameRegister(), eax); PopOperand(StoreDescriptor::ReceiverRegister()); // Receiver. PopOperand(StoreDescriptor::ValueRegister()); // Restore value. - EmitLoadStoreICSlot(slot); - CallKeyedStoreIC(); + CallKeyedStoreIC(slot); break; } } @@ -2036,13 +2023,11 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, FeedbackVectorSlot slot) { if (var->IsUnallocated()) { // Global var, const, or let. - __ mov(StoreDescriptor::NameRegister(), var->name()); __ mov(StoreDescriptor::ReceiverRegister(), NativeContextOperand()); __ mov(StoreDescriptor::ReceiverRegister(), ContextOperand(StoreDescriptor::ReceiverRegister(), Context::EXTENSION_INDEX)); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, var->name()); } else if (IsLexicalVariableMode(var->mode()) && op != Token::INIT) { DCHECK(!var->IsLookupSlot()); @@ -2110,10 +2095,8 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { DCHECK(prop != NULL); DCHECK(prop->key()->IsLiteral()); - __ mov(StoreDescriptor::NameRegister(), prop->key()->AsLiteral()->value()); PopOperand(StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(expr->AssignmentSlot()); - CallStoreIC(); + CallStoreIC(expr->AssignmentSlot(), prop->key()->AsLiteral()->value()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(eax); } @@ -2156,8 +2139,7 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { PopOperand(StoreDescriptor::NameRegister()); // Key. PopOperand(StoreDescriptor::ReceiverRegister()); DCHECK(StoreDescriptor::ValueRegister().is(eax)); - EmitLoadStoreICSlot(expr->AssignmentSlot()); - CallKeyedStoreIC(); + CallKeyedStoreIC(expr->AssignmentSlot()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(eax); } @@ -3202,11 +3184,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { } break; case NAMED_PROPERTY: { - __ mov(StoreDescriptor::NameRegister(), - prop->key()->AsLiteral()->value()); PopOperand(StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(expr->CountSlot()); - CallStoreIC(); + CallStoreIC(expr->CountSlot(), prop->key()->AsLiteral()->value()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); if (expr->is_postfix()) { if (!context()->IsEffect()) { @@ -3244,8 +3223,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { case KEYED_PROPERTY: { PopOperand(StoreDescriptor::NameRegister()); PopOperand(StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(expr->CountSlot()); - CallKeyedStoreIC(); + CallKeyedStoreIC(expr->CountSlot()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); if (expr->is_postfix()) { // Result is on the stack diff --git a/src/full-codegen/mips/full-codegen-mips.cc b/src/full-codegen/mips/full-codegen-mips.cc index 4c03f3ecfa..b2871b9e46 100644 --- a/src/full-codegen/mips/full-codegen-mips.cc +++ b/src/full-codegen/mips/full-codegen-mips.cc @@ -1163,12 +1163,9 @@ void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset, FeedbackVectorSlot slot) { DCHECK(NeedsHomeObject(initializer)); __ lw(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); - __ li(StoreDescriptor::NameRegister(), - Operand(isolate()->factory()->home_object_symbol())); __ lw(StoreDescriptor::ValueRegister(), MemOperand(sp, offset * kPointerSize)); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, isolate()->factory()->home_object_symbol()); } @@ -1177,12 +1174,9 @@ void FullCodeGenerator::EmitSetHomeObjectAccumulator(Expression* initializer, FeedbackVectorSlot slot) { DCHECK(NeedsHomeObject(initializer)); __ Move(StoreDescriptor::ReceiverRegister(), v0); - __ li(StoreDescriptor::NameRegister(), - Operand(isolate()->factory()->home_object_symbol())); __ lw(StoreDescriptor::ValueRegister(), MemOperand(sp, offset * kPointerSize)); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, isolate()->factory()->home_object_symbol()); } @@ -1419,10 +1413,8 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { VisitForAccumulatorValue(value); __ mov(StoreDescriptor::ValueRegister(), result_register()); DCHECK(StoreDescriptor::ValueRegister().is(a0)); - __ li(StoreDescriptor::NameRegister(), Operand(key->value())); __ lw(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); - EmitLoadStoreICSlot(property->GetSlot(0)); - CallStoreIC(); + CallStoreIC(property->GetSlot(0), key->value()); PrepareForBailoutForId(key->id(), BailoutState::NO_REGISTERS); if (NeedsHomeObject(value)) { @@ -1620,8 +1612,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { __ li(StoreDescriptor::NameRegister(), Operand(Smi::FromInt(array_index))); __ lw(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0)); __ mov(StoreDescriptor::ValueRegister(), result_register()); - EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); - CallKeyedStoreIC(); + CallKeyedStoreIC(expr->LiteralFeedbackSlot()); PrepareForBailoutForId(expr->GetIdForElement(array_index), BailoutState::NO_REGISTERS); @@ -2060,10 +2051,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, VisitForAccumulatorValue(prop->obj()); __ mov(StoreDescriptor::ReceiverRegister(), result_register()); PopOperand(StoreDescriptor::ValueRegister()); // Restore value. - __ li(StoreDescriptor::NameRegister(), - Operand(prop->key()->AsLiteral()->value())); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, prop->key()->AsLiteral()->value()); break; } case NAMED_SUPER_PROPERTY: { @@ -2110,8 +2098,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, __ mov(StoreDescriptor::NameRegister(), result_register()); PopOperands(StoreDescriptor::ValueRegister(), StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(slot); - CallKeyedStoreIC(); + CallKeyedStoreIC(slot); break; } } @@ -2137,10 +2124,8 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, if (var->IsUnallocated()) { // Global var, const, or let. __ mov(StoreDescriptor::ValueRegister(), result_register()); - __ li(StoreDescriptor::NameRegister(), Operand(var->name())); __ LoadGlobalObject(StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, var->name()); } else if (IsLexicalVariableMode(var->mode()) && op != Token::INIT) { DCHECK(!var->IsLookupSlot()); @@ -2209,11 +2194,8 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { DCHECK(prop->key()->IsLiteral()); __ mov(StoreDescriptor::ValueRegister(), result_register()); - __ li(StoreDescriptor::NameRegister(), - Operand(prop->key()->AsLiteral()->value())); PopOperand(StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(expr->AssignmentSlot()); - CallStoreIC(); + CallStoreIC(expr->AssignmentSlot(), prop->key()->AsLiteral()->value()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(v0); @@ -2261,8 +2243,7 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { StoreDescriptor::NameRegister()); DCHECK(StoreDescriptor::ValueRegister().is(a0)); - EmitLoadStoreICSlot(expr->AssignmentSlot()); - CallKeyedStoreIC(); + CallKeyedStoreIC(expr->AssignmentSlot()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(v0); @@ -3310,11 +3291,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { break; case NAMED_PROPERTY: { __ mov(StoreDescriptor::ValueRegister(), result_register()); - __ li(StoreDescriptor::NameRegister(), - Operand(prop->key()->AsLiteral()->value())); PopOperand(StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(expr->CountSlot()); - CallStoreIC(); + CallStoreIC(expr->CountSlot(), prop->key()->AsLiteral()->value()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); if (expr->is_postfix()) { if (!context()->IsEffect()) { @@ -3353,8 +3331,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { __ mov(StoreDescriptor::ValueRegister(), result_register()); PopOperands(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister()); - EmitLoadStoreICSlot(expr->CountSlot()); - CallKeyedStoreIC(); + CallKeyedStoreIC(expr->CountSlot()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); if (expr->is_postfix()) { if (!context()->IsEffect()) { diff --git a/src/full-codegen/mips64/full-codegen-mips64.cc b/src/full-codegen/mips64/full-codegen-mips64.cc index 389f33d354..4105b39891 100644 --- a/src/full-codegen/mips64/full-codegen-mips64.cc +++ b/src/full-codegen/mips64/full-codegen-mips64.cc @@ -1164,12 +1164,9 @@ void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset, FeedbackVectorSlot slot) { DCHECK(NeedsHomeObject(initializer)); __ ld(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); - __ li(StoreDescriptor::NameRegister(), - Operand(isolate()->factory()->home_object_symbol())); __ ld(StoreDescriptor::ValueRegister(), MemOperand(sp, offset * kPointerSize)); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, isolate()->factory()->home_object_symbol()); } @@ -1178,12 +1175,9 @@ void FullCodeGenerator::EmitSetHomeObjectAccumulator(Expression* initializer, FeedbackVectorSlot slot) { DCHECK(NeedsHomeObject(initializer)); __ Move(StoreDescriptor::ReceiverRegister(), v0); - __ li(StoreDescriptor::NameRegister(), - Operand(isolate()->factory()->home_object_symbol())); __ ld(StoreDescriptor::ValueRegister(), MemOperand(sp, offset * kPointerSize)); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, isolate()->factory()->home_object_symbol()); } @@ -1420,10 +1414,8 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { VisitForAccumulatorValue(value); __ mov(StoreDescriptor::ValueRegister(), result_register()); DCHECK(StoreDescriptor::ValueRegister().is(a0)); - __ li(StoreDescriptor::NameRegister(), Operand(key->value())); __ ld(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); - EmitLoadStoreICSlot(property->GetSlot(0)); - CallStoreIC(); + CallStoreIC(property->GetSlot(0), key->value()); PrepareForBailoutForId(key->id(), BailoutState::NO_REGISTERS); if (NeedsHomeObject(value)) { @@ -1621,8 +1613,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { __ li(StoreDescriptor::NameRegister(), Operand(Smi::FromInt(array_index))); __ ld(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0)); __ mov(StoreDescriptor::ValueRegister(), result_register()); - EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); - CallKeyedStoreIC(); + CallKeyedStoreIC(expr->LiteralFeedbackSlot()); PrepareForBailoutForId(expr->GetIdForElement(array_index), BailoutState::NO_REGISTERS); @@ -2060,10 +2051,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, VisitForAccumulatorValue(prop->obj()); __ mov(StoreDescriptor::ReceiverRegister(), result_register()); PopOperand(StoreDescriptor::ValueRegister()); // Restore value. - __ li(StoreDescriptor::NameRegister(), - Operand(prop->key()->AsLiteral()->value())); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, prop->key()->AsLiteral()->value()); break; } case NAMED_SUPER_PROPERTY: { @@ -2110,8 +2098,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, __ Move(StoreDescriptor::NameRegister(), result_register()); PopOperands(StoreDescriptor::ValueRegister(), StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(slot); - CallKeyedStoreIC(); + CallKeyedStoreIC(slot); break; } } @@ -2137,10 +2124,8 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, if (var->IsUnallocated()) { // Global var, const, or let. __ mov(StoreDescriptor::ValueRegister(), result_register()); - __ li(StoreDescriptor::NameRegister(), Operand(var->name())); __ LoadGlobalObject(StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, var->name()); } else if (IsLexicalVariableMode(var->mode()) && op != Token::INIT) { DCHECK(!var->IsLookupSlot()); @@ -2208,11 +2193,8 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { DCHECK(prop->key()->IsLiteral()); __ mov(StoreDescriptor::ValueRegister(), result_register()); - __ li(StoreDescriptor::NameRegister(), - Operand(prop->key()->AsLiteral()->value())); PopOperand(StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(expr->AssignmentSlot()); - CallStoreIC(); + CallStoreIC(expr->AssignmentSlot(), prop->key()->AsLiteral()->value()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(v0); @@ -2260,8 +2242,7 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { StoreDescriptor::NameRegister()); DCHECK(StoreDescriptor::ValueRegister().is(a0)); - EmitLoadStoreICSlot(expr->AssignmentSlot()); - CallKeyedStoreIC(); + CallKeyedStoreIC(expr->AssignmentSlot()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(v0); @@ -3310,11 +3291,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { break; case NAMED_PROPERTY: { __ mov(StoreDescriptor::ValueRegister(), result_register()); - __ li(StoreDescriptor::NameRegister(), - Operand(prop->key()->AsLiteral()->value())); PopOperand(StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(expr->CountSlot()); - CallStoreIC(); + CallStoreIC(expr->CountSlot(), prop->key()->AsLiteral()->value()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); if (expr->is_postfix()) { if (!context()->IsEffect()) { @@ -3353,8 +3331,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { __ mov(StoreDescriptor::ValueRegister(), result_register()); PopOperands(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister()); - EmitLoadStoreICSlot(expr->CountSlot()); - CallKeyedStoreIC(); + CallKeyedStoreIC(expr->CountSlot()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); if (expr->is_postfix()) { if (!context()->IsEffect()) { diff --git a/src/full-codegen/ppc/full-codegen-ppc.cc b/src/full-codegen/ppc/full-codegen-ppc.cc index ab1d17fa4f..20143f6779 100644 --- a/src/full-codegen/ppc/full-codegen-ppc.cc +++ b/src/full-codegen/ppc/full-codegen-ppc.cc @@ -1133,12 +1133,9 @@ void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset, FeedbackVectorSlot slot) { DCHECK(NeedsHomeObject(initializer)); __ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); - __ mov(StoreDescriptor::NameRegister(), - Operand(isolate()->factory()->home_object_symbol())); __ LoadP(StoreDescriptor::ValueRegister(), MemOperand(sp, offset * kPointerSize)); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, isolate()->factory()->home_object_symbol()); } @@ -1147,12 +1144,9 @@ void FullCodeGenerator::EmitSetHomeObjectAccumulator(Expression* initializer, FeedbackVectorSlot slot) { DCHECK(NeedsHomeObject(initializer)); __ Move(StoreDescriptor::ReceiverRegister(), r3); - __ mov(StoreDescriptor::NameRegister(), - Operand(isolate()->factory()->home_object_symbol())); __ LoadP(StoreDescriptor::ValueRegister(), MemOperand(sp, offset * kPointerSize)); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, isolate()->factory()->home_object_symbol()); } @@ -1387,10 +1381,8 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { if (property->emit_store()) { VisitForAccumulatorValue(value); DCHECK(StoreDescriptor::ValueRegister().is(r3)); - __ mov(StoreDescriptor::NameRegister(), Operand(key->value())); __ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); - EmitLoadStoreICSlot(property->GetSlot(0)); - CallStoreIC(); + CallStoreIC(property->GetSlot(0), key->value()); PrepareForBailoutForId(key->id(), BailoutState::NO_REGISTERS); if (NeedsHomeObject(value)) { @@ -1586,8 +1578,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { __ LoadSmiLiteral(StoreDescriptor::NameRegister(), Smi::FromInt(array_index)); __ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0)); - EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); - CallKeyedStoreIC(); + CallKeyedStoreIC(expr->LiteralFeedbackSlot()); PrepareForBailoutForId(expr->GetIdForElement(array_index), BailoutState::NO_REGISTERS); @@ -2063,10 +2054,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, VisitForAccumulatorValue(prop->obj()); __ Move(StoreDescriptor::ReceiverRegister(), r3); PopOperand(StoreDescriptor::ValueRegister()); // Restore value. - __ mov(StoreDescriptor::NameRegister(), - Operand(prop->key()->AsLiteral()->value())); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, prop->key()->AsLiteral()->value()); break; } case NAMED_SUPER_PROPERTY: { @@ -2113,8 +2101,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, __ Move(StoreDescriptor::NameRegister(), r3); PopOperands(StoreDescriptor::ValueRegister(), StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(slot); - CallKeyedStoreIC(); + CallKeyedStoreIC(slot); break; } } @@ -2139,10 +2126,8 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, FeedbackVectorSlot slot) { if (var->IsUnallocated()) { // Global var, const, or let. - __ mov(StoreDescriptor::NameRegister(), Operand(var->name())); __ LoadGlobalObject(StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, var->name()); } else if (IsLexicalVariableMode(var->mode()) && op != Token::INIT) { DCHECK(!var->IsLookupSlot()); @@ -2210,11 +2195,8 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { DCHECK(prop != NULL); DCHECK(prop->key()->IsLiteral()); - __ mov(StoreDescriptor::NameRegister(), - Operand(prop->key()->AsLiteral()->value())); PopOperand(StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(expr->AssignmentSlot()); - CallStoreIC(); + CallStoreIC(expr->AssignmentSlot(), prop->key()->AsLiteral()->value()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(r3); @@ -2256,8 +2238,7 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { StoreDescriptor::NameRegister()); DCHECK(StoreDescriptor::ValueRegister().is(r3)); - EmitLoadStoreICSlot(expr->AssignmentSlot()); - CallKeyedStoreIC(); + CallKeyedStoreIC(expr->AssignmentSlot()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(r3); @@ -3301,11 +3282,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { } break; case NAMED_PROPERTY: { - __ mov(StoreDescriptor::NameRegister(), - Operand(prop->key()->AsLiteral()->value())); PopOperand(StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(expr->CountSlot()); - CallStoreIC(); + CallStoreIC(expr->CountSlot(), prop->key()->AsLiteral()->value()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); if (expr->is_postfix()) { if (!context()->IsEffect()) { @@ -3343,8 +3321,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { case KEYED_PROPERTY: { PopOperands(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister()); - EmitLoadStoreICSlot(expr->CountSlot()); - CallKeyedStoreIC(); + CallKeyedStoreIC(expr->CountSlot()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); if (expr->is_postfix()) { if (!context()->IsEffect()) { diff --git a/src/full-codegen/s390/full-codegen-s390.cc b/src/full-codegen/s390/full-codegen-s390.cc index 9e6dccda4c..3e70cb3e32 100644 --- a/src/full-codegen/s390/full-codegen-s390.cc +++ b/src/full-codegen/s390/full-codegen-s390.cc @@ -1101,12 +1101,9 @@ void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset, FeedbackVectorSlot slot) { DCHECK(NeedsHomeObject(initializer)); __ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); - __ mov(StoreDescriptor::NameRegister(), - Operand(isolate()->factory()->home_object_symbol())); __ LoadP(StoreDescriptor::ValueRegister(), MemOperand(sp, offset * kPointerSize)); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, isolate()->factory()->home_object_symbol()); } void FullCodeGenerator::EmitSetHomeObjectAccumulator(Expression* initializer, @@ -1114,12 +1111,9 @@ void FullCodeGenerator::EmitSetHomeObjectAccumulator(Expression* initializer, FeedbackVectorSlot slot) { DCHECK(NeedsHomeObject(initializer)); __ Move(StoreDescriptor::ReceiverRegister(), r2); - __ mov(StoreDescriptor::NameRegister(), - Operand(isolate()->factory()->home_object_symbol())); __ LoadP(StoreDescriptor::ValueRegister(), MemOperand(sp, offset * kPointerSize)); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, isolate()->factory()->home_object_symbol()); } void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, @@ -1347,10 +1341,8 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { if (property->emit_store()) { VisitForAccumulatorValue(value); DCHECK(StoreDescriptor::ValueRegister().is(r2)); - __ mov(StoreDescriptor::NameRegister(), Operand(key->value())); __ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); - EmitLoadStoreICSlot(property->GetSlot(0)); - CallStoreIC(); + CallStoreIC(property->GetSlot(0), key->value()); PrepareForBailoutForId(key->id(), BailoutState::NO_REGISTERS); if (NeedsHomeObject(value)) { @@ -1545,8 +1537,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { __ LoadSmiLiteral(StoreDescriptor::NameRegister(), Smi::FromInt(array_index)); __ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0)); - EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); - CallKeyedStoreIC(); + CallKeyedStoreIC(expr->LiteralFeedbackSlot()); PrepareForBailoutForId(expr->GetIdForElement(array_index), BailoutState::NO_REGISTERS); @@ -2018,10 +2009,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, VisitForAccumulatorValue(prop->obj()); __ Move(StoreDescriptor::ReceiverRegister(), r2); PopOperand(StoreDescriptor::ValueRegister()); // Restore value. - __ mov(StoreDescriptor::NameRegister(), - Operand(prop->key()->AsLiteral()->value())); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, prop->key()->AsLiteral()->value()); break; } case NAMED_SUPER_PROPERTY: { @@ -2068,8 +2056,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, __ Move(StoreDescriptor::NameRegister(), r2); PopOperands(StoreDescriptor::ValueRegister(), StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(slot); - CallKeyedStoreIC(); + CallKeyedStoreIC(slot); break; } } @@ -2092,10 +2079,8 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, FeedbackVectorSlot slot) { if (var->IsUnallocated()) { // Global var, const, or let. - __ mov(StoreDescriptor::NameRegister(), Operand(var->name())); __ LoadGlobalObject(StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, var->name()); } else if (IsLexicalVariableMode(var->mode()) && op != Token::INIT) { // Non-initializing assignment to let variable needs a write barrier. @@ -2162,11 +2147,8 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { DCHECK(prop != NULL); DCHECK(prop->key()->IsLiteral()); - __ mov(StoreDescriptor::NameRegister(), - Operand(prop->key()->AsLiteral()->value())); PopOperand(StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(expr->AssignmentSlot()); - CallStoreIC(); + CallStoreIC(expr->AssignmentSlot(), prop->key()->AsLiteral()->value()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(r2); @@ -2205,8 +2187,7 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { StoreDescriptor::NameRegister()); DCHECK(StoreDescriptor::ValueRegister().is(r2)); - EmitLoadStoreICSlot(expr->AssignmentSlot()); - CallKeyedStoreIC(); + CallKeyedStoreIC(expr->AssignmentSlot()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(r2); @@ -3219,11 +3200,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { } break; case NAMED_PROPERTY: { - __ mov(StoreDescriptor::NameRegister(), - Operand(prop->key()->AsLiteral()->value())); PopOperand(StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(expr->CountSlot()); - CallStoreIC(); + CallStoreIC(expr->CountSlot(), prop->key()->AsLiteral()->value()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); if (expr->is_postfix()) { if (!context()->IsEffect()) { @@ -3261,8 +3239,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { case KEYED_PROPERTY: { PopOperands(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister()); - EmitLoadStoreICSlot(expr->CountSlot()); - CallKeyedStoreIC(); + CallKeyedStoreIC(expr->CountSlot()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); if (expr->is_postfix()) { if (!context()->IsEffect()) { diff --git a/src/full-codegen/x64/full-codegen-x64.cc b/src/full-codegen/x64/full-codegen-x64.cc index 50a5af56d1..b0042c5a01 100644 --- a/src/full-codegen/x64/full-codegen-x64.cc +++ b/src/full-codegen/x64/full-codegen-x64.cc @@ -1119,12 +1119,9 @@ void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset, FeedbackVectorSlot slot) { DCHECK(NeedsHomeObject(initializer)); __ movp(StoreDescriptor::ReceiverRegister(), Operand(rsp, 0)); - __ Move(StoreDescriptor::NameRegister(), - isolate()->factory()->home_object_symbol()); __ movp(StoreDescriptor::ValueRegister(), Operand(rsp, offset * kPointerSize)); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, isolate()->factory()->home_object_symbol()); } @@ -1133,12 +1130,9 @@ void FullCodeGenerator::EmitSetHomeObjectAccumulator(Expression* initializer, FeedbackVectorSlot slot) { DCHECK(NeedsHomeObject(initializer)); __ movp(StoreDescriptor::ReceiverRegister(), rax); - __ Move(StoreDescriptor::NameRegister(), - isolate()->factory()->home_object_symbol()); __ movp(StoreDescriptor::ValueRegister(), Operand(rsp, offset * kPointerSize)); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, isolate()->factory()->home_object_symbol()); } @@ -1373,10 +1367,8 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { if (property->emit_store()) { VisitForAccumulatorValue(value); DCHECK(StoreDescriptor::ValueRegister().is(rax)); - __ Move(StoreDescriptor::NameRegister(), key->value()); __ movp(StoreDescriptor::ReceiverRegister(), Operand(rsp, 0)); - EmitLoadStoreICSlot(property->GetSlot(0)); - CallStoreIC(); + CallStoreIC(property->GetSlot(0), key->value()); PrepareForBailoutForId(key->id(), BailoutState::NO_REGISTERS); if (NeedsHomeObject(value)) { @@ -1565,8 +1557,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { __ Move(StoreDescriptor::NameRegister(), Smi::FromInt(array_index)); __ movp(StoreDescriptor::ReceiverRegister(), Operand(rsp, 0)); - EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); - CallKeyedStoreIC(); + CallKeyedStoreIC(expr->LiteralFeedbackSlot()); PrepareForBailoutForId(expr->GetIdForElement(array_index), BailoutState::NO_REGISTERS); @@ -1954,10 +1945,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, VisitForAccumulatorValue(prop->obj()); __ Move(StoreDescriptor::ReceiverRegister(), rax); PopOperand(StoreDescriptor::ValueRegister()); // Restore value. - __ Move(StoreDescriptor::NameRegister(), - prop->key()->AsLiteral()->value()); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, prop->key()->AsLiteral()->value()); break; } case NAMED_SUPER_PROPERTY: { @@ -2004,8 +1992,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, __ Move(StoreDescriptor::NameRegister(), rax); PopOperand(StoreDescriptor::ReceiverRegister()); PopOperand(StoreDescriptor::ValueRegister()); // Restore value. - EmitLoadStoreICSlot(slot); - CallKeyedStoreIC(); + CallKeyedStoreIC(slot); break; } } @@ -2028,10 +2015,8 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, FeedbackVectorSlot slot) { if (var->IsUnallocated()) { // Global var, const, or let. - __ Move(StoreDescriptor::NameRegister(), var->name()); __ LoadGlobalObject(StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, var->name()); } else if (IsLexicalVariableMode(var->mode()) && op != Token::INIT) { DCHECK(!var->IsLookupSlot()); @@ -2098,10 +2083,8 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { DCHECK(prop != NULL); DCHECK(prop->key()->IsLiteral()); - __ Move(StoreDescriptor::NameRegister(), prop->key()->AsLiteral()->value()); PopOperand(StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(expr->AssignmentSlot()); - CallStoreIC(); + CallStoreIC(expr->AssignmentSlot(), prop->key()->AsLiteral()->value()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(rax); @@ -2142,8 +2125,7 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { PopOperand(StoreDescriptor::NameRegister()); // Key. PopOperand(StoreDescriptor::ReceiverRegister()); DCHECK(StoreDescriptor::ValueRegister().is(rax)); - EmitLoadStoreICSlot(expr->AssignmentSlot()); - CallKeyedStoreIC(); + CallKeyedStoreIC(expr->AssignmentSlot()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(rax); @@ -3191,11 +3173,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { } break; case NAMED_PROPERTY: { - __ Move(StoreDescriptor::NameRegister(), - prop->key()->AsLiteral()->value()); PopOperand(StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(expr->CountSlot()); - CallStoreIC(); + CallStoreIC(expr->CountSlot(), prop->key()->AsLiteral()->value()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); if (expr->is_postfix()) { if (!context()->IsEffect()) { @@ -3233,8 +3212,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { case KEYED_PROPERTY: { PopOperand(StoreDescriptor::NameRegister()); PopOperand(StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(expr->CountSlot()); - CallKeyedStoreIC(); + CallKeyedStoreIC(expr->CountSlot()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); if (expr->is_postfix()) { if (!context()->IsEffect()) { diff --git a/src/full-codegen/x87/full-codegen-x87.cc b/src/full-codegen/x87/full-codegen-x87.cc index f59bab99e6..89e13a8739 100644 --- a/src/full-codegen/x87/full-codegen-x87.cc +++ b/src/full-codegen/x87/full-codegen-x87.cc @@ -1084,11 +1084,8 @@ void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset, FeedbackVectorSlot slot) { DCHECK(NeedsHomeObject(initializer)); __ mov(StoreDescriptor::ReceiverRegister(), Operand(esp, 0)); - __ mov(StoreDescriptor::NameRegister(), - Immediate(isolate()->factory()->home_object_symbol())); __ mov(StoreDescriptor::ValueRegister(), Operand(esp, offset * kPointerSize)); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, isolate()->factory()->home_object_symbol()); } @@ -1097,11 +1094,8 @@ void FullCodeGenerator::EmitSetHomeObjectAccumulator(Expression* initializer, FeedbackVectorSlot slot) { DCHECK(NeedsHomeObject(initializer)); __ mov(StoreDescriptor::ReceiverRegister(), eax); - __ mov(StoreDescriptor::NameRegister(), - Immediate(isolate()->factory()->home_object_symbol())); __ mov(StoreDescriptor::ValueRegister(), Operand(esp, offset * kPointerSize)); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, isolate()->factory()->home_object_symbol()); } @@ -1336,10 +1330,8 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { if (property->emit_store()) { VisitForAccumulatorValue(value); DCHECK(StoreDescriptor::ValueRegister().is(eax)); - __ mov(StoreDescriptor::NameRegister(), Immediate(key->value())); __ mov(StoreDescriptor::ReceiverRegister(), Operand(esp, 0)); - EmitLoadStoreICSlot(property->GetSlot(0)); - CallStoreIC(); + CallStoreIC(property->GetSlot(0), key->value()); PrepareForBailoutForId(key->id(), BailoutState::NO_REGISTERS); if (NeedsHomeObject(value)) { EmitSetHomeObjectAccumulator(value, 0, property->GetSlot(1)); @@ -1530,8 +1522,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { __ mov(StoreDescriptor::NameRegister(), Immediate(Smi::FromInt(array_index))); __ mov(StoreDescriptor::ReceiverRegister(), Operand(esp, 0)); - EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); - CallKeyedStoreIC(); + CallKeyedStoreIC(expr->LiteralFeedbackSlot()); PrepareForBailoutForId(expr->GetIdForElement(array_index), BailoutState::NO_REGISTERS); } @@ -1954,10 +1945,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, VisitForAccumulatorValue(prop->obj()); __ Move(StoreDescriptor::ReceiverRegister(), eax); PopOperand(StoreDescriptor::ValueRegister()); // Restore value. - __ mov(StoreDescriptor::NameRegister(), - prop->key()->AsLiteral()->value()); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, prop->key()->AsLiteral()->value()); break; } case NAMED_SUPER_PROPERTY: { @@ -2004,8 +1992,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, __ Move(StoreDescriptor::NameRegister(), eax); PopOperand(StoreDescriptor::ReceiverRegister()); // Receiver. PopOperand(StoreDescriptor::ValueRegister()); // Restore value. - EmitLoadStoreICSlot(slot); - CallKeyedStoreIC(); + CallKeyedStoreIC(slot); break; } } @@ -2028,13 +2015,11 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, FeedbackVectorSlot slot) { if (var->IsUnallocated()) { // Global var, const, or let. - __ mov(StoreDescriptor::NameRegister(), var->name()); __ mov(StoreDescriptor::ReceiverRegister(), NativeContextOperand()); __ mov(StoreDescriptor::ReceiverRegister(), ContextOperand(StoreDescriptor::ReceiverRegister(), Context::EXTENSION_INDEX)); - EmitLoadStoreICSlot(slot); - CallStoreIC(); + CallStoreIC(slot, var->name()); } else if (IsLexicalVariableMode(var->mode()) && op != Token::INIT) { DCHECK(!var->IsLookupSlot()); @@ -2102,10 +2087,8 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { DCHECK(prop != NULL); DCHECK(prop->key()->IsLiteral()); - __ mov(StoreDescriptor::NameRegister(), prop->key()->AsLiteral()->value()); PopOperand(StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(expr->AssignmentSlot()); - CallStoreIC(); + CallStoreIC(expr->AssignmentSlot(), prop->key()->AsLiteral()->value()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(eax); } @@ -2148,8 +2131,7 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { PopOperand(StoreDescriptor::NameRegister()); // Key. PopOperand(StoreDescriptor::ReceiverRegister()); DCHECK(StoreDescriptor::ValueRegister().is(eax)); - EmitLoadStoreICSlot(expr->AssignmentSlot()); - CallKeyedStoreIC(); + CallKeyedStoreIC(expr->AssignmentSlot()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(eax); } @@ -3194,11 +3176,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { } break; case NAMED_PROPERTY: { - __ mov(StoreDescriptor::NameRegister(), - prop->key()->AsLiteral()->value()); PopOperand(StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(expr->CountSlot()); - CallStoreIC(); + CallStoreIC(expr->CountSlot(), prop->key()->AsLiteral()->value()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); if (expr->is_postfix()) { if (!context()->IsEffect()) { @@ -3236,8 +3215,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { case KEYED_PROPERTY: { PopOperand(StoreDescriptor::NameRegister()); PopOperand(StoreDescriptor::ReceiverRegister()); - EmitLoadStoreICSlot(expr->CountSlot()); - CallKeyedStoreIC(); + CallKeyedStoreIC(expr->CountSlot()); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); if (expr->is_postfix()) { // Result is on the stack