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

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
« no previous file with comments | « 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 7959 matching lines...) Expand 10 before | Expand all | Expand 10 after
7970 if (!type_class.HasResolvedFactoryClass()) { 7970 if (!type_class.HasResolvedFactoryClass()) {
7971 // This error can occur only with bootstrap classes. 7971 // This error can occur only with bootstrap classes.
7972 const UnresolvedClass& unresolved = 7972 const UnresolvedClass& unresolved =
7973 UnresolvedClass::Handle(type_class.UnresolvedFactoryClass()); 7973 UnresolvedClass::Handle(type_class.UnresolvedFactoryClass());
7974 const String& missing_class_name = String::Handle(unresolved.ident()); 7974 const String& missing_class_name = String::Handle(unresolved.ident());
7975 ErrorMsg("unresolved factory class '%s'", missing_class_name.ToCString()); 7975 ErrorMsg("unresolved factory class '%s'", missing_class_name.ToCString());
7976 } 7976 }
7977 // Only change the class of the constructor to the factory class if the 7977 // Only change the class of the constructor to the factory class if the
7978 // factory class implements the interface 'type'. 7978 // factory class implements the interface 'type'.
7979 const Class& factory_class = Class::Handle(type_class.FactoryClass()); 7979 const Class& factory_class = Class::Handle(type_class.FactoryClass());
7980 Error& malformed_error = Error::Handle();
7981 if (factory_class.IsSubtypeOf(TypeArguments::Handle(), 7980 if (factory_class.IsSubtypeOf(TypeArguments::Handle(),
7982 type_class, 7981 type_class,
7983 TypeArguments::Handle(), 7982 TypeArguments::Handle(),
7984 &malformed_error)) { 7983 NULL)) {
7985 // Class finalization verifies that the factory class has identical type 7984 // Class finalization verifies that the factory class has identical type
7986 // parameters as the interface. 7985 // parameters as the interface.
7987 constructor_class_name = factory_class.Name(); 7986 constructor_class_name = factory_class.Name();
7988 } 7987 }
7989 // Always change the result type of the constructor to the factory type. 7988 // Always change the result type of the constructor to the factory type.
7990 constructor_class = factory_class.raw(); 7989 constructor_class = factory_class.raw();
7991 // The finalized type_arguments are still those of the interface type. 7990 // The finalized type_arguments are still those of the interface type.
7992 ASSERT(!constructor_class.is_interface()); 7991 ASSERT(!constructor_class.is_interface());
7993 } 7992 }
7994 7993
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
8679 void Parser::SkipQualIdent() { 8678 void Parser::SkipQualIdent() {
8680 ASSERT(IsIdentifier()); 8679 ASSERT(IsIdentifier());
8681 ConsumeToken(); 8680 ConsumeToken();
8682 if (CurrentToken() == Token::kPERIOD) { 8681 if (CurrentToken() == Token::kPERIOD) {
8683 ConsumeToken(); // Consume the kPERIOD token. 8682 ConsumeToken(); // Consume the kPERIOD token.
8684 ExpectIdentifier("identifier expected after '.'"); 8683 ExpectIdentifier("identifier expected after '.'");
8685 } 8684 }
8686 } 8685 }
8687 8686
8688 } // namespace dart 8687 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698