< 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"

1101   ProfileData* data = h_mdo->data_at(h_mdo->dp_to_di(last_frame.mdp()));
1102   guarantee(data != NULL, "profile data must be valid");
1103   RetData* rdata = data->as_RetData();
1104   address new_mdp = rdata->fixup_ret(return_bci, h_mdo);
1105   last_frame.set_mdp(new_mdp);
1106 JRT_END
1107 
1108 JRT_ENTRY(MethodCounters*, InterpreterRuntime::build_method_counters(JavaThread* current, Method* m))
1109   return Method::build_method_counters(current, m);
1110 JRT_END
1111 
1112 
1113 JRT_ENTRY(void, InterpreterRuntime::at_safepoint(JavaThread* current))
1114   // We used to need an explict preserve_arguments here for invoke bytecodes. However,
1115   // stack traversal automatically takes care of preserving arguments for invoke, so
1116   // this is no longer needed.
1117 
1118   // JRT_END does an implicit safepoint check, hence we are guaranteed to block
1119   // if this is called during a safepoint
1120 




1121   if (JvmtiExport::should_post_single_step()) {
1122     // This function is called by the interpreter when single stepping. Such single
1123     // stepping could unwind a frame. Then, it is important that we process any frames
1124     // that we might return into.
1125     StackWatermarkSet::before_unwind(current);
1126 
1127     // We are called during regular safepoints and when the VM is
1128     // single stepping. If any thread is marked for single stepping,
1129     // then we may have JVMTI work to do.
1130     LastFrameAccessor last_frame(current);
1131     JvmtiExport::at_single_stepping_point(current, last_frame.method(), last_frame.bcp());
1132   }
1133 JRT_END
1134 
1135 JRT_LEAF(void, InterpreterRuntime::at_unwind(JavaThread* current))
1136   // This function is called by the interpreter when the return poll found a reason
1137   // to call the VM. The reason could be that we are returning into a not yet safe
1138   // to access frame. We handle that below.
1139   // Note that this path does not check for single stepping, because we do not want
1140   // to single step when unwinding frames for an exception being thrown. Instead,

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

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

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