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

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

Issue 8761011: Renaming type classes as discussed: (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
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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 311
312 // Check that the given instance is an instance of the given type. 312 // Check that the given instance is an instance of the given type.
313 // Tested instance may not be null, because the null test is inlined. 313 // Tested instance may not be null, because the null test is inlined.
314 // Arg0: instance being checked. 314 // Arg0: instance being checked.
315 // Arg1: type. 315 // Arg1: type.
316 // Arg2: type arguments of the instantiator of the type. 316 // Arg2: type arguments of the instantiator of the type.
317 // Return value: true or false. 317 // Return value: true or false.
318 DEFINE_RUNTIME_ENTRY(Instanceof, 3) { 318 DEFINE_RUNTIME_ENTRY(Instanceof, 3) {
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 AbstractType& type = AbstractType::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 ParameterizedType& instance_type = 329 const Type& instance_type = Type::Handle(instance.GetType());
330 ParameterizedType::Handle(instance.GetType());
331 ASSERT(instance_type.IsInstantiated()); 330 ASSERT(instance_type.IsInstantiated());
332 if (type.IsInstantiated()) { 331 if (type.IsInstantiated()) {
333 OS::Print("InstanceOf: '%s' %s '%s'\n", 332 OS::Print("InstanceOf: '%s' %s '%s'\n",
334 String::Handle(instance_type.Name()).ToCString(), 333 String::Handle(instance_type.Name()).ToCString(),
335 (result.raw() == Bool::True()) ? "is" : "is !", 334 (result.raw() == Bool::True()) ? "is" : "is !",
336 String::Handle(type.Name()).ToCString()); 335 String::Handle(type.Name()).ToCString());
337 } else { 336 } else {
338 // Instantiate type before printing. 337 // Instantiate type before printing.
339 const Type& instantiated_type = 338 const AbstractType& instantiated_type =
340 Type::Handle(type.InstantiateFrom(type_instantiator, 0)); 339 AbstractType::Handle(type.InstantiateFrom(type_instantiator, 0));
341 OS::Print("InstanceOf: '%s' %s '%s' instantiated from '%s'\n", 340 OS::Print("InstanceOf: '%s' %s '%s' instantiated from '%s'\n",
342 String::Handle(instance_type.Name()).ToCString(), 341 String::Handle(instance_type.Name()).ToCString(),
343 (result.raw() == Bool::True()) ? "is" : "is !", 342 (result.raw() == Bool::True()) ? "is" : "is !",
344 String::Handle(instantiated_type.Name()).ToCString(), 343 String::Handle(instantiated_type.Name()).ToCString(),
345 String::Handle(type.Name()).ToCString()); 344 String::Handle(type.Name()).ToCString());
346 } 345 }
347 } 346 }
348 arguments.SetReturn(result); 347 arguments.SetReturn(result);
349 } 348 }
350 349
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
1032 } 1031 }
1033 } 1032 }
1034 } 1033 }
1035 // The cache is null terminated, therefore the loop above should never 1034 // The cache is null terminated, therefore the loop above should never
1036 // terminate by itself. 1035 // terminate by itself.
1037 UNREACHABLE(); 1036 UNREACHABLE();
1038 return Code::null(); 1037 return Code::null();
1039 } 1038 }
1040 1039
1041 } // namespace dart 1040 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698