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/scopeinfo.h" | 10 #include "src/ast/scopeinfo.h" |
(...skipping 1511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1522 // Load the "prototype" from the constructor. | 1522 // Load the "prototype" from the constructor. |
1523 __ Move(LoadDescriptor::ReceiverRegister(), result_register()); | 1523 __ Move(LoadDescriptor::ReceiverRegister(), result_register()); |
1524 __ LoadRoot(LoadDescriptor::NameRegister(), | 1524 __ LoadRoot(LoadDescriptor::NameRegister(), |
1525 Heap::kprototype_stringRootIndex); | 1525 Heap::kprototype_stringRootIndex); |
1526 __ Move(LoadDescriptor::SlotRegister(), SmiFromSlot(lit->PrototypeSlot())); | 1526 __ Move(LoadDescriptor::SlotRegister(), SmiFromSlot(lit->PrototypeSlot())); |
1527 CallLoadIC(NOT_INSIDE_TYPEOF); | 1527 CallLoadIC(NOT_INSIDE_TYPEOF); |
1528 PrepareForBailoutForId(lit->PrototypeId(), TOS_REG); | 1528 PrepareForBailoutForId(lit->PrototypeId(), TOS_REG); |
1529 PushOperand(result_register()); | 1529 PushOperand(result_register()); |
1530 | 1530 |
1531 EmitClassDefineProperties(lit); | 1531 EmitClassDefineProperties(lit); |
| 1532 DropOperands(1); |
1532 | 1533 |
1533 // Set both the prototype and constructor to have fast properties. | 1534 // Set the constructor to have fast properties. |
1534 CallRuntimeWithOperands(Runtime::kFinalizeClassDefinition); | 1535 CallRuntimeWithOperands(Runtime::kToFastProperties); |
1535 | 1536 |
1536 if (lit->class_variable_proxy() != nullptr) { | 1537 if (lit->class_variable_proxy() != nullptr) { |
1537 EmitVariableAssignment(lit->class_variable_proxy()->var(), Token::INIT, | 1538 EmitVariableAssignment(lit->class_variable_proxy()->var(), Token::INIT, |
1538 lit->ProxySlot()); | 1539 lit->ProxySlot()); |
1539 } | 1540 } |
1540 } | 1541 } |
1541 | 1542 |
1542 context()->Plug(result_register()); | 1543 context()->Plug(result_register()); |
1543 } | 1544 } |
1544 | 1545 |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1974 return var->scope()->is_nonlinear() || | 1975 return var->scope()->is_nonlinear() || |
1975 var->initializer_position() >= proxy->position(); | 1976 var->initializer_position() >= proxy->position(); |
1976 } | 1977 } |
1977 | 1978 |
1978 | 1979 |
1979 #undef __ | 1980 #undef __ |
1980 | 1981 |
1981 | 1982 |
1982 } // namespace internal | 1983 } // namespace internal |
1983 } // namespace v8 | 1984 } // namespace v8 |
OLD | NEW |