Commit 9b53e7cb authored by ishell's avatar ishell Committed by Commit bot

[fullcodegen] Introduce single bottleneck for calling KeyedStoreIC.

Review-Url: https://codereview.chromium.org/2316453002
Cr-Commit-Position: refs/heads/master@{#39178}
parent 433c9ee7
...@@ -1610,9 +1610,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { ...@@ -1610,9 +1610,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
__ mov(StoreDescriptor::NameRegister(), Operand(Smi::FromInt(array_index))); __ mov(StoreDescriptor::NameRegister(), Operand(Smi::FromInt(array_index)));
__ ldr(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0)); __ ldr(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0));
EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); EmitLoadStoreICSlot(expr->LiteralFeedbackSlot());
Handle<Code> ic = CallKeyedStoreIC();
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
CallIC(ic);
PrepareForBailoutForId(expr->GetIdForElement(array_index), PrepareForBailoutForId(expr->GetIdForElement(array_index),
BailoutState::NO_REGISTERS); BailoutState::NO_REGISTERS);
...@@ -2119,9 +2117,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, ...@@ -2119,9 +2117,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr,
PopOperands(StoreDescriptor::ValueRegister(), PopOperands(StoreDescriptor::ValueRegister(),
StoreDescriptor::ReceiverRegister()); StoreDescriptor::ReceiverRegister());
EmitLoadStoreICSlot(slot); EmitLoadStoreICSlot(slot);
Handle<Code> ic = CallKeyedStoreIC();
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
CallIC(ic);
break; break;
} }
} }
...@@ -2263,10 +2259,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { ...@@ -2263,10 +2259,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
StoreDescriptor::NameRegister()); StoreDescriptor::NameRegister());
DCHECK(StoreDescriptor::ValueRegister().is(r0)); DCHECK(StoreDescriptor::ValueRegister().is(r0));
Handle<Code> ic =
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
EmitLoadStoreICSlot(expr->AssignmentSlot()); EmitLoadStoreICSlot(expr->AssignmentSlot());
CallIC(ic); CallKeyedStoreIC();
PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER);
context()->Plug(r0); context()->Plug(r0);
...@@ -3362,10 +3356,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { ...@@ -3362,10 +3356,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
case KEYED_PROPERTY: { case KEYED_PROPERTY: {
PopOperands(StoreDescriptor::ReceiverRegister(), PopOperands(StoreDescriptor::ReceiverRegister(),
StoreDescriptor::NameRegister()); StoreDescriptor::NameRegister());
Handle<Code> ic =
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
EmitLoadStoreICSlot(expr->CountSlot()); EmitLoadStoreICSlot(expr->CountSlot());
CallIC(ic); CallKeyedStoreIC();
PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER);
if (expr->is_postfix()) { if (expr->is_postfix()) {
if (!context()->IsEffect()) { if (!context()->IsEffect()) {
......
...@@ -1593,9 +1593,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { ...@@ -1593,9 +1593,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
__ Mov(StoreDescriptor::NameRegister(), Smi::FromInt(array_index)); __ Mov(StoreDescriptor::NameRegister(), Smi::FromInt(array_index));
__ Peek(StoreDescriptor::ReceiverRegister(), 0); __ Peek(StoreDescriptor::ReceiverRegister(), 0);
EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); EmitLoadStoreICSlot(expr->LiteralFeedbackSlot());
Handle<Code> ic = CallKeyedStoreIC();
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
CallIC(ic);
PrepareForBailoutForId(expr->GetIdForElement(array_index), PrepareForBailoutForId(expr->GetIdForElement(array_index),
BailoutState::NO_REGISTERS); BailoutState::NO_REGISTERS);
...@@ -2012,9 +2010,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, ...@@ -2012,9 +2010,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr,
PopOperands(StoreDescriptor::ReceiverRegister(), PopOperands(StoreDescriptor::ReceiverRegister(),
StoreDescriptor::ValueRegister()); StoreDescriptor::ValueRegister());
EmitLoadStoreICSlot(slot); EmitLoadStoreICSlot(slot);
Handle<Code> ic = CallKeyedStoreIC();
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
CallIC(ic);
break; break;
} }
} }
...@@ -2158,10 +2154,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { ...@@ -2158,10 +2154,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
StoreDescriptor::ReceiverRegister()); StoreDescriptor::ReceiverRegister());
DCHECK(StoreDescriptor::ValueRegister().is(x0)); DCHECK(StoreDescriptor::ValueRegister().is(x0));
Handle<Code> ic =
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
EmitLoadStoreICSlot(expr->AssignmentSlot()); EmitLoadStoreICSlot(expr->AssignmentSlot());
CallIC(ic); CallKeyedStoreIC();
PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER);
context()->Plug(x0); context()->Plug(x0);
...@@ -3284,10 +3278,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { ...@@ -3284,10 +3278,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
case KEYED_PROPERTY: { case KEYED_PROPERTY: {
PopOperand(StoreDescriptor::NameRegister()); PopOperand(StoreDescriptor::NameRegister());
PopOperand(StoreDescriptor::ReceiverRegister()); PopOperand(StoreDescriptor::ReceiverRegister());
Handle<Code> ic =
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
EmitLoadStoreICSlot(expr->CountSlot()); EmitLoadStoreICSlot(expr->CountSlot());
CallIC(ic); CallKeyedStoreIC();
PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER);
if (expr->is_postfix()) { if (expr->is_postfix()) {
if (!context()->IsEffect()) { if (!context()->IsEffect()) {
......
...@@ -242,6 +242,11 @@ void FullCodeGenerator::CallStoreIC(TypeFeedbackId id) { ...@@ -242,6 +242,11 @@ void FullCodeGenerator::CallStoreIC(TypeFeedbackId id) {
CallIC(ic, id); CallIC(ic, id);
} }
void FullCodeGenerator::CallKeyedStoreIC() {
Handle<Code> ic =
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
CallIC(ic);
}
void FullCodeGenerator::RecordJSReturnSite(Call* call) { void FullCodeGenerator::RecordJSReturnSite(Call* call) {
// We record the offset of the function return so we can rebuild the frame // We record the offset of the function return so we can rebuild the frame
......
...@@ -622,6 +622,7 @@ class FullCodeGenerator final : public AstVisitor<FullCodeGenerator> { ...@@ -622,6 +622,7 @@ class FullCodeGenerator final : public AstVisitor<FullCodeGenerator> {
void CallLoadGlobalIC(TypeofMode typeof_mode, void CallLoadGlobalIC(TypeofMode typeof_mode,
TypeFeedbackId id = TypeFeedbackId::None()); TypeFeedbackId id = TypeFeedbackId::None());
void CallStoreIC(TypeFeedbackId id = TypeFeedbackId::None()); void CallStoreIC(TypeFeedbackId id = TypeFeedbackId::None());
void CallKeyedStoreIC();
void SetFunctionPosition(FunctionLiteral* fun); void SetFunctionPosition(FunctionLiteral* fun);
void SetReturnPosition(FunctionLiteral* fun); void SetReturnPosition(FunctionLiteral* fun);
......
...@@ -1528,9 +1528,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { ...@@ -1528,9 +1528,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
Immediate(Smi::FromInt(array_index))); Immediate(Smi::FromInt(array_index)));
__ mov(StoreDescriptor::ReceiverRegister(), Operand(esp, 0)); __ mov(StoreDescriptor::ReceiverRegister(), Operand(esp, 0));
EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); EmitLoadStoreICSlot(expr->LiteralFeedbackSlot());
Handle<Code> ic = CallKeyedStoreIC();
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
CallIC(ic);
PrepareForBailoutForId(expr->GetIdForElement(array_index), PrepareForBailoutForId(expr->GetIdForElement(array_index),
BailoutState::NO_REGISTERS); BailoutState::NO_REGISTERS);
} }
...@@ -2025,9 +2023,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, ...@@ -2025,9 +2023,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr,
PopOperand(StoreDescriptor::ReceiverRegister()); // Receiver. PopOperand(StoreDescriptor::ReceiverRegister()); // Receiver.
PopOperand(StoreDescriptor::ValueRegister()); // Restore value. PopOperand(StoreDescriptor::ValueRegister()); // Restore value.
EmitLoadStoreICSlot(slot); EmitLoadStoreICSlot(slot);
Handle<Code> ic = CallKeyedStoreIC();
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
CallIC(ic);
break; break;
} }
} }
...@@ -2170,10 +2166,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { ...@@ -2170,10 +2166,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
PopOperand(StoreDescriptor::NameRegister()); // Key. PopOperand(StoreDescriptor::NameRegister()); // Key.
PopOperand(StoreDescriptor::ReceiverRegister()); PopOperand(StoreDescriptor::ReceiverRegister());
DCHECK(StoreDescriptor::ValueRegister().is(eax)); DCHECK(StoreDescriptor::ValueRegister().is(eax));
Handle<Code> ic =
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
EmitLoadStoreICSlot(expr->AssignmentSlot()); EmitLoadStoreICSlot(expr->AssignmentSlot());
CallIC(ic); CallKeyedStoreIC();
PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER);
context()->Plug(eax); context()->Plug(eax);
} }
...@@ -3260,10 +3254,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { ...@@ -3260,10 +3254,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
case KEYED_PROPERTY: { case KEYED_PROPERTY: {
PopOperand(StoreDescriptor::NameRegister()); PopOperand(StoreDescriptor::NameRegister());
PopOperand(StoreDescriptor::ReceiverRegister()); PopOperand(StoreDescriptor::ReceiverRegister());
Handle<Code> ic =
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
EmitLoadStoreICSlot(expr->CountSlot()); EmitLoadStoreICSlot(expr->CountSlot());
CallIC(ic); CallKeyedStoreIC();
PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER);
if (expr->is_postfix()) { if (expr->is_postfix()) {
// Result is on the stack // Result is on the stack
......
...@@ -1607,9 +1607,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { ...@@ -1607,9 +1607,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
__ lw(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0)); __ lw(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0));
__ mov(StoreDescriptor::ValueRegister(), result_register()); __ mov(StoreDescriptor::ValueRegister(), result_register());
EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); EmitLoadStoreICSlot(expr->LiteralFeedbackSlot());
Handle<Code> ic = CallKeyedStoreIC();
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
CallIC(ic);
PrepareForBailoutForId(expr->GetIdForElement(array_index), PrepareForBailoutForId(expr->GetIdForElement(array_index),
BailoutState::NO_REGISTERS); BailoutState::NO_REGISTERS);
...@@ -2123,9 +2121,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, ...@@ -2123,9 +2121,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr,
PopOperands(StoreDescriptor::ValueRegister(), PopOperands(StoreDescriptor::ValueRegister(),
StoreDescriptor::ReceiverRegister()); StoreDescriptor::ReceiverRegister());
EmitLoadStoreICSlot(slot); EmitLoadStoreICSlot(slot);
Handle<Code> ic = CallKeyedStoreIC();
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
CallIC(ic);
break; break;
} }
} }
...@@ -2275,10 +2271,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { ...@@ -2275,10 +2271,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
StoreDescriptor::NameRegister()); StoreDescriptor::NameRegister());
DCHECK(StoreDescriptor::ValueRegister().is(a0)); DCHECK(StoreDescriptor::ValueRegister().is(a0));
Handle<Code> ic =
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
EmitLoadStoreICSlot(expr->AssignmentSlot()); EmitLoadStoreICSlot(expr->AssignmentSlot());
CallIC(ic); CallKeyedStoreIC();
PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER);
context()->Plug(v0); context()->Plug(v0);
...@@ -3369,10 +3363,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { ...@@ -3369,10 +3363,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
__ mov(StoreDescriptor::ValueRegister(), result_register()); __ mov(StoreDescriptor::ValueRegister(), result_register());
PopOperands(StoreDescriptor::ReceiverRegister(), PopOperands(StoreDescriptor::ReceiverRegister(),
StoreDescriptor::NameRegister()); StoreDescriptor::NameRegister());
Handle<Code> ic =
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
EmitLoadStoreICSlot(expr->CountSlot()); EmitLoadStoreICSlot(expr->CountSlot());
CallIC(ic); CallKeyedStoreIC();
PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER);
if (expr->is_postfix()) { if (expr->is_postfix()) {
if (!context()->IsEffect()) { if (!context()->IsEffect()) {
......
...@@ -1608,9 +1608,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { ...@@ -1608,9 +1608,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
__ ld(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0)); __ ld(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0));
__ mov(StoreDescriptor::ValueRegister(), result_register()); __ mov(StoreDescriptor::ValueRegister(), result_register());
EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); EmitLoadStoreICSlot(expr->LiteralFeedbackSlot());
Handle<Code> ic = CallKeyedStoreIC();
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
CallIC(ic);
PrepareForBailoutForId(expr->GetIdForElement(array_index), PrepareForBailoutForId(expr->GetIdForElement(array_index),
BailoutState::NO_REGISTERS); BailoutState::NO_REGISTERS);
...@@ -2123,9 +2121,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, ...@@ -2123,9 +2121,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr,
PopOperands(StoreDescriptor::ValueRegister(), PopOperands(StoreDescriptor::ValueRegister(),
StoreDescriptor::ReceiverRegister()); StoreDescriptor::ReceiverRegister());
EmitLoadStoreICSlot(slot); EmitLoadStoreICSlot(slot);
Handle<Code> ic = CallKeyedStoreIC();
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
CallIC(ic);
break; break;
} }
} }
...@@ -2274,10 +2270,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { ...@@ -2274,10 +2270,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
StoreDescriptor::NameRegister()); StoreDescriptor::NameRegister());
DCHECK(StoreDescriptor::ValueRegister().is(a0)); DCHECK(StoreDescriptor::ValueRegister().is(a0));
Handle<Code> ic =
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
EmitLoadStoreICSlot(expr->AssignmentSlot()); EmitLoadStoreICSlot(expr->AssignmentSlot());
CallIC(ic); CallKeyedStoreIC();
PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER);
context()->Plug(v0); context()->Plug(v0);
...@@ -3369,10 +3363,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { ...@@ -3369,10 +3363,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
__ mov(StoreDescriptor::ValueRegister(), result_register()); __ mov(StoreDescriptor::ValueRegister(), result_register());
PopOperands(StoreDescriptor::ReceiverRegister(), PopOperands(StoreDescriptor::ReceiverRegister(),
StoreDescriptor::NameRegister()); StoreDescriptor::NameRegister());
Handle<Code> ic =
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
EmitLoadStoreICSlot(expr->CountSlot()); EmitLoadStoreICSlot(expr->CountSlot());
CallIC(ic); CallKeyedStoreIC();
PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER);
if (expr->is_postfix()) { if (expr->is_postfix()) {
if (!context()->IsEffect()) { if (!context()->IsEffect()) {
......
...@@ -1571,9 +1571,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { ...@@ -1571,9 +1571,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
Smi::FromInt(array_index)); Smi::FromInt(array_index));
__ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0)); __ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0));
EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); EmitLoadStoreICSlot(expr->LiteralFeedbackSlot());
Handle<Code> ic = CallKeyedStoreIC();
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
CallIC(ic);
PrepareForBailoutForId(expr->GetIdForElement(array_index), PrepareForBailoutForId(expr->GetIdForElement(array_index),
BailoutState::NO_REGISTERS); BailoutState::NO_REGISTERS);
...@@ -2124,9 +2122,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, ...@@ -2124,9 +2122,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr,
PopOperands(StoreDescriptor::ValueRegister(), PopOperands(StoreDescriptor::ValueRegister(),
StoreDescriptor::ReceiverRegister()); StoreDescriptor::ReceiverRegister());
EmitLoadStoreICSlot(slot); EmitLoadStoreICSlot(slot);
Handle<Code> ic = CallKeyedStoreIC();
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
CallIC(ic);
break; break;
} }
} }
...@@ -2268,10 +2264,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { ...@@ -2268,10 +2264,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
StoreDescriptor::NameRegister()); StoreDescriptor::NameRegister());
DCHECK(StoreDescriptor::ValueRegister().is(r3)); DCHECK(StoreDescriptor::ValueRegister().is(r3));
Handle<Code> ic =
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
EmitLoadStoreICSlot(expr->AssignmentSlot()); EmitLoadStoreICSlot(expr->AssignmentSlot());
CallIC(ic); CallKeyedStoreIC();
PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER);
context()->Plug(r3); context()->Plug(r3);
...@@ -3357,10 +3351,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { ...@@ -3357,10 +3351,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
case KEYED_PROPERTY: { case KEYED_PROPERTY: {
PopOperands(StoreDescriptor::ReceiverRegister(), PopOperands(StoreDescriptor::ReceiverRegister(),
StoreDescriptor::NameRegister()); StoreDescriptor::NameRegister());
Handle<Code> ic =
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
EmitLoadStoreICSlot(expr->CountSlot()); EmitLoadStoreICSlot(expr->CountSlot());
CallIC(ic); CallKeyedStoreIC();
PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER);
if (expr->is_postfix()) { if (expr->is_postfix()) {
if (!context()->IsEffect()) { if (!context()->IsEffect()) {
......
...@@ -1531,9 +1531,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { ...@@ -1531,9 +1531,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
Smi::FromInt(array_index)); Smi::FromInt(array_index));
__ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0)); __ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0));
EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); EmitLoadStoreICSlot(expr->LiteralFeedbackSlot());
Handle<Code> ic = CallKeyedStoreIC();
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
CallIC(ic);
PrepareForBailoutForId(expr->GetIdForElement(array_index), PrepareForBailoutForId(expr->GetIdForElement(array_index),
BailoutState::NO_REGISTERS); BailoutState::NO_REGISTERS);
...@@ -2080,9 +2078,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, ...@@ -2080,9 +2078,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr,
PopOperands(StoreDescriptor::ValueRegister(), PopOperands(StoreDescriptor::ValueRegister(),
StoreDescriptor::ReceiverRegister()); StoreDescriptor::ReceiverRegister());
EmitLoadStoreICSlot(slot); EmitLoadStoreICSlot(slot);
Handle<Code> ic = CallKeyedStoreIC();
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
CallIC(ic);
break; break;
} }
} }
...@@ -2218,10 +2214,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { ...@@ -2218,10 +2214,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
StoreDescriptor::NameRegister()); StoreDescriptor::NameRegister());
DCHECK(StoreDescriptor::ValueRegister().is(r2)); DCHECK(StoreDescriptor::ValueRegister().is(r2));
Handle<Code> ic =
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
EmitLoadStoreICSlot(expr->AssignmentSlot()); EmitLoadStoreICSlot(expr->AssignmentSlot());
CallIC(ic); CallKeyedStoreIC();
PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER);
context()->Plug(r2); context()->Plug(r2);
...@@ -3276,10 +3270,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { ...@@ -3276,10 +3270,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
case KEYED_PROPERTY: { case KEYED_PROPERTY: {
PopOperands(StoreDescriptor::ReceiverRegister(), PopOperands(StoreDescriptor::ReceiverRegister(),
StoreDescriptor::NameRegister()); StoreDescriptor::NameRegister());
Handle<Code> ic =
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
EmitLoadStoreICSlot(expr->CountSlot()); EmitLoadStoreICSlot(expr->CountSlot());
CallIC(ic); CallKeyedStoreIC();
PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER);
if (expr->is_postfix()) { if (expr->is_postfix()) {
if (!context()->IsEffect()) { if (!context()->IsEffect()) {
......
...@@ -1554,9 +1554,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { ...@@ -1554,9 +1554,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
__ Move(StoreDescriptor::NameRegister(), Smi::FromInt(array_index)); __ Move(StoreDescriptor::NameRegister(), Smi::FromInt(array_index));
__ movp(StoreDescriptor::ReceiverRegister(), Operand(rsp, 0)); __ movp(StoreDescriptor::ReceiverRegister(), Operand(rsp, 0));
EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); EmitLoadStoreICSlot(expr->LiteralFeedbackSlot());
Handle<Code> ic = CallKeyedStoreIC();
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
CallIC(ic);
PrepareForBailoutForId(expr->GetIdForElement(array_index), PrepareForBailoutForId(expr->GetIdForElement(array_index),
BailoutState::NO_REGISTERS); BailoutState::NO_REGISTERS);
...@@ -2019,9 +2017,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, ...@@ -2019,9 +2017,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr,
PopOperand(StoreDescriptor::ReceiverRegister()); PopOperand(StoreDescriptor::ReceiverRegister());
PopOperand(StoreDescriptor::ValueRegister()); // Restore value. PopOperand(StoreDescriptor::ValueRegister()); // Restore value.
EmitLoadStoreICSlot(slot); EmitLoadStoreICSlot(slot);
Handle<Code> ic = CallKeyedStoreIC();
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
CallIC(ic);
break; break;
} }
} }
...@@ -2158,10 +2154,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { ...@@ -2158,10 +2154,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
PopOperand(StoreDescriptor::NameRegister()); // Key. PopOperand(StoreDescriptor::NameRegister()); // Key.
PopOperand(StoreDescriptor::ReceiverRegister()); PopOperand(StoreDescriptor::ReceiverRegister());
DCHECK(StoreDescriptor::ValueRegister().is(rax)); DCHECK(StoreDescriptor::ValueRegister().is(rax));
Handle<Code> ic =
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
EmitLoadStoreICSlot(expr->AssignmentSlot()); EmitLoadStoreICSlot(expr->AssignmentSlot());
CallIC(ic); CallKeyedStoreIC();
PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER);
context()->Plug(rax); context()->Plug(rax);
...@@ -3251,10 +3245,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { ...@@ -3251,10 +3245,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
case KEYED_PROPERTY: { case KEYED_PROPERTY: {
PopOperand(StoreDescriptor::NameRegister()); PopOperand(StoreDescriptor::NameRegister());
PopOperand(StoreDescriptor::ReceiverRegister()); PopOperand(StoreDescriptor::ReceiverRegister());
Handle<Code> ic =
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
EmitLoadStoreICSlot(expr->CountSlot()); EmitLoadStoreICSlot(expr->CountSlot());
CallIC(ic); CallKeyedStoreIC();
PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER);
if (expr->is_postfix()) { if (expr->is_postfix()) {
if (!context()->IsEffect()) { if (!context()->IsEffect()) {
......
...@@ -1520,9 +1520,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { ...@@ -1520,9 +1520,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
Immediate(Smi::FromInt(array_index))); Immediate(Smi::FromInt(array_index)));
__ mov(StoreDescriptor::ReceiverRegister(), Operand(esp, 0)); __ mov(StoreDescriptor::ReceiverRegister(), Operand(esp, 0));
EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); EmitLoadStoreICSlot(expr->LiteralFeedbackSlot());
Handle<Code> ic = CallKeyedStoreIC();
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
CallIC(ic);
PrepareForBailoutForId(expr->GetIdForElement(array_index), PrepareForBailoutForId(expr->GetIdForElement(array_index),
BailoutState::NO_REGISTERS); BailoutState::NO_REGISTERS);
} }
...@@ -2017,9 +2015,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, ...@@ -2017,9 +2015,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr,
PopOperand(StoreDescriptor::ReceiverRegister()); // Receiver. PopOperand(StoreDescriptor::ReceiverRegister()); // Receiver.
PopOperand(StoreDescriptor::ValueRegister()); // Restore value. PopOperand(StoreDescriptor::ValueRegister()); // Restore value.
EmitLoadStoreICSlot(slot); EmitLoadStoreICSlot(slot);
Handle<Code> ic = CallKeyedStoreIC();
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
CallIC(ic);
break; break;
} }
} }
...@@ -2162,10 +2158,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { ...@@ -2162,10 +2158,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
PopOperand(StoreDescriptor::NameRegister()); // Key. PopOperand(StoreDescriptor::NameRegister()); // Key.
PopOperand(StoreDescriptor::ReceiverRegister()); PopOperand(StoreDescriptor::ReceiverRegister());
DCHECK(StoreDescriptor::ValueRegister().is(eax)); DCHECK(StoreDescriptor::ValueRegister().is(eax));
Handle<Code> ic =
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
EmitLoadStoreICSlot(expr->AssignmentSlot()); EmitLoadStoreICSlot(expr->AssignmentSlot());
CallIC(ic); CallKeyedStoreIC();
PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER);
context()->Plug(eax); context()->Plug(eax);
} }
...@@ -3252,10 +3246,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { ...@@ -3252,10 +3246,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
case KEYED_PROPERTY: { case KEYED_PROPERTY: {
PopOperand(StoreDescriptor::NameRegister()); PopOperand(StoreDescriptor::NameRegister());
PopOperand(StoreDescriptor::ReceiverRegister()); PopOperand(StoreDescriptor::ReceiverRegister());
Handle<Code> ic =
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
EmitLoadStoreICSlot(expr->CountSlot()); EmitLoadStoreICSlot(expr->CountSlot());
CallIC(ic); CallKeyedStoreIC();
PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER);
if (expr->is_postfix()) { if (expr->is_postfix()) {
// Result is on the stack // Result is on the stack
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment