Chromium Code Reviews| 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(); |
| } |