| 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_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
| 6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 intptr_t token_pos, | 498 intptr_t token_pos, |
| 499 const AbstractType& type, | 499 const AbstractType& type, |
| 500 Label* is_instance_lbl, | 500 Label* is_instance_lbl, |
| 501 Label* is_not_instance_lbl) { | 501 Label* is_not_instance_lbl) { |
| 502 __ Comment("InlineInstanceof"); | 502 __ Comment("InlineInstanceof"); |
| 503 if (type.IsVoidType()) { | 503 if (type.IsVoidType()) { |
| 504 // A non-null value is returned from a void function, which will result in a | 504 // A non-null value is returned from a void function, which will result in a |
| 505 // type error. A null value is handled prior to executing this inline code. | 505 // type error. A null value is handled prior to executing this inline code. |
| 506 return SubtypeTestCache::null(); | 506 return SubtypeTestCache::null(); |
| 507 } | 507 } |
| 508 if (TypeCheckAsClassEquality(type)) { | |
| 509 const intptr_t type_cid = Class::Handle(type.type_class()).id(); | |
| 510 const Register kInstanceReg = R0; | |
| 511 __ tst(kInstanceReg, ShifterOperand(kSmiTagMask)); | |
| 512 if (type_cid == kSmiCid) { | |
| 513 __ b(is_instance_lbl, EQ); | |
| 514 } else { | |
| 515 __ b(is_not_instance_lbl, EQ); | |
| 516 __ CompareClassId(kInstanceReg, type_cid, R3); | |
| 517 __ b(is_instance_lbl, EQ); | |
| 518 } | |
| 519 __ b(is_not_instance_lbl); | |
| 520 return SubtypeTestCache::null(); | |
| 521 } | |
| 522 if (type.IsInstantiated()) { | 508 if (type.IsInstantiated()) { |
| 523 const Class& type_class = Class::ZoneHandle(type.type_class()); | 509 const Class& type_class = Class::ZoneHandle(type.type_class()); |
| 524 // A class equality check is only applicable with a dst type of a | 510 // A class equality check is only applicable with a dst type of a |
| 525 // non-parameterized class, non-signature class, or with a raw dst type of | 511 // non-parameterized class, non-signature class, or with a raw dst type of |
| 526 // a parameterized class. | 512 // a parameterized class. |
| 527 if (type_class.IsSignatureClass() || (type_class.NumTypeArguments() > 0)) { | 513 if (type_class.IsSignatureClass() || (type_class.NumTypeArguments() > 0)) { |
| 528 return GenerateInstantiatedTypeWithArgumentsTest(token_pos, | 514 return GenerateInstantiatedTypeWithArgumentsTest(token_pos, |
| 529 type, | 515 type, |
| 530 is_instance_lbl, | 516 is_instance_lbl, |
| 531 is_not_instance_lbl); | 517 is_not_instance_lbl); |
| (...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1823 DRegister dreg = EvenDRegisterOf(reg); | 1809 DRegister dreg = EvenDRegisterOf(reg); |
| 1824 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); | 1810 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); |
| 1825 } | 1811 } |
| 1826 | 1812 |
| 1827 | 1813 |
| 1828 #undef __ | 1814 #undef __ |
| 1829 | 1815 |
| 1830 } // namespace dart | 1816 } // namespace dart |
| 1831 | 1817 |
| 1832 #endif // defined TARGET_ARCH_ARM | 1818 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |