| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/parser.h" | 5 #include "vm/parser.h" |
| 6 | 6 |
| 7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/compiler_stats.h" | 10 #include "vm/compiler_stats.h" |
| (...skipping 1723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1734 Smi::ZoneHandle(Smi::New(Function::kCtorPhaseInit)))); | 1734 Smi::ZoneHandle(Smi::New(Function::kCtorPhaseInit)))); |
| 1735 | 1735 |
| 1736 ArgumentListNode* super_call_args = new ArgumentListNode(token_index_); | 1736 ArgumentListNode* super_call_args = new ArgumentListNode(token_index_); |
| 1737 // First argument is the receiver. | 1737 // First argument is the receiver. |
| 1738 super_call_args->Add(new LoadLocalNode(token_index_, *receiver)); | 1738 super_call_args->Add(new LoadLocalNode(token_index_, *receiver)); |
| 1739 // Second argument is the constructor phase argument. | 1739 // Second argument is the constructor phase argument. |
| 1740 AstNode* phase_parameter = | 1740 AstNode* phase_parameter = |
| 1741 new LiteralNode(token_index_, | 1741 new LiteralNode(token_index_, |
| 1742 Smi::ZoneHandle(Smi::New(Function::kCtorPhaseBody))); | 1742 Smi::ZoneHandle(Smi::New(Function::kCtorPhaseBody))); |
| 1743 super_call_args->Add(phase_parameter); | 1743 super_call_args->Add(phase_parameter); |
| 1744 super_call_args->set_names(initializer_args->names()); |
| 1744 for (int i = 2; i < initializer_args->length(); i++) { | 1745 for (int i = 2; i < initializer_args->length(); i++) { |
| 1745 AstNode* arg = initializer_args->NodeAt(i); | 1746 AstNode* arg = initializer_args->NodeAt(i); |
| 1746 if (arg->IsLiteralNode()) { | 1747 if (arg->IsLiteralNode()) { |
| 1747 LiteralNode* lit = arg->AsLiteralNode(); | 1748 LiteralNode* lit = arg->AsLiteralNode(); |
| 1748 super_call_args->Add(new LiteralNode(token_index_, lit->literal())); | 1749 super_call_args->Add(new LiteralNode(token_index_, lit->literal())); |
| 1749 } else { | 1750 } else { |
| 1750 ASSERT(arg->IsLoadLocalNode() || arg->IsStoreLocalNode()); | 1751 ASSERT(arg->IsLoadLocalNode() || arg->IsStoreLocalNode()); |
| 1751 if (arg->IsLoadLocalNode()) { | 1752 if (arg->IsLoadLocalNode()) { |
| 1752 const LocalVariable& temp = arg->AsLoadLocalNode()->local(); | 1753 const LocalVariable& temp = arg->AsLoadLocalNode()->local(); |
| 1753 super_call_args->Add(new LoadLocalNode(token_index_, temp)); | 1754 super_call_args->Add(new LoadLocalNode(token_index_, temp)); |
| (...skipping 5444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7198 } | 7199 } |
| 7199 | 7200 |
| 7200 | 7201 |
| 7201 void Parser::SkipNestedExpr() { | 7202 void Parser::SkipNestedExpr() { |
| 7202 const bool saved_mode = SetAllowFunctionLiterals(true); | 7203 const bool saved_mode = SetAllowFunctionLiterals(true); |
| 7203 SkipExpr(); | 7204 SkipExpr(); |
| 7204 SetAllowFunctionLiterals(saved_mode); | 7205 SetAllowFunctionLiterals(saved_mode); |
| 7205 } | 7206 } |
| 7206 | 7207 |
| 7207 } // namespace dart | 7208 } // namespace dart |
| OLD | NEW |