Merge

Thu, 11 Sep 2014 20:56:04 +0000

author
iveresov
date
Thu, 11 Sep 2014 20:56:04 +0000
changeset 7173
a98dd542cd25
parent 7170
64156d22e49d
parent 7172
0d78074d2444
child 7174
df66e3a3c4c2

Merge

     1.1 --- a/src/share/vm/classfile/systemDictionary.cpp	Thu Sep 11 11:55:30 2014 -0700
     1.2 +++ b/src/share/vm/classfile/systemDictionary.cpp	Thu Sep 11 20:56:04 2014 +0000
     1.3 @@ -51,6 +51,7 @@
     1.4  #include "oops/typeArrayKlass.hpp"
     1.5  #include "prims/jvmtiEnvBase.hpp"
     1.6  #include "prims/methodHandles.hpp"
     1.7 +#include "runtime/arguments.hpp"
     1.8  #include "runtime/biasedLocking.hpp"
     1.9  #include "runtime/fieldType.hpp"
    1.10  #include "runtime/handles.inline.hpp"
    1.11 @@ -2277,7 +2278,11 @@
    1.12      m = Method::make_method_handle_intrinsic(iid, signature, CHECK_(empty));
    1.13      CompileBroker::compile_method(m, InvocationEntryBci, CompLevel_highest_tier,
    1.14                                    methodHandle(), CompileThreshold, "MH", CHECK_(empty));
    1.15 -
    1.16 +    // Check if we need to have compiled code but we don't.
    1.17 +    if (!Arguments::is_interpreter_only() && !m->has_compiled_code()) {
    1.18 +      THROW_MSG_(vmSymbols::java_lang_VirtualMachineError(),
    1.19 +                 "out of space in CodeCache for method handle intrinsic", empty);
    1.20 +    }
    1.21      // Now grab the lock.  We might have to throw away the new method,
    1.22      // if a racing thread has managed to install one at the same time.
    1.23      {
    1.24 @@ -2291,7 +2296,7 @@
    1.25    }
    1.26  
    1.27    assert(spe != NULL && spe->method() != NULL, "");
    1.28 -  assert(!UseCompiler || (spe->method()->has_compiled_code() &&
    1.29 +  assert(Arguments::is_interpreter_only() || (spe->method()->has_compiled_code() &&
    1.30           spe->method()->code()->entry_point() == spe->method()->from_compiled_entry()),
    1.31           "MH intrinsic invariant");
    1.32    return spe->method();
     2.1 --- a/src/share/vm/oops/method.cpp	Thu Sep 11 11:55:30 2014 -0700
     2.2 +++ b/src/share/vm/oops/method.cpp	Thu Sep 11 20:56:04 2014 +0000
     2.3 @@ -1636,34 +1636,34 @@
     2.4  }
     2.5  
     2.6  int Method::highest_comp_level() const {
     2.7 -  const MethodData* mdo = method_data();
     2.8 -  if (mdo != NULL) {
     2.9 -    return mdo->highest_comp_level();
    2.10 +  const MethodCounters* mcs = method_counters();
    2.11 +  if (mcs != NULL) {
    2.12 +    return mcs->highest_comp_level();
    2.13    } else {
    2.14      return CompLevel_none;
    2.15    }
    2.16  }
    2.17  
    2.18  int Method::highest_osr_comp_level() const {
    2.19 -  const MethodData* mdo = method_data();
    2.20 -  if (mdo != NULL) {
    2.21 -    return mdo->highest_osr_comp_level();
    2.22 +  const MethodCounters* mcs = method_counters();
    2.23 +  if (mcs != NULL) {
    2.24 +    return mcs->highest_osr_comp_level();
    2.25    } else {
    2.26      return CompLevel_none;
    2.27    }
    2.28  }
    2.29  
    2.30  void Method::set_highest_comp_level(int level) {
    2.31 -  MethodData* mdo = method_data();
    2.32 -  if (mdo != NULL) {
    2.33 -    mdo->set_highest_comp_level(level);
    2.34 +  MethodCounters* mcs = method_counters();
    2.35 +  if (mcs != NULL) {
    2.36 +    mcs->set_highest_comp_level(level);
    2.37    }
    2.38  }
    2.39  
    2.40  void Method::set_highest_osr_comp_level(int level) {
    2.41 -  MethodData* mdo = method_data();
    2.42 -  if (mdo != NULL) {
    2.43 -    mdo->set_highest_osr_comp_level(level);
    2.44 +  MethodCounters* mcs = method_counters();
    2.45 +  if (mcs != NULL) {
    2.46 +    mcs->set_highest_osr_comp_level(level);
    2.47    }
    2.48  }
    2.49  
     3.1 --- a/src/share/vm/oops/methodCounters.cpp	Thu Sep 11 11:55:30 2014 -0700
     3.2 +++ b/src/share/vm/oops/methodCounters.cpp	Thu Sep 11 20:56:04 2014 +0000
     3.3 @@ -34,4 +34,40 @@
     3.4    backedge_counter()->reset();
     3.5    set_interpreter_throwout_count(0);
     3.6    set_interpreter_invocation_count(0);
     3.7 +#ifdef TIERED
     3.8 +  set_prev_time(0);
     3.9 +  set_rate(0);
    3.10 +  set_highest_comp_level(0);
    3.11 +  set_highest_osr_comp_level(0);
    3.12 +#endif
    3.13  }
    3.14 +
    3.15 +
    3.16 +int MethodCounters::highest_comp_level() const {
    3.17 +#ifdef TIERED
    3.18 +  return _highest_comp_level;
    3.19 +#else
    3.20 +  return CompLevel_none;
    3.21 +#endif
    3.22 +}
    3.23 +
    3.24 +void MethodCounters::set_highest_comp_level(int level) {
    3.25 +#ifdef TIERED
    3.26 +  _highest_comp_level = level;
    3.27 +#endif
    3.28 +}
    3.29 +
    3.30 +int MethodCounters::highest_osr_comp_level() const {
    3.31 +#ifdef TIERED
    3.32 +  return _highest_osr_comp_level;
    3.33 +#else
    3.34 +  return CompLevel_none;
    3.35 +#endif
    3.36 +}
    3.37 +
    3.38 +void MethodCounters::set_highest_osr_comp_level(int level) {
    3.39 +#ifdef TIERED
    3.40 +  _highest_osr_comp_level = level;
    3.41 +#endif
    3.42 +}
    3.43 +
     4.1 --- a/src/share/vm/oops/methodCounters.hpp	Thu Sep 11 11:55:30 2014 -0700
     4.2 +++ b/src/share/vm/oops/methodCounters.hpp	Thu Sep 11 20:56:04 2014 +0000
     4.3 @@ -39,6 +39,8 @@
     4.4  
     4.5  #ifdef TIERED
     4.6    float             _rate;                        // Events (invocation and backedge counter increments) per millisecond
     4.7 +  u1                _highest_comp_level;          // Highest compile level this method has ever seen.
     4.8 +  u1                _highest_osr_comp_level;      // Same for OSR level
     4.9    jlong             _prev_time;                   // Previous time the rate was acquired
    4.10  #endif
    4.11  
    4.12 @@ -47,6 +49,8 @@
    4.13                       _number_of_breakpoints(0)
    4.14  #ifdef TIERED
    4.15                     , _rate(0),
    4.16 +                     _highest_comp_level(0),
    4.17 +                     _highest_osr_comp_level(0),
    4.18                       _prev_time(0)
    4.19  #endif
    4.20    {
    4.21 @@ -100,6 +104,11 @@
    4.22    void set_rate(float rate)                      { _rate = rate; }
    4.23  #endif
    4.24  
    4.25 +  int highest_comp_level() const;
    4.26 +  void set_highest_comp_level(int level);
    4.27 +  int highest_osr_comp_level() const;
    4.28 +  void set_highest_osr_comp_level(int level);
    4.29 +
    4.30    // invocation counter
    4.31    InvocationCounter* invocation_counter() { return &_invocation_counter; }
    4.32    InvocationCounter* backedge_counter()   { return &_backedge_counter; }
     5.1 --- a/src/share/vm/oops/methodData.cpp	Thu Sep 11 11:55:30 2014 -0700
     5.2 +++ b/src/share/vm/oops/methodData.cpp	Thu Sep 11 20:56:04 2014 +0000
     5.3 @@ -1153,8 +1153,6 @@
     5.4    _backedge_counter_start = 0;
     5.5    _num_loops = 0;
     5.6    _num_blocks = 0;
     5.7 -  _highest_comp_level = 0;
     5.8 -  _highest_osr_comp_level = 0;
     5.9    _would_profile = true;
    5.10  
    5.11  #if INCLUDE_RTM_OPT
     6.1 --- a/src/share/vm/oops/methodData.hpp	Thu Sep 11 11:55:30 2014 -0700
     6.2 +++ b/src/share/vm/oops/methodData.hpp	Thu Sep 11 20:56:04 2014 +0000
     6.3 @@ -2098,10 +2098,6 @@
     6.4    // time with C1. It is used to determine if method is trivial.
     6.5    short             _num_loops;
     6.6    short             _num_blocks;
     6.7 -  // Highest compile level this method has ever seen.
     6.8 -  u1                _highest_comp_level;
     6.9 -  // Same for OSR level
    6.10 -  u1                _highest_osr_comp_level;
    6.11    // Does this method contain anything worth profiling?
    6.12    bool              _would_profile;
    6.13  
    6.14 @@ -2275,11 +2271,6 @@
    6.15    void set_would_profile(bool p)              { _would_profile = p;    }
    6.16    bool would_profile() const                  { return _would_profile; }
    6.17  
    6.18 -  int highest_comp_level() const              { return _highest_comp_level;      }
    6.19 -  void set_highest_comp_level(int level)      { _highest_comp_level = level;     }
    6.20 -  int highest_osr_comp_level() const          { return _highest_osr_comp_level;  }
    6.21 -  void set_highest_osr_comp_level(int level)  { _highest_osr_comp_level = level; }
    6.22 -
    6.23    int num_loops() const                       { return _num_loops;  }
    6.24    void set_num_loops(int n)                   { _num_loops = n;     }
    6.25    int num_blocks() const                      { return _num_blocks; }
     7.1 --- a/src/share/vm/runtime/arguments.hpp	Thu Sep 11 11:55:30 2014 -0700
     7.2 +++ b/src/share/vm/runtime/arguments.hpp	Thu Sep 11 20:56:04 2014 +0000
     7.3 @@ -601,7 +601,9 @@
     7.4    static void  fix_appclasspath();
     7.5  
     7.6    // Operation modi
     7.7 -  static Mode mode()                        { return _mode; }
     7.8 +  static Mode mode()                { return _mode; }
     7.9 +  static bool is_interpreter_only() { return mode() == _int; }
    7.10 +
    7.11  
    7.12    // Utility: copies src into buf, replacing "%%" with "%" and "%p" with pid.
    7.13    static bool copy_expand_pid(const char* src, size_t srclen, char* buf, size_t buflen);

mercurial