OLD | NEW |
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 #include "src/full-codegen/full-codegen.h" | 5 #include "src/full-codegen/full-codegen.h" |
6 | 6 |
7 #include "src/ast/ast-numbering.h" | 7 #include "src/ast/ast-numbering.h" |
8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/ast/prettyprinter.h" | 9 #include "src/ast/prettyprinter.h" |
10 #include "src/ast/scopes.h" | 10 #include "src/ast/scopes.h" |
(...skipping 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1521 | 1521 |
1522 VisitForStackValue(lit->constructor()); | 1522 VisitForStackValue(lit->constructor()); |
1523 | 1523 |
1524 PushOperand(Smi::FromInt(lit->start_position())); | 1524 PushOperand(Smi::FromInt(lit->start_position())); |
1525 PushOperand(Smi::FromInt(lit->end_position())); | 1525 PushOperand(Smi::FromInt(lit->end_position())); |
1526 | 1526 |
1527 CallRuntimeWithOperands(Runtime::kDefineClass); | 1527 CallRuntimeWithOperands(Runtime::kDefineClass); |
1528 PrepareForBailoutForId(lit->CreateLiteralId(), BailoutState::TOS_REGISTER); | 1528 PrepareForBailoutForId(lit->CreateLiteralId(), BailoutState::TOS_REGISTER); |
1529 PushOperand(result_register()); | 1529 PushOperand(result_register()); |
1530 | 1530 |
| 1531 // TODO(bakkot) This shouldn't be necessary; I just couldn't figure out how to |
| 1532 // invoke the function literal with appropriate home object and receiver |
| 1533 // (mainly because of FeedbackVector check failures which are totally opaque |
| 1534 // to me) |
| 1535 VariableProxy* static_initializer_proxy = lit->static_initializer_proxy(); |
| 1536 if (static_initializer_proxy != nullptr) { |
| 1537 Variable* variable = static_initializer_proxy->var(); |
| 1538 EmitVariableAssignment(variable, Token::INIT, |
| 1539 FeedbackVectorSlot::Invalid()); |
| 1540 } |
| 1541 |
1531 // Load the "prototype" from the constructor. | 1542 // Load the "prototype" from the constructor. |
1532 __ Move(LoadDescriptor::ReceiverRegister(), result_register()); | 1543 __ Move(LoadDescriptor::ReceiverRegister(), result_register()); |
1533 __ LoadRoot(LoadDescriptor::NameRegister(), Heap::kprototype_stringRootIndex); | 1544 __ LoadRoot(LoadDescriptor::NameRegister(), Heap::kprototype_stringRootIndex); |
1534 __ Move(LoadDescriptor::SlotRegister(), SmiFromSlot(lit->PrototypeSlot())); | 1545 __ Move(LoadDescriptor::SlotRegister(), SmiFromSlot(lit->PrototypeSlot())); |
1535 CallLoadIC(); | 1546 CallLoadIC(); |
1536 PrepareForBailoutForId(lit->PrototypeId(), BailoutState::TOS_REGISTER); | 1547 PrepareForBailoutForId(lit->PrototypeId(), BailoutState::TOS_REGISTER); |
1537 PushOperand(result_register()); | 1548 PushOperand(result_register()); |
1538 | 1549 |
1539 EmitClassDefineProperties(lit); | 1550 EmitClassDefineProperties(lit); |
1540 DropOperands(1); | 1551 DropOperands(1); |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2013 return info_->has_simple_parameters(); | 2024 return info_->has_simple_parameters(); |
2014 } | 2025 } |
2015 | 2026 |
2016 FunctionLiteral* FullCodeGenerator::literal() const { return info_->literal(); } | 2027 FunctionLiteral* FullCodeGenerator::literal() const { return info_->literal(); } |
2017 | 2028 |
2018 #undef __ | 2029 #undef __ |
2019 | 2030 |
2020 | 2031 |
2021 } // namespace internal | 2032 } // namespace internal |
2022 } // namespace v8 | 2033 } // namespace v8 |
OLD | NEW |