mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-24 13:04:33 +02:00
8028128: Add a type safe alternative for working with counter based data
Reviewed-by: dholmes, egahlin
This commit is contained in:
parent
9963570316
commit
b1e3461fe5
37 changed files with 522 additions and 235 deletions
|
@ -42,6 +42,7 @@
|
|||
#include "runtime/deoptimization.hpp"
|
||||
#include "runtime/vmThread.hpp"
|
||||
#include "trace/tracing.hpp"
|
||||
#include "utilities/ticks.hpp"
|
||||
|
||||
class Block;
|
||||
class Bundle;
|
||||
|
@ -597,20 +598,19 @@ class Compile : public Phase {
|
|||
bool has_method_handle_invokes() const { return _has_method_handle_invokes; }
|
||||
void set_has_method_handle_invokes(bool z) { _has_method_handle_invokes = z; }
|
||||
|
||||
jlong _latest_stage_start_counter;
|
||||
Ticks _latest_stage_start_counter;
|
||||
|
||||
void begin_method() {
|
||||
#ifndef PRODUCT
|
||||
if (_printer) _printer->begin_method(this);
|
||||
#endif
|
||||
C->_latest_stage_start_counter = os::elapsed_counter();
|
||||
C->_latest_stage_start_counter.stamp();
|
||||
}
|
||||
|
||||
void print_method(CompilerPhaseType cpt, int level = 1) {
|
||||
EventCompilerPhase event(UNTIMED);
|
||||
EventCompilerPhase event;
|
||||
if (event.should_commit()) {
|
||||
event.set_starttime(C->_latest_stage_start_counter);
|
||||
event.set_endtime(os::elapsed_counter());
|
||||
event.set_phase((u1) cpt);
|
||||
event.set_compileID(C->_compile_id);
|
||||
event.set_phaseLevel(level);
|
||||
|
@ -621,14 +621,13 @@ class Compile : public Phase {
|
|||
#ifndef PRODUCT
|
||||
if (_printer) _printer->print_method(this, CompilerPhaseTypeHelper::to_string(cpt), level);
|
||||
#endif
|
||||
C->_latest_stage_start_counter = os::elapsed_counter();
|
||||
C->_latest_stage_start_counter.stamp();
|
||||
}
|
||||
|
||||
void end_method(int level = 1) {
|
||||
EventCompilerPhase event(UNTIMED);
|
||||
EventCompilerPhase event;
|
||||
if (event.should_commit()) {
|
||||
event.set_starttime(C->_latest_stage_start_counter);
|
||||
event.set_endtime(os::elapsed_counter());
|
||||
event.set_phase((u1) PHASE_END);
|
||||
event.set_compileID(C->_compile_id);
|
||||
event.set_phaseLevel(level);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue