1399 // load the length relative to the body.
1400 __ movl(tmp_reg, Address(tmp_reg, arrayOopDesc::length_offset_in_bytes() -
1401 arrayOopDesc::base_offset_in_bytes(in_elem_type)));
1402 simple_move32(masm, tmp, length_arg);
1403 __ jmpb(done);
1404 __ bind(is_null);
1405 // Pass zeros
1406 __ xorptr(tmp_reg, tmp_reg);
1407 simple_move32(masm, tmp, body_arg);
1408 simple_move32(masm, tmp, length_arg);
1409 __ bind(done);
1410 }
1411
1412 static void verify_oop_args(MacroAssembler* masm,
1413 const methodHandle& method,
1414 const BasicType* sig_bt,
1415 const VMRegPair* regs) {
1416 Register temp_reg = rbx; // not part of any compiled calling seq
1417 if (VerifyOops) {
1418 for (int i = 0; i < method->size_of_parameters(); i++) {
1419 if (sig_bt[i] == T_OBJECT ||
1420 sig_bt[i] == T_ARRAY) {
1421 VMReg r = regs[i].first();
1422 assert(r->is_valid(), "bad oop arg");
1423 if (r->is_stack()) {
1424 __ movptr(temp_reg, Address(rsp, r->reg2stack() * VMRegImpl::stack_slot_size + wordSize));
1425 __ verify_oop(temp_reg);
1426 } else {
1427 __ verify_oop(r->as_Register());
1428 }
1429 }
1430 }
1431 }
1432 }
1433
1434 static void gen_special_dispatch(MacroAssembler* masm,
1435 const methodHandle& method,
1436 const BasicType* sig_bt,
1437 const VMRegPair* regs) {
1438 verify_oop_args(masm, method, sig_bt, regs);
1439 vmIntrinsics::ID iid = method->intrinsic_id();
1440
2201 __ bind(done);
2202
2203 }
2204
2205 {
2206 SkipIfEqual skip_if(masm, &DTraceMethodProbes, 0);
2207 // Tell dtrace about this method exit
2208 save_native_result(masm, ret_type, stack_slots);
2209 __ mov_metadata(rax, method());
2210 __ call_VM_leaf(
2211 CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit),
2212 thread, rax);
2213 restore_native_result(masm, ret_type, stack_slots);
2214 }
2215
2216 // We can finally stop using that last_Java_frame we setup ages ago
2217
2218 __ reset_last_Java_frame(thread, false);
2219
2220 // Unbox oop result, e.g. JNIHandles::resolve value.
2221 if (ret_type == T_OBJECT || ret_type == T_ARRAY) {
2222 __ resolve_jobject(rax /* value */,
2223 thread /* thread */,
2224 rcx /* tmp */);
2225 }
2226
2227 if (CheckJNICalls) {
2228 // clear_pending_jni_exception_check
2229 __ movptr(Address(thread, JavaThread::pending_jni_exception_check_fn_offset()), NULL_WORD);
2230 }
2231
2232 if (!is_critical_native) {
2233 // reset handle block
2234 __ movptr(rcx, Address(thread, JavaThread::active_handles_offset()));
2235 __ movl(Address(rcx, JNIHandleBlock::top_offset_in_bytes()), NULL_WORD);
2236
2237 // Any exception pending?
2238 __ cmpptr(Address(thread, in_bytes(Thread::pending_exception_offset())), (int32_t)NULL_WORD);
2239 __ jcc(Assembler::notEqual, exception_pending);
2240 }
2241
|
1399 // load the length relative to the body.
1400 __ movl(tmp_reg, Address(tmp_reg, arrayOopDesc::length_offset_in_bytes() -
1401 arrayOopDesc::base_offset_in_bytes(in_elem_type)));
1402 simple_move32(masm, tmp, length_arg);
1403 __ jmpb(done);
1404 __ bind(is_null);
1405 // Pass zeros
1406 __ xorptr(tmp_reg, tmp_reg);
1407 simple_move32(masm, tmp, body_arg);
1408 simple_move32(masm, tmp, length_arg);
1409 __ bind(done);
1410 }
1411
1412 static void verify_oop_args(MacroAssembler* masm,
1413 const methodHandle& method,
1414 const BasicType* sig_bt,
1415 const VMRegPair* regs) {
1416 Register temp_reg = rbx; // not part of any compiled calling seq
1417 if (VerifyOops) {
1418 for (int i = 0; i < method->size_of_parameters(); i++) {
1419 if (is_reference_type(sig_bt[i])) {
1420 VMReg r = regs[i].first();
1421 assert(r->is_valid(), "bad oop arg");
1422 if (r->is_stack()) {
1423 __ movptr(temp_reg, Address(rsp, r->reg2stack() * VMRegImpl::stack_slot_size + wordSize));
1424 __ verify_oop(temp_reg);
1425 } else {
1426 __ verify_oop(r->as_Register());
1427 }
1428 }
1429 }
1430 }
1431 }
1432
1433 static void gen_special_dispatch(MacroAssembler* masm,
1434 const methodHandle& method,
1435 const BasicType* sig_bt,
1436 const VMRegPair* regs) {
1437 verify_oop_args(masm, method, sig_bt, regs);
1438 vmIntrinsics::ID iid = method->intrinsic_id();
1439
2200 __ bind(done);
2201
2202 }
2203
2204 {
2205 SkipIfEqual skip_if(masm, &DTraceMethodProbes, 0);
2206 // Tell dtrace about this method exit
2207 save_native_result(masm, ret_type, stack_slots);
2208 __ mov_metadata(rax, method());
2209 __ call_VM_leaf(
2210 CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit),
2211 thread, rax);
2212 restore_native_result(masm, ret_type, stack_slots);
2213 }
2214
2215 // We can finally stop using that last_Java_frame we setup ages ago
2216
2217 __ reset_last_Java_frame(thread, false);
2218
2219 // Unbox oop result, e.g. JNIHandles::resolve value.
2220 if (is_reference_type(ret_type)) {
2221 __ resolve_jobject(rax /* value */,
2222 thread /* thread */,
2223 rcx /* tmp */);
2224 }
2225
2226 if (CheckJNICalls) {
2227 // clear_pending_jni_exception_check
2228 __ movptr(Address(thread, JavaThread::pending_jni_exception_check_fn_offset()), NULL_WORD);
2229 }
2230
2231 if (!is_critical_native) {
2232 // reset handle block
2233 __ movptr(rcx, Address(thread, JavaThread::active_handles_offset()));
2234 __ movl(Address(rcx, JNIHandleBlock::top_offset_in_bytes()), NULL_WORD);
2235
2236 // Any exception pending?
2237 __ cmpptr(Address(thread, in_bytes(Thread::pending_exception_offset())), (int32_t)NULL_WORD);
2238 __ jcc(Assembler::notEqual, exception_pending);
2239 }
2240
|