Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(424)

Side by Side Diff: runtime/vm/parser.cc

Issue 16835002: One more premature load-static node generation solved. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/class_finalizer.h" 9 #include "vm/class_finalizer.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 7507 matching lines...) Expand 10 before | Expand all | Expand 10 after
7518 // The field is not yet initialized and could not be initialized at compile 7518 // The field is not yet initialized and could not be initialized at compile
7519 // time. The getter will initialize the field. 7519 // time. The getter will initialize the field.
7520 return initializing_getter; 7520 return initializing_getter;
7521 } 7521 }
7522 // The field is initialized. 7522 // The field is initialized.
7523 if (field.is_const()) { 7523 if (field.is_const()) {
7524 ASSERT(field.value() != Object::sentinel().raw()); 7524 ASSERT(field.value() != Object::sentinel().raw());
7525 ASSERT(field.value() != Object::transition_sentinel().raw()); 7525 ASSERT(field.value() != Object::transition_sentinel().raw());
7526 return new LiteralNode(ident_pos, Instance::ZoneHandle(field.value())); 7526 return new LiteralNode(ident_pos, Instance::ZoneHandle(field.value()));
7527 } 7527 }
7528 // Access the field directly. 7528 ASSERT(field.is_static());
7529 return new LoadStaticFieldNode(ident_pos, Field::ZoneHandle(field.raw())); 7529 const Class& field_owner = Class::ZoneHandle(field.owner());
7530 const String& field_name = String::ZoneHandle(field.name());
7531 const String& getter_name = String::Handle(Field::GetterName(field_name));
7532 const Function& getter =
7533 Function::Handle(field_owner.LookupStaticFunction(getter_name));
7534 // Never load field directly if there is a getter (deterministic AST).
7535 if (getter.IsNull()) {
7536 return new LoadStaticFieldNode(ident_pos, Field::ZoneHandle(field.raw()));
7537 } else {
7538 ASSERT(getter.kind() == RawFunction::kConstImplicitGetter);
7539 return new StaticGetterNode(ident_pos,
7540 NULL, // Receiver.
7541 false, // is_super_getter.
7542 field_owner,
7543 field_name);
7544 }
7530 } 7545 }
7531 7546
7532 7547
7533 AstNode* Parser::ParseStaticFieldAccess(const Class& cls, 7548 AstNode* Parser::ParseStaticFieldAccess(const Class& cls,
7534 const String& field_name, 7549 const String& field_name,
7535 intptr_t ident_pos, 7550 intptr_t ident_pos,
7536 bool consume_cascades) { 7551 bool consume_cascades) {
7537 TRACE_PARSER("ParseStaticFieldAccess"); 7552 TRACE_PARSER("ParseStaticFieldAccess");
7538 AstNode* access = NULL; 7553 AstNode* access = NULL;
7539 const intptr_t call_pos = TokenPos(); 7554 const intptr_t call_pos = TokenPos();
(...skipping 2545 matching lines...) Expand 10 before | Expand all | Expand 10 after
10085 void Parser::SkipQualIdent() { 10100 void Parser::SkipQualIdent() {
10086 ASSERT(IsIdentifier()); 10101 ASSERT(IsIdentifier());
10087 ConsumeToken(); 10102 ConsumeToken();
10088 if (CurrentToken() == Token::kPERIOD) { 10103 if (CurrentToken() == Token::kPERIOD) {
10089 ConsumeToken(); // Consume the kPERIOD token. 10104 ConsumeToken(); // Consume the kPERIOD token.
10090 ExpectIdentifier("identifier expected after '.'"); 10105 ExpectIdentifier("identifier expected after '.'");
10091 } 10106 }
10092 } 10107 }
10093 10108
10094 } // namespace dart 10109 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698