| 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/compiler.h" | 7 #include "src/compiler.h" |
| 8 #include "src/compiler/ast-loop-assignment-analyzer.h" | 8 #include "src/compiler/ast-loop-assignment-analyzer.h" |
| 9 #include "src/compiler/control-builders.h" | 9 #include "src/compiler/control-builders.h" |
| 10 #include "src/compiler/js-type-feedback.h" | 10 #include "src/compiler/js-type-feedback.h" |
| (...skipping 1622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1633 NewNode(op, receiver, key, value, attr); | 1633 NewNode(op, receiver, key, value, attr); |
| 1634 break; | 1634 break; |
| 1635 } | 1635 } |
| 1636 } | 1636 } |
| 1637 } | 1637 } |
| 1638 | 1638 |
| 1639 // Transform both the class literal and the prototype to fast properties. | 1639 // Transform both the class literal and the prototype to fast properties. |
| 1640 const Operator* op = javascript()->CallRuntime(Runtime::kToFastProperties, 1); | 1640 const Operator* op = javascript()->CallRuntime(Runtime::kToFastProperties, 1); |
| 1641 NewNode(op, environment()->Pop()); // prototype | 1641 NewNode(op, environment()->Pop()); // prototype |
| 1642 NewNode(op, environment()->Pop()); // literal | 1642 NewNode(op, environment()->Pop()); // literal |
| 1643 if (is_strong(language_mode())) { |
| 1644 // TODO(conradw): It would be more efficient to define the properties with |
| 1645 // the right attributes the first time round. |
| 1646 literal = |
| 1647 NewNode(javascript()->CallRuntime(Runtime::kObjectFreeze, 1), literal); |
| 1648 // Freezing the class object should never deopt. |
| 1649 PrepareFrameState(literal, BailoutId::None()); |
| 1650 } |
| 1643 | 1651 |
| 1644 // Assign to class variable. | 1652 // Assign to class variable. |
| 1645 if (expr->scope() != NULL) { | 1653 if (expr->scope() != NULL) { |
| 1646 DCHECK_NOT_NULL(expr->class_variable_proxy()); | 1654 DCHECK_NOT_NULL(expr->class_variable_proxy()); |
| 1647 Variable* var = expr->class_variable_proxy()->var(); | 1655 Variable* var = expr->class_variable_proxy()->var(); |
| 1648 FrameStateBeforeAndAfter states(this, BailoutId::None()); | 1656 FrameStateBeforeAndAfter states(this, BailoutId::None()); |
| 1649 VectorSlotPair feedback = CreateVectorSlotPair( | 1657 VectorSlotPair feedback = CreateVectorSlotPair( |
| 1650 FLAG_vector_stores ? expr->GetNthSlot(store_slot_index++) | 1658 FLAG_vector_stores ? expr->GetNthSlot(store_slot_index++) |
| 1651 : FeedbackVectorICSlot::Invalid()); | 1659 : FeedbackVectorICSlot::Invalid()); |
| 1652 BuildVariableAssignment(var, literal, Token::INIT_CONST, feedback, | 1660 BuildVariableAssignment(var, literal, Token::INIT_CONST, feedback, |
| 1653 BailoutId::None(), states); | 1661 BailoutId::None(), states); |
| 1654 } | 1662 } |
| 1655 | |
| 1656 ast_context()->ProduceValue(literal); | 1663 ast_context()->ProduceValue(literal); |
| 1657 } | 1664 } |
| 1658 | 1665 |
| 1659 | 1666 |
| 1660 void AstGraphBuilder::VisitNativeFunctionLiteral(NativeFunctionLiteral* expr) { | 1667 void AstGraphBuilder::VisitNativeFunctionLiteral(NativeFunctionLiteral* expr) { |
| 1661 UNREACHABLE(); | 1668 UNREACHABLE(); |
| 1662 } | 1669 } |
| 1663 | 1670 |
| 1664 | 1671 |
| 1665 void AstGraphBuilder::VisitConditional(Conditional* expr) { | 1672 void AstGraphBuilder::VisitConditional(Conditional* expr) { |
| (...skipping 2572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4238 // Phi does not exist yet, introduce one. | 4245 // Phi does not exist yet, introduce one. |
| 4239 value = NewPhi(inputs, value, control); | 4246 value = NewPhi(inputs, value, control); |
| 4240 value->ReplaceInput(inputs - 1, other); | 4247 value->ReplaceInput(inputs - 1, other); |
| 4241 } | 4248 } |
| 4242 return value; | 4249 return value; |
| 4243 } | 4250 } |
| 4244 | 4251 |
| 4245 } // namespace compiler | 4252 } // namespace compiler |
| 4246 } // namespace internal | 4253 } // namespace internal |
| 4247 } // namespace v8 | 4254 } // namespace v8 |
| OLD | NEW |