< prev index next >

src/hotspot/share/prims/jvmtiExport.hpp

Print this page




  70 
  71 #if INCLUDE_JVMTI
  72   static int         _field_access_count;
  73   static int         _field_modification_count;
  74 
  75   static bool        _can_access_local_variables;
  76   static bool        _can_hotswap_or_post_breakpoint;
  77   static bool        _can_modify_any_class;
  78   static bool        _can_walk_any_space;
  79 #endif // INCLUDE_JVMTI
  80 
  81   JVMTI_SUPPORT_FLAG(can_get_source_debug_extension)
  82   JVMTI_SUPPORT_FLAG(can_maintain_original_method_order)
  83   JVMTI_SUPPORT_FLAG(can_post_interpreter_events)
  84   JVMTI_SUPPORT_FLAG(can_post_on_exceptions)
  85   JVMTI_SUPPORT_FLAG(can_post_breakpoint)
  86   JVMTI_SUPPORT_FLAG(can_post_field_access)
  87   JVMTI_SUPPORT_FLAG(can_post_field_modification)
  88   JVMTI_SUPPORT_FLAG(can_post_method_entry)
  89   JVMTI_SUPPORT_FLAG(can_post_method_exit)

  90   JVMTI_SUPPORT_FLAG(can_pop_frame)
  91   JVMTI_SUPPORT_FLAG(can_force_early_return)


  92 
  93   JVMTI_SUPPORT_FLAG(early_vmstart_recorded)
  94 
  95   friend class JvmtiEventControllerPrivate;  // should only modify these flags
  96   JVMTI_SUPPORT_FLAG(should_post_single_step)
  97   JVMTI_SUPPORT_FLAG(should_post_field_access)
  98   JVMTI_SUPPORT_FLAG(should_post_field_modification)
  99   JVMTI_SUPPORT_FLAG(should_post_class_load)
 100   JVMTI_SUPPORT_FLAG(should_post_class_prepare)
 101   JVMTI_SUPPORT_FLAG(should_post_class_unload)
 102   JVMTI_SUPPORT_FLAG(should_post_native_method_bind)
 103   JVMTI_SUPPORT_FLAG(should_post_compiled_method_load)
 104   JVMTI_SUPPORT_FLAG(should_post_compiled_method_unload)
 105   JVMTI_SUPPORT_FLAG(should_post_dynamic_code_generated)
 106   JVMTI_SUPPORT_FLAG(should_post_monitor_contended_enter)
 107   JVMTI_SUPPORT_FLAG(should_post_monitor_contended_entered)
 108   JVMTI_SUPPORT_FLAG(should_post_monitor_wait)
 109   JVMTI_SUPPORT_FLAG(should_post_monitor_waited)
 110   JVMTI_SUPPORT_FLAG(should_post_data_dump)
 111   JVMTI_SUPPORT_FLAG(should_post_garbage_collection_start)
 112   JVMTI_SUPPORT_FLAG(should_post_garbage_collection_finish)
 113   JVMTI_SUPPORT_FLAG(should_post_on_exceptions)
 114 
 115   // ------ the below maybe don't have to be (but are for now)
 116   // fixed conditions here ------------
 117   // any events can be enabled
 118   JVMTI_SUPPORT_FLAG(should_post_thread_life)
 119   JVMTI_SUPPORT_FLAG(should_post_object_free)
 120   JVMTI_SUPPORT_FLAG(should_post_resource_exhausted)
 121 
 122   // we are holding objects on the heap - need to talk to GC - e.g.
 123   // breakpoint info
 124   JVMTI_SUPPORT_FLAG(should_clean_up_heap_objects)
 125   JVMTI_SUPPORT_FLAG(should_post_vm_object_alloc)
 126   JVMTI_SUPPORT_FLAG(should_post_sampled_object_alloc)
 127 








 128   // If flag cannot be implemented, give an error if on=true
 129   static void report_unsupported(bool on);
 130 
 131   // these should only be called by the friend class
 132   friend class JvmtiManageCapabilities;
 133   inline static void set_can_modify_any_class(bool on) {
 134     JVMTI_ONLY(_can_modify_any_class = (on != 0);)
 135   }
 136   inline static void set_can_access_local_variables(bool on) {
 137     JVMTI_ONLY(_can_access_local_variables = (on != 0);)
 138   }
 139   inline static void set_can_hotswap_or_post_breakpoint(bool on) {
 140     JVMTI_ONLY(_can_hotswap_or_post_breakpoint = (on != 0);)
 141   }
 142   inline static void set_can_walk_any_space(bool on) {
 143     JVMTI_ONLY(_can_walk_any_space = (on != 0);)
 144   }
 145 
 146   enum {
 147     JVMTI_VERSION_MASK   = 0x70000000,


 301     jvalue *value) NOT_JVMTI_RETURN_(NULL);
 302   static oop jni_SetField_probe_nh       (JavaThread *thread, jobject jobj,
 303     oop obj, Klass* klass, jfieldID fieldID, bool is_static, char sig_type,
 304     jvalue *value) NOT_JVMTI_RETURN_(NULL);
 305   static void post_field_modification_by_jni(JavaThread *thread, oop obj,
 306     Klass* klass, jfieldID fieldID, bool is_static, char sig_type,
 307     jvalue *value);
 308   static void post_raw_field_modification(JavaThread *thread, Method* method,
 309     address location, Klass* field_klass, Handle object, jfieldID field,
 310     char sig_type, jvalue *value) NOT_JVMTI_RETURN;
 311 
 312   static void post_method_entry          (JavaThread *thread, Method* method, frame current_frame) NOT_JVMTI_RETURN;
 313   static void post_method_exit           (JavaThread *thread, Method* method, frame current_frame) NOT_JVMTI_RETURN;
 314 
 315   static void post_class_load            (JavaThread *thread, Klass* klass) NOT_JVMTI_RETURN;
 316   static void post_class_unload          (Klass* klass) NOT_JVMTI_RETURN;
 317   static void post_class_prepare         (JavaThread *thread, Klass* klass) NOT_JVMTI_RETURN;
 318 
 319   static void post_thread_start          (JavaThread *thread) NOT_JVMTI_RETURN;
 320   static void post_thread_end            (JavaThread *thread) NOT_JVMTI_RETURN;








 321 
 322   // Support for java.lang.instrument agent loading.
 323   static bool _should_post_class_file_load_hook;
 324   inline static void set_should_post_class_file_load_hook(bool on)     { _should_post_class_file_load_hook = on;  }
 325   inline static bool should_post_class_file_load_hook()           {
 326     JVMTI_ONLY(return _should_post_class_file_load_hook);
 327     NOT_JVMTI(return false;)
 328   }
 329   static bool is_early_phase() NOT_JVMTI_RETURN_(false);
 330   static bool has_early_class_hook_env() NOT_JVMTI_RETURN_(false);
 331   // Return true if the class was modified by the hook.
 332   static bool post_class_file_load_hook(Symbol* h_name, Handle class_loader,
 333                                         Handle h_protection_domain,
 334                                         unsigned char **data_ptr, unsigned char **end_ptr,
 335                                         JvmtiCachedClassFileData **cache_ptr) NOT_JVMTI_RETURN_(false);
 336   static void post_native_method_bind(Method* method, address* function_ptr) NOT_JVMTI_RETURN;
 337   static void post_compiled_method_load(nmethod *nm) NOT_JVMTI_RETURN;
 338   static void post_dynamic_code_generated(const char *name, const void *code_begin, const void *code_end) NOT_JVMTI_RETURN;
 339 
 340   // used to post a CompiledMethodUnload event




  70 
  71 #if INCLUDE_JVMTI
  72   static int         _field_access_count;
  73   static int         _field_modification_count;
  74 
  75   static bool        _can_access_local_variables;
  76   static bool        _can_hotswap_or_post_breakpoint;
  77   static bool        _can_modify_any_class;
  78   static bool        _can_walk_any_space;
  79 #endif // INCLUDE_JVMTI
  80 
  81   JVMTI_SUPPORT_FLAG(can_get_source_debug_extension)
  82   JVMTI_SUPPORT_FLAG(can_maintain_original_method_order)
  83   JVMTI_SUPPORT_FLAG(can_post_interpreter_events)
  84   JVMTI_SUPPORT_FLAG(can_post_on_exceptions)
  85   JVMTI_SUPPORT_FLAG(can_post_breakpoint)
  86   JVMTI_SUPPORT_FLAG(can_post_field_access)
  87   JVMTI_SUPPORT_FLAG(can_post_field_modification)
  88   JVMTI_SUPPORT_FLAG(can_post_method_entry)
  89   JVMTI_SUPPORT_FLAG(can_post_method_exit)
  90   JVMTI_SUPPORT_FLAG(can_post_frame_pop)
  91   JVMTI_SUPPORT_FLAG(can_pop_frame)
  92   JVMTI_SUPPORT_FLAG(can_force_early_return)
  93   JVMTI_SUPPORT_FLAG(can_support_fibers)
  94   JVMTI_SUPPORT_FLAG(can_support_continuations)
  95 
  96   JVMTI_SUPPORT_FLAG(early_vmstart_recorded)
  97 
  98   friend class JvmtiEventControllerPrivate;  // should only modify these flags
  99   JVMTI_SUPPORT_FLAG(should_post_single_step)
 100   JVMTI_SUPPORT_FLAG(should_post_field_access)
 101   JVMTI_SUPPORT_FLAG(should_post_field_modification)
 102   JVMTI_SUPPORT_FLAG(should_post_class_load)
 103   JVMTI_SUPPORT_FLAG(should_post_class_prepare)
 104   JVMTI_SUPPORT_FLAG(should_post_class_unload)
 105   JVMTI_SUPPORT_FLAG(should_post_native_method_bind)
 106   JVMTI_SUPPORT_FLAG(should_post_compiled_method_load)
 107   JVMTI_SUPPORT_FLAG(should_post_compiled_method_unload)
 108   JVMTI_SUPPORT_FLAG(should_post_dynamic_code_generated)
 109   JVMTI_SUPPORT_FLAG(should_post_monitor_contended_enter)
 110   JVMTI_SUPPORT_FLAG(should_post_monitor_contended_entered)
 111   JVMTI_SUPPORT_FLAG(should_post_monitor_wait)
 112   JVMTI_SUPPORT_FLAG(should_post_monitor_waited)
 113   JVMTI_SUPPORT_FLAG(should_post_data_dump)
 114   JVMTI_SUPPORT_FLAG(should_post_garbage_collection_start)
 115   JVMTI_SUPPORT_FLAG(should_post_garbage_collection_finish)
 116   JVMTI_SUPPORT_FLAG(should_post_on_exceptions)
 117 
 118   // ------ the below maybe don't have to be (but are for now)
 119   // fixed conditions here ------------
 120   // any events can be enabled
 121   JVMTI_SUPPORT_FLAG(should_post_thread_life)
 122   JVMTI_SUPPORT_FLAG(should_post_object_free)
 123   JVMTI_SUPPORT_FLAG(should_post_resource_exhausted)
 124 
 125   // we are holding objects on the heap - need to talk to GC - e.g.
 126   // breakpoint info
 127   JVMTI_SUPPORT_FLAG(should_clean_up_heap_objects)
 128   JVMTI_SUPPORT_FLAG(should_post_vm_object_alloc)
 129   JVMTI_SUPPORT_FLAG(should_post_sampled_object_alloc)
 130 
 131   JVMTI_SUPPORT_FLAG(should_post_continuation_run)
 132   JVMTI_SUPPORT_FLAG(should_post_continuation_yield)
 133 
 134   JVMTI_SUPPORT_FLAG(should_post_fiber_scheduled)
 135   JVMTI_SUPPORT_FLAG(should_post_fiber_terminated)
 136   JVMTI_SUPPORT_FLAG(should_post_fiber_mount)
 137   JVMTI_SUPPORT_FLAG(should_post_fiber_unmount)
 138 
 139   // If flag cannot be implemented, give an error if on=true
 140   static void report_unsupported(bool on);
 141 
 142   // these should only be called by the friend class
 143   friend class JvmtiManageCapabilities;
 144   inline static void set_can_modify_any_class(bool on) {
 145     JVMTI_ONLY(_can_modify_any_class = (on != 0);)
 146   }
 147   inline static void set_can_access_local_variables(bool on) {
 148     JVMTI_ONLY(_can_access_local_variables = (on != 0);)
 149   }
 150   inline static void set_can_hotswap_or_post_breakpoint(bool on) {
 151     JVMTI_ONLY(_can_hotswap_or_post_breakpoint = (on != 0);)
 152   }
 153   inline static void set_can_walk_any_space(bool on) {
 154     JVMTI_ONLY(_can_walk_any_space = (on != 0);)
 155   }
 156 
 157   enum {
 158     JVMTI_VERSION_MASK   = 0x70000000,


 312     jvalue *value) NOT_JVMTI_RETURN_(NULL);
 313   static oop jni_SetField_probe_nh       (JavaThread *thread, jobject jobj,
 314     oop obj, Klass* klass, jfieldID fieldID, bool is_static, char sig_type,
 315     jvalue *value) NOT_JVMTI_RETURN_(NULL);
 316   static void post_field_modification_by_jni(JavaThread *thread, oop obj,
 317     Klass* klass, jfieldID fieldID, bool is_static, char sig_type,
 318     jvalue *value);
 319   static void post_raw_field_modification(JavaThread *thread, Method* method,
 320     address location, Klass* field_klass, Handle object, jfieldID field,
 321     char sig_type, jvalue *value) NOT_JVMTI_RETURN;
 322 
 323   static void post_method_entry          (JavaThread *thread, Method* method, frame current_frame) NOT_JVMTI_RETURN;
 324   static void post_method_exit           (JavaThread *thread, Method* method, frame current_frame) NOT_JVMTI_RETURN;
 325 
 326   static void post_class_load            (JavaThread *thread, Klass* klass) NOT_JVMTI_RETURN;
 327   static void post_class_unload          (Klass* klass) NOT_JVMTI_RETURN;
 328   static void post_class_prepare         (JavaThread *thread, Klass* klass) NOT_JVMTI_RETURN;
 329 
 330   static void post_thread_start          (JavaThread *thread) NOT_JVMTI_RETURN;
 331   static void post_thread_end            (JavaThread *thread) NOT_JVMTI_RETURN;
 332 
 333   static void post_fiber_scheduled       (jthread thread, jobject fiber) NOT_JVMTI_RETURN;
 334   static void post_fiber_terminated      (jthread thread, jobject fiber) NOT_JVMTI_RETURN;
 335   static void post_fiber_mount           (jthread thread, jobject fiber) NOT_JVMTI_RETURN;
 336   static void post_fiber_unmount         (jthread thread, jobject fiber) NOT_JVMTI_RETURN;
 337   
 338   static void post_continuation_run      (JavaThread* thread, jint continuation_frame_count) NOT_JVMTI_RETURN;
 339   static void post_continuation_yield    (JavaThread* thread, jint continuation_frame_count) NOT_JVMTI_RETURN;
 340 
 341   // Support for java.lang.instrument agent loading.
 342   static bool _should_post_class_file_load_hook;
 343   inline static void set_should_post_class_file_load_hook(bool on)     { _should_post_class_file_load_hook = on;  }
 344   inline static bool should_post_class_file_load_hook()           {
 345     JVMTI_ONLY(return _should_post_class_file_load_hook);
 346     NOT_JVMTI(return false;)
 347   }
 348   static bool is_early_phase() NOT_JVMTI_RETURN_(false);
 349   static bool has_early_class_hook_env() NOT_JVMTI_RETURN_(false);
 350   // Return true if the class was modified by the hook.
 351   static bool post_class_file_load_hook(Symbol* h_name, Handle class_loader,
 352                                         Handle h_protection_domain,
 353                                         unsigned char **data_ptr, unsigned char **end_ptr,
 354                                         JvmtiCachedClassFileData **cache_ptr) NOT_JVMTI_RETURN_(false);
 355   static void post_native_method_bind(Method* method, address* function_ptr) NOT_JVMTI_RETURN;
 356   static void post_compiled_method_load(nmethod *nm) NOT_JVMTI_RETURN;
 357   static void post_dynamic_code_generated(const char *name, const void *code_begin, const void *code_end) NOT_JVMTI_RETURN;
 358 
 359   // used to post a CompiledMethodUnload event


< prev index next >