< prev index next >

src/hotspot/share/interpreter/interpreterRuntime.cpp

Print this page

  38 #include "interpreter/interpreterRuntime.hpp"
  39 #include "interpreter/linkResolver.hpp"
  40 #include "interpreter/templateTable.hpp"
  41 #include "logging/log.hpp"
  42 #include "memory/oopFactory.hpp"
  43 #include "memory/resourceArea.hpp"
  44 #include "memory/universe.hpp"
  45 #include "oops/constantPool.hpp"
  46 #include "oops/cpCache.inline.hpp"
  47 #include "oops/instanceKlass.inline.hpp"
  48 #include "oops/klass.inline.hpp"
  49 #include "oops/methodData.hpp"
  50 #include "oops/objArrayKlass.hpp"
  51 #include "oops/objArrayOop.inline.hpp"
  52 #include "oops/oop.inline.hpp"
  53 #include "oops/symbol.hpp"
  54 #include "prims/jvmtiExport.hpp"
  55 #include "prims/methodHandles.hpp"
  56 #include "prims/nativeLookup.hpp"
  57 #include "runtime/atomic.hpp"

  58 #include "runtime/deoptimization.hpp"
  59 #include "runtime/fieldDescriptor.inline.hpp"
  60 #include "runtime/frame.inline.hpp"
  61 #include "runtime/handles.inline.hpp"
  62 #include "runtime/icache.hpp"
  63 #include "runtime/interfaceSupport.inline.hpp"
  64 #include "runtime/java.hpp"
  65 #include "runtime/javaCalls.hpp"
  66 #include "runtime/jfieldIDWorkaround.hpp"
  67 #include "runtime/osThread.hpp"
  68 #include "runtime/sharedRuntime.hpp"
  69 #include "runtime/stackWatermarkSet.hpp"
  70 #include "runtime/stubRoutines.hpp"
  71 #include "runtime/synchronizer.hpp"
  72 #include "runtime/threadCritical.hpp"
  73 #include "utilities/align.hpp"
  74 #include "utilities/copy.hpp"
  75 #include "utilities/events.hpp"
  76 #ifdef COMPILER2
  77 #include "opto/runtime.hpp"

1086   ProfileData* data = h_mdo->data_at(h_mdo->dp_to_di(last_frame.mdp()));
1087   guarantee(data != NULL, "profile data must be valid");
1088   RetData* rdata = data->as_RetData();
1089   address new_mdp = rdata->fixup_ret(return_bci, h_mdo);
1090   last_frame.set_mdp(new_mdp);
1091 JRT_END
1092 
1093 JRT_ENTRY(MethodCounters*, InterpreterRuntime::build_method_counters(JavaThread* current, Method* m))
1094   return Method::build_method_counters(current, m);
1095 JRT_END
1096 
1097 
1098 JRT_ENTRY(void, InterpreterRuntime::at_safepoint(JavaThread* current))
1099   // We used to need an explict preserve_arguments here for invoke bytecodes. However,
1100   // stack traversal automatically takes care of preserving arguments for invoke, so
1101   // this is no longer needed.
1102 
1103   // JRT_END does an implicit safepoint check, hence we are guaranteed to block
1104   // if this is called during a safepoint
1105 




1106   if (JvmtiExport::should_post_single_step()) {
1107     // This function is called by the interpreter when single stepping. Such single
1108     // stepping could unwind a frame. Then, it is important that we process any frames
1109     // that we might return into.
1110     StackWatermarkSet::before_unwind(current);
1111 
1112     // We are called during regular safepoints and when the VM is
1113     // single stepping. If any thread is marked for single stepping,
1114     // then we may have JVMTI work to do.
1115     LastFrameAccessor last_frame(current);
1116     JvmtiExport::at_single_stepping_point(current, last_frame.method(), last_frame.bcp());
1117   }
1118 JRT_END
1119 
1120 JRT_LEAF(void, InterpreterRuntime::at_unwind(JavaThread* current))
1121   // This function is called by the interpreter when the return poll found a reason
1122   // to call the VM. The reason could be that we are returning into a not yet safe
1123   // to access frame. We handle that below.
1124   // Note that this path does not check for single stepping, because we do not want
1125   // to single step when unwinding frames for an exception being thrown. Instead,

