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

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

Issue 8742028: Use ParametrizedType instead of Type where appropriate. Expand ToCString of type related classes. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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 | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/object.h » ('j') | 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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 ASSERT(arguments.Count() == kInstanceofRuntimeEntry.argument_count()); 319 ASSERT(arguments.Count() == kInstanceofRuntimeEntry.argument_count());
320 const Instance& instance = Instance::CheckedHandle(arguments.At(0)); 320 const Instance& instance = Instance::CheckedHandle(arguments.At(0));
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 const Bool& result = Bool::Handle( 325 const Bool& result = Bool::Handle(
326 instance.IsInstanceOf(type, type_instantiator) ? 326 instance.IsInstanceOf(type, type_instantiator) ?
327 Bool::True() : Bool::False()); 327 Bool::True() : Bool::False());
328 if (FLAG_trace_type_checks) { 328 if (FLAG_trace_type_checks) {
329 const Type& instance_type = Type::Handle(instance.GetType()); 329 const ParameterizedType& instance_type =
330 ParameterizedType::Handle(instance.GetType());
331 ASSERT(instance_type.IsInstantiated());
330 if (type.IsInstantiated()) { 332 if (type.IsInstantiated()) {
331 OS::Print("InstanceOf: '%s' %s '%s'\n", 333 OS::Print("InstanceOf: '%s' %s '%s'\n",
332 String::Handle(instance_type.Name()).ToCString(), 334 String::Handle(instance_type.Name()).ToCString(),
333 (result.raw() == Bool::True()) ? "is" : "is !", 335 (result.raw() == Bool::True()) ? "is" : "is !",
334 String::Handle(type.Name()).ToCString()); 336 String::Handle(type.Name()).ToCString());
335 } else { 337 } else {
336 // Instantiate type before printing. 338 // Instantiate type before printing.
337 const Type& instantiated_type = 339 const Type& instantiated_type =
338 Type::Handle(type.InstantiateFrom(type_instantiator, 0)); 340 Type::Handle(type.InstantiateFrom(type_instantiator, 0));
339 OS::Print("InstanceOf: '%s' %s '%s' instantiated from '%s'\n", 341 OS::Print("InstanceOf: '%s' %s '%s' instantiated from '%s'\n",
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 } 1032 }
1031 } 1033 }
1032 } 1034 }
1033 // The cache is null terminated, therefore the loop above should never 1035 // The cache is null terminated, therefore the loop above should never
1034 // terminate by itself. 1036 // terminate by itself.
1035 UNREACHABLE(); 1037 UNREACHABLE();
1036 return Code::null(); 1038 return Code::null();
1037 } 1039 }
1038 1040
1039 } // namespace dart 1041 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698