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/intrinsifier.h" | 8 #include "vm/intrinsifier.h" |
9 | 9 |
10 #include "vm/assembler.h" | 10 #include "vm/assembler.h" |
(...skipping 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1563 void Intrinsifier::ObjectEquals(Assembler* assembler) { | 1563 void Intrinsifier::ObjectEquals(Assembler* assembler) { |
1564 __ ldr(R0, Address(SP, 0 * kWordSize)); | 1564 __ ldr(R0, Address(SP, 0 * kWordSize)); |
1565 __ ldr(R1, Address(SP, 1 * kWordSize)); | 1565 __ ldr(R1, Address(SP, 1 * kWordSize)); |
1566 __ cmp(R0, Operand(R1)); | 1566 __ cmp(R0, Operand(R1)); |
1567 __ LoadObject(R0, Bool::False(), NE); | 1567 __ LoadObject(R0, Bool::False(), NE); |
1568 __ LoadObject(R0, Bool::True(), EQ); | 1568 __ LoadObject(R0, Bool::True(), EQ); |
1569 __ Ret(); | 1569 __ Ret(); |
1570 } | 1570 } |
1571 | 1571 |
1572 | 1572 |
| 1573 // Return type quickly for simple types (not parameterized and not signature). |
| 1574 void Intrinsifier::ObjectRuntimeType(Assembler* assembler) { |
| 1575 Label fall_through; |
| 1576 static const intptr_t kSmiCidSource = kSmiCid << RawObject::kClassIdTagPos; |
| 1577 __ ldr(R0, Address(SP, 0 * kWordSize)); |
| 1578 |
| 1579 __ LoadImmediate(TMP, reinterpret_cast<int32_t>(&kSmiCidSource) + 1); |
| 1580 __ tst(R0, Operand(kSmiTagMask)); |
| 1581 __ mov(TMP, Operand(R0), NE); |
| 1582 __ LoadClassId(R1, TMP); |
| 1583 __ LoadClassById(R2, R1); |
| 1584 // R2: class of instance (R0). |
| 1585 __ ldr(R3, FieldAddress(R2, Class::signature_function_offset())); |
| 1586 __ CompareImmediate(R3, reinterpret_cast<int32_t>(Object::null())); |
| 1587 __ b(&fall_through, NE); |
| 1588 |
| 1589 __ ldrh(R3, FieldAddress(R2, Class::num_type_arguments_offset())); |
| 1590 __ CompareImmediate(R3, 0); |
| 1591 __ b(&fall_through, NE); |
| 1592 |
| 1593 __ ldr(R0, FieldAddress(R2, Class::canonical_types_offset())); |
| 1594 __ CompareImmediate(R0, reinterpret_cast<int32_t>(Object::null())); |
| 1595 __ b(&fall_through, EQ); |
| 1596 __ Ret(); |
| 1597 |
| 1598 __ Bind(&fall_through); |
| 1599 } |
| 1600 |
| 1601 |
1573 void Intrinsifier::String_getHashCode(Assembler* assembler) { | 1602 void Intrinsifier::String_getHashCode(Assembler* assembler) { |
1574 __ ldr(R0, Address(SP, 0 * kWordSize)); | 1603 __ ldr(R0, Address(SP, 0 * kWordSize)); |
1575 __ ldr(R0, FieldAddress(R0, String::hash_offset())); | 1604 __ ldr(R0, FieldAddress(R0, String::hash_offset())); |
1576 __ cmp(R0, Operand(0)); | 1605 __ cmp(R0, Operand(0)); |
1577 __ bx(LR, NE); // Hash not yet computed. | 1606 __ bx(LR, NE); // Hash not yet computed. |
1578 } | 1607 } |
1579 | 1608 |
1580 | 1609 |
1581 void Intrinsifier::StringBaseCodeUnitAt(Assembler* assembler) { | 1610 void Intrinsifier::StringBaseCodeUnitAt(Assembler* assembler) { |
1582 Label fall_through, try_two_byte_string; | 1611 Label fall_through, try_two_byte_string; |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2027 Isolate* isolate = Isolate::Current(); | 2056 Isolate* isolate = Isolate::Current(); |
2028 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); | 2057 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); |
2029 // Set return value to Isolate::current_tag_. | 2058 // Set return value to Isolate::current_tag_. |
2030 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); | 2059 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); |
2031 __ Ret(); | 2060 __ Ret(); |
2032 } | 2061 } |
2033 | 2062 |
2034 } // namespace dart | 2063 } // namespace dart |
2035 | 2064 |
2036 #endif // defined TARGET_ARCH_ARM | 2065 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |