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

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

Issue 10823022: Improve static type propagation. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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
« runtime/vm/intermediate_language.cc ('K') | « runtime/vm/object.cc ('k') | 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 "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 7992 matching lines...) Expand 10 before | Expand all | Expand 10 after
8003 if (!type_class.HasResolvedFactoryClass()) { 8003 if (!type_class.HasResolvedFactoryClass()) {
8004 // This error can occur only with bootstrap classes. 8004 // This error can occur only with bootstrap classes.
8005 const UnresolvedClass& unresolved = 8005 const UnresolvedClass& unresolved =
8006 UnresolvedClass::Handle(type_class.UnresolvedFactoryClass()); 8006 UnresolvedClass::Handle(type_class.UnresolvedFactoryClass());
8007 const String& missing_class_name = String::Handle(unresolved.ident()); 8007 const String& missing_class_name = String::Handle(unresolved.ident());
8008 ErrorMsg("unresolved factory class '%s'", missing_class_name.ToCString()); 8008 ErrorMsg("unresolved factory class '%s'", missing_class_name.ToCString());
8009 } 8009 }
8010 // Only change the class of the constructor to the factory class if the 8010 // Only change the class of the constructor to the factory class if the
8011 // factory class implements the interface 'type'. 8011 // factory class implements the interface 'type'.
8012 const Class& factory_class = Class::Handle(type_class.FactoryClass()); 8012 const Class& factory_class = Class::Handle(type_class.FactoryClass());
8013 Error& malformed_error = Error::Handle();
8014 if (factory_class.IsSubtypeOf(TypeArguments::Handle(), 8013 if (factory_class.IsSubtypeOf(TypeArguments::Handle(),
8015 type_class, 8014 type_class,
8016 TypeArguments::Handle(), 8015 TypeArguments::Handle(),
8017 &malformed_error)) { 8016 NULL)) {
8018 // Class finalization verifies that the factory class has identical type 8017 // Class finalization verifies that the factory class has identical type
8019 // parameters as the interface. 8018 // parameters as the interface.
8020 constructor_class_name = factory_class.Name(); 8019 constructor_class_name = factory_class.Name();
8021 } 8020 }
8022 // Always change the result type of the constructor to the factory type. 8021 // Always change the result type of the constructor to the factory type.
8023 constructor_class = factory_class.raw(); 8022 constructor_class = factory_class.raw();
8024 // The finalized type_arguments are still those of the interface type. 8023 // The finalized type_arguments are still those of the interface type.
8025 ASSERT(!constructor_class.is_interface()); 8024 ASSERT(!constructor_class.is_interface());
8026 } 8025 }
8027 8026
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
8705 void Parser::SkipQualIdent() { 8704 void Parser::SkipQualIdent() {
8706 ASSERT(IsIdentifier()); 8705 ASSERT(IsIdentifier());
8707 ConsumeToken(); 8706 ConsumeToken();
8708 if (CurrentToken() == Token::kPERIOD) { 8707 if (CurrentToken() == Token::kPERIOD) {
8709 ConsumeToken(); // Consume the kPERIOD token. 8708 ConsumeToken(); // Consume the kPERIOD token.
8710 ExpectIdentifier("identifier expected after '.'"); 8709 ExpectIdentifier("identifier expected after '.'");
8711 } 8710 }
8712 } 8711 }
8713 8712
8714 } // namespace dart 8713 } // namespace dart
OLDNEW
« runtime/vm/intermediate_language.cc ('K') | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698