src/share/vm/oops/methodDataOop.hpp

changeset 2138
d5d065957597
parent 1907
c18cbe5936b8
child 2314
f95d63e2154a
     1.1 --- a/src/share/vm/oops/methodDataOop.hpp	Thu Sep 02 11:40:02 2010 -0700
     1.2 +++ b/src/share/vm/oops/methodDataOop.hpp	Fri Sep 03 17:51:07 2010 -0700
     1.3 @@ -1206,7 +1206,25 @@
     1.4    intx              _arg_stack;       // bit set of stack-allocatable arguments
     1.5    intx              _arg_returned;    // bit set of returned arguments
     1.6  
     1.7 -  int _creation_mileage;            // method mileage at MDO creation
     1.8 +  int _creation_mileage;              // method mileage at MDO creation
     1.9 +
    1.10 +  // How many invocations has this MDO seen?
    1.11 +  // These counters are used to determine the exact age of MDO.
    1.12 +  // We need those because in tiered a method can be concurrently
    1.13 +  // executed at different levels.
    1.14 +  InvocationCounter _invocation_counter;
    1.15 +  // Same for backedges.
    1.16 +  InvocationCounter _backedge_counter;
    1.17 +  // Number of loops and blocks is computed when compiling the first
    1.18 +  // time with C1. It is used to determine if method is trivial.
    1.19 +  short             _num_loops;
    1.20 +  short             _num_blocks;
    1.21 +  // Highest compile level this method has ever seen.
    1.22 +  u1                _highest_comp_level;
    1.23 +  // Same for OSR level
    1.24 +  u1                _highest_osr_comp_level;
    1.25 +  // Does this method contain anything worth profiling?
    1.26 +  bool              _would_profile;
    1.27  
    1.28    // Size of _data array in bytes.  (Excludes header and extra_data fields.)
    1.29    int _data_size;
    1.30 @@ -1292,6 +1310,36 @@
    1.31  
    1.32    int      creation_mileage() const  { return _creation_mileage; }
    1.33    void set_creation_mileage(int x)   { _creation_mileage = x; }
    1.34 +
    1.35 +  int invocation_count() {
    1.36 +    if (invocation_counter()->carry()) {
    1.37 +      return InvocationCounter::count_limit;
    1.38 +    }
    1.39 +    return invocation_counter()->count();
    1.40 +  }
    1.41 +  int backedge_count() {
    1.42 +    if (backedge_counter()->carry()) {
    1.43 +      return InvocationCounter::count_limit;
    1.44 +    }
    1.45 +    return backedge_counter()->count();
    1.46 +  }
    1.47 +
    1.48 +  InvocationCounter* invocation_counter()     { return &_invocation_counter; }
    1.49 +  InvocationCounter* backedge_counter()       { return &_backedge_counter;   }
    1.50 +
    1.51 +  void set_would_profile(bool p)              { _would_profile = p;    }
    1.52 +  bool would_profile() const                  { return _would_profile; }
    1.53 +
    1.54 +  int highest_comp_level()                    { return _highest_comp_level;      }
    1.55 +  void set_highest_comp_level(int level)      { _highest_comp_level = level;     }
    1.56 +  int highest_osr_comp_level()                { return _highest_osr_comp_level;  }
    1.57 +  void set_highest_osr_comp_level(int level)  { _highest_osr_comp_level = level; }
    1.58 +
    1.59 +  int num_loops() const                       { return _num_loops;  }
    1.60 +  void set_num_loops(int n)                   { _num_loops = n;     }
    1.61 +  int num_blocks() const                      { return _num_blocks; }
    1.62 +  void set_num_blocks(int n)                  { _num_blocks = n;    }
    1.63 +
    1.64    bool is_mature() const;  // consult mileage and ProfileMaturityPercentage
    1.65    static int mileage_of(methodOop m);
    1.66  
    1.67 @@ -1413,7 +1461,7 @@
    1.68    void inc_decompile_count() {
    1.69      _nof_decompiles += 1;
    1.70      if (decompile_count() > (uint)PerMethodRecompilationCutoff) {
    1.71 -      method()->set_not_compilable();
    1.72 +      method()->set_not_compilable(CompLevel_full_optimization);
    1.73      }
    1.74    }
    1.75  
    1.76 @@ -1422,6 +1470,13 @@
    1.77      return byte_offset_of(methodDataOopDesc, _data[0]);
    1.78    }
    1.79  
    1.80 +  static ByteSize invocation_counter_offset() {
    1.81 +    return byte_offset_of(methodDataOopDesc, _invocation_counter);
    1.82 +  }
    1.83 +  static ByteSize backedge_counter_offset() {
    1.84 +    return byte_offset_of(methodDataOopDesc, _backedge_counter);
    1.85 +  }
    1.86 +
    1.87    // GC support
    1.88    oop* adr_method() const { return (oop*)&_method; }
    1.89    bool object_is_parsable() const { return _size != 0; }

mercurial