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

Unified Diff: runtime/lib/object.cc

Issue 21049012: Update VM to handle malformed types according to revised spec (issues 9055, (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/lib/map_patch.dart ('k') | runtime/vm/class_finalizer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/object.cc
===================================================================
--- runtime/lib/object.cc (revision 25651)
+++ runtime/lib/object.cc (working copy)
@@ -115,6 +115,17 @@
const bool is_instance_of = instance.IsInstanceOf(type,
instantiator_type_arguments,
&malformed_error);
+ if (FLAG_trace_type_checks) {
+ const char* result_str = is_instance_of ? "true" : "false";
+ OS::Print("Object.instanceOf: result %s\n", result_str);
+ const Type& instance_type = Type::Handle(instance.GetType());
+ OS::Print(" instance type: %s\n",
+ String::Handle(instance_type.Name()).ToCString());
+ OS::Print(" test type: %s\n", String::Handle(type.Name()).ToCString());
+ if (!malformed_error.IsNull()) {
+ OS::Print(" malformed error: %s\n", malformed_error.ToErrorCString());
+ }
+ }
if (!is_instance_of && !malformed_error.IsNull()) {
// Throw a dynamic type error only if the instanceof test fails.
DartFrameIterator iterator;
@@ -128,17 +139,6 @@
Symbols::Empty(), malformed_error_message);
UNREACHABLE();
}
-
- if (FLAG_trace_type_checks) {
- const char* result_str = is_instance_of ? "true" : "false";
- OS::Print("Object.instanceOf: result %s\n", result_str);
- const Class& instance_class = Class::Handle(instance.clazz());
- OS::Print(" instance [class: %s]\n",
- String::Handle(instance_class.Name()).ToCString());
- OS::Print(" test-type [class: %s]\n",
- String::Handle(Class::Handle(type.type_class()).Name()).ToCString());
- OS::Print(" type-args %s\n", instantiator_type_arguments.ToCString());
- }
return Bool::Get(negate.value() ? !is_instance_of : is_instance_of);
}
« no previous file with comments | « runtime/lib/map_patch.dart ('k') | runtime/vm/class_finalizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698