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

Unified Diff: runtime/vm/object.cc

Issue 1124253004: Make sure the bound of a mixin type parameter is finalized before instantiating (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 45585)
+++ runtime/vm/object.cc (working copy)
@@ -15101,42 +15101,40 @@
const char* Type::ToCString() const {
- if (IsResolved()) {
- const TypeArguments& type_arguments = TypeArguments::Handle(arguments());
- const char* class_name;
- if (HasResolvedTypeClass()) {
- class_name = String::Handle(
- Class::Handle(type_class()).Name()).ToCString();
- } else {
- class_name = UnresolvedClass::Handle(unresolved_class()).ToCString();
- }
- if (type_arguments.IsNull()) {
- const char* format = "Type: class '%s'";
- const intptr_t len = OS::SNPrint(NULL, 0, format, class_name) + 1;
- char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
- OS::SNPrint(chars, len, format, class_name);
- return chars;
- } else if (IsFinalized() && IsRecursive()) {
- const char* format = "Type: (@%" Px " H%" Px ") class '%s', args:[%s]";
- const intptr_t hash = Hash();
- const char* args_cstr = TypeArguments::Handle(arguments()).ToCString();
- const intptr_t len =
- OS::SNPrint(NULL, 0, format, raw(), hash, class_name, args_cstr) + 1;
- char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
- OS::SNPrint(chars, len, format, raw(), hash, class_name, args_cstr);
- return chars;
- } else {
- const char* format = "Type: class '%s', args:[%s]";
- const char* args_cstr = TypeArguments::Handle(arguments()).ToCString();
- const intptr_t len =
- OS::SNPrint(NULL, 0, format, class_name, args_cstr) + 1;
- char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
- OS::SNPrint(chars, len, format, class_name, args_cstr);
- return chars;
- }
+ const char* unresolved = IsResolved() ? "" : "Unresolved ";
+ const TypeArguments& type_arguments = TypeArguments::Handle(arguments());
+ const char* class_name;
+ if (HasResolvedTypeClass()) {
+ class_name = String::Handle(
+ Class::Handle(type_class()).Name()).ToCString();
} else {
- return "Unresolved Type";
+ class_name = UnresolvedClass::Handle(unresolved_class()).ToCString();
}
+ if (type_arguments.IsNull()) {
+ const char* format = "%sType: class '%s'";
+ const intptr_t len =
+ OS::SNPrint(NULL, 0, format, unresolved, class_name) + 1;
+ char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
+ OS::SNPrint(chars, len, format, unresolved, class_name);
+ return chars;
+ } else if (IsResolved() && IsFinalized() && IsRecursive()) {
+ const char* format = "Type: (@%" Px " H%" Px ") class '%s', args:[%s]";
+ const intptr_t hash = Hash();
+ const char* args_cstr = TypeArguments::Handle(arguments()).ToCString();
+ const intptr_t len =
+ OS::SNPrint(NULL, 0, format, raw(), hash, class_name, args_cstr) + 1;
+ char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
+ OS::SNPrint(chars, len, format, raw(), hash, class_name, args_cstr);
+ return chars;
+ } else {
+ const char* format = "%sType: class '%s', args:[%s]";
+ const char* args_cstr = TypeArguments::Handle(arguments()).ToCString();
+ const intptr_t len =
+ OS::SNPrint(NULL, 0, format, unresolved, class_name, args_cstr) + 1;
+ char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
+ OS::SNPrint(chars, len, format, unresolved, class_name, args_cstr);
+ return chars;
+ }
}
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698