< prev index next >

src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp

Print this page

  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);

1381                           in_bytes(MultiBranchData::relative_count_offset()));
1382 
1383     // The method data pointer needs to be updated.
1384     update_mdp_by_offset(mdp,
1385                          index,
1386                          in_bytes(MultiBranchData::
1387                                   relative_displacement_offset()));
1388 
1389     bind(profile_continue);
1390   }
1391 }
1392 
1393 void InterpreterMacroAssembler::_interp_verify_oop(Register reg, TosState state, const char* file, int line) {
1394   if (state == atos) {
1395     MacroAssembler::_verify_oop_checked(reg, "broken oop", file, line);
1396   }
1397 }
1398 
1399 void InterpreterMacroAssembler::verify_FPU(int stack_depth, TosState state) { ; }
1400 










1401 
1402 void InterpreterMacroAssembler::notify_method_entry() {
1403   // Whenever JVMTI is interp_only_mode, method entry/exit events are sent to
1404   // track stack depth.  If it is possible to enter interp_only_mode we add
1405   // the code to check if the event should be sent.
1406   if (JvmtiExport::can_post_interpreter_events()) {
1407     Label L;
1408     ldrw(r3, Address(rthread, JavaThread::interp_only_mode_offset()));
1409     cbzw(r3, L);
1410     call_VM(noreg, CAST_FROM_FN_PTR(address,
1411                                     InterpreterRuntime::post_method_entry));
1412     bind(L);
1413   }
1414 
1415   if (DTraceMethodProbes) {
1416     get_method(c_rarg1);
1417     call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_entry),
1418                  rthread, c_rarg1);
1419   }
1420 
1421   // RedefineClasses() tracing support for obsolete method entry
1422   if (log_is_enabled(Trace, redefine, class, obsolete)) {

1423     get_method(c_rarg1);
1424     call_VM_leaf(
1425       CAST_FROM_FN_PTR(address, SharedRuntime::rc_trace_method_entry),
1426       rthread, c_rarg1);
1427   }
1428 
1429  }
1430 
1431 
1432 void InterpreterMacroAssembler::notify_method_exit(
1433     TosState state, NotifyMethodExitMode mode) {
1434   // Whenever JVMTI is interp_only_mode, method entry/exit events are sent to
1435   // track stack depth.  If it is possible to enter interp_only_mode we add
1436   // the code to check if the event should be sent.
1437   if (mode == NotifyJVMTI && JvmtiExport::can_post_interpreter_events()) {
1438     Label L;
1439     // Note: frame::interpreter_frame_result has a dependency on how the
1440     // method result is saved across the call to post_method_exit. If this
1441     // is changed then the interpreter_frame_result implementation will
1442     // 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);

1382                           in_bytes(MultiBranchData::relative_count_offset()));
1383 
1384     // The method data pointer needs to be updated.
1385     update_mdp_by_offset(mdp,
1386                          index,
1387                          in_bytes(MultiBranchData::
1388                                   relative_displacement_offset()));
1389 
1390     bind(profile_continue);
1391   }
1392 }
1393 
1394 void InterpreterMacroAssembler::_interp_verify_oop(Register reg, TosState state, const char* file, int line) {
1395   if (state == atos) {
1396     MacroAssembler::_verify_oop_checked(reg, "broken oop", file, line);
1397   }
1398 }
1399 
1400 void InterpreterMacroAssembler::verify_FPU(int stack_depth, TosState state) { ; }
1401 
1402 void InterpreterMacroAssembler::generate_runtime_upcalls_on_method_entry()
1403 {
1404   address upcall = RuntimeUpcalls::on_method_entry_upcall_address();
1405   if (RuntimeUpcalls::does_upcall_need_method_parameter(upcall)) {
1406     get_method(c_rarg1);
1407     call_VM(noreg,upcall, c_rarg1);
1408   } else {
1409     call_VM(noreg,upcall);
1410   }
1411 }
1412 
1413 void InterpreterMacroAssembler::notify_method_entry() {
1414   // Whenever JVMTI is interp_only_mode, method entry/exit events are sent to
1415   // track stack depth.  If it is possible to enter interp_only_mode we add
1416   // the code to check if the event should be sent.
1417   if (JvmtiExport::can_post_interpreter_events()) {
1418     Label L;
1419     ldrw(r3, Address(rthread, JavaThread::interp_only_mode_offset()));
1420     cbzw(r3, L);
1421     call_VM(noreg, CAST_FROM_FN_PTR(address,
1422                                     InterpreterRuntime::post_method_entry));
1423     bind(L);
1424   }
1425 
1426   if (DTraceMethodProbes) {
1427     get_method(c_rarg1);
1428     call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_entry),
1429                  rthread, c_rarg1);
1430   }
1431 
1432   // RedefineClasses() tracing support for obsolete method entry
1433   if (log_is_enabled(Trace, redefine, class, obsolete) ||
1434       log_is_enabled(Trace, interpreter, bytecode)) {
1435     get_method(c_rarg1);
1436     call_VM_leaf(
1437       CAST_FROM_FN_PTR(address, SharedRuntime::rc_trace_method_entry),
1438       rthread, c_rarg1);
1439   }
1440 
1441  }
1442 
1443 
1444 void InterpreterMacroAssembler::notify_method_exit(
1445     TosState state, NotifyMethodExitMode mode) {
1446   // Whenever JVMTI is interp_only_mode, method entry/exit events are sent to
1447   // track stack depth.  If it is possible to enter interp_only_mode we add
1448   // the code to check if the event should be sent.
1449   if (mode == NotifyJVMTI && JvmtiExport::can_post_interpreter_events()) {
1450     Label L;
1451     // Note: frame::interpreter_frame_result has a dependency on how the
1452     // method result is saved across the call to post_method_exit. If this
1453     // is changed then the interpreter_frame_result implementation will
1454     // need to be updated too.
< prev index next >