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

Unified 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, 6 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/intrinsifier_arm64.cc
diff --git a/runtime/vm/intrinsifier_arm64.cc b/runtime/vm/intrinsifier_arm64.cc
index fedbe17236dfc543157c04634e21194abae71a56..92b65799dc43bc2a4d676bdf467367921b20217f 100644
--- a/runtime/vm/intrinsifier_arm64.cc
+++ b/runtime/vm/intrinsifier_arm64.cc
@@ -1646,6 +1646,30 @@ void Intrinsifier::ObjectEquals(Assembler* assembler) {
}
+// Return type quickly for simple types (not parameterized and not signature).
+void Intrinsifier::ObjectRuntimeType(Assembler* assembler) {
+ Label fall_through;
+ __ ldr(R0, Address(SP, 0 * kWordSize));
+ __ LoadClassIdMayBeSmi(R1, R0);
+ __ LoadClassById(R2, R1, PP);
+ // R2: class of instance (R0).
+ __ ldr(R3, FieldAddress(R2, Class::signature_function_offset()));
+ __ CompareObject(R3, Object::null_object(), PP);
+ __ b(&fall_through, NE);
+
+ __ ldr(R3, FieldAddress(R2, Class::num_type_arguments_offset()), kHalfword);
+ __ CompareImmediate(R3, 0, kNoPP);
+ __ b(&fall_through, NE);
+
+ __ ldr(R0, FieldAddress(R2, Class::canonical_types_offset()));
+ __ CompareObject(R0, Object::null_object(), PP);
+ __ b(&fall_through, EQ);
+ __ ret();
+
+ __ Bind(&fall_through);
+}
+
+
void Intrinsifier::String_getHashCode(Assembler* assembler) {
Label fall_through;
__ ldr(R0, Address(SP, 0 * kWordSize));

Powered by Google App Engine
This is Rietveld 408576698