< prev index next >

src/hotspot/cpu/x86/methodHandles_x86.cpp

Print this page

 94   __ cmpptr(temp, ExternalAddress((address) klass_addr), rscratch1);
 95   __ jcc(Assembler::equal, L_ok);
 96   POP;
 97   __ bind(L_bad);
 98   __ STOP(error_message);
 99   __ BIND(L_ok);
100   POP;
101   BLOCK_COMMENT("} verify_klass");
102 #undef POP
103 #undef PUSH
104 }
105 
106 void MethodHandles::verify_ref_kind(MacroAssembler* _masm, int ref_kind, Register member_reg, Register temp) {
107   Label L;
108   BLOCK_COMMENT("verify_ref_kind {");
109   __ movl(temp, Address(member_reg, NONZERO(java_lang_invoke_MemberName::flags_offset())));
110   __ shrl(temp, java_lang_invoke_MemberName::MN_REFERENCE_KIND_SHIFT);
111   __ andl(temp, java_lang_invoke_MemberName::MN_REFERENCE_KIND_MASK);
112   __ cmpl(temp, ref_kind);
113   __ jcc(Assembler::equal, L);
114   { char* buf = NEW_C_HEAP_ARRAY(char, 100, mtInternal);
115     jio_snprintf(buf, 100, "verify_ref_kind expected %x", ref_kind);

116     if (ref_kind == JVM_REF_invokeVirtual ||
117         ref_kind == JVM_REF_invokeSpecial)
118       // could do this for all ref_kinds, but would explode assembly code size
119       trace_method_handle(_masm, buf);

120     __ STOP(buf);
121   }
122   BLOCK_COMMENT("} verify_ref_kind");
123   __ bind(L);
124 }
125 
126 #endif //ASSERT
127 
128 void MethodHandles::jump_from_method_handle(MacroAssembler* _masm, Register method, Register temp,
129                                             bool for_compiler_entry) {
130   assert(method == rbx, "interpreter calling convention");
131 
132    Label L_no_such_method;
133    __ testptr(rbx, rbx);
134    __ jcc(Assembler::zero, L_no_such_method);
135 
136   __ verify_method_ptr(method);
137 
138   if (!for_compiler_entry && JvmtiExport::can_post_interpreter_events()) {
139     Label run_compiled_code;

 94   __ cmpptr(temp, ExternalAddress((address) klass_addr), rscratch1);
 95   __ jcc(Assembler::equal, L_ok);
 96   POP;
 97   __ bind(L_bad);
 98   __ STOP(error_message);
 99   __ BIND(L_ok);
100   POP;
101   BLOCK_COMMENT("} verify_klass");
102 #undef POP
103 #undef PUSH
104 }
105 
106 void MethodHandles::verify_ref_kind(MacroAssembler* _masm, int ref_kind, Register member_reg, Register temp) {
107   Label L;
108   BLOCK_COMMENT("verify_ref_kind {");
109   __ movl(temp, Address(member_reg, NONZERO(java_lang_invoke_MemberName::flags_offset())));
110   __ shrl(temp, java_lang_invoke_MemberName::MN_REFERENCE_KIND_SHIFT);
111   __ andl(temp, java_lang_invoke_MemberName::MN_REFERENCE_KIND_MASK);
112   __ cmpl(temp, ref_kind);
113   __ jcc(Assembler::equal, L);
114   { //char* buf = NEW_C_HEAP_ARRAY(char, 100, mtInternal);
115     //jio_snprintf(buf, 100, "verify_ref_kind expected %x", ref_kind);
116     const char* buf = "verify_ref_kind"; // avoid allocating new strings
117     if (ref_kind == JVM_REF_invokeVirtual ||
118         ref_kind == JVM_REF_invokeSpecial) {
119       // could do this for all ref_kinds, but would explode assembly code size
120       trace_method_handle(_masm, buf);
121     }
122     __ STOP(buf);
123   }
124   BLOCK_COMMENT("} verify_ref_kind");
125   __ bind(L);
126 }
127 
128 #endif //ASSERT
129 
130 void MethodHandles::jump_from_method_handle(MacroAssembler* _masm, Register method, Register temp,
131                                             bool for_compiler_entry) {
132   assert(method == rbx, "interpreter calling convention");
133 
134    Label L_no_such_method;
135    __ testptr(rbx, rbx);
136    __ jcc(Assembler::zero, L_no_such_method);
137 
138   __ verify_method_ptr(method);
139 
140   if (!for_compiler_entry && JvmtiExport::can_post_interpreter_events()) {
141     Label run_compiled_code;
< prev index next >