1126 }
1127
1128 __ push_cont_fastpath(); // Set JavaThread::_cont_fastpath to the sp of the oldest interpreted frame we know about
1129
1130 BLOCK_COMMENT("Store method");
1131 // Store method into thread->callee_target.
1132 // We might end up in handle_wrong_method if the callee is
1133 // deoptimized as we race thru here. If that happens we don't want
1134 // to take a safepoint because the caller frame will look
1135 // interpreted and arguments are now "compiled" so it is much better
1136 // to make this transition invisible to the stack walking
1137 // code. Unfortunately if we try and find the callee by normal means
1138 // a safepoint is possible. So we stash the desired callee in the
1139 // thread and the vm will find there should this case occur.
1140 __ std(R19_method, thread_(callee_target));
1141
1142 // Jump to the compiled code just as if compiled code was doing it.
1143 __ bctr();
1144 }
1145
1146 AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm,
1147 int total_args_passed,
1148 int comp_args_on_stack,
1149 const BasicType *sig_bt,
1150 const VMRegPair *regs,
1151 AdapterFingerPrint* fingerprint) {
1152 address i2c_entry;
1153 address c2i_unverified_entry;
1154 address c2i_entry;
1155
1156
1157 // entry: i2c
1158
1159 __ align(CodeEntryAlignment);
1160 i2c_entry = __ pc();
1161 gen_i2c_adapter(masm, total_args_passed, comp_args_on_stack, sig_bt, regs);
1162
1163
1164 // entry: c2i unverified
1165
1166 __ align(CodeEntryAlignment);
1167 BLOCK_COMMENT("c2i unverified entry");
1168 c2i_unverified_entry = __ pc();
1169
1170 // inline_cache contains a CompiledICData
1171 const Register ic = R19_inline_cache_reg;
1206 __ beq(CR0, L_skip_barrier); // non-static
1207 }
1208
1209 Register klass = R11_scratch1;
1210 __ load_method_holder(klass, R19_method);
1211 __ clinit_barrier(klass, R16_thread, &L_skip_barrier /*L_fast_path*/);
1212
1213 __ load_const_optimized(klass, SharedRuntime::get_handle_wrong_method_stub(), R0);
1214 __ mtctr(klass);
1215 __ bctr();
1216
1217 __ bind(L_skip_barrier);
1218 c2i_no_clinit_check_entry = __ pc();
1219 }
1220
1221 BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
1222 bs->c2i_entry_barrier(masm, /* tmp register*/ ic_klass, /* tmp register*/ receiver_klass, /* tmp register*/ code);
1223
1224 gen_c2i_adapter(masm, total_args_passed, comp_args_on_stack, sig_bt, regs, call_interpreter, ientry);
1225
1226 return AdapterHandlerLibrary::new_entry(fingerprint, i2c_entry, c2i_entry, c2i_unverified_entry,
1227 c2i_no_clinit_check_entry);
1228 }
1229
1230 // An oop arg. Must pass a handle not the oop itself.
1231 static void object_move(MacroAssembler* masm,
1232 int frame_size_in_slots,
1233 OopMap* oop_map, int oop_handle_offset,
1234 bool is_receiver, int* receiver_offset,
1235 VMRegPair src, VMRegPair dst,
1236 Register r_caller_sp, Register r_temp_1, Register r_temp_2) {
1237 assert(!is_receiver || (is_receiver && (*receiver_offset == -1)),
1238 "receiver has already been moved");
1239
1240 // We must pass a handle. First figure out the location we use as a handle.
1241
1242 if (src.first()->is_stack()) {
1243 // stack to stack or reg
1244
1245 const Register r_handle = dst.first()->is_stack() ? r_temp_1 : dst.first()->as_Register();
1246 Label skip;
1247 const int oop_slot_in_callers_frame = reg2slot(src.first());
|
1126 }
1127
1128 __ push_cont_fastpath(); // Set JavaThread::_cont_fastpath to the sp of the oldest interpreted frame we know about
1129
1130 BLOCK_COMMENT("Store method");
1131 // Store method into thread->callee_target.
1132 // We might end up in handle_wrong_method if the callee is
1133 // deoptimized as we race thru here. If that happens we don't want
1134 // to take a safepoint because the caller frame will look
1135 // interpreted and arguments are now "compiled" so it is much better
1136 // to make this transition invisible to the stack walking
1137 // code. Unfortunately if we try and find the callee by normal means
1138 // a safepoint is possible. So we stash the desired callee in the
1139 // thread and the vm will find there should this case occur.
1140 __ std(R19_method, thread_(callee_target));
1141
1142 // Jump to the compiled code just as if compiled code was doing it.
1143 __ bctr();
1144 }
1145
1146 void SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm,
1147 int total_args_passed,
1148 int comp_args_on_stack,
1149 const BasicType *sig_bt,
1150 const VMRegPair *regs,
1151 AdapterHandlerEntry* handler) {
1152 address i2c_entry;
1153 address c2i_unverified_entry;
1154 address c2i_entry;
1155
1156
1157 // entry: i2c
1158
1159 __ align(CodeEntryAlignment);
1160 i2c_entry = __ pc();
1161 gen_i2c_adapter(masm, total_args_passed, comp_args_on_stack, sig_bt, regs);
1162
1163
1164 // entry: c2i unverified
1165
1166 __ align(CodeEntryAlignment);
1167 BLOCK_COMMENT("c2i unverified entry");
1168 c2i_unverified_entry = __ pc();
1169
1170 // inline_cache contains a CompiledICData
1171 const Register ic = R19_inline_cache_reg;
1206 __ beq(CR0, L_skip_barrier); // non-static
1207 }
1208
1209 Register klass = R11_scratch1;
1210 __ load_method_holder(klass, R19_method);
1211 __ clinit_barrier(klass, R16_thread, &L_skip_barrier /*L_fast_path*/);
1212
1213 __ load_const_optimized(klass, SharedRuntime::get_handle_wrong_method_stub(), R0);
1214 __ mtctr(klass);
1215 __ bctr();
1216
1217 __ bind(L_skip_barrier);
1218 c2i_no_clinit_check_entry = __ pc();
1219 }
1220
1221 BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
1222 bs->c2i_entry_barrier(masm, /* tmp register*/ ic_klass, /* tmp register*/ receiver_klass, /* tmp register*/ code);
1223
1224 gen_c2i_adapter(masm, total_args_passed, comp_args_on_stack, sig_bt, regs, call_interpreter, ientry);
1225
1226 handler->set_entry_points(i2c_entry, c2i_entry, c2i_unverified_entry, c2i_no_clinit_check_entry);
1227 return;
1228 }
1229
1230 // An oop arg. Must pass a handle not the oop itself.
1231 static void object_move(MacroAssembler* masm,
1232 int frame_size_in_slots,
1233 OopMap* oop_map, int oop_handle_offset,
1234 bool is_receiver, int* receiver_offset,
1235 VMRegPair src, VMRegPair dst,
1236 Register r_caller_sp, Register r_temp_1, Register r_temp_2) {
1237 assert(!is_receiver || (is_receiver && (*receiver_offset == -1)),
1238 "receiver has already been moved");
1239
1240 // We must pass a handle. First figure out the location we use as a handle.
1241
1242 if (src.first()->is_stack()) {
1243 // stack to stack or reg
1244
1245 const Register r_handle = dst.first()->is_stack() ? r_temp_1 : dst.first()->as_Register();
1246 Label skip;
1247 const int oop_slot_in_callers_frame = reg2slot(src.first());
|