Mon, 06 May 2013 19:57:35 -0400
8013067: Zero builds are broken after 8010862.
Summary: Fixed broken Zero build.
Reviewed-by: twisti, coleenp, kvn
1.1 --- a/src/cpu/zero/vm/cppInterpreter_zero.cpp Mon Apr 29 01:58:43 2013 -0700 1.2 +++ b/src/cpu/zero/vm/cppInterpreter_zero.cpp Mon May 06 19:57:35 2013 -0400 1.3 @@ -212,7 +212,13 @@ 1.4 1.5 // Update the invocation counter 1.6 if ((UseCompiler || CountCompiledCalls) && !method->is_synchronized()) { 1.7 - InvocationCounter *counter = method->invocation_counter(); 1.8 + MethodCounters* mcs = method->method_counters(); 1.9 + if (mcs == NULL) { 1.10 + CALL_VM_NOCHECK(mcs = InterpreterRuntime::build_method_counters(thread, method)); 1.11 + if (HAS_PENDING_EXCEPTION) 1.12 + goto unwind_and_return; 1.13 + } 1.14 + InvocationCounter *counter = mcs->invocation_counter(); 1.15 counter->increment(); 1.16 if (counter->reached_InvocationLimit()) { 1.17 CALL_VM_NOCHECK(
2.1 --- a/src/share/vm/interpreter/bytecodeInterpreter.cpp Mon Apr 29 01:58:43 2013 -0700 2.2 +++ b/src/share/vm/interpreter/bytecodeInterpreter.cpp Mon May 06 19:57:35 2013 -0400 2.3 @@ -32,6 +32,7 @@ 2.4 #include "interpreter/interpreterRuntime.hpp" 2.5 #include "memory/cardTableModRefBS.hpp" 2.6 #include "memory/resourceArea.hpp" 2.7 +#include "oops/methodCounters.hpp" 2.8 #include "oops/objArrayKlass.hpp" 2.9 #include "oops/oop.inline.hpp" 2.10 #include "prims/jvmtiExport.hpp" 2.11 @@ -304,11 +305,12 @@ 2.12 2.13 2.14 #define METHOD istate->method() 2.15 -#define INVOCATION_COUNT METHOD->invocation_counter() 2.16 -#define BACKEDGE_COUNT METHOD->backedge_counter() 2.17 - 2.18 - 2.19 -#define INCR_INVOCATION_COUNT INVOCATION_COUNT->increment() 2.20 +#define GET_METHOD_COUNTERS(res) \ 2.21 + res = METHOD->method_counters(); \ 2.22 + if (res == NULL) { \ 2.23 + CALL_VM(res = InterpreterRuntime::build_method_counters(THREAD, METHOD), handle_exception); \ 2.24 + } 2.25 + 2.26 #define OSR_REQUEST(res, branch_pc) \ 2.27 CALL_VM(res=InterpreterRuntime::frequency_counter_overflow(THREAD, branch_pc), handle_exception); 2.28 /* 2.29 @@ -325,10 +327,12 @@ 2.30 2.31 #define DO_BACKEDGE_CHECKS(skip, branch_pc) \ 2.32 if ((skip) <= 0) { \ 2.33 + MethodCounters* mcs; \ 2.34 + GET_METHOD_COUNTERS(mcs); \ 2.35 if (UseLoopCounter) { \ 2.36 bool do_OSR = UseOnStackReplacement; \ 2.37 - BACKEDGE_COUNT->increment(); \ 2.38 - if (do_OSR) do_OSR = BACKEDGE_COUNT->reached_InvocationLimit(); \ 2.39 + mcs->backedge_counter()->increment(); \ 2.40 + if (do_OSR) do_OSR = mcs->backedge_counter()->reached_InvocationLimit(); \ 2.41 if (do_OSR) { \ 2.42 nmethod* osr_nmethod; \ 2.43 OSR_REQUEST(osr_nmethod, branch_pc); \ 2.44 @@ -341,7 +345,7 @@ 2.45 } \ 2.46 } \ 2.47 } /* UseCompiler ... */ \ 2.48 - INCR_INVOCATION_COUNT; \ 2.49 + mcs->invocation_counter()->increment(); \ 2.50 SAFEPOINT; \ 2.51 } 2.52 2.53 @@ -618,11 +622,13 @@ 2.54 // count invocations 2.55 assert(initialized, "Interpreter not initialized"); 2.56 if (_compiling) { 2.57 + MethodCounters* mcs; 2.58 + GET_METHOD_COUNTERS(mcs); 2.59 if (ProfileInterpreter) { 2.60 - METHOD->increment_interpreter_invocation_count(); 2.61 + METHOD->increment_interpreter_invocation_count(THREAD); 2.62 } 2.63 - INCR_INVOCATION_COUNT; 2.64 - if (INVOCATION_COUNT->reached_InvocationLimit()) { 2.65 + mcs->invocation_counter()->increment(); 2.66 + if (mcs->invocation_counter()->reached_InvocationLimit()) { 2.67 CALL_VM((void)InterpreterRuntime::frequency_counter_overflow(THREAD, NULL), handle_exception); 2.68 2.69 // We no longer retry on a counter overflow
3.1 --- a/src/share/vm/oops/method.hpp Mon Apr 29 01:58:43 2013 -0700 3.2 +++ b/src/share/vm/oops/method.hpp Mon May 06 19:57:35 2013 -0400 3.3 @@ -67,7 +67,7 @@ 3.4 // | ConstMethod* (oop) | 3.5 // |------------------------------------------------------| 3.6 // | methodData (oop) | 3.7 -// | interp_invocation_count | 3.8 +// | methodCounters | 3.9 // |------------------------------------------------------| 3.10 // | access_flags | 3.11 // | vtable_index | 3.12 @@ -76,16 +76,6 @@ 3.13 // |------------------------------------------------------| 3.14 // | method_size | intrinsic_id| flags | 3.15 // |------------------------------------------------------| 3.16 -// | throwout_count | num_breakpoints | 3.17 -// |------------------------------------------------------| 3.18 -// | invocation_counter | 3.19 -// | backedge_counter | 3.20 -// |------------------------------------------------------| 3.21 -// | prev_time (tiered only, 64 bit wide) | 3.22 -// | | 3.23 -// |------------------------------------------------------| 3.24 -// | rate (tiered) | 3.25 -// |------------------------------------------------------| 3.26 // | code (pointer) | 3.27 // | i2i (pointer) | 3.28 // | adapter (pointer) |