1207   JvmtiExport::post_raw_field_modification(current, last_frame.method(), last_frame.bcp(), ik, h_obj,
1208                                            fid, sig_type, &fvalue);
1209 JRT_END
1210 
1211 JRT_ENTRY(void, InterpreterRuntime::post_method_entry(JavaThread* current))
1212   LastFrameAccessor last_frame(current);
1213   JvmtiExport::post_method_entry(current, last_frame.method(), last_frame.get_frame());
1214 JRT_END
1215 
1216 
1217 // This is a JRT_BLOCK_ENTRY because we have to stash away the return oop
1218 // before transitioning to VM, and restore it after transitioning back
1219 // to Java. The return oop at the top-of-stack, is not walked by the GC.
1220 JRT_BLOCK_ENTRY(void, InterpreterRuntime::post_method_exit(JavaThread* current))
1221   LastFrameAccessor last_frame(current);
1222   JvmtiExport::post_method_exit(current, last_frame.method(), last_frame.get_frame());
1223 JRT_END
1224 
1225 JRT_LEAF(int, InterpreterRuntime::interpreter_contains(address pc))
1226 {
1227   return (Interpreter::contains(pc) ? 1 : 0);
1228 }
1229 JRT_END
1230 
1231 
1232 // Implementation of SignatureHandlerLibrary
1233 
1234 #ifndef SHARING_FAST_NATIVE_FINGERPRINTS
1235 // Dummy definition (else normalization method is defined in CPU
1236 // dependant code)
1237 uint64_t InterpreterRuntime::normalize_fast_native_fingerprint(uint64_t fingerprint) {
1238   return fingerprint;
1239 }
1240 #endif
1241 
1242 address SignatureHandlerLibrary::set_handler_blob() {
1243   BufferBlob* handler_blob = BufferBlob::create("native signature handlers", blob_size);
1244   if (handler_blob == NULL) {
1245     return NULL;
1246   }
1247   address handler = handler_blob->code_begin();

  38 #include "interpreter/interpreterRuntime.hpp"
  39 #include "interpreter/linkResolver.hpp"
  40 #include "interpreter/templateTable.hpp"
  41 #include "logging/log.hpp"
  42 #include "memory/oopFactory.hpp"
  43 #include "memory/resourceArea.hpp"
  44 #include "memory/universe.hpp"
  45 #include "oops/constantPool.hpp"
  46 #include "oops/cpCache.inline.hpp"
  47 #include "oops/instanceKlass.inline.hpp"
  48 #include "oops/klass.inline.hpp"
  49 #include "oops/methodData.hpp"
  50 #include "oops/objArrayKlass.hpp"
  51 #include "oops/objArrayOop.inline.hpp"
  52 #include "oops/oop.inline.hpp"
  53 #include "oops/symbol.hpp"
  54 #include "prims/jvmtiExport.hpp"
  55 #include "prims/methodHandles.hpp"
  56 #include "prims/nativeLookup.hpp"
  57 #include "runtime/atomic.hpp"
  58 #include "runtime/continuation.hpp"
  59 #include "runtime/deoptimization.hpp"
  60 #include "runtime/fieldDescriptor.inline.hpp"
  61 #include "runtime/frame.inline.hpp"
  62 #include "runtime/handles.inline.hpp"
  63 #include "runtime/icache.hpp"
  64 #include "runtime/interfaceSupport.inline.hpp"
  65 #include "runtime/java.hpp"
  66 #include "runtime/javaCalls.hpp"
  67 #include "runtime/jfieldIDWorkaround.hpp"
  68 #include "runtime/osThread.hpp"
  69 #include "runtime/sharedRuntime.hpp"
  70 #include "runtime/stackWatermarkSet.hpp"
  71 #include "runtime/stubRoutines.hpp"
  72 #include "runtime/synchronizer.hpp"
  73 #include "runtime/threadCritical.hpp"
  74 #include "utilities/align.hpp"
  75 #include "utilities/copy.hpp"
  76 #include "utilities/events.hpp"
  77 #ifdef COMPILER2
  78 #include "opto/runtime.hpp"

1087   ProfileData* data = h_mdo->data_at(h_mdo->dp_to_di(last_frame.mdp()));
1088   guarantee(data != NULL, "profile data must be valid");
1089   RetData* rdata = data->as_RetData();
1090   address new_mdp = rdata->fixup_ret(return_bci, h_mdo);
1091   last_frame.set_mdp(new_mdp);
1092 JRT_END
1093 
1094 JRT_ENTRY(MethodCounters*, InterpreterRuntime::build_method_counters(JavaThread* current, Method* m))
1095   return Method::build_method_counters(current, m);
1096 JRT_END
1097 
1098 
1099 JRT_ENTRY(void, InterpreterRuntime::at_safepoint(JavaThread* current))
1100   // We used to need an explict preserve_arguments here for invoke bytecodes. However,
1101   // stack traversal automatically takes care of preserving arguments for invoke, so
1102   // this is no longer needed.
1103 
1104   // JRT_END does an implicit safepoint check, hence we are guaranteed to block
1105   // if this is called during a safepoint
1106 
1107   if (java_lang_VirtualThread::notify_jvmti_events()) {
1108     JvmtiExport::check_suspend_at_safepoint(current);
1109   }
1110 
1111   if (JvmtiExport::should_post_single_step()) {
1112     // This function is called by the interpreter when single stepping. Such single
1113     // stepping could unwind a frame. Then, it is important that we process any frames
1114     // that we might return into.
1115     StackWatermarkSet::before_unwind(current);
1116 
1117     // We are called during regular safepoints and when the VM is
1118     // single stepping. If any thread is marked for single stepping,
1119     // then we may have JVMTI work to do.
1120     LastFrameAccessor last_frame(current);
1121     JvmtiExport::at_single_stepping_point(current, last_frame.method(), last_frame.bcp());
1122   }
1123 JRT_END
1124 
1125 JRT_LEAF(void, InterpreterRuntime::at_unwind(JavaThread* current))
1126   // This function is called by the interpreter when the return poll found a reason
1127   // to call the VM. The reason could be that we are returning into a not yet safe
1128   // to access frame. We handle that below.
1129   // Note that this path does not check for single stepping, because we do not want
1130   // to single step when unwinding frames for an exception being thrown. Instead,

1212   JvmtiExport::post_raw_field_modification(current, last_frame.method(), last_frame.bcp(), ik, h_obj,
1213                                            fid, sig_type, &fvalue);
1214 JRT_END
1215 
1216 JRT_ENTRY(void, InterpreterRuntime::post_method_entry(JavaThread* current))
1217   LastFrameAccessor last_frame(current);
1218   JvmtiExport::post_method_entry(current, last_frame.method(), last_frame.get_frame());
1219 JRT_END
1220 
1221 
1222 // This is a JRT_BLOCK_ENTRY because we have to stash away the return oop
1223 // before transitioning to VM, and restore it after transitioning back
1224 // to Java. The return oop at the top-of-stack, is not walked by the GC.
1225 JRT_BLOCK_ENTRY(void, InterpreterRuntime::post_method_exit(JavaThread* current))
1226   LastFrameAccessor last_frame(current);
1227   JvmtiExport::post_method_exit(current, last_frame.method(), last_frame.get_frame());
1228 JRT_END
1229 
1230 JRT_LEAF(int, InterpreterRuntime::interpreter_contains(address pc))
1231 {
1232   return (Interpreter::contains(Continuation::get_top_return_pc_post_barrier(JavaThread::current(), pc)) ? 1 : 0);
1233 }
1234 JRT_END
1235 
1236 
1237 // Implementation of SignatureHandlerLibrary
1238 
1239 #ifndef SHARING_FAST_NATIVE_FINGERPRINTS
1240 // Dummy definition (else normalization method is defined in CPU
1241 // dependant code)
1242 uint64_t InterpreterRuntime::normalize_fast_native_fingerprint(uint64_t fingerprint) {
1243   return fingerprint;
1244 }
1245 #endif
1246 
1247 address SignatureHandlerLibrary::set_handler_blob() {
1248   BufferBlob* handler_blob = BufferBlob::create("native signature handlers", blob_size);
1249   if (handler_blob == NULL) {
1250     return NULL;
1251   }
1252   address handler = handler_blob->code_begin();
< prev index next >