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

Unified Diff: runtime/lib/error.cc

Issue 8503034: Add type check tracing (--trace_type_checks). Inline type checks with class types that have only ... (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
« no previous file with comments | « no previous file | runtime/vm/code_generator_ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/error.cc
===================================================================
--- runtime/lib/error.cc (revision 1367)
+++ runtime/lib/error.cc (working copy)
@@ -12,6 +12,7 @@
namespace dart {
+DEFINE_FLAG(bool, trace_type_checks, false, "Trace runtime type checks.");
DECLARE_FLAG(bool, print_stack_trace_at_throw);
@@ -213,6 +214,17 @@
ThrowTypeError(location, src_type_name, dst_type_name, dst_name);
UNREACHABLE();
}
+
+ if (FLAG_trace_type_checks) {
+ Class& cls = Class::Handle(src_instance.clazz());
+ // TODO(regis): Remove once all classes finalized.
+ if (cls.is_finalized()) {
+ OS::Print("TypeCheck '%s' vs '%s'\n",
+ String::Handle(Type::Handle(src_instance.GetType()).Name()).
+ ToCString(),
+ String::Handle(dst_type.Name()).ToCString());
+ }
+ }
arguments.SetReturn(src_instance);
}
« no previous file with comments | « no previous file | runtime/vm/code_generator_ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698