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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 FlowGraphCompiler::GenerateInstantiatedTypeWithArgumentsTest( | 269 FlowGraphCompiler::GenerateInstantiatedTypeWithArgumentsTest( |
270 intptr_t token_pos, | 270 intptr_t token_pos, |
271 const AbstractType& type, | 271 const AbstractType& type, |
272 Label* is_instance_lbl, | 272 Label* is_instance_lbl, |
273 Label* is_not_instance_lbl) { | 273 Label* is_not_instance_lbl) { |
274 __ Comment("InstantiatedTypeWithArgumentsTest"); | 274 __ Comment("InstantiatedTypeWithArgumentsTest"); |
275 ASSERT(type.IsInstantiated()); | 275 ASSERT(type.IsInstantiated()); |
276 const Class& type_class = Class::ZoneHandle(zone(), type.type_class()); | 276 const Class& type_class = Class::ZoneHandle(zone(), type.type_class()); |
277 ASSERT((type_class.NumTypeArguments() > 0) || type_class.IsSignatureClass()); | 277 ASSERT((type_class.NumTypeArguments() > 0) || type_class.IsSignatureClass()); |
278 const Register kInstanceReg = RAX; | 278 const Register kInstanceReg = RAX; |
279 Error& malformed_error = Error::Handle(zone()); | 279 Error& bound_error = Error::Handle(zone()); |
280 const Type& int_type = Type::Handle(zone(), Type::IntType()); | 280 const Type& int_type = Type::Handle(zone(), Type::IntType()); |
281 const bool smi_is_ok = | 281 const bool smi_is_ok = int_type.IsSubtypeOf(type, &bound_error, Heap::kOld); |
282 int_type.IsSubtypeOf(type, &malformed_error, Heap::kOld); | |
283 // Malformed type should have been handled at graph construction time. | 282 // Malformed type should have been handled at graph construction time. |
284 ASSERT(smi_is_ok || malformed_error.IsNull()); | 283 ASSERT(smi_is_ok || bound_error.IsNull()); |
285 __ testq(kInstanceReg, Immediate(kSmiTagMask)); | 284 __ testq(kInstanceReg, Immediate(kSmiTagMask)); |
286 if (smi_is_ok) { | 285 if (smi_is_ok) { |
287 __ j(ZERO, is_instance_lbl); | 286 __ j(ZERO, is_instance_lbl); |
288 } else { | 287 } else { |
289 __ j(ZERO, is_not_instance_lbl); | 288 __ j(ZERO, is_not_instance_lbl); |
290 } | 289 } |
291 const intptr_t num_type_args = type_class.NumTypeArguments(); | 290 const intptr_t num_type_args = type_class.NumTypeArguments(); |
292 const intptr_t num_type_params = type_class.NumTypeParameters(); | 291 const intptr_t num_type_params = type_class.NumTypeParameters(); |
293 const intptr_t from_index = num_type_args - num_type_params; | 292 const intptr_t from_index = num_type_args - num_type_params; |
294 const TypeArguments& type_arguments = | 293 const TypeArguments& type_arguments = |
(...skipping 1516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1811 __ movups(reg, Address(RSP, 0)); | 1810 __ movups(reg, Address(RSP, 0)); |
1812 __ AddImmediate(RSP, Immediate(kFpuRegisterSize)); | 1811 __ AddImmediate(RSP, Immediate(kFpuRegisterSize)); |
1813 } | 1812 } |
1814 | 1813 |
1815 | 1814 |
1816 #undef __ | 1815 #undef __ |
1817 | 1816 |
1818 } // namespace dart | 1817 } // namespace dart |
1819 | 1818 |
1820 #endif // defined TARGET_ARCH_X64 | 1819 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |