< prev index next >

src/hotspot/share/jfr/leakprofiler/sampling/objectSample.hpp

Print this page
@@ -56,10 +56,11 @@
    int _index;
    size_t _span;
    size_t _allocated;
    size_t _heap_used_at_last_gc;
    unsigned int _stack_trace_hash;
+   bool _virtual_thread;
  
    void release_references() {
      _stacktrace.~JfrBlobHandle();
      _thread.~JfrBlobHandle();
      _type_set.~JfrBlobHandle();

@@ -78,11 +79,12 @@
                     _thread_id(0),
                     _index(0),
                     _span(0),
                     _allocated(0),
                     _heap_used_at_last_gc(0),
-                    _stack_trace_hash(0) {}
+                    _stack_trace_hash(0),
+                    _virtual_thread(false) {}
  
    ObjectSample* next() const {
      return _next;
    }
  

@@ -141,10 +143,15 @@
  
    const void set_allocation_time(const JfrTicks& time) {
      _allocation_time = Ticks(time.value());
    }
  
+   bool is_alive_and_older_than(jlong time_stamp) const {
+     return !is_dead() && (JfrTime::is_ft_enabled() ?
+       _allocation_time.ft_value() : _allocation_time.value()) < time_stamp;
+   }
+ 
    void set_heap_used_at_last_gc(size_t heap_used) {
      _heap_used_at_last_gc = heap_used;
    }
  
    size_t heap_used_at_last_gc() const {

@@ -169,23 +176,10 @@
  
    void set_stack_trace_hash(unsigned int hash) {
      _stack_trace_hash = hash;
    }
  
-   traceid thread_id() const {
-     return _thread_id;
-   }
- 
-   void set_thread_id(traceid id) {
-     _thread_id = id;
-   }
- 
-   bool is_alive_and_older_than(jlong time_stamp) const {
-     return !is_dead() && (JfrTime::is_ft_enabled() ?
-       _allocation_time.ft_value() : _allocation_time.value()) < time_stamp;
-   }
- 
    const JfrBlobHandle& stacktrace() const {
      return _stacktrace;
    }
  
    bool has_stacktrace() const {

@@ -198,24 +192,41 @@
      if (_stacktrace != ref) {
        _stacktrace = ref;
      }
    }
  
-   const JfrBlobHandle& thread() const {
-     return _thread;
-   }
- 
    bool has_thread() const {
      return _thread.valid();
    }
  
+   const JfrBlobHandle& thread() const {
+     return _thread;
+   }
+ 
    void set_thread(const JfrBlobHandle& ref) {
      if (_thread != ref) {
        _thread = ref;
      }
    }
  
+   traceid thread_id() const {
+     return _thread_id;
+   }
+ 
+   void set_thread_id(traceid id) {
+     _thread_id = id;
+   }
+ 
+   bool is_virtual_thread() const {
+     return _virtual_thread;
+   }
+ 
+   void set_thread_is_virtual() {
+     assert(!_virtual_thread, "invariant");
+     _virtual_thread = true;
+   }
+ 
    const JfrBlobHandle& type_set() const {
      return _type_set;
    }
  
    bool has_type_set() const {
< prev index next >