| 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 "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
| 8 #include "vm/bigint_operations.h" | 8 #include "vm/bigint_operations.h" |
| 9 #include "vm/bootstrap.h" | 9 #include "vm/bootstrap.h" |
| 10 #include "vm/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
| (...skipping 8109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8120 return initializing_getter; | 8120 return initializing_getter; |
| 8121 } | 8121 } |
| 8122 // The field is initialized. | 8122 // The field is initialized. |
| 8123 ASSERT(field.is_static()); | 8123 ASSERT(field.is_static()); |
| 8124 const Class& field_owner = Class::ZoneHandle(field.owner()); | 8124 const Class& field_owner = Class::ZoneHandle(field.owner()); |
| 8125 const String& field_name = String::ZoneHandle(field.name()); | 8125 const String& field_name = String::ZoneHandle(field.name()); |
| 8126 const String& getter_name = String::Handle(Field::GetterName(field_name)); | 8126 const String& getter_name = String::Handle(Field::GetterName(field_name)); |
| 8127 const Function& getter = | 8127 const Function& getter = |
| 8128 Function::Handle(field_owner.LookupStaticFunction(getter_name)); | 8128 Function::Handle(field_owner.LookupStaticFunction(getter_name)); |
| 8129 // Never load field directly if there is a getter (deterministic AST). | 8129 // Never load field directly if there is a getter (deterministic AST). |
| 8130 if (getter.IsNull()) { | 8130 if (getter.IsNull() || field.is_const()) { |
| 8131 return new LoadStaticFieldNode(ident_pos, Field::ZoneHandle(field.raw())); | 8131 return new LoadStaticFieldNode(ident_pos, Field::ZoneHandle(field.raw())); |
| 8132 } else { | 8132 } else { |
| 8133 ASSERT(getter.kind() == RawFunction::kImplicitStaticFinalGetter); | 8133 ASSERT(getter.kind() == RawFunction::kImplicitStaticFinalGetter); |
| 8134 return new StaticGetterNode(ident_pos, | 8134 return new StaticGetterNode(ident_pos, |
| 8135 NULL, // Receiver. | 8135 NULL, // Receiver. |
| 8136 false, // is_super_getter. | 8136 false, // is_super_getter. |
| 8137 field_owner, | 8137 field_owner, |
| 8138 field_name); | 8138 field_name); |
| 8139 } | 8139 } |
| 8140 } | 8140 } |
| (...skipping 2489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10630 void Parser::SkipQualIdent() { | 10630 void Parser::SkipQualIdent() { |
| 10631 ASSERT(IsIdentifier()); | 10631 ASSERT(IsIdentifier()); |
| 10632 ConsumeToken(); | 10632 ConsumeToken(); |
| 10633 if (CurrentToken() == Token::kPERIOD) { | 10633 if (CurrentToken() == Token::kPERIOD) { |
| 10634 ConsumeToken(); // Consume the kPERIOD token. | 10634 ConsumeToken(); // Consume the kPERIOD token. |
| 10635 ExpectIdentifier("identifier expected after '.'"); | 10635 ExpectIdentifier("identifier expected after '.'"); |
| 10636 } | 10636 } |
| 10637 } | 10637 } |
| 10638 | 10638 |
| 10639 } // namespace dart | 10639 } // namespace dart |
| OLD | NEW |