| 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 | 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 1499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1510 } | 1510 } |
| 1511 | 1511 |
| 1512 | 1512 |
| 1513 void Parser::GenerateSuperConstructorCall(const Class& cls, | 1513 void Parser::GenerateSuperConstructorCall(const Class& cls, |
| 1514 LocalVariable* receiver) { | 1514 LocalVariable* receiver) { |
| 1515 const intptr_t supercall_pos = TokenPos(); | 1515 const intptr_t supercall_pos = TokenPos(); |
| 1516 const Class& super_class = Class::Handle(cls.SuperClass()); | 1516 const Class& super_class = Class::Handle(cls.SuperClass()); |
| 1517 // Omit the implicit super() if there is no super class (i.e. | 1517 // Omit the implicit super() if there is no super class (i.e. |
| 1518 // we're not compiling class Object), or if the super class is an | 1518 // we're not compiling class Object), or if the super class is an |
| 1519 // artificially generated "wrapper class" that has no constructor. | 1519 // artificially generated "wrapper class" that has no constructor. |
| 1520 if (super_class.IsNull() || (super_class.num_native_fields() > 0)) { | 1520 if (super_class.IsNull() || |
| 1521 (super_class.num_native_fields() > 0 && |
| 1522 Class::Handle(super_class.SuperClass()).IsObjectClass())) { |
| 1521 return; | 1523 return; |
| 1522 } | 1524 } |
| 1523 String& ctor_name = String::Handle(super_class.Name()); | 1525 String& ctor_name = String::Handle(super_class.Name()); |
| 1524 String& ctor_suffix = String::Handle(Symbols::Dot()); | 1526 String& ctor_suffix = String::Handle(Symbols::Dot()); |
| 1525 ctor_name = String::Concat(ctor_name, ctor_suffix); | 1527 ctor_name = String::Concat(ctor_name, ctor_suffix); |
| 1526 ArgumentListNode* arguments = new ArgumentListNode(supercall_pos); | 1528 ArgumentListNode* arguments = new ArgumentListNode(supercall_pos); |
| 1527 // Implicit 'this' parameter is the first argument. | 1529 // Implicit 'this' parameter is the first argument. |
| 1528 AstNode* implicit_argument = new LoadLocalNode(supercall_pos, receiver); | 1530 AstNode* implicit_argument = new LoadLocalNode(supercall_pos, receiver); |
| 1529 arguments->Add(implicit_argument); | 1531 arguments->Add(implicit_argument); |
| 1530 // Implicit construction phase parameter is second argument. | 1532 // Implicit construction phase parameter is second argument. |
| (...skipping 7979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9510 void Parser::SkipQualIdent() { | 9512 void Parser::SkipQualIdent() { |
| 9511 ASSERT(IsIdentifier()); | 9513 ASSERT(IsIdentifier()); |
| 9512 ConsumeToken(); | 9514 ConsumeToken(); |
| 9513 if (CurrentToken() == Token::kPERIOD) { | 9515 if (CurrentToken() == Token::kPERIOD) { |
| 9514 ConsumeToken(); // Consume the kPERIOD token. | 9516 ConsumeToken(); // Consume the kPERIOD token. |
| 9515 ExpectIdentifier("identifier expected after '.'"); | 9517 ExpectIdentifier("identifier expected after '.'"); |
| 9516 } | 9518 } |
| 9517 } | 9519 } |
| 9518 | 9520 |
| 9519 } // namespace dart | 9521 } // namespace dart |
| OLD | NEW |