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

Unified Diff: runtime/lib/object.cc

Issue 18807007: Fix wrong type test optimization when testing against a signature class: we must always consider th… (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 | « no previous file | runtime/vm/code_generator.cc » ('j') | runtime/vm/flow_graph_compiler_arm.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/object.cc
===================================================================
--- runtime/lib/object.cc (revision 24922)
+++ runtime/lib/object.cc (working copy)
@@ -14,6 +14,7 @@
namespace dart {
DECLARE_FLAG(bool, enable_type_checks);
+DECLARE_FLAG(bool, trace_type_checks);
DEFINE_NATIVE_ENTRY(Object_cid, 1) {
@@ -127,7 +128,18 @@
Symbols::Empty(), malformed_error_message);
UNREACHABLE();
}
- return Bool::Get(negate.value() ? !is_instance_of : is_instance_of);
+ const Bool& result = Bool::Handle(
regis 2013/07/12 00:29:31 You could spare the handle creation that you just
srdjan 2013/07/12 16:56:11 Done.
+ Bool::Get(negate.value() ? !is_instance_of : is_instance_of));
+ if (FLAG_trace_type_checks) {
+ OS::Print("Object.instanceOf: result %s\n", result.ToCString());
+ 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 result.raw();
}
« no previous file with comments | « no previous file | runtime/vm/code_generator.cc » ('j') | runtime/vm/flow_graph_compiler_arm.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698