OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/globals.h" // Needed here to get TARGET_ARCH_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
7 | 7 |
8 #include "vm/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
9 | 9 |
10 #include "vm/ast_printer.h" | 10 #include "vm/ast_printer.h" |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 FlowGraphCompiler::GenerateInstantiatedTypeWithArgumentsTest( | 272 FlowGraphCompiler::GenerateInstantiatedTypeWithArgumentsTest( |
273 intptr_t token_pos, | 273 intptr_t token_pos, |
274 const AbstractType& type, | 274 const AbstractType& type, |
275 Label* is_instance_lbl, | 275 Label* is_instance_lbl, |
276 Label* is_not_instance_lbl) { | 276 Label* is_not_instance_lbl) { |
277 __ Comment("InstantiatedTypeWithArgumentsTest"); | 277 __ Comment("InstantiatedTypeWithArgumentsTest"); |
278 ASSERT(type.IsInstantiated()); | 278 ASSERT(type.IsInstantiated()); |
279 const Class& type_class = Class::ZoneHandle(zone(), type.type_class()); | 279 const Class& type_class = Class::ZoneHandle(zone(), type.type_class()); |
280 ASSERT((type_class.NumTypeArguments() > 0) || type_class.IsSignatureClass()); | 280 ASSERT((type_class.NumTypeArguments() > 0) || type_class.IsSignatureClass()); |
281 const Register kInstanceReg = EAX; | 281 const Register kInstanceReg = EAX; |
282 Error& malformed_error = Error::Handle(zone()); | 282 Error& bound_error = Error::Handle(zone()); |
283 const Type& int_type = Type::Handle(zone(), Type::IntType()); | 283 const Type& int_type = Type::Handle(zone(), Type::IntType()); |
284 const bool smi_is_ok = | 284 const bool smi_is_ok = int_type.IsSubtypeOf(type, &bound_error, Heap::kOld); |
285 int_type.IsSubtypeOf(type, &malformed_error, Heap::kOld); | |
286 // Malformed type should have been handled at graph construction time. | 285 // Malformed type should have been handled at graph construction time. |
287 ASSERT(smi_is_ok || malformed_error.IsNull()); | 286 ASSERT(smi_is_ok || bound_error.IsNull()); |
288 __ testl(kInstanceReg, Immediate(kSmiTagMask)); | 287 __ testl(kInstanceReg, Immediate(kSmiTagMask)); |
289 if (smi_is_ok) { | 288 if (smi_is_ok) { |
290 __ j(ZERO, is_instance_lbl); | 289 __ j(ZERO, is_instance_lbl); |
291 } else { | 290 } else { |
292 __ j(ZERO, is_not_instance_lbl); | 291 __ j(ZERO, is_not_instance_lbl); |
293 } | 292 } |
294 const intptr_t num_type_args = type_class.NumTypeArguments(); | 293 const intptr_t num_type_args = type_class.NumTypeArguments(); |
295 const intptr_t num_type_params = type_class.NumTypeParameters(); | 294 const intptr_t num_type_params = type_class.NumTypeParameters(); |
296 const intptr_t from_index = num_type_args - num_type_params; | 295 const intptr_t from_index = num_type_args - num_type_params; |
297 const TypeArguments& type_arguments = | 296 const TypeArguments& type_arguments = |
(...skipping 1541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1839 __ movups(reg, Address(ESP, 0)); | 1838 __ movups(reg, Address(ESP, 0)); |
1840 __ addl(ESP, Immediate(kFpuRegisterSize)); | 1839 __ addl(ESP, Immediate(kFpuRegisterSize)); |
1841 } | 1840 } |
1842 | 1841 |
1843 | 1842 |
1844 #undef __ | 1843 #undef __ |
1845 | 1844 |
1846 } // namespace dart | 1845 } // namespace dart |
1847 | 1846 |
1848 #endif // defined TARGET_ARCH_IA32 | 1847 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |