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

Unified Diff: runtime/vm/compiler.cc

Issue 77043010: - Ensure that classes are finalized before their description is (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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
Index: runtime/vm/compiler.cc
===================================================================
--- runtime/vm/compiler.cc (revision 30528)
+++ runtime/vm/compiler.cc (working copy)
@@ -155,8 +155,18 @@
if (cls.is_marked_for_parsing()) {
return Error::null();
}
+
+ Isolate* isolate = Isolate::Current();
+ // We remember all the classes that are being compiled in these lists. This
+ // also allows us to reset the marked_for_parsing state in case we see an
+ // error.
+ Class& parse_class = Class::Handle();
+ const GrowableObjectArray& parse_list =
+ GrowableObjectArray::Handle(GrowableObjectArray::New(4));
+ const GrowableObjectArray& patch_list =
+ GrowableObjectArray::Handle(GrowableObjectArray::New(4));
+
// Parse the class and all the interfaces it implements and super classes.
- Isolate* isolate = Isolate::Current();
StackZone zone(isolate);
LongJump* base = isolate->long_jump_base();
LongJump jump;
@@ -166,12 +176,6 @@
OS::Print("Compiling Class %s '%s'\n", "", cls.ToCString());
}
- Class& parse_class = Class::Handle();
- const GrowableObjectArray& parse_list =
- GrowableObjectArray::Handle(GrowableObjectArray::New(4));
- const GrowableObjectArray& patch_list =
- GrowableObjectArray::Handle(GrowableObjectArray::New(4));
-
// Add the primary class which needs to be parsed to the parse list.
// Mark the class as parsed so that we don't recursively add the same
// class back into the list.
@@ -214,6 +218,20 @@
isolate->set_long_jump_base(base);
return Error::null();
} else {
+ // Reset the marked for parsing flags.
+ for (intptr_t i = 0; i < parse_list.Length(); i++) {
+ parse_class ^= parse_list.At(i);
+ if (parse_class.is_marked_for_parsing()) {
+ parse_class.reset_is_marked_for_parsing();
+ }
+ }
+ for (intptr_t i = 0; i < patch_list.Length(); i++) {
+ parse_class ^= patch_list.At(i);
+ if (parse_class.is_marked_for_parsing()) {
+ parse_class.reset_is_marked_for_parsing();
+ }
+ }
+
Error& error = Error::Handle();
error = isolate->object_store()->sticky_error();
isolate->object_store()->clear_sticky_error();

Powered by Google App Engine
This is Rietveld 408576698