| OLD | NEW |
| 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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 const AbstractTypeArguments& type_instantiator = | 322 const AbstractTypeArguments& type_instantiator = |
| 323 AbstractTypeArguments::CheckedHandle(arguments.At(2)); | 323 AbstractTypeArguments::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 Type& instance_type = Type::Handle(instance.GetType()); |
| 330 ASSERT(instance_type.IsInstantiated()); | 330 ASSERT(instance_type.IsInstantiated()); |
| 331 if (type.IsInstantiated()) { | 331 if (type.IsInstantiated()) { |
| 332 OS::Print("InstanceOf: '%s' %s '%s'\n", | 332 OS::Print("InstanceOf: '%s' %s '%s'.\n", |
| 333 String::Handle(instance_type.Name()).ToCString(), | 333 String::Handle(instance_type.Name()).ToCString(), |
| 334 (result.raw() == Bool::True()) ? "is" : "is !", | 334 (result.raw() == Bool::True()) ? "is" : "is !", |
| 335 String::Handle(type.Name()).ToCString()); | 335 String::Handle(type.Name()).ToCString()); |
| 336 } else { | 336 } else { |
| 337 // Instantiate type before printing. | 337 // Instantiate type before printing. |
| 338 const AbstractType& instantiated_type = | 338 const AbstractType& instantiated_type = |
| 339 AbstractType::Handle(type.InstantiateFrom(type_instantiator, 0)); | 339 AbstractType::Handle(type.InstantiateFrom(type_instantiator)); |
| 340 OS::Print("InstanceOf: '%s' %s '%s' instantiated from '%s'\n", | 340 OS::Print("InstanceOf: '%s' %s '%s' instantiated from '%s'.\n", |
| 341 String::Handle(instance_type.Name()).ToCString(), | 341 String::Handle(instance_type.Name()).ToCString(), |
| 342 (result.raw() == Bool::True()) ? "is" : "is !", | 342 (result.raw() == Bool::True()) ? "is" : "is !", |
| 343 String::Handle(instantiated_type.Name()).ToCString(), | 343 String::Handle(instantiated_type.Name()).ToCString(), |
| 344 String::Handle(type.Name()).ToCString()); | 344 String::Handle(type.Name()).ToCString()); |
| 345 } | 345 } |
| 346 } | 346 } |
| 347 arguments.SetReturn(result); | 347 arguments.SetReturn(result); |
| 348 } | 348 } |
| 349 | 349 |
| 350 | 350 |
| (...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1038 } | 1038 } |
| 1039 } | 1039 } |
| 1040 } | 1040 } |
| 1041 // The cache is null terminated, therefore the loop above should never | 1041 // The cache is null terminated, therefore the loop above should never |
| 1042 // terminate by itself. | 1042 // terminate by itself. |
| 1043 UNREACHABLE(); | 1043 UNREACHABLE(); |
| 1044 return Code::null(); | 1044 return Code::null(); |
| 1045 } | 1045 } |
| 1046 | 1046 |
| 1047 } // namespace dart | 1047 } // namespace dart |
| OLD | NEW |