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

Side by Side Diff: runtime/vm/code_generator.cc

Issue 8598023: Print uninstantiated type with --trace_type_checks for instanceof (easier to identify what caused... (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/code_generator.h" 5 #include "vm/code_generator.h"
6 6
7 #include "vm/code_index_table.h" 7 #include "vm/code_index_table.h"
8 #include "vm/code_patcher.h" 8 #include "vm/code_patcher.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart_api_impl.h" 10 #include "vm/dart_api_impl.h"
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 const Type& type = Type::CheckedHandle(arguments.At(1)); 321 const Type& type = Type::CheckedHandle(arguments.At(1));
322 const TypeArguments& type_instantiator = 322 const TypeArguments& type_instantiator =
323 TypeArguments::CheckedHandle(arguments.At(2)); 323 TypeArguments::CheckedHandle(arguments.At(2));
324 ASSERT(type.IsFinalized()); 324 ASSERT(type.IsFinalized());
325 ASSERT(!instance.IsNull()); 325 ASSERT(!instance.IsNull());
326 const Bool& result = Bool::Handle( 326 const Bool& result = Bool::Handle(
327 instance.IsInstanceOf(type, type_instantiator) ? 327 instance.IsInstanceOf(type, type_instantiator) ?
328 Bool::True() : Bool::False()); 328 Bool::True() : Bool::False());
329 if (FLAG_trace_type_checks) { 329 if (FLAG_trace_type_checks) {
330 const Type& instance_type = Type::Handle(instance.GetType()); 330 const Type& instance_type = Type::Handle(instance.GetType());
331 Type& instantiated_type = Type::Handle(type.raw()); 331 if (type.IsInstantiated()) {
332 if (!type.IsInstantiated()) { 332 OS::Print("InstanceOf: '%s' %s '%s'\n",
333 String::Handle(instance_type.Name()).ToCString(),
334 (result.raw() == Bool::True()) ? "is" : "is !",
335 String::Handle(type.Name()).ToCString());
336 } else {
333 // Instantiate type before printing. 337 // Instantiate type before printing.
334 instantiated_type = type.InstantiateFrom(type_instantiator, 0); 338 const Type& instantiated_type =
339 Type::Handle(type.InstantiateFrom(type_instantiator, 0));
340 OS::Print("InstanceOf: '%s' %s '%s (%s)'\n",
regis 2011/11/18 22:26:18 Using parenthesis to display the uninstantiated ty
srdjan 2011/11/18 22:49:55 Changed to output of fromm: InstanceOf: 'Smi' is
341 String::Handle(instance_type.Name()).ToCString(),
342 (result.raw() == Bool::True()) ? "is" : "is !",
343 String::Handle(instantiated_type.Name()).ToCString(),
344 String::Handle(type.Name()).ToCString());
335 } 345 }
336 OS::Print("InstanceOf: '%s' %s '%s'\n",
337 String::Handle(instance_type.Name()).ToCString(),
338 (result.raw() == Bool::True()) ? "is" : "is !",
339 String::Handle(instantiated_type.Name()).ToCString());
340 } 346 }
341 arguments.SetReturn(result); 347 arguments.SetReturn(result);
342 } 348 }
343 349
344 350
345 DEFINE_RUNTIME_ENTRY(Throw, 1) { 351 DEFINE_RUNTIME_ENTRY(Throw, 1) {
346 ASSERT(arguments.Count() == kThrowRuntimeEntry.argument_count()); 352 ASSERT(arguments.Count() == kThrowRuntimeEntry.argument_count());
347 const Instance& exception = Instance::CheckedHandle(arguments.At(0)); 353 const Instance& exception = Instance::CheckedHandle(arguments.At(0));
348 Exceptions::Throw(exception); 354 Exceptions::Throw(exception);
349 } 355 }
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 } 1013 }
1008 } 1014 }
1009 } 1015 }
1010 // The cache is null terminated, therefore the loop above should never 1016 // The cache is null terminated, therefore the loop above should never
1011 // terminate by itself. 1017 // terminate by itself.
1012 UNREACHABLE(); 1018 UNREACHABLE();
1013 return Code::null(); 1019 return Code::null();
1014 } 1020 }
1015 1021
1016 } // namespace dart 1022 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698