Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(493)

Side by Side Diff: runtime/vm/intrinsifier_arm64.cc

Issue 1217323002: Intrinsic version of Object.runtimeType (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: more Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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_ARM64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
6 #if defined(TARGET_ARCH_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
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 1628 matching lines...) Expand 10 before | Expand all | Expand 10 after
1639 __ ldr(R0, Address(SP, 0 * kWordSize)); 1639 __ ldr(R0, Address(SP, 0 * kWordSize));
1640 __ ldr(R1, Address(SP, 1 * kWordSize)); 1640 __ ldr(R1, Address(SP, 1 * kWordSize));
1641 __ cmp(R0, Operand(R1)); 1641 __ cmp(R0, Operand(R1));
1642 __ LoadObject(R0, Bool::False(), PP); 1642 __ LoadObject(R0, Bool::False(), PP);
1643 __ LoadObject(TMP, Bool::True(), PP); 1643 __ LoadObject(TMP, Bool::True(), PP);
1644 __ csel(R0, TMP, R0, EQ); 1644 __ csel(R0, TMP, R0, EQ);
1645 __ ret(); 1645 __ ret();
1646 } 1646 }
1647 1647
1648 1648
1649 // Return type quickly for simple types (not parameterized and not signature).
1650 void Intrinsifier::ObjectRuntimeType(Assembler* assembler) {
1651 Label fall_through;
1652 __ ldr(R0, Address(SP, 0 * kWordSize));
1653 __ LoadClassIdMayBeSmi(R1, R0);
1654 __ LoadClassById(R2, R1, PP);
1655 // R2: class of instance (R0).
1656 __ ldr(R3, FieldAddress(R2, Class::signature_function_offset()));
1657 __ CompareObject(R3, Object::null_object(), PP);
1658 __ b(&fall_through, NE);
1659
1660 __ ldr(R3, FieldAddress(R2, Class::num_type_arguments_offset()), kHalfword);
1661 __ CompareImmediate(R3, 0, kNoPP);
1662 __ b(&fall_through, NE);
1663
1664 __ ldr(R0, FieldAddress(R2, Class::canonical_types_offset()));
1665 __ CompareObject(R0, Object::null_object(), PP);
1666 __ b(&fall_through, EQ);
1667 __ ret();
1668
1669 __ Bind(&fall_through);
1670 }
1671
1672
1649 void Intrinsifier::String_getHashCode(Assembler* assembler) { 1673 void Intrinsifier::String_getHashCode(Assembler* assembler) {
1650 Label fall_through; 1674 Label fall_through;
1651 __ ldr(R0, Address(SP, 0 * kWordSize)); 1675 __ ldr(R0, Address(SP, 0 * kWordSize));
1652 __ ldr(R0, FieldAddress(R0, String::hash_offset())); 1676 __ ldr(R0, FieldAddress(R0, String::hash_offset()));
1653 __ CompareRegisters(R0, ZR); 1677 __ CompareRegisters(R0, ZR);
1654 __ b(&fall_through, EQ); 1678 __ b(&fall_through, EQ);
1655 __ ret(); 1679 __ ret();
1656 // Hash not yet computed. 1680 // Hash not yet computed.
1657 __ Bind(&fall_through); 1681 __ Bind(&fall_through);
1658 } 1682 }
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
2109 Isolate* isolate = Isolate::Current(); 2133 Isolate* isolate = Isolate::Current();
2110 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate), kNoPP); 2134 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate), kNoPP);
2111 // Set return value to Isolate::current_tag_. 2135 // Set return value to Isolate::current_tag_.
2112 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); 2136 __ ldr(R0, Address(R1, Isolate::current_tag_offset()));
2113 __ ret(); 2137 __ ret();
2114 } 2138 }
2115 2139
2116 } // namespace dart 2140 } // namespace dart
2117 2141
2118 #endif // defined TARGET_ARCH_ARM64 2142 #endif // defined TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698