| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 #include "vm/flags.h" | 6 #include "vm/flags.h" |
| 7 | 7 |
| 8 #ifndef DART_PRECOMPILED_RUNTIME | 8 #ifndef DART_PRECOMPILED_RUNTIME |
| 9 | 9 |
| 10 #include "lib/invocation_mirror.h" | 10 #include "lib/invocation_mirror.h" |
| (...skipping 2398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2409 } | 2409 } |
| 2410 String& super_ctor_name = String::Handle(Z, super_class.Name()); | 2410 String& super_ctor_name = String::Handle(Z, super_class.Name()); |
| 2411 super_ctor_name = Symbols::FromDot(T, super_ctor_name); | 2411 super_ctor_name = Symbols::FromDot(T, super_ctor_name); |
| 2412 | 2412 |
| 2413 ArgumentListNode* arguments = new ArgumentListNode(supercall_pos); | 2413 ArgumentListNode* arguments = new ArgumentListNode(supercall_pos); |
| 2414 // Implicit 'this' parameter is the first argument. | 2414 // Implicit 'this' parameter is the first argument. |
| 2415 AstNode* implicit_argument = new LoadLocalNode(supercall_pos, receiver); | 2415 AstNode* implicit_argument = new LoadLocalNode(supercall_pos, receiver); |
| 2416 arguments->Add(implicit_argument); | 2416 arguments->Add(implicit_argument); |
| 2417 | 2417 |
| 2418 // If this is a super call in a forwarding constructor, add the user- | 2418 // If this is a super call in a forwarding constructor, add the user- |
| 2419 // defined arguments to the super call and adjust the the super | 2419 // defined arguments to the super call and adjust the super |
| 2420 // constructor name to the respective named constructor if necessary. | 2420 // constructor name to the respective named constructor if necessary. |
| 2421 if (forwarding_args != NULL) { | 2421 if (forwarding_args != NULL) { |
| 2422 for (int i = 0; i < forwarding_args->length(); i++) { | 2422 for (int i = 0; i < forwarding_args->length(); i++) { |
| 2423 arguments->Add(forwarding_args->NodeAt(i)); | 2423 arguments->Add(forwarding_args->NodeAt(i)); |
| 2424 } | 2424 } |
| 2425 String& ctor_name = String::Handle(Z, current_function().name()); | 2425 String& ctor_name = String::Handle(Z, current_function().name()); |
| 2426 String& class_name = String::Handle(Z, cls.Name()); | 2426 String& class_name = String::Handle(Z, cls.Name()); |
| 2427 if (ctor_name.Length() > class_name.Length() + 1) { | 2427 if (ctor_name.Length() > class_name.Length() + 1) { |
| 2428 // Generating a forwarding call to a named constructor 'C.n'. | 2428 // Generating a forwarding call to a named constructor 'C.n'. |
| 2429 // Add the constructor name 'n' to the super constructor. | 2429 // Add the constructor name 'n' to the super constructor. |
| (...skipping 12104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14534 const ArgumentListNode& function_args, | 14534 const ArgumentListNode& function_args, |
| 14535 const LocalVariable* temp_for_last_arg, | 14535 const LocalVariable* temp_for_last_arg, |
| 14536 bool is_super_invocation) { | 14536 bool is_super_invocation) { |
| 14537 UNREACHABLE(); | 14537 UNREACHABLE(); |
| 14538 return NULL; | 14538 return NULL; |
| 14539 } | 14539 } |
| 14540 | 14540 |
| 14541 } // namespace dart | 14541 } // namespace dart |
| 14542 | 14542 |
| 14543 #endif // DART_PRECOMPILED_RUNTIME | 14543 #endif // DART_PRECOMPILED_RUNTIME |
| OLD | NEW |