@@ -925,6 +925,52 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
925
925
}
926
926
break ;
927
927
928
+ case C1StubId::is_instance_of_id:
929
+ {
930
+ // Mirror: x10
931
+ // Object: x11
932
+ // Temps: x13, x14, x15, x16, x17
933
+ // Result: x10
934
+
935
+ // Get the Klass* into x16
936
+ Register klass = x16, obj = x11, result = x10;
937
+ __ ld (klass, Address (x10, java_lang_Class::klass_offset ()));
938
+
939
+ Label fail, is_secondary, success;
940
+
941
+ __ beqz (klass, fail); // Klass is null
942
+ __ beqz (obj, fail); // obj is null
943
+
944
+ __ lwu (x13, Address (klass, in_bytes (Klass::super_check_offset_offset ())));
945
+ __ mv (x17, in_bytes (Klass::secondary_super_cache_offset ()));
946
+ __ beq (x13, x17, is_secondary); // Klass is a secondary superclass
947
+
948
+ // Klass is a concrete class
949
+ __ load_klass (x15, obj);
950
+ __ add (x17, x15, x13);
951
+ __ ld (x17, Address (x17));
952
+ __ beq (klass, x17, success);
953
+ __ mv (result, 0 );
954
+ __ ret ();
955
+
956
+ __ bind (is_secondary);
957
+ __ load_klass (obj, obj);
958
+
959
+ // This is necessary because I am never in my own secondary_super list.
960
+ __ beq (obj, klass, success);
961
+
962
+ __ lookup_secondary_supers_table_var (obj, klass, result, x13, x14, x15, x17, &success);
963
+
964
+ __ bind (fail);
965
+ __ mv (result, 0 );
966
+ __ ret ();
967
+
968
+ __ bind (success);
969
+ __ mv (result, 1 );
970
+ __ ret ();
971
+ }
972
+ break ;
973
+
928
974
case C1StubId::monitorexit_nofpu_id:
929
975
save_fpu_registers = false ;
930
976
// fall through
0 commit comments