50 "MH argument is a Class");
51 }
52 __ ldr(klass_reg, Address(klass_reg, java_lang_Class::klass_offset_in_bytes()));
53 }
54
55 #ifdef ASSERT
56 static int check_nonzero(const char* xname, int x) {
57 assert(x != 0, "%s should be nonzero", xname);
58 return x;
59 }
60 #define NONZERO(x) check_nonzero(#x, x)
61 #else //ASSERT
62 #define NONZERO(x) (x)
63 #endif //ASSERT
64
65 #ifdef ASSERT
66 void MethodHandles::verify_klass(MacroAssembler* _masm,
67 Register obj, Register temp1, Register temp2, SystemDictionary::WKID klass_id,
68 const char* error_message) {
69 InstanceKlass** klass_addr = SystemDictionary::well_known_klass_addr(klass_id);
70 KlassHandle klass = SystemDictionary::well_known_klass(klass_id);
71 Label L_ok, L_bad;
72 BLOCK_COMMENT("verify_klass {");
73 __ verify_oop(obj);
74 __ cbz(obj, L_bad);
75 __ load_klass(temp1, obj);
76 __ lea(temp2, ExternalAddress((address) klass_addr));
77 __ ldr(temp2, temp2); // the cmpptr on x86 dereferences the AddressLiteral (not lea)
78 __ cmp(temp1, temp2);
79 __ b(L_ok, eq);
80 intptr_t super_check_offset = klass->super_check_offset();
81 __ ldr(temp1, Address(temp1, super_check_offset));
82 __ cmp(temp1, temp2);
83 __ b(L_ok, eq);
84
85 __ bind(L_bad);
86 __ stop(error_message);
87 __ BIND(L_ok);
88 BLOCK_COMMENT("} verify_klass");
89 }
90
|
50 "MH argument is a Class");
51 }
52 __ ldr(klass_reg, Address(klass_reg, java_lang_Class::klass_offset_in_bytes()));
53 }
54
55 #ifdef ASSERT
56 static int check_nonzero(const char* xname, int x) {
57 assert(x != 0, "%s should be nonzero", xname);
58 return x;
59 }
60 #define NONZERO(x) check_nonzero(#x, x)
61 #else //ASSERT
62 #define NONZERO(x) (x)
63 #endif //ASSERT
64
65 #ifdef ASSERT
66 void MethodHandles::verify_klass(MacroAssembler* _masm,
67 Register obj, Register temp1, Register temp2, SystemDictionary::WKID klass_id,
68 const char* error_message) {
69 InstanceKlass** klass_addr = SystemDictionary::well_known_klass_addr(klass_id);
70 Klass* klass = SystemDictionary::well_known_klass(klass_id);
71 Label L_ok, L_bad;
72 BLOCK_COMMENT("verify_klass {");
73 __ verify_oop(obj);
74 __ cbz(obj, L_bad);
75 __ load_klass(temp1, obj);
76 __ lea(temp2, ExternalAddress((address) klass_addr));
77 __ ldr(temp2, temp2); // the cmpptr on x86 dereferences the AddressLiteral (not lea)
78 __ cmp(temp1, temp2);
79 __ b(L_ok, eq);
80 intptr_t super_check_offset = klass->super_check_offset();
81 __ ldr(temp1, Address(temp1, super_check_offset));
82 __ cmp(temp1, temp2);
83 __ b(L_ok, eq);
84
85 __ bind(L_bad);
86 __ stop(error_message);
87 __ BIND(L_ok);
88 BLOCK_COMMENT("} verify_klass");
89 }
90
|