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.h" | 7 #include "src/ast/ast.h" |
8 #include "src/ast/ast-numbering.h" | 8 #include "src/ast/ast-numbering.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 1490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1501 __ Move(LoadDescriptor::ReceiverRegister(), result_register()); | 1501 __ Move(LoadDescriptor::ReceiverRegister(), result_register()); |
1502 __ LoadRoot(LoadDescriptor::NameRegister(), | 1502 __ LoadRoot(LoadDescriptor::NameRegister(), |
1503 Heap::kprototype_stringRootIndex); | 1503 Heap::kprototype_stringRootIndex); |
1504 __ Move(LoadDescriptor::SlotRegister(), SmiFromSlot(lit->PrototypeSlot())); | 1504 __ Move(LoadDescriptor::SlotRegister(), SmiFromSlot(lit->PrototypeSlot())); |
1505 CallLoadIC(NOT_INSIDE_TYPEOF); | 1505 CallLoadIC(NOT_INSIDE_TYPEOF); |
1506 PrepareForBailoutForId(lit->PrototypeId(), TOS_REG); | 1506 PrepareForBailoutForId(lit->PrototypeId(), TOS_REG); |
1507 PushOperand(result_register()); | 1507 PushOperand(result_register()); |
1508 | 1508 |
1509 EmitClassDefineProperties(lit); | 1509 EmitClassDefineProperties(lit); |
1510 | 1510 |
1511 // Set both the prototype and constructor to have fast properties, and also | 1511 // Set constructor to have fast properties. |
1512 // freeze them in strong mode. | |
1513 CallRuntimeWithOperands(Runtime::kFinalizeClassDefinition); | 1512 CallRuntimeWithOperands(Runtime::kFinalizeClassDefinition); |
1514 | 1513 |
1515 if (lit->class_variable_proxy() != nullptr) { | 1514 if (lit->class_variable_proxy() != nullptr) { |
1516 EmitVariableAssignment(lit->class_variable_proxy()->var(), Token::INIT, | 1515 EmitVariableAssignment(lit->class_variable_proxy()->var(), Token::INIT, |
1517 lit->ProxySlot()); | 1516 lit->ProxySlot()); |
1518 } | 1517 } |
1519 } | 1518 } |
1520 | 1519 |
1521 context()->Plug(result_register()); | 1520 context()->Plug(result_register()); |
1522 } | 1521 } |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1907 return var->mode() == CONST_LEGACY || var->scope()->is_nonlinear() || | 1906 return var->mode() == CONST_LEGACY || var->scope()->is_nonlinear() || |
1908 var->initializer_position() >= proxy->position(); | 1907 var->initializer_position() >= proxy->position(); |
1909 } | 1908 } |
1910 | 1909 |
1911 | 1910 |
1912 #undef __ | 1911 #undef __ |
1913 | 1912 |
1914 | 1913 |
1915 } // namespace internal | 1914 } // namespace internal |
1916 } // namespace v8 | 1915 } // namespace v8 |
OLD | NEW |