Merge

Tue, 08 Oct 2013 07:08:27 -0700

author
iveresov
date
Tue, 08 Oct 2013 07:08:27 -0700
changeset 5909
17cda06bcb7d
parent 5824
deec468baebd
parent 5908
d9043b88eeb3
child 5910
6171eb9da4fd

Merge

src/share/vm/classfile/defaultMethods.cpp file | annotate | diff | comparison | revisions
test/compiler/8013496/Test8013496.sh file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/c1/c1_LIRGenerator.cpp	Fri Oct 04 14:19:56 2013 -0700
     1.2 +++ b/src/share/vm/c1/c1_LIRGenerator.cpp	Tue Oct 08 07:08:27 2013 -0700
     1.3 @@ -3053,7 +3053,11 @@
     1.4    int offset = -1;
     1.5    LIR_Opr counter_holder;
     1.6    if (level == CompLevel_limited_profile) {
     1.7 -    address counters_adr = method->ensure_method_counters();
     1.8 +    MethodCounters* counters_adr = method->ensure_method_counters();
     1.9 +    if (counters_adr == NULL) {
    1.10 +      bailout("method counters allocation failed");
    1.11 +      return;
    1.12 +    }
    1.13      counter_holder = new_pointer_register();
    1.14      __ move(LIR_OprFact::intptrConst(counters_adr), counter_holder);
    1.15      offset = in_bytes(backedge ? MethodCounters::backedge_counter_offset() :
     2.1 --- a/src/share/vm/ci/ciEnv.cpp	Fri Oct 04 14:19:56 2013 -0700
     2.2 +++ b/src/share/vm/ci/ciEnv.cpp	Tue Oct 08 07:08:27 2013 -0700
     2.3 @@ -1154,9 +1154,12 @@
     2.4    GUARDED_VM_ENTRY(return _factory->get_unloaded_object_constant();)
     2.5  }
     2.6  
     2.7 -void ciEnv::dump_replay_data(outputStream* out) {
     2.8 -  VM_ENTRY_MARK;
     2.9 -  MutexLocker ml(Compile_lock);
    2.10 +// ------------------------------------------------------------------
    2.11 +// ciEnv::dump_replay_data*
    2.12 +
    2.13 +// Don't change thread state and acquire any locks.
    2.14 +// Safe to call from VM error reporter.
    2.15 +void ciEnv::dump_replay_data_unsafe(outputStream* out) {
    2.16    ResourceMark rm;
    2.17  #if INCLUDE_JVMTI
    2.18    out->print_cr("JvmtiExport can_access_local_variables %d",     _jvmti_can_access_local_variables);
    2.19 @@ -1181,3 +1184,10 @@
    2.20                  entry_bci, comp_level);
    2.21    out->flush();
    2.22  }
    2.23 +
    2.24 +void ciEnv::dump_replay_data(outputStream* out) {
    2.25 +  GUARDED_VM_ENTRY(
    2.26 +    MutexLocker ml(Compile_lock);
    2.27 +    dump_replay_data_unsafe(out);
    2.28 +  )
    2.29 +}
     3.1 --- a/src/share/vm/ci/ciEnv.hpp	Fri Oct 04 14:19:56 2013 -0700
     3.2 +++ b/src/share/vm/ci/ciEnv.hpp	Tue Oct 08 07:08:27 2013 -0700
     3.3 @@ -452,6 +452,7 @@
     3.4  
     3.5    // Dump the compilation replay data for the ciEnv to the stream.
     3.6    void dump_replay_data(outputStream* out);
     3.7 +  void dump_replay_data_unsafe(outputStream* out);
     3.8  };
     3.9  
    3.10  #endif // SHARE_VM_CI_CIENV_HPP
     4.1 --- a/src/share/vm/ci/ciInstanceKlass.cpp	Fri Oct 04 14:19:56 2013 -0700
     4.2 +++ b/src/share/vm/ci/ciInstanceKlass.cpp	Tue Oct 08 07:08:27 2013 -0700
     4.3 @@ -671,7 +671,6 @@
     4.4  
     4.5  
     4.6  void ciInstanceKlass::dump_replay_data(outputStream* out) {
     4.7 -  ASSERT_IN_VM;
     4.8    ResourceMark rm;
     4.9  
    4.10    InstanceKlass* ik = get_instanceKlass();
     5.1 --- a/src/share/vm/ci/ciMethod.cpp	Fri Oct 04 14:19:56 2013 -0700
     5.2 +++ b/src/share/vm/ci/ciMethod.cpp	Tue Oct 08 07:08:27 2013 -0700
     5.3 @@ -846,7 +846,9 @@
     5.4  // Return true if allocation was successful or no MDO is required.
     5.5  bool ciMethod::ensure_method_data(methodHandle h_m) {
     5.6    EXCEPTION_CONTEXT;
     5.7 -  if (is_native() || is_abstract() || h_m()->is_accessor()) return true;
     5.8 +  if (is_native() || is_abstract() || h_m()->is_accessor()) {
     5.9 +    return true;
    5.10 +  }
    5.11    if (h_m()->method_data() == NULL) {
    5.12      Method::build_interpreter_method_data(h_m, THREAD);
    5.13      if (HAS_PENDING_EXCEPTION) {
    5.14 @@ -903,22 +905,21 @@
    5.15  // NULL otherwise.
    5.16  ciMethodData* ciMethod::method_data_or_null() {
    5.17    ciMethodData *md = method_data();
    5.18 -  if (md->is_empty()) return NULL;
    5.19 +  if (md->is_empty()) {
    5.20 +    return NULL;
    5.21 +  }
    5.22    return md;
    5.23  }
    5.24  
    5.25  // ------------------------------------------------------------------
    5.26  // ciMethod::ensure_method_counters
    5.27  //
    5.28 -address ciMethod::ensure_method_counters() {
    5.29 +MethodCounters* ciMethod::ensure_method_counters() {
    5.30    check_is_loaded();
    5.31    VM_ENTRY_MARK;
    5.32    methodHandle mh(THREAD, get_Method());
    5.33 -  MethodCounters *counter = mh->method_counters();
    5.34 -  if (counter == NULL) {
    5.35 -    counter = Method::build_method_counters(mh(), CHECK_AND_CLEAR_NULL);
    5.36 -  }
    5.37 -  return (address)counter;
    5.38 +  MethodCounters* method_counters = mh->get_method_counters(CHECK_NULL);
    5.39 +  return method_counters;
    5.40  }
    5.41  
    5.42  // ------------------------------------------------------------------
    5.43 @@ -1247,7 +1248,6 @@
    5.44  #undef FETCH_FLAG_FROM_VM
    5.45  
    5.46  void ciMethod::dump_replay_data(outputStream* st) {
    5.47 -  ASSERT_IN_VM;
    5.48    ResourceMark rm;
    5.49    Method* method = get_Method();
    5.50    MethodCounters* mcs = method->method_counters();
     6.1 --- a/src/share/vm/ci/ciMethod.hpp	Fri Oct 04 14:19:56 2013 -0700
     6.2 +++ b/src/share/vm/ci/ciMethod.hpp	Tue Oct 08 07:08:27 2013 -0700
     6.3 @@ -265,7 +265,7 @@
     6.4    bool is_klass_loaded(int refinfo_index, bool must_be_resolved) const;
     6.5    bool check_call(int refinfo_index, bool is_static) const;
     6.6    bool ensure_method_data();  // make sure it exists in the VM also
     6.7 -  address ensure_method_counters();
     6.8 +  MethodCounters* ensure_method_counters();
     6.9    int instructions_size();
    6.10    int scale_count(int count, float prof_factor = 1.);  // make MDO count commensurate with IIC
    6.11  
     7.1 --- a/src/share/vm/ci/ciMethodData.cpp	Fri Oct 04 14:19:56 2013 -0700
     7.2 +++ b/src/share/vm/ci/ciMethodData.cpp	Tue Oct 08 07:08:27 2013 -0700
     7.3 @@ -78,7 +78,9 @@
     7.4  
     7.5  void ciMethodData::load_data() {
     7.6    MethodData* mdo = get_MethodData();
     7.7 -  if (mdo == NULL) return;
     7.8 +  if (mdo == NULL) {
     7.9 +    return;
    7.10 +  }
    7.11  
    7.12    // To do: don't copy the data if it is not "ripe" -- require a minimum #
    7.13    // of invocations.
    7.14 @@ -373,7 +375,6 @@
    7.15  }
    7.16  
    7.17  void ciMethodData::dump_replay_data(outputStream* out) {
    7.18 -  ASSERT_IN_VM;
    7.19    ResourceMark rm;
    7.20    MethodData* mdo = get_MethodData();
    7.21    Method* method = mdo->method();
     8.1 --- a/src/share/vm/ci/ciMethodData.hpp	Fri Oct 04 14:19:56 2013 -0700
     8.2 +++ b/src/share/vm/ci/ciMethodData.hpp	Tue Oct 08 07:08:27 2013 -0700
     8.3 @@ -232,8 +232,6 @@
     8.4  public:
     8.5    bool is_method_data() const { return true; }
     8.6  
     8.7 -  void set_mature() { _state = mature_state; }
     8.8 -
     8.9    bool is_empty()  { return _state == empty_state; }
    8.10    bool is_mature() { return _state == mature_state; }
    8.11  
     9.1 --- a/src/share/vm/ci/ciReplay.cpp	Fri Oct 04 14:19:56 2013 -0700
     9.2 +++ b/src/share/vm/ci/ciReplay.cpp	Tue Oct 08 07:08:27 2013 -0700
     9.3 @@ -965,14 +965,12 @@
     9.4      tty->cr();
     9.5    } else {
     9.6      EXCEPTION_CONTEXT;
     9.7 -    MethodCounters* mcs = method->method_counters();
     9.8      // m->_instructions_size = rec->instructions_size;
     9.9      m->_instructions_size = -1;
    9.10      m->_interpreter_invocation_count = rec->interpreter_invocation_count;
    9.11      m->_interpreter_throwout_count = rec->interpreter_throwout_count;
    9.12 -    if (mcs == NULL) {
    9.13 -      mcs = Method::build_method_counters(method, CHECK_AND_CLEAR);
    9.14 -    }
    9.15 +    MethodCounters* mcs = method->get_method_counters(CHECK_AND_CLEAR);
    9.16 +    guarantee(mcs != NULL, "method counters allocation failed");
    9.17      mcs->invocation_counter()->_counter = rec->invocation_counter;
    9.18      mcs->backedge_counter()->_counter = rec->backedge_counter;
    9.19    }
    10.1 --- a/src/share/vm/classfile/defaultMethods.cpp	Fri Oct 04 14:19:56 2013 -0700
    10.2 +++ b/src/share/vm/classfile/defaultMethods.cpp	Tue Oct 08 07:08:27 2013 -0700
    10.3 @@ -898,7 +898,6 @@
    10.4    m->set_max_locals(params);
    10.5    m->constMethod()->set_stackmap_data(NULL);
    10.6    m->set_code(code_start);
    10.7 -  m->set_force_inline(true);
    10.8  
    10.9    return m;
   10.10  }
    11.1 --- a/src/share/vm/compiler/compileBroker.cpp	Fri Oct 04 14:19:56 2013 -0700
    11.2 +++ b/src/share/vm/compiler/compileBroker.cpp	Tue Oct 08 07:08:27 2013 -0700
    11.3 @@ -1953,6 +1953,10 @@
    11.4        // Since code cache is full, immediately stop new compiles
    11.5        if (CompileBroker::set_should_compile_new_jobs(CompileBroker::stop_compilation)) {
    11.6          NMethodSweeper::log_sweep("disable_compiler");
    11.7 +
    11.8 +        // Switch to 'vm_state'. This ensures that possibly_sweep() can be called
    11.9 +        // without having to consider the state in which the current thread is.
   11.10 +        ThreadInVMfromUnknown in_vm;
   11.11          NMethodSweeper::possibly_sweep();
   11.12        }
   11.13      } else {
    12.1 --- a/src/share/vm/oops/method.hpp	Fri Oct 04 14:19:56 2013 -0700
    12.2 +++ b/src/share/vm/oops/method.hpp	Tue Oct 08 07:08:27 2013 -0700
    12.3 @@ -804,6 +804,7 @@
    12.4   private:
    12.5    void print_made_not_compilable(int comp_level, bool is_osr, bool report, const char* reason);
    12.6  
    12.7 + public:
    12.8    MethodCounters* get_method_counters(TRAPS) {
    12.9      if (_method_counters == NULL) {
   12.10        build_method_counters(this, CHECK_AND_CLEAR_NULL);
   12.11 @@ -811,7 +812,6 @@
   12.12      return _method_counters;
   12.13    }
   12.14  
   12.15 - public:
   12.16    bool   is_not_c1_compilable() const         { return access_flags().is_not_c1_compilable();  }
   12.17    void  set_not_c1_compilable()               {       _access_flags.set_not_c1_compilable();   }
   12.18    void clear_not_c1_compilable()              {       _access_flags.clear_not_c1_compilable(); }
    13.1 --- a/src/share/vm/opto/bytecodeInfo.cpp	Fri Oct 04 14:19:56 2013 -0700
    13.2 +++ b/src/share/vm/opto/bytecodeInfo.cpp	Tue Oct 08 07:08:27 2013 -0700
    13.3 @@ -197,6 +197,7 @@
    13.4  // negative filter: should callee NOT be inlined?
    13.5  bool InlineTree::should_not_inline(ciMethod *callee_method,
    13.6                                     ciMethod* caller_method,
    13.7 +                                   JVMState* jvms,
    13.8                                     WarmCallInfo* wci_result) {
    13.9  
   13.10    const char* fail_msg = NULL;
   13.11 @@ -226,7 +227,7 @@
   13.12      // don't inline exception code unless the top method belongs to an
   13.13      // exception class
   13.14      if (callee_method->holder()->is_subclass_of(C->env()->Throwable_klass())) {
   13.15 -      ciMethod* top_method = caller_jvms() ? caller_jvms()->of_depth(1)->method() : method();
   13.16 +      ciMethod* top_method = jvms->caller() != NULL ? jvms->caller()->of_depth(1)->method() : method();
   13.17        if (!top_method->holder()->is_subclass_of(C->env()->Throwable_klass())) {
   13.18          wci_result->set_profit(wci_result->profit() * 0.1);
   13.19        }
   13.20 @@ -328,7 +329,7 @@
   13.21  // return true if ok
   13.22  // Relocated from "InliningClosure::try_to_inline"
   13.23  bool InlineTree::try_to_inline(ciMethod* callee_method, ciMethod* caller_method,
   13.24 -                               int caller_bci, ciCallProfile& profile,
   13.25 +                               int caller_bci, JVMState* jvms, ciCallProfile& profile,
   13.26                                 WarmCallInfo* wci_result, bool& should_delay) {
   13.27  
   13.28     // Old algorithm had funny accumulating BC-size counters
   13.29 @@ -346,7 +347,7 @@
   13.30                       wci_result)) {
   13.31      return false;
   13.32    }
   13.33 -  if (should_not_inline(callee_method, caller_method, wci_result)) {
   13.34 +  if (should_not_inline(callee_method, caller_method, jvms, wci_result)) {
   13.35      return false;
   13.36    }
   13.37  
   13.38 @@ -397,24 +398,35 @@
   13.39    }
   13.40  
   13.41    // detect direct and indirect recursive inlining
   13.42 -  if (!callee_method->is_compiled_lambda_form()) {
   13.43 +  {
   13.44      // count the current method and the callee
   13.45 -    int inline_level = (method() == callee_method) ? 1 : 0;
   13.46 -    if (inline_level > MaxRecursiveInlineLevel) {
   13.47 -      set_msg("recursively inlining too deep");
   13.48 -      return false;
   13.49 +    const bool is_compiled_lambda_form = callee_method->is_compiled_lambda_form();
   13.50 +    int inline_level = 0;
   13.51 +    if (!is_compiled_lambda_form) {
   13.52 +      if (method() == callee_method) {
   13.53 +        inline_level++;
   13.54 +      }
   13.55      }
   13.56      // count callers of current method and callee
   13.57 -    JVMState* jvms = caller_jvms();
   13.58 -    while (jvms != NULL && jvms->has_method()) {
   13.59 -      if (jvms->method() == callee_method) {
   13.60 -        inline_level++;
   13.61 -        if (inline_level > MaxRecursiveInlineLevel) {
   13.62 -          set_msg("recursively inlining too deep");
   13.63 -          return false;
   13.64 +    Node* callee_argument0 = is_compiled_lambda_form ? jvms->map()->argument(jvms, 0)->uncast() : NULL;
   13.65 +    for (JVMState* j = jvms->caller(); j != NULL && j->has_method(); j = j->caller()) {
   13.66 +      if (j->method() == callee_method) {
   13.67 +        if (is_compiled_lambda_form) {
   13.68 +          // Since compiled lambda forms are heavily reused we allow recursive inlining.  If it is truly
   13.69 +          // a recursion (using the same "receiver") we limit inlining otherwise we can easily blow the
   13.70 +          // compiler stack.
   13.71 +          Node* caller_argument0 = j->map()->argument(j, 0)->uncast();
   13.72 +          if (caller_argument0 == callee_argument0) {
   13.73 +            inline_level++;
   13.74 +          }
   13.75 +        } else {
   13.76 +          inline_level++;
   13.77          }
   13.78        }
   13.79 -      jvms = jvms->caller();
   13.80 +    }
   13.81 +    if (inline_level > MaxRecursiveInlineLevel) {
   13.82 +      set_msg("recursive inlining is too deep");
   13.83 +      return false;
   13.84      }
   13.85    }
   13.86  
   13.87 @@ -536,7 +548,7 @@
   13.88    // Check if inlining policy says no.
   13.89    WarmCallInfo wci = *(initial_wci);
   13.90    bool success = try_to_inline(callee_method, caller_method, caller_bci,
   13.91 -                               profile, &wci, should_delay);
   13.92 +                               jvms, profile, &wci, should_delay);
   13.93  
   13.94  #ifndef PRODUCT
   13.95    if (UseOldInlining && InlineWarmCalls
    14.1 --- a/src/share/vm/opto/graphKit.cpp	Fri Oct 04 14:19:56 2013 -0700
    14.2 +++ b/src/share/vm/opto/graphKit.cpp	Tue Oct 08 07:08:27 2013 -0700
    14.3 @@ -2122,7 +2122,7 @@
    14.4  // Null check oop.  Set null-path control into Region in slot 3.
    14.5  // Make a cast-not-nullness use the other not-null control.  Return cast.
    14.6  Node* GraphKit::null_check_oop(Node* value, Node* *null_control,
    14.7 -                               bool never_see_null) {
    14.8 +                               bool never_see_null, bool safe_for_replace) {
    14.9    // Initial NULL check taken path
   14.10    (*null_control) = top();
   14.11    Node* cast = null_check_common(value, T_OBJECT, false, null_control);
   14.12 @@ -2140,6 +2140,9 @@
   14.13                    Deoptimization::Action_make_not_entrant);
   14.14      (*null_control) = top();    // NULL path is dead
   14.15    }
   14.16 +  if ((*null_control) == top() && safe_for_replace) {
   14.17 +    replace_in_map(value, cast);
   14.18 +  }
   14.19  
   14.20    // Cast away null-ness on the result
   14.21    return cast;
   14.22 @@ -2634,15 +2637,17 @@
   14.23    C->set_has_split_ifs(true); // Has chance for split-if optimization
   14.24  
   14.25    ciProfileData* data = NULL;
   14.26 +  bool safe_for_replace = false;
   14.27    if (java_bc() == Bytecodes::_instanceof) {  // Only for the bytecode
   14.28      data = method()->method_data()->bci_to_data(bci());
   14.29 +    safe_for_replace = true;
   14.30    }
   14.31    bool never_see_null = (ProfileDynamicTypes  // aggressive use of profile
   14.32                           && seems_never_null(obj, data));
   14.33  
   14.34    // Null check; get casted pointer; set region slot 3
   14.35    Node* null_ctl = top();
   14.36 -  Node* not_null_obj = null_check_oop(obj, &null_ctl, never_see_null);
   14.37 +  Node* not_null_obj = null_check_oop(obj, &null_ctl, never_see_null, safe_for_replace);
   14.38  
   14.39    // If not_null_obj is dead, only null-path is taken
   14.40    if (stopped()) {              // Doing instance-of on a NULL?
   14.41 @@ -2723,11 +2728,13 @@
   14.42    }
   14.43  
   14.44    ciProfileData* data = NULL;
   14.45 +  bool safe_for_replace = false;
   14.46    if (failure_control == NULL) {        // use MDO in regular case only
   14.47      assert(java_bc() == Bytecodes::_aastore ||
   14.48             java_bc() == Bytecodes::_checkcast,
   14.49             "interpreter profiles type checks only for these BCs");
   14.50      data = method()->method_data()->bci_to_data(bci());
   14.51 +    safe_for_replace = true;
   14.52    }
   14.53  
   14.54    // Make the merge point
   14.55 @@ -2742,7 +2749,7 @@
   14.56  
   14.57    // Null check; get casted pointer; set region slot 3
   14.58    Node* null_ctl = top();
   14.59 -  Node* not_null_obj = null_check_oop(obj, &null_ctl, never_see_null);
   14.60 +  Node* not_null_obj = null_check_oop(obj, &null_ctl, never_see_null, safe_for_replace);
   14.61  
   14.62    // If not_null_obj is dead, only null-path is taken
   14.63    if (stopped()) {              // Doing instance-of on a NULL?
    15.1 --- a/src/share/vm/opto/graphKit.hpp	Fri Oct 04 14:19:56 2013 -0700
    15.2 +++ b/src/share/vm/opto/graphKit.hpp	Tue Oct 08 07:08:27 2013 -0700
    15.3 @@ -378,8 +378,10 @@
    15.4    // Return a cast-not-null node which depends on the not-null control.
    15.5    // If never_see_null, use an uncommon trap (*null_control sees a top).
    15.6    // The cast is not valid along the null path; keep a copy of the original.
    15.7 +  // If safe_for_replace, then we can replace the value with the cast
    15.8 +  // in the parsing map (the cast is guaranteed to dominate the map)
    15.9    Node* null_check_oop(Node* value, Node* *null_control,
   15.10 -                       bool never_see_null = false);
   15.11 +                       bool never_see_null = false, bool safe_for_replace = false);
   15.12  
   15.13    // Check the null_seen bit.
   15.14    bool seems_never_null(Node* obj, ciProfileData* data);
    16.1 --- a/src/share/vm/opto/parse.hpp	Fri Oct 04 14:19:56 2013 -0700
    16.2 +++ b/src/share/vm/opto/parse.hpp	Tue Oct 08 07:08:27 2013 -0700
    16.3 @@ -73,6 +73,7 @@
    16.4    bool        try_to_inline(ciMethod* callee_method,
    16.5                              ciMethod* caller_method,
    16.6                              int caller_bci,
    16.7 +                            JVMState* jvms,
    16.8                              ciCallProfile& profile,
    16.9                              WarmCallInfo* wci_result,
   16.10                              bool& should_delay);
   16.11 @@ -83,6 +84,7 @@
   16.12                              WarmCallInfo* wci_result);
   16.13    bool        should_not_inline(ciMethod* callee_method,
   16.14                                  ciMethod* caller_method,
   16.15 +                                JVMState* jvms,
   16.16                                  WarmCallInfo* wci_result);
   16.17    void        print_inlining(ciMethod* callee_method, int caller_bci,
   16.18                               bool success) const;
    17.1 --- a/src/share/vm/opto/parse2.cpp	Fri Oct 04 14:19:56 2013 -0700
    17.2 +++ b/src/share/vm/opto/parse2.cpp	Tue Oct 08 07:08:27 2013 -0700
    17.3 @@ -268,7 +268,7 @@
    17.4      return adjoinRange(value, value, dest, table_index);
    17.5    }
    17.6  
    17.7 -  void print(ciEnv* env) {
    17.8 +  void print() {
    17.9      if (is_singleton())
   17.10        tty->print(" {%d}=>%d", lo(), dest());
   17.11      else if (lo() == min_jint)
   17.12 @@ -471,8 +471,8 @@
   17.13    // These are the switch destinations hanging off the jumpnode
   17.14    int i = 0;
   17.15    for (SwitchRange* r = lo; r <= hi; r++) {
   17.16 -    for (int j = r->lo(); j <= r->hi(); j++, i++) {
   17.17 -      Node* input = _gvn.transform(new (C) JumpProjNode(jtn, i, r->dest(), j - lowval));
   17.18 +    for (int64 j = r->lo(); j <= r->hi(); j++, i++) {
   17.19 +      Node* input = _gvn.transform(new (C) JumpProjNode(jtn, i, r->dest(), (int)(j - lowval)));
   17.20        {
   17.21          PreserveJVMState pjvms(this);
   17.22          set_control(input);
   17.23 @@ -632,7 +632,7 @@
   17.24      }
   17.25      tty->print("   ");
   17.26      for( r = lo; r <= hi; r++ ) {
   17.27 -      r->print(env());
   17.28 +      r->print();
   17.29      }
   17.30      tty->print_cr("");
   17.31    }
    18.1 --- a/src/share/vm/opto/parseHelper.cpp	Fri Oct 04 14:19:56 2013 -0700
    18.2 +++ b/src/share/vm/opto/parseHelper.cpp	Tue Oct 08 07:08:27 2013 -0700
    18.3 @@ -343,10 +343,14 @@
    18.4  
    18.5    // Get the Method* node.
    18.6    ciMethod* m = method();
    18.7 -  address counters_adr = m->ensure_method_counters();
    18.8 +  MethodCounters* counters_adr = m->ensure_method_counters();
    18.9 +  if (counters_adr == NULL) {
   18.10 +    C->record_failure("method counters allocation failed");
   18.11 +    return;
   18.12 +  }
   18.13  
   18.14    Node* ctrl = control();
   18.15 -  const TypePtr* adr_type = TypeRawPtr::make(counters_adr);
   18.16 +  const TypePtr* adr_type = TypeRawPtr::make((address) counters_adr);
   18.17    Node *counters_node = makecon(adr_type);
   18.18    Node* adr_iic_node = basic_plus_adr(counters_node, counters_node,
   18.19      MethodCounters::interpreter_invocation_counter_offset_in_bytes());
    19.1 --- a/src/share/vm/utilities/ostream.cpp	Fri Oct 04 14:19:56 2013 -0700
    19.2 +++ b/src/share/vm/utilities/ostream.cpp	Tue Oct 08 07:08:27 2013 -0700
    19.3 @@ -465,7 +465,7 @@
    19.4  }
    19.5  
    19.6  // log_name comes from -XX:LogFile=log_name or -Xloggc:log_name
    19.7 -// in log_name, %p => pipd1234 and
    19.8 +// in log_name, %p => pid1234 and
    19.9  //              %t => YYYY-MM-DD_HH-MM-SS
   19.10  static const char* make_log_name(const char* log_name, const char* force_directory) {
   19.11    char timestr[32];
   19.12 @@ -792,7 +792,7 @@
   19.13  
   19.14  void defaultStream::init_log() {
   19.15    // %%% Need a MutexLocker?
   19.16 -  const char* log_name = LogFile != NULL ? LogFile : "hotspot_pid%p.log";
   19.17 +  const char* log_name = LogFile != NULL ? LogFile : "hotspot_%p.log";
   19.18    const char* try_name = make_log_name(log_name, NULL);
   19.19    fileStream* file = new(ResourceObj::C_HEAP, mtInternal) fileStream(try_name);
   19.20    if (!file->is_open()) {
    20.1 --- a/src/share/vm/utilities/vmError.cpp	Fri Oct 04 14:19:56 2013 -0700
    20.2 +++ b/src/share/vm/utilities/vmError.cpp	Tue Oct 08 07:08:27 2013 -0700
    20.3 @@ -1050,7 +1050,7 @@
    20.4          FILE* replay_data_file = os::open(fd, "w");
    20.5          if (replay_data_file != NULL) {
    20.6            fileStream replay_data_stream(replay_data_file, /*need_close=*/true);
    20.7 -          env->dump_replay_data(&replay_data_stream);
    20.8 +          env->dump_replay_data_unsafe(&replay_data_stream);
    20.9            out.print_raw("#\n# Compiler replay data is saved as:\n# ");
   20.10            out.print_raw_cr(buffer);
   20.11          } else {
    21.1 --- a/test/compiler/8013496/Test8013496.sh	Fri Oct 04 14:19:56 2013 -0700
    21.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.3 @@ -1,55 +0,0 @@
    21.4 -#!/bin/sh
    21.5 -# 
    21.6 -# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    21.7 -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    21.8 -# 
    21.9 -# This code is free software; you can redistribute it and/or modify it
   21.10 -# under the terms of the GNU General Public License version 2 only, as
   21.11 -# published by the Free Software Foundation.
   21.12 -# 
   21.13 -# This code is distributed in the hope that it will be useful, but WITHOUT
   21.14 -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   21.15 -# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   21.16 -# version 2 for more details (a copy is included in the LICENSE file that
   21.17 -# accompanied this code).
   21.18 -# 
   21.19 -# You should have received a copy of the GNU General Public License version
   21.20 -# 2 along with this work; if not, write to the Free Software Foundation,
   21.21 -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   21.22 -# 
   21.23 -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   21.24 -# or visit www.oracle.com if you need additional information or have any
   21.25 -# questions.
   21.26 -# 
   21.27 -#
   21.28 -# @test
   21.29 -# @bug 8013496
   21.30 -# @summary Test checks that the order in which ReversedCodeCacheSize and 
   21.31 -#          InitialCodeCacheSize are passed to the VM is irrelevant.  
   21.32 -# @run shell Test8013496.sh
   21.33 -#
   21.34 -#
   21.35 -## some tests require path to find test source dir
   21.36 -if [ "${TESTSRC}" = "" ]
   21.37 -then
   21.38 -  TESTSRC=${PWD}
   21.39 -  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
   21.40 -fi
   21.41 -echo "TESTSRC=${TESTSRC}"
   21.42 -## Adding common setup Variables for running shell tests.
   21.43 -. ${TESTSRC}/../../test_env.sh
   21.44 -set -x
   21.45 -
   21.46 -${TESTJAVA}/bin/java ${TESTVMOPTS} -XX:ReservedCodeCacheSize=2m -XX:InitialCodeCacheSize=500K -version > 1.out 2>&1
   21.47 -${TESTJAVA}/bin/java ${TESTVMOPTS} -XX:InitialCodeCacheSize=500K -XX:ReservedCodeCacheSize=2m -version > 2.out 2>&1
   21.48 -
   21.49 -diff 1.out 2.out
   21.50 -
   21.51 -result=$?
   21.52 -if [ $result -eq 0 ] ; then  
   21.53 -  echo "Test Passed"
   21.54 -  exit 0
   21.55 -else
   21.56 -  echo "Test Failed"
   21.57 -  exit 1
   21.58 -fi
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/test/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java	Tue Oct 08 07:08:27 2013 -0700
    22.3 @@ -0,0 +1,53 @@
    22.4 +/*
    22.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    22.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    22.7 + *
    22.8 + * This code is free software; you can redistribute it and/or modify it
    22.9 + * under the terms of the GNU General Public License version 2 only, as
   22.10 + * published by the Free Software Foundation.
   22.11 + *
   22.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   22.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   22.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   22.15 + * version 2 for more details (a copy is included in the LICENSE file that
   22.16 + * accompanied this code).
   22.17 + *
   22.18 + * You should have received a copy of the GNU General Public License version
   22.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   22.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   22.21 + *
   22.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   22.23 + * or visit www.oracle.com if you need additional information or have any
   22.24 + * questions.
   22.25 + */
   22.26 +
   22.27 +/*
   22.28 + * @test
   22.29 + * @bug 8013496
   22.30 + * @summary Test checks that the order in which ReversedCodeCacheSize and
   22.31 + *          InitialCodeCacheSize are passed to the VM is irrelevant.
   22.32 + * @library /testlibrary
   22.33 + *
   22.34 + */
   22.35 +import com.oracle.java.testlibrary.*;
   22.36 +
   22.37 +public class CheckReservedInitialCodeCacheSizeArgOrder {
   22.38 +  public static void main(String[] args) throws Exception {
   22.39 +    ProcessBuilder pb1,  pb2;
   22.40 +    OutputAnalyzer out1, out2;
   22.41 +
   22.42 +    pb1 = ProcessTools.createJavaProcessBuilder("-XX:InitialCodeCacheSize=4m", "-XX:ReservedCodeCacheSize=8m", "-version");
   22.43 +    pb2 = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=8m", "-XX:InitialCodeCacheSize=4m", "-version");
   22.44 +
   22.45 +    out1 = new OutputAnalyzer(pb1.start());
   22.46 +    out2 = new OutputAnalyzer(pb2.start());
   22.47 +
   22.48 +    // Check that the outputs are equal
   22.49 +    if (out1.getStdout().compareTo(out2.getStdout()) != 0) {
   22.50 +      throw new RuntimeException("Test failed");
   22.51 +    }
   22.52 +
   22.53 +    out1.shouldHaveExitValue(0);
   22.54 +    out2.shouldHaveExitValue(0);
   22.55 +  }
   22.56 +}

mercurial