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

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

Issue 2423053002: Install the 'name' property in classes at runtime (Closed)
Patch Set: Use an accessor instead of a data property Created 4 years, 1 month 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 #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 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after
1570 1570
1571 // Load the "prototype" from the constructor. 1571 // Load the "prototype" from the constructor.
1572 __ Move(LoadDescriptor::ReceiverRegister(), result_register()); 1572 __ Move(LoadDescriptor::ReceiverRegister(), result_register());
1573 CallLoadIC(lit->PrototypeSlot(), isolate()->factory()->prototype_string()); 1573 CallLoadIC(lit->PrototypeSlot(), isolate()->factory()->prototype_string());
1574 PrepareForBailoutForId(lit->PrototypeId(), BailoutState::TOS_REGISTER); 1574 PrepareForBailoutForId(lit->PrototypeId(), BailoutState::TOS_REGISTER);
1575 PushOperand(result_register()); 1575 PushOperand(result_register());
1576 1576
1577 EmitClassDefineProperties(lit); 1577 EmitClassDefineProperties(lit);
1578 DropOperands(1); 1578 DropOperands(1);
1579 1579
1580 // ES6 section 14.5.16 class expression evaluation, step 5
1581 EmitClassDefineNameProperty(lit);
rmcilroy 2016/11/24 14:31:15 Just a heads up - FullCodeGenerator::VisitClassLit
1582
1580 // Set the constructor to have fast properties. 1583 // Set the constructor to have fast properties.
1581 CallRuntimeWithOperands(Runtime::kToFastProperties); 1584 CallRuntimeWithOperands(Runtime::kToFastProperties);
1582 1585
1583 if (lit->class_variable_proxy() != nullptr) { 1586 if (lit->class_variable_proxy() != nullptr) {
1584 EmitVariableAssignment(lit->class_variable_proxy()->var(), Token::INIT, 1587 EmitVariableAssignment(lit->class_variable_proxy()->var(), Token::INIT,
1585 lit->ProxySlot()); 1588 lit->ProxySlot());
1586 } 1589 }
1587 1590
1588 context()->Plug(result_register()); 1591 context()->Plug(result_register());
1589 } 1592 }
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
2051 return info_->has_simple_parameters(); 2054 return info_->has_simple_parameters();
2052 } 2055 }
2053 2056
2054 FunctionLiteral* FullCodeGenerator::literal() const { return info_->literal(); } 2057 FunctionLiteral* FullCodeGenerator::literal() const { return info_->literal(); }
2055 2058
2056 #undef __ 2059 #undef __
2057 2060
2058 2061
2059 } // namespace internal 2062 } // namespace internal
2060 } // namespace v8 2063 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698