| 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_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
| 6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
| 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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 FlowGraphCompiler::GenerateInstantiatedTypeWithArgumentsTest( | 260 FlowGraphCompiler::GenerateInstantiatedTypeWithArgumentsTest( |
| 261 intptr_t token_pos, | 261 intptr_t token_pos, |
| 262 const AbstractType& type, | 262 const AbstractType& type, |
| 263 Label* is_instance_lbl, | 263 Label* is_instance_lbl, |
| 264 Label* is_not_instance_lbl) { | 264 Label* is_not_instance_lbl) { |
| 265 __ Comment("InstantiatedTypeWithArgumentsTest"); | 265 __ Comment("InstantiatedTypeWithArgumentsTest"); |
| 266 ASSERT(type.IsInstantiated()); | 266 ASSERT(type.IsInstantiated()); |
| 267 const Class& type_class = Class::ZoneHandle(zone(), type.type_class()); | 267 const Class& type_class = Class::ZoneHandle(zone(), type.type_class()); |
| 268 ASSERT((type_class.NumTypeArguments() > 0) || type_class.IsSignatureClass()); | 268 ASSERT((type_class.NumTypeArguments() > 0) || type_class.IsSignatureClass()); |
| 269 const Register kInstanceReg = A0; | 269 const Register kInstanceReg = A0; |
| 270 Error& malformed_error = Error::Handle(zone()); | 270 Error& bound_error = Error::Handle(zone()); |
| 271 const Type& int_type = Type::Handle(zone(), Type::IntType()); | 271 const Type& int_type = Type::Handle(zone(), Type::IntType()); |
| 272 const bool smi_is_ok = | 272 const bool smi_is_ok = int_type.IsSubtypeOf(type, &bound_error, Heap::kOld); |
| 273 int_type.IsSubtypeOf(type, &malformed_error, Heap::kOld); | |
| 274 // Malformed type should have been handled at graph construction time. | 273 // Malformed type should have been handled at graph construction time. |
| 275 ASSERT(smi_is_ok || malformed_error.IsNull()); | 274 ASSERT(smi_is_ok || bound_error.IsNull()); |
| 276 __ andi(CMPRES1, kInstanceReg, Immediate(kSmiTagMask)); | 275 __ andi(CMPRES1, kInstanceReg, Immediate(kSmiTagMask)); |
| 277 if (smi_is_ok) { | 276 if (smi_is_ok) { |
| 278 __ beq(CMPRES1, ZR, is_instance_lbl); | 277 __ beq(CMPRES1, ZR, is_instance_lbl); |
| 279 } else { | 278 } else { |
| 280 __ beq(CMPRES1, ZR, is_not_instance_lbl); | 279 __ beq(CMPRES1, ZR, is_not_instance_lbl); |
| 281 } | 280 } |
| 282 const intptr_t num_type_args = type_class.NumTypeArguments(); | 281 const intptr_t num_type_args = type_class.NumTypeArguments(); |
| 283 const intptr_t num_type_params = type_class.NumTypeParameters(); | 282 const intptr_t num_type_params = type_class.NumTypeParameters(); |
| 284 const intptr_t from_index = num_type_args - num_type_params; | 283 const intptr_t from_index = num_type_args - num_type_params; |
| 285 const TypeArguments& type_arguments = | 284 const TypeArguments& type_arguments = |
| (...skipping 1611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1897 __ AddImmediate(SP, kDoubleSize); | 1896 __ AddImmediate(SP, kDoubleSize); |
| 1898 } | 1897 } |
| 1899 | 1898 |
| 1900 | 1899 |
| 1901 #undef __ | 1900 #undef __ |
| 1902 | 1901 |
| 1903 | 1902 |
| 1904 } // namespace dart | 1903 } // namespace dart |
| 1905 | 1904 |
| 1906 #endif // defined TARGET_ARCH_MIPS | 1905 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |