1.1 --- a/src/share/vm/prims/jvmtiImpl.hpp Thu Feb 24 21:38:37 2011 -0500 1.2 +++ b/src/share/vm/prims/jvmtiImpl.hpp Sat Feb 26 13:33:23 2011 -0500 1.3 @@ -451,7 +451,7 @@ 1.4 TYPE_NONE, 1.5 TYPE_COMPILED_METHOD_LOAD, 1.6 TYPE_COMPILED_METHOD_UNLOAD, 1.7 - TYPE_FLUSH // pseudo-event used to implement flush_queue() 1.8 + TYPE_DYNAMIC_CODE_GENERATED 1.9 } Type; 1.10 1.11 Type _type; 1.12 @@ -461,49 +461,15 @@ 1.13 jmethodID method_id; 1.14 const void* code_begin; 1.15 } compiled_method_unload; 1.16 - int* flush_state_addr; 1.17 + struct { 1.18 + const char* name; 1.19 + const void* code_begin; 1.20 + const void* code_end; 1.21 + } dynamic_code_generated; 1.22 } _event_data; 1.23 1.24 JvmtiDeferredEvent(Type t) : _type(t) {} 1.25 1.26 - void set_compiled_method_load(nmethod* nm) { 1.27 - assert(_type == TYPE_COMPILED_METHOD_LOAD, "must be"); 1.28 - _event_data.compiled_method_load = nm; 1.29 - } 1.30 - 1.31 - nmethod* compiled_method_load() const { 1.32 - assert(_type == TYPE_COMPILED_METHOD_LOAD, "must be"); 1.33 - return _event_data.compiled_method_load; 1.34 - } 1.35 - 1.36 - void set_compiled_method_unload(jmethodID id, const void* code) { 1.37 - assert(_type == TYPE_COMPILED_METHOD_UNLOAD, "must be"); 1.38 - _event_data.compiled_method_unload.method_id = id; 1.39 - _event_data.compiled_method_unload.code_begin = code; 1.40 - } 1.41 - 1.42 - jmethodID compiled_method_unload_method_id() const { 1.43 - assert(_type == TYPE_COMPILED_METHOD_UNLOAD, "must be"); 1.44 - return _event_data.compiled_method_unload.method_id; 1.45 - } 1.46 - 1.47 - const void* compiled_method_unload_code_begin() const { 1.48 - assert(_type == TYPE_COMPILED_METHOD_UNLOAD, "must be"); 1.49 - return _event_data.compiled_method_unload.code_begin; 1.50 - } 1.51 - 1.52 - bool is_flush_event() const { return _type == TYPE_FLUSH; } 1.53 - 1.54 - int* flush_state_addr() const { 1.55 - assert(is_flush_event(), "must be"); 1.56 - return _event_data.flush_state_addr; 1.57 - } 1.58 - 1.59 - void set_flush_state_addr(int* flag) { 1.60 - assert(is_flush_event(), "must be"); 1.61 - _event_data.flush_state_addr = flag; 1.62 - } 1.63 - 1.64 public: 1.65 1.66 JvmtiDeferredEvent() : _type(TYPE_NONE) {} 1.67 @@ -513,6 +479,9 @@ 1.68 KERNEL_RETURN_(JvmtiDeferredEvent()); 1.69 static JvmtiDeferredEvent compiled_method_unload_event( 1.70 jmethodID id, const void* code) KERNEL_RETURN_(JvmtiDeferredEvent()); 1.71 + static JvmtiDeferredEvent dynamic_code_generated_event( 1.72 + const char* name, const void* begin, const void* end) 1.73 + KERNEL_RETURN_(JvmtiDeferredEvent()); 1.74 1.75 // Actually posts the event. 1.76 void post() KERNEL_RETURN; 1.77 @@ -548,25 +517,12 @@ 1.78 // Transfers events from the _pending_list to the _queue. 1.79 static void process_pending_events() KERNEL_RETURN; 1.80 1.81 - static void flush_complete(int* flush_state) KERNEL_RETURN; 1.82 - 1.83 public: 1.84 // Must be holding Service_lock when calling these 1.85 static bool has_events() KERNEL_RETURN_(false); 1.86 static void enqueue(const JvmtiDeferredEvent& event) KERNEL_RETURN; 1.87 static JvmtiDeferredEvent dequeue() KERNEL_RETURN_(JvmtiDeferredEvent()); 1.88 1.89 - // This call blocks until all events enqueued prior to this call 1.90 - // have been posted. The Service_lock is acquired and waited upon. 1.91 - // 1.92 - // Implemented by creating a "flush" event and placing it in the queue. 1.93 - // When the flush event is "posted" it will call flush_complete(), which 1.94 - // will release the caller. 1.95 - // 1.96 - // Can be called by any thread (maybe even the service thread itself). 1.97 - // Not necessary for the caller to be a JavaThread. 1.98 - static void flush_queue(Thread* current) KERNEL_RETURN; 1.99 - 1.100 // Used to enqueue events without using a lock, for times (such as during 1.101 // safepoint) when we can't or don't want to lock the Service_lock. 1.102 //