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

Unified Diff: runtime/vm/parser.cc

Issue 8506001: Finalize all classes (fix issue 364). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« runtime/vm/object.cc ('K') | « runtime/vm/object_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 1336)
+++ runtime/vm/parser.cc (working copy)
@@ -174,6 +174,8 @@
current_class_(Class::Handle()),
library_(library),
try_blocks_list_(NULL) {
+ ASSERT(!tokens_.IsNull());
+ ASSERT(!library.IsNull());
SetPosition(0);
}
@@ -192,6 +194,8 @@
current_class_(Class::Handle(current_function_.owner())),
library_(Library::Handle(current_class_.library())),
try_blocks_list_(NULL) {
+ ASSERT(!tokens_.IsNull());
+ ASSERT(!function.IsNull());
SetPosition(token_index);
}
@@ -2612,7 +2616,8 @@
// Allocate an interface to hold the type parameters and their 'extends'
// constraints. Make it the owner of the function type descriptor.
const Class& alias_owner = Class::Handle(
- Class::New(String::Handle(String::NewSymbol("")), Script::Handle()));
+ Class::New(String::Handle(String::NewSymbol(":alias_owner")),
+ Script::Handle()));
alias_owner.set_is_interface();
set_current_class(alias_owner);
ParseTypeParameters(alias_owner);
@@ -3207,9 +3212,15 @@
is_top_level_ = true;
TopLevel top_level;
Class& toplevel_class = Class::ZoneHandle(
- Class::New(String::ZoneHandle(String::NewSymbol("")), script_));
+ Class::New(String::ZoneHandle(String::NewSymbol("::")), script_));
toplevel_class.set_library(library_);
+ // TODO(regis): We need a better interface to the class finalizer.
+ // We notify the class finalizer to expect pending classes.
+ // This allows signature classes generated at runtime to be properly
+ // finalized, without finalizing them prematurely at compile time.
+ ClassFinalizer::ExpectPendingClasses();
+
if (is_library_source()) {
ParseLibraryDefinition();
}
@@ -3679,8 +3690,8 @@
if (!errmsg.IsNull()) {
ErrorMsg(errmsg.ToCString());
}
- // The call to ClassFinalizer::FinalizeTypeWhileParsing may have extended
- // the vector of type arguments.
+ // The call to ClassFinalizer::FinalizeAndCanonicalizeType may have
+ // extended the vector of type arguments.
ASSERT(signature_type_arguments.IsNull() ||
(signature_type_arguments.Length() ==
signature_class.NumTypeArguments()));
« runtime/vm/object.cc ('K') | « runtime/vm/object_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698