Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Side by Side Diff: src/full-codegen/ia32/full-codegen-ia32.cc

Issue 2324013002: [cleanup] Remove dead code for handling pre-desugaring spread implementation (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/full-codegen/full-codegen.h" 7 #include "src/full-codegen/full-codegen.h"
8 #include "src/ast/compile-time-value.h" 8 #include "src/ast/compile-time-value.h"
9 #include "src/ast/scopes.h" 9 #include "src/ast/scopes.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after
1502 __ CallStub(&stub); 1502 __ CallStub(&stub);
1503 } 1503 }
1504 PrepareForBailoutForId(expr->CreateLiteralId(), BailoutState::TOS_REGISTER); 1504 PrepareForBailoutForId(expr->CreateLiteralId(), BailoutState::TOS_REGISTER);
1505 1505
1506 bool result_saved = false; // Is the result saved to the stack? 1506 bool result_saved = false; // Is the result saved to the stack?
1507 ZoneList<Expression*>* subexprs = expr->values(); 1507 ZoneList<Expression*>* subexprs = expr->values();
1508 int length = subexprs->length(); 1508 int length = subexprs->length();
1509 1509
1510 // Emit code to evaluate all the non-constant subexpressions and to store 1510 // Emit code to evaluate all the non-constant subexpressions and to store
1511 // them into the newly cloned array. 1511 // them into the newly cloned array.
1512 int array_index = 0; 1512 for (int array_index = 0; array_index < length; array_index++) {
1513 for (; array_index < length; array_index++) {
1514 Expression* subexpr = subexprs->at(array_index); 1513 Expression* subexpr = subexprs->at(array_index);
1515 DCHECK(!subexpr->IsSpread()); 1514 DCHECK(!subexpr->IsSpread());
1516 1515
1517 // If the subexpression is a literal or a simple materialized literal it 1516 // If the subexpression is a literal or a simple materialized literal it
1518 // is already set in the cloned array. 1517 // is already set in the cloned array.
1519 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; 1518 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue;
1520 1519
1521 if (!result_saved) { 1520 if (!result_saved) {
1522 PushOperand(eax); // array literal. 1521 PushOperand(eax); // array literal.
1523 result_saved = true; 1522 result_saved = true;
1524 } 1523 }
1525 VisitForAccumulatorValue(subexpr); 1524 VisitForAccumulatorValue(subexpr);
1526 1525
1527 __ mov(StoreDescriptor::NameRegister(), 1526 __ mov(StoreDescriptor::NameRegister(),
1528 Immediate(Smi::FromInt(array_index))); 1527 Immediate(Smi::FromInt(array_index)));
1529 __ mov(StoreDescriptor::ReceiverRegister(), Operand(esp, 0)); 1528 __ mov(StoreDescriptor::ReceiverRegister(), Operand(esp, 0));
1530 EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); 1529 EmitLoadStoreICSlot(expr->LiteralFeedbackSlot());
1531 CallKeyedStoreIC(); 1530 CallKeyedStoreIC();
1532 PrepareForBailoutForId(expr->GetIdForElement(array_index), 1531 PrepareForBailoutForId(expr->GetIdForElement(array_index),
1533 BailoutState::NO_REGISTERS); 1532 BailoutState::NO_REGISTERS);
1534 } 1533 }
1535 1534
1536 // In case the array literal contains spread expressions it has two parts. The
1537 // first part is the "static" array which has a literal index is handled
1538 // above. The second part is the part after the first spread expression
1539 // (inclusive) and these elements gets appended to the array. Note that the
1540 // number elements an iterable produces is unknown ahead of time.
1541 if (array_index < length && result_saved) {
1542 PopOperand(eax);
1543 result_saved = false;
1544 }
1545 for (; array_index < length; array_index++) {
1546 Expression* subexpr = subexprs->at(array_index);
1547
1548 PushOperand(eax);
1549 DCHECK(!subexpr->IsSpread());
1550 VisitForStackValue(subexpr);
1551 CallRuntimeWithOperands(Runtime::kAppendElement);
1552
1553 PrepareForBailoutForId(expr->GetIdForElement(array_index),
1554 BailoutState::NO_REGISTERS);
1555 }
1556
1557 if (result_saved) { 1535 if (result_saved) {
1558 context()->PlugTOS(); 1536 context()->PlugTOS();
1559 } else { 1537 } else {
1560 context()->Plug(eax); 1538 context()->Plug(eax);
1561 } 1539 }
1562 } 1540 }
1563 1541
1564 1542
1565 void FullCodeGenerator::VisitAssignment(Assignment* expr) { 1543 void FullCodeGenerator::VisitAssignment(Assignment* expr) {
1566 DCHECK(expr->target()->IsValidReferenceExpressionOrThis()); 1544 DCHECK(expr->target()->IsValidReferenceExpressionOrThis());
(...skipping 2060 matching lines...) Expand 10 before | Expand all | Expand 10 after
3627 isolate->builtins()->OnStackReplacement()->entry(), 3605 isolate->builtins()->OnStackReplacement()->entry(),
3628 Assembler::target_address_at(call_target_address, unoptimized_code)); 3606 Assembler::target_address_at(call_target_address, unoptimized_code));
3629 return ON_STACK_REPLACEMENT; 3607 return ON_STACK_REPLACEMENT;
3630 } 3608 }
3631 3609
3632 3610
3633 } // namespace internal 3611 } // namespace internal
3634 } // namespace v8 3612 } // namespace v8
3635 3613
3636 #endif // V8_TARGET_ARCH_IA32 3614 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/full-codegen/arm64/full-codegen-arm64.cc ('k') | src/full-codegen/mips/full-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698