27 #include "asm/macroAssembler.inline.hpp"
28 #include "compiler/compiler_globals.hpp"
29 #include "gc/shared/barrierSet.hpp"
30 #include "gc/shared/barrierSetAssembler.hpp"
31 #include "interp_masm_aarch64.hpp"
32 #include "interpreter/interpreter.hpp"
33 #include "interpreter/interpreterRuntime.hpp"
34 #include "logging/log.hpp"
35 #include "oops/arrayOop.hpp"
36 #include "oops/markWord.hpp"
37 #include "oops/method.hpp"
38 #include "oops/methodData.hpp"
39 #include "oops/resolvedFieldEntry.hpp"
40 #include "oops/resolvedIndyEntry.hpp"
41 #include "oops/resolvedMethodEntry.hpp"
42 #include "prims/jvmtiExport.hpp"
43 #include "prims/jvmtiThreadState.hpp"
44 #include "runtime/basicLock.hpp"
45 #include "runtime/frame.inline.hpp"
46 #include "runtime/javaThread.hpp"
47 #include "runtime/safepointMechanism.hpp"
48 #include "runtime/sharedRuntime.hpp"
49 #include "utilities/powerOfTwo.hpp"
50
51 void InterpreterMacroAssembler::narrow(Register result) {
52
53 // Get method->_constMethod->_result_type
54 ldr(rscratch1, Address(rfp, frame::interpreter_frame_method_offset * wordSize));
55 ldr(rscratch1, Address(rscratch1, Method::const_offset()));
56 ldrb(rscratch1, Address(rscratch1, ConstMethod::result_type_offset()));
57
58 Label done, notBool, notByte, notChar;
59
60 // common case first
61 cmpw(rscratch1, T_INT);
62 br(Assembler::EQ, done);
63
64 // mask integer result to narrower return type.
65 cmpw(rscratch1, T_BOOLEAN);
66 br(Assembler::NE, notBool);
1387 in_bytes(MultiBranchData::relative_count_offset()));
1388
1389 // The method data pointer needs to be updated.
1390 update_mdp_by_offset(mdp,
1391 index,
1392 in_bytes(MultiBranchData::
1393 relative_displacement_offset()));
1394
1395 bind(profile_continue);
1396 }
1397 }
1398
1399 void InterpreterMacroAssembler::_interp_verify_oop(Register reg, TosState state, const char* file, int line) {
1400 if (state == atos) {
1401 MacroAssembler::_verify_oop_checked(reg, "broken oop", file, line);
1402 }
1403 }
1404
1405 void InterpreterMacroAssembler::verify_FPU(int stack_depth, TosState state) { ; }
1406
1407
1408 void InterpreterMacroAssembler::notify_method_entry() {
1409 // Whenever JVMTI is interp_only_mode, method entry/exit events are sent to
1410 // track stack depth. If it is possible to enter interp_only_mode we add
1411 // the code to check if the event should be sent.
1412 if (JvmtiExport::can_post_interpreter_events()) {
1413 Label L;
1414 ldrw(r3, Address(rthread, JavaThread::interp_only_mode_offset()));
1415 cbzw(r3, L);
1416 call_VM(noreg, CAST_FROM_FN_PTR(address,
1417 InterpreterRuntime::post_method_entry));
1418 bind(L);
1419 }
1420
1421 if (DTraceMethodProbes) {
1422 get_method(c_rarg1);
1423 call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_entry),
1424 rthread, c_rarg1);
1425 }
1426
1427 // RedefineClasses() tracing support for obsolete method entry
1428 if (log_is_enabled(Trace, redefine, class, obsolete)) {
1429 get_method(c_rarg1);
1430 call_VM_leaf(
1431 CAST_FROM_FN_PTR(address, SharedRuntime::rc_trace_method_entry),
1432 rthread, c_rarg1);
1433 }
1434
1435 }
1436
1437
1438 void InterpreterMacroAssembler::notify_method_exit(
1439 TosState state, NotifyMethodExitMode mode) {
1440 // Whenever JVMTI is interp_only_mode, method entry/exit events are sent to
1441 // track stack depth. If it is possible to enter interp_only_mode we add
1442 // the code to check if the event should be sent.
1443 if (mode == NotifyJVMTI && JvmtiExport::can_post_interpreter_events()) {
1444 Label L;
1445 // Note: frame::interpreter_frame_result has a dependency on how the
1446 // method result is saved across the call to post_method_exit. If this
1447 // is changed then the interpreter_frame_result implementation will
1448 // need to be updated too.
|
27 #include "asm/macroAssembler.inline.hpp"
28 #include "compiler/compiler_globals.hpp"
29 #include "gc/shared/barrierSet.hpp"
30 #include "gc/shared/barrierSetAssembler.hpp"
31 #include "interp_masm_aarch64.hpp"
32 #include "interpreter/interpreter.hpp"
33 #include "interpreter/interpreterRuntime.hpp"
34 #include "logging/log.hpp"
35 #include "oops/arrayOop.hpp"
36 #include "oops/markWord.hpp"
37 #include "oops/method.hpp"
38 #include "oops/methodData.hpp"
39 #include "oops/resolvedFieldEntry.hpp"
40 #include "oops/resolvedIndyEntry.hpp"
41 #include "oops/resolvedMethodEntry.hpp"
42 #include "prims/jvmtiExport.hpp"
43 #include "prims/jvmtiThreadState.hpp"
44 #include "runtime/basicLock.hpp"
45 #include "runtime/frame.inline.hpp"
46 #include "runtime/javaThread.hpp"
47 #include "runtime/runtimeUpcalls.hpp"
48 #include "runtime/safepointMechanism.hpp"
49 #include "runtime/sharedRuntime.hpp"
50 #include "utilities/powerOfTwo.hpp"
51
52 void InterpreterMacroAssembler::narrow(Register result) {
53
54 // Get method->_constMethod->_result_type
55 ldr(rscratch1, Address(rfp, frame::interpreter_frame_method_offset * wordSize));
56 ldr(rscratch1, Address(rscratch1, Method::const_offset()));
57 ldrb(rscratch1, Address(rscratch1, ConstMethod::result_type_offset()));
58
59 Label done, notBool, notByte, notChar;
60
61 // common case first
62 cmpw(rscratch1, T_INT);
63 br(Assembler::EQ, done);
64
65 // mask integer result to narrower return type.
66 cmpw(rscratch1, T_BOOLEAN);
67 br(Assembler::NE, notBool);
1388 in_bytes(MultiBranchData::relative_count_offset()));
1389
1390 // The method data pointer needs to be updated.
1391 update_mdp_by_offset(mdp,
1392 index,
1393 in_bytes(MultiBranchData::
1394 relative_displacement_offset()));
1395
1396 bind(profile_continue);
1397 }
1398 }
1399
1400 void InterpreterMacroAssembler::_interp_verify_oop(Register reg, TosState state, const char* file, int line) {
1401 if (state == atos) {
1402 MacroAssembler::_verify_oop_checked(reg, "broken oop", file, line);
1403 }
1404 }
1405
1406 void InterpreterMacroAssembler::verify_FPU(int stack_depth, TosState state) { ; }
1407
1408 void InterpreterMacroAssembler::generate_runtime_upcalls_on_method_entry()
1409 {
1410 address upcall = RuntimeUpcalls::on_method_entry_upcall_address();
1411 if (RuntimeUpcalls::does_upcall_need_method_parameter(upcall)) {
1412 get_method(c_rarg1);
1413 call_VM(noreg,upcall, c_rarg1);
1414 } else {
1415 call_VM(noreg,upcall);
1416 }
1417 }
1418
1419 void InterpreterMacroAssembler::notify_method_entry() {
1420 // Whenever JVMTI is interp_only_mode, method entry/exit events are sent to
1421 // track stack depth. If it is possible to enter interp_only_mode we add
1422 // the code to check if the event should be sent.
1423 if (JvmtiExport::can_post_interpreter_events()) {
1424 Label L;
1425 ldrw(r3, Address(rthread, JavaThread::interp_only_mode_offset()));
1426 cbzw(r3, L);
1427 call_VM(noreg, CAST_FROM_FN_PTR(address,
1428 InterpreterRuntime::post_method_entry));
1429 bind(L);
1430 }
1431
1432 if (DTraceMethodProbes) {
1433 get_method(c_rarg1);
1434 call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_entry),
1435 rthread, c_rarg1);
1436 }
1437
1438 // RedefineClasses() tracing support for obsolete method entry
1439 if (log_is_enabled(Trace, redefine, class, obsolete) ||
1440 log_is_enabled(Trace, interpreter, bytecode)) {
1441 get_method(c_rarg1);
1442 call_VM_leaf(
1443 CAST_FROM_FN_PTR(address, SharedRuntime::rc_trace_method_entry),
1444 rthread, c_rarg1);
1445 }
1446
1447 }
1448
1449
1450 void InterpreterMacroAssembler::notify_method_exit(
1451 TosState state, NotifyMethodExitMode mode) {
1452 // Whenever JVMTI is interp_only_mode, method entry/exit events are sent to
1453 // track stack depth. If it is possible to enter interp_only_mode we add
1454 // the code to check if the event should be sent.
1455 if (mode == NotifyJVMTI && JvmtiExport::can_post_interpreter_events()) {
1456 Label L;
1457 // Note: frame::interpreter_frame_result has a dependency on how the
1458 // method result is saved across the call to post_method_exit. If this
1459 // is changed then the interpreter_frame_result implementation will
1460 // need to be updated too.
|