OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/compiler/ast-graph-builder.h" | 5 #include "src/compiler/ast-graph-builder.h" |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
9 #include "src/compiler/ast-loop-assignment-analyzer.h" | 9 #include "src/compiler/ast-loop-assignment-analyzer.h" |
10 #include "src/compiler/control-builders.h" | 10 #include "src/compiler/control-builders.h" |
(...skipping 1652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1663 case ObjectLiteral::Property::SETTER: { | 1663 case ObjectLiteral::Property::SETTER: { |
1664 Node* attr = jsgraph()->Constant(DONT_ENUM); | 1664 Node* attr = jsgraph()->Constant(DONT_ENUM); |
1665 const Operator* op = javascript()->CallRuntime( | 1665 const Operator* op = javascript()->CallRuntime( |
1666 Runtime::kDefineSetterPropertyUnchecked, 4); | 1666 Runtime::kDefineSetterPropertyUnchecked, 4); |
1667 NewNode(op, receiver, key, value, attr); | 1667 NewNode(op, receiver, key, value, attr); |
1668 break; | 1668 break; |
1669 } | 1669 } |
1670 } | 1670 } |
1671 } | 1671 } |
1672 | 1672 |
1673 // Set both the prototype and constructor to have fast properties. | 1673 // Set the constructor to have fast properties. |
1674 prototype = environment()->Pop(); | 1674 prototype = environment()->Pop(); |
1675 literal = environment()->Pop(); | 1675 literal = environment()->Pop(); |
1676 const Operator* op = | 1676 const Operator* op = javascript()->CallRuntime(Runtime::kToFastProperties); |
1677 javascript()->CallRuntime(Runtime::kFinalizeClassDefinition); | 1677 literal = NewNode(op, literal); |
1678 literal = NewNode(op, literal, prototype); | |
1679 | 1678 |
1680 // Assign to class variable. | 1679 // Assign to class variable. |
1681 if (expr->class_variable_proxy() != nullptr) { | 1680 if (expr->class_variable_proxy() != nullptr) { |
1682 Variable* var = expr->class_variable_proxy()->var(); | 1681 Variable* var = expr->class_variable_proxy()->var(); |
1683 FrameStateBeforeAndAfter states(this, BailoutId::None()); | 1682 FrameStateBeforeAndAfter states(this, BailoutId::None()); |
1684 VectorSlotPair feedback = CreateVectorSlotPair( | 1683 VectorSlotPair feedback = CreateVectorSlotPair( |
1685 expr->NeedsProxySlot() ? expr->ProxySlot() | 1684 expr->NeedsProxySlot() ? expr->ProxySlot() |
1686 : FeedbackVectorSlot::Invalid()); | 1685 : FeedbackVectorSlot::Invalid()); |
1687 BuildVariableAssignment(var, literal, Token::INIT, feedback, | 1686 BuildVariableAssignment(var, literal, Token::INIT, feedback, |
1688 BailoutId::None(), states); | 1687 BailoutId::None(), states); |
(...skipping 2674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4363 // Phi does not exist yet, introduce one. | 4362 // Phi does not exist yet, introduce one. |
4364 value = NewPhi(inputs, value, control); | 4363 value = NewPhi(inputs, value, control); |
4365 value->ReplaceInput(inputs - 1, other); | 4364 value->ReplaceInput(inputs - 1, other); |
4366 } | 4365 } |
4367 return value; | 4366 return value; |
4368 } | 4367 } |
4369 | 4368 |
4370 } // namespace compiler | 4369 } // namespace compiler |
4371 } // namespace internal | 4370 } // namespace internal |
4372 } // namespace v8 | 4371 } // namespace v8 |
OLD | NEW |