diff --git a/src/full-codegen/arm/full-codegen-arm.cc b/src/full-codegen/arm/full-codegen-arm.cc index 644938eea1c5..9ca85c607b6b 100644 --- a/src/full-codegen/arm/full-codegen-arm.cc +++ b/src/full-codegen/arm/full-codegen-arm.cc @@ -1168,9 +1168,12 @@ 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)); - CallStoreIC(slot, isolate()->factory()->home_object_symbol()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); } @@ -1179,9 +1182,12 @@ 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)); - CallStoreIC(slot, isolate()->factory()->home_object_symbol()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); } @@ -1416,8 +1422,10 @@ 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)); - CallStoreIC(property->GetSlot(0), key->value()); + EmitLoadStoreICSlot(property->GetSlot(0)); + CallStoreIC(); PrepareForBailoutForId(key->id(), BailoutState::NO_REGISTERS); if (NeedsHomeObject(value)) { @@ -1615,7 +1623,8 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { __ mov(StoreDescriptor::NameRegister(), Operand(Smi::FromInt(array_index))); __ ldr(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0)); - CallKeyedStoreIC(expr->LiteralFeedbackSlot()); + EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); + CallKeyedStoreIC(); PrepareForBailoutForId(expr->GetIdForElement(array_index), BailoutState::NO_REGISTERS); @@ -2047,7 +2056,10 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, VisitForAccumulatorValue(prop->obj()); __ Move(StoreDescriptor::ReceiverRegister(), r0); PopOperand(StoreDescriptor::ValueRegister()); // Restore value. - CallStoreIC(slot, prop->key()->AsLiteral()->value()); + __ mov(StoreDescriptor::NameRegister(), + Operand(prop->key()->AsLiteral()->value())); + EmitLoadStoreICSlot(slot); + CallStoreIC(); break; } case NAMED_SUPER_PROPERTY: { @@ -2094,7 +2106,8 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, __ Move(StoreDescriptor::NameRegister(), r0); PopOperands(StoreDescriptor::ValueRegister(), StoreDescriptor::ReceiverRegister()); - CallKeyedStoreIC(slot); + EmitLoadStoreICSlot(slot); + CallKeyedStoreIC(); break; } } @@ -2119,8 +2132,10 @@ 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()); - CallStoreIC(slot, var->name()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); } else if (IsLexicalVariableMode(var->mode()) && op != Token::INIT) { DCHECK(!var->IsLookupSlot()); @@ -2188,8 +2203,11 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { DCHECK(prop != NULL); DCHECK(prop->key()->IsLiteral()); + __ mov(StoreDescriptor::NameRegister(), + Operand(prop->key()->AsLiteral()->value())); PopOperand(StoreDescriptor::ReceiverRegister()); - CallStoreIC(expr->AssignmentSlot(), prop->key()->AsLiteral()->value()); + EmitLoadStoreICSlot(expr->AssignmentSlot()); + CallStoreIC(); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(r0); @@ -2231,7 +2249,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { StoreDescriptor::NameRegister()); DCHECK(StoreDescriptor::ValueRegister().is(r0)); - CallKeyedStoreIC(expr->AssignmentSlot()); + EmitLoadStoreICSlot(expr->AssignmentSlot()); + CallKeyedStoreIC(); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(r0); @@ -3285,8 +3304,11 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { } break; case NAMED_PROPERTY: { + __ mov(StoreDescriptor::NameRegister(), + Operand(prop->key()->AsLiteral()->value())); PopOperand(StoreDescriptor::ReceiverRegister()); - CallStoreIC(expr->CountSlot(), prop->key()->AsLiteral()->value()); + EmitLoadStoreICSlot(expr->CountSlot()); + CallStoreIC(); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); if (expr->is_postfix()) { if (!context()->IsEffect()) { @@ -3324,7 +3346,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { case KEYED_PROPERTY: { PopOperands(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister()); - CallKeyedStoreIC(expr->CountSlot()); + EmitLoadStoreICSlot(expr->CountSlot()); + CallKeyedStoreIC(); 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 ce61808d3c70..530d2bdeacf4 100644 --- a/src/full-codegen/arm64/full-codegen-arm64.cc +++ b/src/full-codegen/arm64/full-codegen-arm64.cc @@ -1158,8 +1158,11 @@ 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); - CallStoreIC(slot, isolate()->factory()->home_object_symbol()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); } @@ -1168,8 +1171,11 @@ 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); - CallStoreIC(slot, isolate()->factory()->home_object_symbol()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); } @@ -1403,8 +1409,10 @@ 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); - CallStoreIC(property->GetSlot(0), key->value()); + EmitLoadStoreICSlot(property->GetSlot(0)); + CallStoreIC(); PrepareForBailoutForId(key->id(), BailoutState::NO_REGISTERS); if (NeedsHomeObject(value)) { @@ -1598,7 +1606,8 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { __ Mov(StoreDescriptor::NameRegister(), Smi::FromInt(array_index)); __ Peek(StoreDescriptor::ReceiverRegister(), 0); - CallKeyedStoreIC(expr->LiteralFeedbackSlot()); + EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); + CallKeyedStoreIC(); PrepareForBailoutForId(expr->GetIdForElement(array_index), BailoutState::NO_REGISTERS); @@ -1940,7 +1949,10 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, // this copy. __ Mov(StoreDescriptor::ReceiverRegister(), x0); PopOperand(StoreDescriptor::ValueRegister()); // Restore value. - CallStoreIC(slot, prop->key()->AsLiteral()->value()); + __ Mov(StoreDescriptor::NameRegister(), + Operand(prop->key()->AsLiteral()->value())); + EmitLoadStoreICSlot(slot); + CallStoreIC(); break; } case NAMED_SUPER_PROPERTY: { @@ -1987,7 +1999,8 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, __ Mov(StoreDescriptor::NameRegister(), x0); PopOperands(StoreDescriptor::ReceiverRegister(), StoreDescriptor::ValueRegister()); - CallKeyedStoreIC(slot); + EmitLoadStoreICSlot(slot); + CallKeyedStoreIC(); break; } } @@ -2013,8 +2026,10 @@ 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()); - CallStoreIC(slot, var->name()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); } else if (IsLexicalVariableMode(var->mode()) && op != Token::INIT) { DCHECK(!var->IsLookupSlot()); @@ -2080,8 +2095,11 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { DCHECK(prop != NULL); DCHECK(prop->key()->IsLiteral()); + __ Mov(StoreDescriptor::NameRegister(), + Operand(prop->key()->AsLiteral()->value())); PopOperand(StoreDescriptor::ReceiverRegister()); - CallStoreIC(expr->AssignmentSlot(), prop->key()->AsLiteral()->value()); + EmitLoadStoreICSlot(expr->AssignmentSlot()); + CallStoreIC(); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(x0); @@ -2126,7 +2144,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { StoreDescriptor::ReceiverRegister()); DCHECK(StoreDescriptor::ValueRegister().is(x0)); - CallKeyedStoreIC(expr->AssignmentSlot()); + EmitLoadStoreICSlot(expr->AssignmentSlot()); + CallKeyedStoreIC(); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(x0); @@ -3207,8 +3226,11 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { } break; case NAMED_PROPERTY: { + __ Mov(StoreDescriptor::NameRegister(), + Operand(prop->key()->AsLiteral()->value())); PopOperand(StoreDescriptor::ReceiverRegister()); - CallStoreIC(expr->CountSlot(), prop->key()->AsLiteral()->value()); + EmitLoadStoreICSlot(expr->CountSlot()); + CallStoreIC(); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); if (expr->is_postfix()) { if (!context()->IsEffect()) { @@ -3246,7 +3268,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { case KEYED_PROPERTY: { PopOperand(StoreDescriptor::NameRegister()); PopOperand(StoreDescriptor::ReceiverRegister()); - CallKeyedStoreIC(expr->CountSlot()); + EmitLoadStoreICSlot(expr->CountSlot()); + CallKeyedStoreIC(); 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 15fe94c569a5..fe073bdea602 100644 --- a/src/full-codegen/full-codegen.cc +++ b/src/full-codegen/full-codegen.cc @@ -235,37 +235,31 @@ void FullCodeGenerator::CallLoadGlobalIC(TypeofMode typeof_mode, CallIC(ic, id); } -void FullCodeGenerator::CallStoreIC(FeedbackVectorSlot slot, - Handle name, TypeFeedbackId id) { - DCHECK(name->IsName()); - __ Move(StoreDescriptor::NameRegister(), name); +void FullCodeGenerator::CallStoreIC(TypeFeedbackId id) { + Handle ic = CodeFactory::StoreIC(isolate(), language_mode()).code(); STATIC_ASSERT(!StoreDescriptor::kPassLastArgsOnStack || StoreDescriptor::kStackArgumentsCount == 2); if (StoreDescriptor::kPassLastArgsOnStack) { __ Push(StoreDescriptor::ValueRegister()); - EmitPushSlot(slot); - } else { - EmitLoadSlot(StoreDescriptor::SlotRegister(), slot); + __ Push(StoreDescriptor::SlotRegister()); } - Handle ic = CodeFactory::StoreIC(isolate(), language_mode()).code(); CallIC(ic, id); RestoreContext(); } -void FullCodeGenerator::CallKeyedStoreIC(FeedbackVectorSlot slot) { +void FullCodeGenerator::CallKeyedStoreIC() { + Handle ic = + CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); + STATIC_ASSERT(!StoreDescriptor::kPassLastArgsOnStack || StoreDescriptor::kStackArgumentsCount == 2); if (StoreDescriptor::kPassLastArgsOnStack) { __ Push(StoreDescriptor::ValueRegister()); - EmitPushSlot(slot); - } else { - EmitLoadSlot(StoreDescriptor::SlotRegister(), slot); + __ Push(StoreDescriptor::SlotRegister()); } - Handle ic = - CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); CallIC(ic); RestoreContext(); } @@ -494,6 +488,7 @@ void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) { EmitVariableLoad(expr); } + void FullCodeGenerator::VisitSloppyBlockFunctionStatement( SloppyBlockFunctionStatement* declaration) { Visit(declaration->statement()); @@ -1134,14 +1129,9 @@ void FullCodeGenerator::EmitPropertyKey(LiteralProperty* property, PushOperand(result_register()); } -void FullCodeGenerator::EmitLoadSlot(Register destination, - FeedbackVectorSlot slot) { +void FullCodeGenerator::EmitLoadStoreICSlot(FeedbackVectorSlot slot) { DCHECK(!slot.IsInvalid()); - __ Move(destination, SmiFromSlot(slot)); -} - -void FullCodeGenerator::EmitPushSlot(FeedbackVectorSlot slot) { - __ Push(SmiFromSlot(slot)); + __ Move(StoreDescriptor::SlotRegister(), SmiFromSlot(slot)); } void FullCodeGenerator::VisitReturnStatement(ReturnStatement* stmt) { diff --git a/src/full-codegen/full-codegen.h b/src/full-codegen/full-codegen.h index 7e003629379a..c33685cfd170 100644 --- a/src/full-codegen/full-codegen.h +++ b/src/full-codegen/full-codegen.h @@ -613,10 +613,7 @@ class FullCodeGenerator final : public AstVisitor { void EmitSetHomeObjectAccumulator(Expression* initializer, int offset, 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 EmitLoadStoreICSlot(FeedbackVectorSlot slot); void CallIC(Handle code, TypeFeedbackId id = TypeFeedbackId::None()); @@ -625,9 +622,8 @@ class FullCodeGenerator final : public AstVisitor { // Inside typeof reference errors are never thrown. void CallLoadGlobalIC(TypeofMode typeof_mode, TypeFeedbackId id = TypeFeedbackId::None()); - void CallStoreIC(FeedbackVectorSlot slot, Handle name, - TypeFeedbackId id = TypeFeedbackId::None()); - void CallKeyedStoreIC(FeedbackVectorSlot slot); + void CallStoreIC(TypeFeedbackId id = TypeFeedbackId::None()); + void CallKeyedStoreIC(); 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 e7e6aa0fe29a..28164bd80acd 100644 --- a/src/full-codegen/ia32/full-codegen-ia32.cc +++ b/src/full-codegen/ia32/full-codegen-ia32.cc @@ -1092,8 +1092,11 @@ 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)); - CallStoreIC(slot, isolate()->factory()->home_object_symbol()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); } @@ -1102,8 +1105,11 @@ 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)); - CallStoreIC(slot, isolate()->factory()->home_object_symbol()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); } @@ -1338,8 +1344,10 @@ 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)); - CallStoreIC(property->GetSlot(0), key->value()); + EmitLoadStoreICSlot(property->GetSlot(0)); + CallStoreIC(); PrepareForBailoutForId(key->id(), BailoutState::NO_REGISTERS); if (NeedsHomeObject(value)) { EmitSetHomeObjectAccumulator(value, 0, property->GetSlot(1)); @@ -1530,7 +1538,8 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { __ mov(StoreDescriptor::NameRegister(), Immediate(Smi::FromInt(array_index))); __ mov(StoreDescriptor::ReceiverRegister(), Operand(esp, 0)); - CallKeyedStoreIC(expr->LiteralFeedbackSlot()); + EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); + CallKeyedStoreIC(); PrepareForBailoutForId(expr->GetIdForElement(array_index), BailoutState::NO_REGISTERS); } @@ -1953,7 +1962,10 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, VisitForAccumulatorValue(prop->obj()); __ Move(StoreDescriptor::ReceiverRegister(), eax); PopOperand(StoreDescriptor::ValueRegister()); // Restore value. - CallStoreIC(slot, prop->key()->AsLiteral()->value()); + __ mov(StoreDescriptor::NameRegister(), + prop->key()->AsLiteral()->value()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); break; } case NAMED_SUPER_PROPERTY: { @@ -2000,7 +2012,8 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, __ Move(StoreDescriptor::NameRegister(), eax); PopOperand(StoreDescriptor::ReceiverRegister()); // Receiver. PopOperand(StoreDescriptor::ValueRegister()); // Restore value. - CallKeyedStoreIC(slot); + EmitLoadStoreICSlot(slot); + CallKeyedStoreIC(); break; } } @@ -2023,11 +2036,13 @@ 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)); - CallStoreIC(slot, var->name()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); } else if (IsLexicalVariableMode(var->mode()) && op != Token::INIT) { DCHECK(!var->IsLookupSlot()); @@ -2095,8 +2110,10 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { DCHECK(prop != NULL); DCHECK(prop->key()->IsLiteral()); + __ mov(StoreDescriptor::NameRegister(), prop->key()->AsLiteral()->value()); PopOperand(StoreDescriptor::ReceiverRegister()); - CallStoreIC(expr->AssignmentSlot(), prop->key()->AsLiteral()->value()); + EmitLoadStoreICSlot(expr->AssignmentSlot()); + CallStoreIC(); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(eax); } @@ -2139,7 +2156,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { PopOperand(StoreDescriptor::NameRegister()); // Key. PopOperand(StoreDescriptor::ReceiverRegister()); DCHECK(StoreDescriptor::ValueRegister().is(eax)); - CallKeyedStoreIC(expr->AssignmentSlot()); + EmitLoadStoreICSlot(expr->AssignmentSlot()); + CallKeyedStoreIC(); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(eax); } @@ -3184,8 +3202,11 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { } break; case NAMED_PROPERTY: { + __ mov(StoreDescriptor::NameRegister(), + prop->key()->AsLiteral()->value()); PopOperand(StoreDescriptor::ReceiverRegister()); - CallStoreIC(expr->CountSlot(), prop->key()->AsLiteral()->value()); + EmitLoadStoreICSlot(expr->CountSlot()); + CallStoreIC(); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); if (expr->is_postfix()) { if (!context()->IsEffect()) { @@ -3223,7 +3244,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { case KEYED_PROPERTY: { PopOperand(StoreDescriptor::NameRegister()); PopOperand(StoreDescriptor::ReceiverRegister()); - CallKeyedStoreIC(expr->CountSlot()); + EmitLoadStoreICSlot(expr->CountSlot()); + CallKeyedStoreIC(); 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 b2871b9e4682..4c03f3ecfac3 100644 --- a/src/full-codegen/mips/full-codegen-mips.cc +++ b/src/full-codegen/mips/full-codegen-mips.cc @@ -1163,9 +1163,12 @@ 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)); - CallStoreIC(slot, isolate()->factory()->home_object_symbol()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); } @@ -1174,9 +1177,12 @@ 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)); - CallStoreIC(slot, isolate()->factory()->home_object_symbol()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); } @@ -1413,8 +1419,10 @@ 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)); - CallStoreIC(property->GetSlot(0), key->value()); + EmitLoadStoreICSlot(property->GetSlot(0)); + CallStoreIC(); PrepareForBailoutForId(key->id(), BailoutState::NO_REGISTERS); if (NeedsHomeObject(value)) { @@ -1612,7 +1620,8 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { __ li(StoreDescriptor::NameRegister(), Operand(Smi::FromInt(array_index))); __ lw(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0)); __ mov(StoreDescriptor::ValueRegister(), result_register()); - CallKeyedStoreIC(expr->LiteralFeedbackSlot()); + EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); + CallKeyedStoreIC(); PrepareForBailoutForId(expr->GetIdForElement(array_index), BailoutState::NO_REGISTERS); @@ -2051,7 +2060,10 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, VisitForAccumulatorValue(prop->obj()); __ mov(StoreDescriptor::ReceiverRegister(), result_register()); PopOperand(StoreDescriptor::ValueRegister()); // Restore value. - CallStoreIC(slot, prop->key()->AsLiteral()->value()); + __ li(StoreDescriptor::NameRegister(), + Operand(prop->key()->AsLiteral()->value())); + EmitLoadStoreICSlot(slot); + CallStoreIC(); break; } case NAMED_SUPER_PROPERTY: { @@ -2098,7 +2110,8 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, __ mov(StoreDescriptor::NameRegister(), result_register()); PopOperands(StoreDescriptor::ValueRegister(), StoreDescriptor::ReceiverRegister()); - CallKeyedStoreIC(slot); + EmitLoadStoreICSlot(slot); + CallKeyedStoreIC(); break; } } @@ -2124,8 +2137,10 @@ 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()); - CallStoreIC(slot, var->name()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); } else if (IsLexicalVariableMode(var->mode()) && op != Token::INIT) { DCHECK(!var->IsLookupSlot()); @@ -2194,8 +2209,11 @@ 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()); - CallStoreIC(expr->AssignmentSlot(), prop->key()->AsLiteral()->value()); + EmitLoadStoreICSlot(expr->AssignmentSlot()); + CallStoreIC(); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(v0); @@ -2243,7 +2261,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { StoreDescriptor::NameRegister()); DCHECK(StoreDescriptor::ValueRegister().is(a0)); - CallKeyedStoreIC(expr->AssignmentSlot()); + EmitLoadStoreICSlot(expr->AssignmentSlot()); + CallKeyedStoreIC(); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(v0); @@ -3291,8 +3310,11 @@ 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()); - CallStoreIC(expr->CountSlot(), prop->key()->AsLiteral()->value()); + EmitLoadStoreICSlot(expr->CountSlot()); + CallStoreIC(); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); if (expr->is_postfix()) { if (!context()->IsEffect()) { @@ -3331,7 +3353,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { __ mov(StoreDescriptor::ValueRegister(), result_register()); PopOperands(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister()); - CallKeyedStoreIC(expr->CountSlot()); + EmitLoadStoreICSlot(expr->CountSlot()); + CallKeyedStoreIC(); 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 4105b398916d..389f33d354f2 100644 --- a/src/full-codegen/mips64/full-codegen-mips64.cc +++ b/src/full-codegen/mips64/full-codegen-mips64.cc @@ -1164,9 +1164,12 @@ 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)); - CallStoreIC(slot, isolate()->factory()->home_object_symbol()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); } @@ -1175,9 +1178,12 @@ 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)); - CallStoreIC(slot, isolate()->factory()->home_object_symbol()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); } @@ -1414,8 +1420,10 @@ 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)); - CallStoreIC(property->GetSlot(0), key->value()); + EmitLoadStoreICSlot(property->GetSlot(0)); + CallStoreIC(); PrepareForBailoutForId(key->id(), BailoutState::NO_REGISTERS); if (NeedsHomeObject(value)) { @@ -1613,7 +1621,8 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { __ li(StoreDescriptor::NameRegister(), Operand(Smi::FromInt(array_index))); __ ld(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0)); __ mov(StoreDescriptor::ValueRegister(), result_register()); - CallKeyedStoreIC(expr->LiteralFeedbackSlot()); + EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); + CallKeyedStoreIC(); PrepareForBailoutForId(expr->GetIdForElement(array_index), BailoutState::NO_REGISTERS); @@ -2051,7 +2060,10 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, VisitForAccumulatorValue(prop->obj()); __ mov(StoreDescriptor::ReceiverRegister(), result_register()); PopOperand(StoreDescriptor::ValueRegister()); // Restore value. - CallStoreIC(slot, prop->key()->AsLiteral()->value()); + __ li(StoreDescriptor::NameRegister(), + Operand(prop->key()->AsLiteral()->value())); + EmitLoadStoreICSlot(slot); + CallStoreIC(); break; } case NAMED_SUPER_PROPERTY: { @@ -2098,7 +2110,8 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, __ Move(StoreDescriptor::NameRegister(), result_register()); PopOperands(StoreDescriptor::ValueRegister(), StoreDescriptor::ReceiverRegister()); - CallKeyedStoreIC(slot); + EmitLoadStoreICSlot(slot); + CallKeyedStoreIC(); break; } } @@ -2124,8 +2137,10 @@ 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()); - CallStoreIC(slot, var->name()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); } else if (IsLexicalVariableMode(var->mode()) && op != Token::INIT) { DCHECK(!var->IsLookupSlot()); @@ -2193,8 +2208,11 @@ 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()); - CallStoreIC(expr->AssignmentSlot(), prop->key()->AsLiteral()->value()); + EmitLoadStoreICSlot(expr->AssignmentSlot()); + CallStoreIC(); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(v0); @@ -2242,7 +2260,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { StoreDescriptor::NameRegister()); DCHECK(StoreDescriptor::ValueRegister().is(a0)); - CallKeyedStoreIC(expr->AssignmentSlot()); + EmitLoadStoreICSlot(expr->AssignmentSlot()); + CallKeyedStoreIC(); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(v0); @@ -3291,8 +3310,11 @@ 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()); - CallStoreIC(expr->CountSlot(), prop->key()->AsLiteral()->value()); + EmitLoadStoreICSlot(expr->CountSlot()); + CallStoreIC(); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); if (expr->is_postfix()) { if (!context()->IsEffect()) { @@ -3331,7 +3353,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { __ mov(StoreDescriptor::ValueRegister(), result_register()); PopOperands(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister()); - CallKeyedStoreIC(expr->CountSlot()); + EmitLoadStoreICSlot(expr->CountSlot()); + CallKeyedStoreIC(); 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 20143f6779ba..ab1d17fa4f5a 100644 --- a/src/full-codegen/ppc/full-codegen-ppc.cc +++ b/src/full-codegen/ppc/full-codegen-ppc.cc @@ -1133,9 +1133,12 @@ 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)); - CallStoreIC(slot, isolate()->factory()->home_object_symbol()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); } @@ -1144,9 +1147,12 @@ 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)); - CallStoreIC(slot, isolate()->factory()->home_object_symbol()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); } @@ -1381,8 +1387,10 @@ 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)); - CallStoreIC(property->GetSlot(0), key->value()); + EmitLoadStoreICSlot(property->GetSlot(0)); + CallStoreIC(); PrepareForBailoutForId(key->id(), BailoutState::NO_REGISTERS); if (NeedsHomeObject(value)) { @@ -1578,7 +1586,8 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { __ LoadSmiLiteral(StoreDescriptor::NameRegister(), Smi::FromInt(array_index)); __ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0)); - CallKeyedStoreIC(expr->LiteralFeedbackSlot()); + EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); + CallKeyedStoreIC(); PrepareForBailoutForId(expr->GetIdForElement(array_index), BailoutState::NO_REGISTERS); @@ -2054,7 +2063,10 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, VisitForAccumulatorValue(prop->obj()); __ Move(StoreDescriptor::ReceiverRegister(), r3); PopOperand(StoreDescriptor::ValueRegister()); // Restore value. - CallStoreIC(slot, prop->key()->AsLiteral()->value()); + __ mov(StoreDescriptor::NameRegister(), + Operand(prop->key()->AsLiteral()->value())); + EmitLoadStoreICSlot(slot); + CallStoreIC(); break; } case NAMED_SUPER_PROPERTY: { @@ -2101,7 +2113,8 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, __ Move(StoreDescriptor::NameRegister(), r3); PopOperands(StoreDescriptor::ValueRegister(), StoreDescriptor::ReceiverRegister()); - CallKeyedStoreIC(slot); + EmitLoadStoreICSlot(slot); + CallKeyedStoreIC(); break; } } @@ -2126,8 +2139,10 @@ 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()); - CallStoreIC(slot, var->name()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); } else if (IsLexicalVariableMode(var->mode()) && op != Token::INIT) { DCHECK(!var->IsLookupSlot()); @@ -2195,8 +2210,11 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { DCHECK(prop != NULL); DCHECK(prop->key()->IsLiteral()); + __ mov(StoreDescriptor::NameRegister(), + Operand(prop->key()->AsLiteral()->value())); PopOperand(StoreDescriptor::ReceiverRegister()); - CallStoreIC(expr->AssignmentSlot(), prop->key()->AsLiteral()->value()); + EmitLoadStoreICSlot(expr->AssignmentSlot()); + CallStoreIC(); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(r3); @@ -2238,7 +2256,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { StoreDescriptor::NameRegister()); DCHECK(StoreDescriptor::ValueRegister().is(r3)); - CallKeyedStoreIC(expr->AssignmentSlot()); + EmitLoadStoreICSlot(expr->AssignmentSlot()); + CallKeyedStoreIC(); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(r3); @@ -3282,8 +3301,11 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { } break; case NAMED_PROPERTY: { + __ mov(StoreDescriptor::NameRegister(), + Operand(prop->key()->AsLiteral()->value())); PopOperand(StoreDescriptor::ReceiverRegister()); - CallStoreIC(expr->CountSlot(), prop->key()->AsLiteral()->value()); + EmitLoadStoreICSlot(expr->CountSlot()); + CallStoreIC(); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); if (expr->is_postfix()) { if (!context()->IsEffect()) { @@ -3321,7 +3343,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { case KEYED_PROPERTY: { PopOperands(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister()); - CallKeyedStoreIC(expr->CountSlot()); + EmitLoadStoreICSlot(expr->CountSlot()); + CallKeyedStoreIC(); 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 3e70cb3e32b2..9e6dccda4c12 100644 --- a/src/full-codegen/s390/full-codegen-s390.cc +++ b/src/full-codegen/s390/full-codegen-s390.cc @@ -1101,9 +1101,12 @@ 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)); - CallStoreIC(slot, isolate()->factory()->home_object_symbol()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); } void FullCodeGenerator::EmitSetHomeObjectAccumulator(Expression* initializer, @@ -1111,9 +1114,12 @@ 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)); - CallStoreIC(slot, isolate()->factory()->home_object_symbol()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); } void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, @@ -1341,8 +1347,10 @@ 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)); - CallStoreIC(property->GetSlot(0), key->value()); + EmitLoadStoreICSlot(property->GetSlot(0)); + CallStoreIC(); PrepareForBailoutForId(key->id(), BailoutState::NO_REGISTERS); if (NeedsHomeObject(value)) { @@ -1537,7 +1545,8 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { __ LoadSmiLiteral(StoreDescriptor::NameRegister(), Smi::FromInt(array_index)); __ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0)); - CallKeyedStoreIC(expr->LiteralFeedbackSlot()); + EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); + CallKeyedStoreIC(); PrepareForBailoutForId(expr->GetIdForElement(array_index), BailoutState::NO_REGISTERS); @@ -2009,7 +2018,10 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, VisitForAccumulatorValue(prop->obj()); __ Move(StoreDescriptor::ReceiverRegister(), r2); PopOperand(StoreDescriptor::ValueRegister()); // Restore value. - CallStoreIC(slot, prop->key()->AsLiteral()->value()); + __ mov(StoreDescriptor::NameRegister(), + Operand(prop->key()->AsLiteral()->value())); + EmitLoadStoreICSlot(slot); + CallStoreIC(); break; } case NAMED_SUPER_PROPERTY: { @@ -2056,7 +2068,8 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, __ Move(StoreDescriptor::NameRegister(), r2); PopOperands(StoreDescriptor::ValueRegister(), StoreDescriptor::ReceiverRegister()); - CallKeyedStoreIC(slot); + EmitLoadStoreICSlot(slot); + CallKeyedStoreIC(); break; } } @@ -2079,8 +2092,10 @@ 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()); - CallStoreIC(slot, var->name()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); } else if (IsLexicalVariableMode(var->mode()) && op != Token::INIT) { // Non-initializing assignment to let variable needs a write barrier. @@ -2147,8 +2162,11 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { DCHECK(prop != NULL); DCHECK(prop->key()->IsLiteral()); + __ mov(StoreDescriptor::NameRegister(), + Operand(prop->key()->AsLiteral()->value())); PopOperand(StoreDescriptor::ReceiverRegister()); - CallStoreIC(expr->AssignmentSlot(), prop->key()->AsLiteral()->value()); + EmitLoadStoreICSlot(expr->AssignmentSlot()); + CallStoreIC(); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(r2); @@ -2187,7 +2205,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { StoreDescriptor::NameRegister()); DCHECK(StoreDescriptor::ValueRegister().is(r2)); - CallKeyedStoreIC(expr->AssignmentSlot()); + EmitLoadStoreICSlot(expr->AssignmentSlot()); + CallKeyedStoreIC(); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(r2); @@ -3200,8 +3219,11 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { } break; case NAMED_PROPERTY: { + __ mov(StoreDescriptor::NameRegister(), + Operand(prop->key()->AsLiteral()->value())); PopOperand(StoreDescriptor::ReceiverRegister()); - CallStoreIC(expr->CountSlot(), prop->key()->AsLiteral()->value()); + EmitLoadStoreICSlot(expr->CountSlot()); + CallStoreIC(); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); if (expr->is_postfix()) { if (!context()->IsEffect()) { @@ -3239,7 +3261,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { case KEYED_PROPERTY: { PopOperands(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister()); - CallKeyedStoreIC(expr->CountSlot()); + EmitLoadStoreICSlot(expr->CountSlot()); + CallKeyedStoreIC(); 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 b0042c5a0110..50a5af56d1ad 100644 --- a/src/full-codegen/x64/full-codegen-x64.cc +++ b/src/full-codegen/x64/full-codegen-x64.cc @@ -1119,9 +1119,12 @@ 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)); - CallStoreIC(slot, isolate()->factory()->home_object_symbol()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); } @@ -1130,9 +1133,12 @@ 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)); - CallStoreIC(slot, isolate()->factory()->home_object_symbol()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); } @@ -1367,8 +1373,10 @@ 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)); - CallStoreIC(property->GetSlot(0), key->value()); + EmitLoadStoreICSlot(property->GetSlot(0)); + CallStoreIC(); PrepareForBailoutForId(key->id(), BailoutState::NO_REGISTERS); if (NeedsHomeObject(value)) { @@ -1557,7 +1565,8 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { __ Move(StoreDescriptor::NameRegister(), Smi::FromInt(array_index)); __ movp(StoreDescriptor::ReceiverRegister(), Operand(rsp, 0)); - CallKeyedStoreIC(expr->LiteralFeedbackSlot()); + EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); + CallKeyedStoreIC(); PrepareForBailoutForId(expr->GetIdForElement(array_index), BailoutState::NO_REGISTERS); @@ -1945,7 +1954,10 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, VisitForAccumulatorValue(prop->obj()); __ Move(StoreDescriptor::ReceiverRegister(), rax); PopOperand(StoreDescriptor::ValueRegister()); // Restore value. - CallStoreIC(slot, prop->key()->AsLiteral()->value()); + __ Move(StoreDescriptor::NameRegister(), + prop->key()->AsLiteral()->value()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); break; } case NAMED_SUPER_PROPERTY: { @@ -1992,7 +2004,8 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, __ Move(StoreDescriptor::NameRegister(), rax); PopOperand(StoreDescriptor::ReceiverRegister()); PopOperand(StoreDescriptor::ValueRegister()); // Restore value. - CallKeyedStoreIC(slot); + EmitLoadStoreICSlot(slot); + CallKeyedStoreIC(); break; } } @@ -2015,8 +2028,10 @@ 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()); - CallStoreIC(slot, var->name()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); } else if (IsLexicalVariableMode(var->mode()) && op != Token::INIT) { DCHECK(!var->IsLookupSlot()); @@ -2083,8 +2098,10 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { DCHECK(prop != NULL); DCHECK(prop->key()->IsLiteral()); + __ Move(StoreDescriptor::NameRegister(), prop->key()->AsLiteral()->value()); PopOperand(StoreDescriptor::ReceiverRegister()); - CallStoreIC(expr->AssignmentSlot(), prop->key()->AsLiteral()->value()); + EmitLoadStoreICSlot(expr->AssignmentSlot()); + CallStoreIC(); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(rax); @@ -2125,7 +2142,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { PopOperand(StoreDescriptor::NameRegister()); // Key. PopOperand(StoreDescriptor::ReceiverRegister()); DCHECK(StoreDescriptor::ValueRegister().is(rax)); - CallKeyedStoreIC(expr->AssignmentSlot()); + EmitLoadStoreICSlot(expr->AssignmentSlot()); + CallKeyedStoreIC(); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(rax); @@ -3173,8 +3191,11 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { } break; case NAMED_PROPERTY: { + __ Move(StoreDescriptor::NameRegister(), + prop->key()->AsLiteral()->value()); PopOperand(StoreDescriptor::ReceiverRegister()); - CallStoreIC(expr->CountSlot(), prop->key()->AsLiteral()->value()); + EmitLoadStoreICSlot(expr->CountSlot()); + CallStoreIC(); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); if (expr->is_postfix()) { if (!context()->IsEffect()) { @@ -3212,7 +3233,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { case KEYED_PROPERTY: { PopOperand(StoreDescriptor::NameRegister()); PopOperand(StoreDescriptor::ReceiverRegister()); - CallKeyedStoreIC(expr->CountSlot()); + EmitLoadStoreICSlot(expr->CountSlot()); + CallKeyedStoreIC(); 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 89e13a8739a9..f59bab99e6c5 100644 --- a/src/full-codegen/x87/full-codegen-x87.cc +++ b/src/full-codegen/x87/full-codegen-x87.cc @@ -1084,8 +1084,11 @@ 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)); - CallStoreIC(slot, isolate()->factory()->home_object_symbol()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); } @@ -1094,8 +1097,11 @@ 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)); - CallStoreIC(slot, isolate()->factory()->home_object_symbol()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); } @@ -1330,8 +1336,10 @@ 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)); - CallStoreIC(property->GetSlot(0), key->value()); + EmitLoadStoreICSlot(property->GetSlot(0)); + CallStoreIC(); PrepareForBailoutForId(key->id(), BailoutState::NO_REGISTERS); if (NeedsHomeObject(value)) { EmitSetHomeObjectAccumulator(value, 0, property->GetSlot(1)); @@ -1522,7 +1530,8 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { __ mov(StoreDescriptor::NameRegister(), Immediate(Smi::FromInt(array_index))); __ mov(StoreDescriptor::ReceiverRegister(), Operand(esp, 0)); - CallKeyedStoreIC(expr->LiteralFeedbackSlot()); + EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); + CallKeyedStoreIC(); PrepareForBailoutForId(expr->GetIdForElement(array_index), BailoutState::NO_REGISTERS); } @@ -1945,7 +1954,10 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, VisitForAccumulatorValue(prop->obj()); __ Move(StoreDescriptor::ReceiverRegister(), eax); PopOperand(StoreDescriptor::ValueRegister()); // Restore value. - CallStoreIC(slot, prop->key()->AsLiteral()->value()); + __ mov(StoreDescriptor::NameRegister(), + prop->key()->AsLiteral()->value()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); break; } case NAMED_SUPER_PROPERTY: { @@ -1992,7 +2004,8 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, __ Move(StoreDescriptor::NameRegister(), eax); PopOperand(StoreDescriptor::ReceiverRegister()); // Receiver. PopOperand(StoreDescriptor::ValueRegister()); // Restore value. - CallKeyedStoreIC(slot); + EmitLoadStoreICSlot(slot); + CallKeyedStoreIC(); break; } } @@ -2015,11 +2028,13 @@ 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)); - CallStoreIC(slot, var->name()); + EmitLoadStoreICSlot(slot); + CallStoreIC(); } else if (IsLexicalVariableMode(var->mode()) && op != Token::INIT) { DCHECK(!var->IsLookupSlot()); @@ -2087,8 +2102,10 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { DCHECK(prop != NULL); DCHECK(prop->key()->IsLiteral()); + __ mov(StoreDescriptor::NameRegister(), prop->key()->AsLiteral()->value()); PopOperand(StoreDescriptor::ReceiverRegister()); - CallStoreIC(expr->AssignmentSlot(), prop->key()->AsLiteral()->value()); + EmitLoadStoreICSlot(expr->AssignmentSlot()); + CallStoreIC(); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(eax); } @@ -2131,7 +2148,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { PopOperand(StoreDescriptor::NameRegister()); // Key. PopOperand(StoreDescriptor::ReceiverRegister()); DCHECK(StoreDescriptor::ValueRegister().is(eax)); - CallKeyedStoreIC(expr->AssignmentSlot()); + EmitLoadStoreICSlot(expr->AssignmentSlot()); + CallKeyedStoreIC(); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); context()->Plug(eax); } @@ -3176,8 +3194,11 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { } break; case NAMED_PROPERTY: { + __ mov(StoreDescriptor::NameRegister(), + prop->key()->AsLiteral()->value()); PopOperand(StoreDescriptor::ReceiverRegister()); - CallStoreIC(expr->CountSlot(), prop->key()->AsLiteral()->value()); + EmitLoadStoreICSlot(expr->CountSlot()); + CallStoreIC(); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); if (expr->is_postfix()) { if (!context()->IsEffect()) { @@ -3215,7 +3236,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { case KEYED_PROPERTY: { PopOperand(StoreDescriptor::NameRegister()); PopOperand(StoreDescriptor::ReceiverRegister()); - CallKeyedStoreIC(expr->CountSlot()); + EmitLoadStoreICSlot(expr->CountSlot()); + CallKeyedStoreIC(); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); if (expr->is_postfix()) { // Result is on the stack