Skip to content

Commit 6b4a5ef

Browse files
Saranya Natarajanchhagedorn
authored andcommitted
8358641: C1 option -XX:+TimeEachLinearScan is broken
Reviewed-by: chagedorn, thartmann
1 parent 9f7dc19 commit 6b4a5ef

File tree

3 files changed

+1
-50
lines changed

3 files changed

+1
-50
lines changed

src/hotspot/share/c1/c1_LinearScan.cpp

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
static LinearScanTimers _total_timer;
4444

4545
// helper macro for short definition of timer
46-
#define TIME_LINEAR_SCAN(timer_name) TraceTime _block_timer("", _total_timer.timer(LinearScanTimers::timer_name), TimeLinearScan || TimeEachLinearScan, Verbose);
46+
#define TIME_LINEAR_SCAN(timer_name) TraceTime _block_timer("", _total_timer.timer(LinearScanTimers::timer_name), TimeLinearScan, Verbose);
4747

4848
#else
4949
#define TIME_LINEAR_SCAN(timer_name)
@@ -3016,8 +3016,6 @@ void LinearScan::assign_reg_num() {
30163016

30173017

30183018
void LinearScan::do_linear_scan() {
3019-
NOT_PRODUCT(_total_timer.begin_method());
3020-
30213019
number_instructions();
30223020

30233021
NOT_PRODUCT(print_lir(1, "Before Register Allocation"));
@@ -3072,7 +3070,6 @@ void LinearScan::do_linear_scan() {
30723070

30733071
NOT_PRODUCT(print_lir(1, "Before Code Generation", false));
30743072
NOT_PRODUCT(LinearScanStatistic::compute(this, _stat_final));
3075-
NOT_PRODUCT(_total_timer.end_method(this));
30763073
}
30773074

30783075

@@ -6727,45 +6724,6 @@ const char* LinearScanTimers::timer_name(int idx) {
67276724
}
67286725
}
67296726

6730-
void LinearScanTimers::begin_method() {
6731-
if (TimeEachLinearScan) {
6732-
// reset all timers to measure only current method
6733-
for (int i = 0; i < number_of_timers; i++) {
6734-
timer(i)->reset();
6735-
}
6736-
}
6737-
}
6738-
6739-
void LinearScanTimers::end_method(LinearScan* allocator) {
6740-
if (TimeEachLinearScan) {
6741-
6742-
double c = timer(timer_do_nothing)->seconds();
6743-
double total = 0;
6744-
for (int i = 1; i < number_of_timers; i++) {
6745-
total += timer(i)->seconds() - c;
6746-
}
6747-
6748-
if (total >= 0.0005) {
6749-
// print all information in one line for automatic processing
6750-
tty->print("@"); allocator->compilation()->method()->print_name();
6751-
6752-
tty->print("@ %d ", allocator->compilation()->method()->code_size());
6753-
tty->print("@ %d ", allocator->block_at(allocator->block_count() - 1)->last_lir_instruction_id() / 2);
6754-
tty->print("@ %d ", allocator->block_count());
6755-
tty->print("@ %d ", allocator->num_virtual_regs());
6756-
tty->print("@ %d ", allocator->interval_count());
6757-
tty->print("@ %d ", allocator->_num_calls);
6758-
tty->print("@ %d ", allocator->num_loops());
6759-
6760-
tty->print("@ %6.6f ", total);
6761-
for (int i = 1; i < number_of_timers; i++) {
6762-
tty->print("@ %4.1f ", ((timer(i)->seconds() - c) / total) * 100);
6763-
}
6764-
tty->cr();
6765-
}
6766-
}
6767-
}
6768-
67696727
void LinearScanTimers::print(double total_time) {
67706728
if (TimeLinearScan) {
67716729
// correction value: sum of dummy-timer that only measures the time that

src/hotspot/share/c1/c1_LinearScan.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -948,11 +948,7 @@ class LinearScanTimers : public StackObj {
948948

949949
public:
950950
LinearScanTimers();
951-
952-
void begin_method(); // called for each method when register allocation starts
953-
void end_method(LinearScan* allocator); // called for each method when register allocation completed
954951
void print(double total_time); // called before termination of VM to print global summary
955-
956952
elapsedTimer* timer(int idx) { return &(_timers[idx]); }
957953
};
958954

src/hotspot/share/c1/c1_globals.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,6 @@
212212
develop(bool, TimeLinearScan, false, \
213213
"detailed timing of LinearScan phases") \
214214
\
215-
develop(bool, TimeEachLinearScan, false, \
216-
"print detailed timing of each LinearScan run") \
217-
\
218215
develop(bool, CountLinearScan, false, \
219216
"collect statistic counters during LinearScan") \
220217
\

0 commit comments

Comments
 (0)