< prev index next >

src/hotspot/share/oops/trainingData.hpp

Print this page
*** 34,10 ***
--- 34,11 ---
  #include "memory/metaspaceClosure.hpp"
  #include "oops/instanceKlass.hpp"
  #include "oops/method.hpp"
  #include "runtime/handles.hpp"
  #include "runtime/mutexLocker.hpp"
+ #include "utilities/count_leading_zeros.hpp"
  #include "utilities/resizeableResourceHash.hpp"
  
  class ciEnv;
  class ciBaseObject;
  class CompileTask;

*** 307,11 ***
    virtual void prepare(Visitor& visitor) = 0;
    virtual void cleanup(Visitor& visitor) = 0;
  
    static void initialize() NOT_CDS_RETURN;
  
!   static void verify();
  
    // Widget for recording dependencies, as an N-to-M graph relation,
    // possibly cyclic.
    template<typename E>
    class DepList : public StackObj {
--- 308,11 ---
    virtual void prepare(Visitor& visitor) = 0;
    virtual void cleanup(Visitor& visitor) = 0;
  
    static void initialize() NOT_CDS_RETURN;
  
!   static void verify() NOT_CDS_RETURN;
  
    // Widget for recording dependencies, as an N-to-M graph relation,
    // possibly cyclic.
    template<typename E>
    class DepList : public StackObj {

*** 735,17 ***
--- 736,23 ---
    }
  
    static int level_mask(int level) {
      return ((level & 0xF) != level ? 0 : 1 << level);
    }
+   static CompLevel highest_level(int mask) {
+     if (mask == 0)  return (CompLevel) 0;
+     int diff = (count_leading_zeros(level_mask(0)) - count_leading_zeros(mask));
+     return (CompLevel) diff;
+   }
  
   public:
    KlassTrainingData* klass()  const { return _klass; }
    bool has_holder()           const { return _holder != nullptr; }
    Method* holder()            const { return _holder; }
    bool only_inlined()         const { return !_was_toplevel; }
    bool saw_level(CompLevel l) const { return (_level_mask & level_mask(l)) != 0; }
+   int highest_level()         const { return highest_level(_level_mask); }
    int highest_top_level()     const { return _highest_top_level; }
    MethodData* final_profile() const { return _final_profile; }
  
    Symbol* name() const {
      precond(has_holder());
< prev index next >