1152 __ movoop(rbx, (jobject)NULL); // method is zapped till fixup time
1153 __ jump(RuntimeAddress((address)-1));
1154
1155 __ end_a_stub();
1156 // Update current stubs pointer and restore code_end.
1157 }
1158 // size of call stub, compiled java to interpretor
1159 uint size_java_to_interp() {
1160 return 10; // movl; jmp
1161 }
1162 // relocation entries for call stub, compiled java to interpretor
1163 uint reloc_java_to_interp() {
1164 return 4; // 3 in emit_java_to_interp + 1 in Java_Static_Call
1165 }
1166
1167 //=============================================================================
1168 #ifndef PRODUCT
1169 void MachUEPNode::format( PhaseRegAlloc *ra_, outputStream* st ) const {
1170 st->print_cr( "CMP EAX,[ECX+4]\t# Inline cache check");
1171 st->print_cr("\tJNE SharedRuntime::handle_ic_miss_stub");
1172 st->print_cr("\tNOP");
1173 st->print_cr("\tNOP");
1174 if( !OptoBreakpoint )
1175 st->print_cr("\tNOP");
1176 }
1177 #endif
1178
1179 void MachUEPNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
1180 MacroAssembler masm(&cbuf);
1181 #ifdef ASSERT
1182 uint code_size = cbuf.code_size();
1183 #endif
1184 masm.cmpl(rax, Address(rcx, oopDesc::klass_offset_in_bytes()));
1185 masm.jump_cc(Assembler::notEqual,
1186 RuntimeAddress(SharedRuntime::get_ic_miss_stub()));
1187 /* WARNING these NOPs are critical so that verified entry point is properly
1188 aligned for patching by NativeJump::patch_verified_entry() */
1189 int nops_cnt = 2;
1190 if( !OptoBreakpoint ) // Leave space for int3
1191 nops_cnt += 1;
1192 masm.nop(nops_cnt);
1193
1194 assert(cbuf.code_size() - code_size == size(ra_), "checking code size of inline cache node");
1195 }
1196
1197 uint MachUEPNode::size(PhaseRegAlloc *ra_) const {
1198 return OptoBreakpoint ? 11 : 12;
1199 }
1200
1201
1202 //=============================================================================
1203 uint size_exception_handler() {
1204 // NativeCall instruction size is the same as NativeJump.
1205 // exception handler starts out as jump and can be patched to
1206 // a call be deoptimization. (4932387)
1207 // Note that this value is also credited (in output.cpp) to
1208 // the size of the code section.
1209 return NativeJump::instruction_size;
1210 }
1211
1212 // Emit exception handler code. Stuff framesize into a register
1213 // and call a VM stub routine.
1214 int emit_exception_handler(CodeBuffer& cbuf) {
1215
1216 // Note that the code buffer's inst_mark is always relative to insts.
1217 // That's why we must use the macroassembler to generate a handler.
1218 MacroAssembler _masm(&cbuf);
|
1152 __ movoop(rbx, (jobject)NULL); // method is zapped till fixup time
1153 __ jump(RuntimeAddress((address)-1));
1154
1155 __ end_a_stub();
1156 // Update current stubs pointer and restore code_end.
1157 }
1158 // size of call stub, compiled java to interpretor
1159 uint size_java_to_interp() {
1160 return 10; // movl; jmp
1161 }
1162 // relocation entries for call stub, compiled java to interpretor
1163 uint reloc_java_to_interp() {
1164 return 4; // 3 in emit_java_to_interp + 1 in Java_Static_Call
1165 }
1166
1167 //=============================================================================
1168 #ifndef PRODUCT
1169 void MachUEPNode::format( PhaseRegAlloc *ra_, outputStream* st ) const {
1170 st->print_cr( "CMP EAX,[ECX+4]\t# Inline cache check");
1171 st->print_cr("\tJNE SharedRuntime::handle_ic_miss_stub");
1172 }
1173 #endif
1174
1175 void MachUEPNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
1176 MacroAssembler masm(&cbuf);
1177 masm.cmpl(rax, Address(rcx, oopDesc::klass_offset_in_bytes()));
1178 masm.jump_cc(Assembler::notEqual,
1179 RuntimeAddress(SharedRuntime::get_ic_miss_stub()));
1180 /* WARNING these NOPs are critical so that verified entry point is properly
1181 aligned (4 bytes) for patching by NativeJump::patch_verified_entry() */
1182
1183 // C2 aligns Start block (verified entry point) to InteriorEntryAlignment
1184 assert((InteriorEntryAlignment & 0x3) == 0, "verified entry point should be aligned to 4 bytes");
1185 }
1186
1187 uint MachUEPNode::size(PhaseRegAlloc *ra_) const {
1188 return MachNode::size(ra_); // too many variables; just compute it
1189 // the hard way
1190 }
1191
1192
1193 //=============================================================================
1194 uint size_exception_handler() {
1195 // NativeCall instruction size is the same as NativeJump.
1196 // exception handler starts out as jump and can be patched to
1197 // a call be deoptimization. (4932387)
1198 // Note that this value is also credited (in output.cpp) to
1199 // the size of the code section.
1200 return NativeJump::instruction_size;
1201 }
1202
1203 // Emit exception handler code. Stuff framesize into a register
1204 // and call a VM stub routine.
1205 int emit_exception_handler(CodeBuffer& cbuf) {
1206
1207 // Note that the code buffer's inst_mark is always relative to insts.
1208 // That's why we must use the macroassembler to generate a handler.
1209 MacroAssembler _masm(&cbuf);
|