@@ -202,7 +202,7 @@ static void prepare_for_resolution() {
202202
203203static bool stack_trace_precondition (const ObjectSample* sample) {
204204 assert (sample != NULL , " invariant" );
205- return sample->has_stack_trace_id () && !sample->is_dead () && !sample-> stacktrace (). valid () ;
205+ return sample->has_stack_trace_id () && !sample->is_dead ();
206206}
207207
208208class StackTraceBlobInstaller {
@@ -249,7 +249,7 @@ void StackTraceBlobInstaller::install(ObjectSample* sample) {
249249 writer.write_type (TYPE_STACKTRACE);
250250 writer.write_count (1 );
251251 ObjectSampleCheckpoint::write_stacktrace (stack_trace, writer);
252- blob = writer.move ();
252+ blob = writer.copy ();
253253 _cache.put (sample, blob);
254254 sample->set_stacktrace (blob);
255255}
@@ -278,7 +278,7 @@ void ObjectSampleCheckpoint::on_rotation(const ObjectSampler* sampler) {
278278}
279279
280280static bool is_klass_unloaded (traceid klass_id) {
281- assert_locked_or_safepoint (ClassLoaderDataGraph_lock);
281+ assert (ClassLoaderDataGraph_lock-> owned_by_self (), " invariant " );
282282 return JfrKlassUnloading::is_unloaded (klass_id);
283283}
284284
@@ -381,12 +381,6 @@ void ObjectSampleCheckpoint::write(const ObjectSampler* sampler, EdgeStore* edge
381381 assert (sampler != NULL , " invariant" );
382382 assert (edge_store != NULL , " invariant" );
383383 assert (thread != NULL , " invariant" );
384- {
385- // First install stacktrace blobs for the most recently added candidates.
386- MutexLocker lock (SafepointSynchronize::is_at_safepoint () ? nullptr : ClassLoaderDataGraph_lock);
387- // the lock is needed to ensure the unload lists do not grow in the middle of inspection.
388- install_stack_traces (sampler);
389- }
390384 write_sample_blobs (sampler, emit_all, thread);
391385 // write reference chains
392386 if (!edge_store->is_empty ()) {
0 commit comments