mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 09:34:38 +02:00
8295661: CompileTask::compile_id() should be passed as int
Reviewed-by: thartmann, dnsimon, never
This commit is contained in:
parent
86d588b035
commit
8e49fcdde4
9 changed files with 44 additions and 46 deletions
|
@ -1226,7 +1226,7 @@ int ciEnv::comp_level() {
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
// ciEnv::compile_id
|
// ciEnv::compile_id
|
||||||
uint ciEnv::compile_id() {
|
int ciEnv::compile_id() {
|
||||||
if (task() == NULL) return 0;
|
if (task() == NULL) return 0;
|
||||||
return task()->compile_id();
|
return task()->compile_id();
|
||||||
}
|
}
|
||||||
|
|
|
@ -366,7 +366,7 @@ public:
|
||||||
|
|
||||||
// Handy forwards to the task:
|
// Handy forwards to the task:
|
||||||
int comp_level(); // task()->comp_level()
|
int comp_level(); // task()->comp_level()
|
||||||
uint compile_id(); // task()->compile_id()
|
int compile_id(); // task()->compile_id()
|
||||||
|
|
||||||
// Register the result of a compilation.
|
// Register the result of a compilation.
|
||||||
void register_method(ciMethod* target,
|
void register_method(ciMethod* target,
|
||||||
|
|
|
@ -258,7 +258,7 @@ static unsigned int used_topSizeBlocks = 0;
|
||||||
|
|
||||||
static struct SizeDistributionElement* SizeDistributionArray = NULL;
|
static struct SizeDistributionElement* SizeDistributionArray = NULL;
|
||||||
|
|
||||||
static unsigned int latest_compilation_id = 0;
|
static int latest_compilation_id = 0;
|
||||||
static volatile bool initialization_complete = false;
|
static volatile bool initialization_complete = false;
|
||||||
|
|
||||||
const char* CodeHeapState::get_heapName(CodeHeap* heap) {
|
const char* CodeHeapState::get_heapName(CodeHeap* heap) {
|
||||||
|
@ -659,7 +659,7 @@ void CodeHeapState::aggregate(outputStream* out, CodeHeap* heap, size_t granular
|
||||||
prepare_SizeDistArray(out, nSizeDistElements, heapName);
|
prepare_SizeDistArray(out, nSizeDistElements, heapName);
|
||||||
|
|
||||||
latest_compilation_id = CompileBroker::get_compilation_id();
|
latest_compilation_id = CompileBroker::get_compilation_id();
|
||||||
unsigned int highest_compilation_id = 0;
|
int highest_compilation_id = 0;
|
||||||
size_t usedSpace = 0;
|
size_t usedSpace = 0;
|
||||||
size_t t1Space = 0;
|
size_t t1Space = 0;
|
||||||
size_t t2Space = 0;
|
size_t t2Space = 0;
|
||||||
|
@ -679,7 +679,7 @@ void CodeHeapState::aggregate(outputStream* out, CodeHeap* heap, size_t granular
|
||||||
size_t hb_bytelen = ((size_t)hb_len)<<log2_seg_size;
|
size_t hb_bytelen = ((size_t)hb_len)<<log2_seg_size;
|
||||||
unsigned int ix_beg = (unsigned int)(((char*)h-low_bound)/granule_size);
|
unsigned int ix_beg = (unsigned int)(((char*)h-low_bound)/granule_size);
|
||||||
unsigned int ix_end = (unsigned int)(((char*)h-low_bound+(hb_bytelen-1))/granule_size);
|
unsigned int ix_end = (unsigned int)(((char*)h-low_bound+(hb_bytelen-1))/granule_size);
|
||||||
unsigned int compile_id = 0;
|
int compile_id = 0;
|
||||||
CompLevel comp_lvl = CompLevel_none;
|
CompLevel comp_lvl = CompLevel_none;
|
||||||
compType cType = noComp;
|
compType cType = noComp;
|
||||||
blobType cbType = noType;
|
blobType cbType = noType;
|
||||||
|
@ -1959,10 +1959,10 @@ void CodeHeapState::print_age(outputStream* out, CodeHeap* heap) {
|
||||||
granules_per_line = 128;
|
granules_per_line = 128;
|
||||||
for (unsigned int ix = 0; ix < alloc_granules; ix++) {
|
for (unsigned int ix = 0; ix < alloc_granules; ix++) {
|
||||||
print_line_delim(out, ast, low_bound, ix, granules_per_line);
|
print_line_delim(out, ast, low_bound, ix, granules_per_line);
|
||||||
unsigned int age1 = StatArray[ix].t1_age;
|
int age1 = StatArray[ix].t1_age;
|
||||||
unsigned int age2 = StatArray[ix].t2_age;
|
int age2 = StatArray[ix].t2_age;
|
||||||
unsigned int agex = StatArray[ix].tx_age;
|
int agex = StatArray[ix].tx_age;
|
||||||
unsigned int age = age1 > age2 ? age1 : age2;
|
int age = age1 > age2 ? age1 : age2;
|
||||||
age = age > agex ? age : agex;
|
age = age > agex ? age : agex;
|
||||||
print_age_single(ast, age);
|
print_age_single(ast, age);
|
||||||
}
|
}
|
||||||
|
@ -2247,9 +2247,7 @@ void CodeHeapState::print_blobType_legend(outputStream* out) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CodeHeapState::print_space_legend(outputStream* out) {
|
void CodeHeapState::print_space_legend(outputStream* out) {
|
||||||
unsigned int indicator = 0;
|
int range_beg = latest_compilation_id;
|
||||||
unsigned int age_range = 256;
|
|
||||||
unsigned int range_beg = latest_compilation_id;
|
|
||||||
out->cr();
|
out->cr();
|
||||||
printBox(out, '-', "Space ranges, based on granule occupancy", NULL);
|
printBox(out, '-', "Space ranges, based on granule occupancy", NULL);
|
||||||
out->print_cr(" - 0%% == occupancy");
|
out->print_cr(" - 0%% == occupancy");
|
||||||
|
@ -2263,12 +2261,12 @@ void CodeHeapState::print_space_legend(outputStream* out) {
|
||||||
|
|
||||||
void CodeHeapState::print_age_legend(outputStream* out) {
|
void CodeHeapState::print_age_legend(outputStream* out) {
|
||||||
unsigned int indicator = 0;
|
unsigned int indicator = 0;
|
||||||
unsigned int age_range = 256;
|
int age_range = 256;
|
||||||
unsigned int range_beg = latest_compilation_id;
|
int range_beg = latest_compilation_id;
|
||||||
out->cr();
|
out->cr();
|
||||||
printBox(out, '-', "Age ranges, based on compilation id", NULL);
|
printBox(out, '-', "Age ranges, based on compilation id", NULL);
|
||||||
while (age_range > 0) {
|
while (age_range > 0) {
|
||||||
out->print_cr(" %d - %6d to %6d", indicator, range_beg, latest_compilation_id - latest_compilation_id/age_range);
|
out->print_cr(" %u - %6d to %6d", indicator, range_beg, latest_compilation_id - latest_compilation_id/age_range);
|
||||||
range_beg = latest_compilation_id - latest_compilation_id/age_range;
|
range_beg = latest_compilation_id - latest_compilation_id/age_range;
|
||||||
age_range /= 2;
|
age_range /= 2;
|
||||||
indicator += 1;
|
indicator += 1;
|
||||||
|
@ -2293,9 +2291,9 @@ void CodeHeapState::print_space_single(outputStream* out, unsigned short space)
|
||||||
out->print("%c", fraction);
|
out->print("%c", fraction);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CodeHeapState::print_age_single(outputStream* out, unsigned int age) {
|
void CodeHeapState::print_age_single(outputStream* out, int age) {
|
||||||
unsigned int indicator = 0;
|
unsigned int indicator = 0;
|
||||||
unsigned int age_range = 256;
|
int age_range = 256;
|
||||||
if (age > 0) {
|
if (age > 0) {
|
||||||
while ((age_range > 0) && (latest_compilation_id-age > latest_compilation_id/age_range)) {
|
while ((age_range > 0) && (latest_compilation_id-age > latest_compilation_id/age_range)) {
|
||||||
age_range /= 2;
|
age_range /= 2;
|
||||||
|
|
|
@ -88,7 +88,7 @@ class CodeHeapState : public CHeapObj<mtCode> {
|
||||||
static void print_blobType_single(outputStream *ast, u2 /* blobType */ type);
|
static void print_blobType_single(outputStream *ast, u2 /* blobType */ type);
|
||||||
static void print_count_single(outputStream *ast, unsigned short count);
|
static void print_count_single(outputStream *ast, unsigned short count);
|
||||||
static void print_space_single(outputStream *ast, unsigned short space);
|
static void print_space_single(outputStream *ast, unsigned short space);
|
||||||
static void print_age_single(outputStream *ast, unsigned int age);
|
static void print_age_single(outputStream *ast, int age);
|
||||||
static void print_line_delim(outputStream* out, bufferedStream *sst, char* low_bound, unsigned int ix, unsigned int gpl);
|
static void print_line_delim(outputStream* out, bufferedStream *sst, char* low_bound, unsigned int ix, unsigned int gpl);
|
||||||
static void print_line_delim(outputStream* out, outputStream *sst, char* low_bound, unsigned int ix, unsigned int gpl);
|
static void print_line_delim(outputStream* out, outputStream *sst, char* low_bound, unsigned int ix, unsigned int gpl);
|
||||||
static blobType get_cbType(CodeBlob* cb);
|
static blobType get_cbType(CodeBlob* cb);
|
||||||
|
@ -119,9 +119,9 @@ class CodeHeapState : public CHeapObj<mtCode> {
|
||||||
class StatElement : public CHeapObj<mtCode> {
|
class StatElement : public CHeapObj<mtCode> {
|
||||||
public:
|
public:
|
||||||
// A note on ages: The compilation_id easily overflows unsigned short in large systems
|
// A note on ages: The compilation_id easily overflows unsigned short in large systems
|
||||||
unsigned int t1_age; // oldest compilation_id of tier1 nMethods.
|
int t1_age; // oldest compilation_id of tier1 nMethods.
|
||||||
unsigned int t2_age; // oldest compilation_id of tier2 nMethods.
|
int t2_age; // oldest compilation_id of tier2 nMethods.
|
||||||
unsigned int tx_age; // oldest compilation_id of inactive/not entrant nMethods.
|
int tx_age; // oldest compilation_id of inactive/not entrant nMethods.
|
||||||
unsigned short t1_space; // in units of _segment_size to "prevent" overflow
|
unsigned short t1_space; // in units of _segment_size to "prevent" overflow
|
||||||
unsigned short t2_space; // in units of _segment_size to "prevent" overflow
|
unsigned short t2_space; // in units of _segment_size to "prevent" overflow
|
||||||
unsigned short tx_space; // in units of _segment_size to "prevent" overflow
|
unsigned short tx_space; // in units of _segment_size to "prevent" overflow
|
||||||
|
|
|
@ -1566,7 +1566,7 @@ int CompileBroker::assign_compile_id(const methodHandle& method, int osr_bci) {
|
||||||
// CompileBroker::assign_compile_id_unlocked
|
// CompileBroker::assign_compile_id_unlocked
|
||||||
//
|
//
|
||||||
// Public wrapper for assign_compile_id that acquires the needed locks
|
// Public wrapper for assign_compile_id that acquires the needed locks
|
||||||
uint CompileBroker::assign_compile_id_unlocked(Thread* thread, const methodHandle& method, int osr_bci) {
|
int CompileBroker::assign_compile_id_unlocked(Thread* thread, const methodHandle& method, int osr_bci) {
|
||||||
MutexLocker locker(thread, MethodCompileQueue_lock);
|
MutexLocker locker(thread, MethodCompileQueue_lock);
|
||||||
return assign_compile_id(method, osr_bci);
|
return assign_compile_id(method, osr_bci);
|
||||||
}
|
}
|
||||||
|
@ -2109,7 +2109,7 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Common flags.
|
// Common flags.
|
||||||
uint compile_id = task->compile_id();
|
int compile_id = task->compile_id();
|
||||||
int osr_bci = task->osr_bci();
|
int osr_bci = task->osr_bci();
|
||||||
bool is_osr = (osr_bci != standard_entry_bci);
|
bool is_osr = (osr_bci != standard_entry_bci);
|
||||||
bool should_log = (thread->log() != NULL);
|
bool should_log = (thread->log() != NULL);
|
||||||
|
@ -2432,7 +2432,7 @@ void CompileBroker::update_compile_perf_data(CompilerThread* thread, const metho
|
||||||
void CompileBroker::collect_statistics(CompilerThread* thread, elapsedTimer time, CompileTask* task) {
|
void CompileBroker::collect_statistics(CompilerThread* thread, elapsedTimer time, CompileTask* task) {
|
||||||
bool success = task->is_success();
|
bool success = task->is_success();
|
||||||
methodHandle method (thread, task->method());
|
methodHandle method (thread, task->method());
|
||||||
uint compile_id = task->compile_id();
|
int compile_id = task->compile_id();
|
||||||
bool is_osr = (task->osr_bci() != standard_entry_bci);
|
bool is_osr = (task->osr_bci() != standard_entry_bci);
|
||||||
const int comp_level = task->comp_level();
|
const int comp_level = task->comp_level();
|
||||||
CompilerCounters* counters = thread->counters();
|
CompilerCounters* counters = thread->counters();
|
||||||
|
|
|
@ -312,10 +312,10 @@ public:
|
||||||
TRAPS);
|
TRAPS);
|
||||||
|
|
||||||
// Acquire any needed locks and assign a compile id
|
// Acquire any needed locks and assign a compile id
|
||||||
static uint assign_compile_id_unlocked(Thread* thread, const methodHandle& method, int osr_bci);
|
static int assign_compile_id_unlocked(Thread* thread, const methodHandle& method, int osr_bci);
|
||||||
|
|
||||||
static void compiler_thread_loop();
|
static void compiler_thread_loop();
|
||||||
static uint get_compilation_id() { return _compilation_id; }
|
static int get_compilation_id() { return _compilation_id; }
|
||||||
|
|
||||||
// Set _should_block.
|
// Set _should_block.
|
||||||
// Call this from the VM, with Threads_lock held and a safepoint requested.
|
// Call this from the VM, with Threads_lock held and a safepoint requested.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -76,7 +76,7 @@ class CompileTask : public CHeapObj<mtCompiler> {
|
||||||
private:
|
private:
|
||||||
static CompileTask* _task_free_list;
|
static CompileTask* _task_free_list;
|
||||||
Monitor* _lock;
|
Monitor* _lock;
|
||||||
uint _compile_id;
|
int _compile_id;
|
||||||
Method* _method;
|
Method* _method;
|
||||||
jobject _method_holder;
|
jobject _method_holder;
|
||||||
int _osr_bci;
|
int _osr_bci;
|
||||||
|
|
|
@ -577,7 +577,7 @@
|
||||||
<Event name="Compilation" category="Java Virtual Machine, Compiler" label="Compilation"
|
<Event name="Compilation" category="Java Virtual Machine, Compiler" label="Compilation"
|
||||||
description="Results of method compilation attempts"
|
description="Results of method compilation attempts"
|
||||||
thread="true">
|
thread="true">
|
||||||
<Field type="uint" name="compileId" label="Compilation Identifier" relation="CompileId" />
|
<Field type="int" name="compileId" label="Compilation Identifier" relation="CompileId" />
|
||||||
<Field type="CompilerType" name="compiler" label="Compiler" />
|
<Field type="CompilerType" name="compiler" label="Compiler" />
|
||||||
<Field type="Method" name="method" label="Method" />
|
<Field type="Method" name="method" label="Method" />
|
||||||
<Field type="ushort" name="compileLevel" label="Compilation Level" />
|
<Field type="ushort" name="compileLevel" label="Compilation Level" />
|
||||||
|
@ -591,7 +591,7 @@
|
||||||
description="Describes various phases of the compilation process like inlining or string optimization related phases"
|
description="Describes various phases of the compilation process like inlining or string optimization related phases"
|
||||||
thread="true">
|
thread="true">
|
||||||
<Field type="CompilerPhaseType" name="phase" label="Compile Phase" />
|
<Field type="CompilerPhaseType" name="phase" label="Compile Phase" />
|
||||||
<Field type="uint" name="compileId" label="Compilation Identifier" relation="CompileId" />
|
<Field type="int" name="compileId" label="Compilation Identifier" relation="CompileId" />
|
||||||
<Field type="ushort" name="phaseLevel" label="Phase Level" />
|
<Field type="ushort" name="phaseLevel" label="Phase Level" />
|
||||||
</Event>
|
</Event>
|
||||||
|
|
||||||
|
@ -599,7 +599,7 @@
|
||||||
description="In case a JIT compilation failed, a compilation failure is triggered, reporting the reason"
|
description="In case a JIT compilation failed, a compilation failure is triggered, reporting the reason"
|
||||||
thread="true" startTime="false">
|
thread="true" startTime="false">
|
||||||
<Field type="string" name="failureMessage" label="Failure Message" />
|
<Field type="string" name="failureMessage" label="Failure Message" />
|
||||||
<Field type="uint" name="compileId" label="Compilation Identifier" relation="CompileId" />
|
<Field type="int" name="compileId" label="Compilation Identifier" relation="CompileId" />
|
||||||
</Event>
|
</Event>
|
||||||
|
|
||||||
<Type name="CalleeMethod">
|
<Type name="CalleeMethod">
|
||||||
|
@ -611,7 +611,7 @@
|
||||||
<Event name="CompilerInlining" category="Java Virtual Machine, Compiler, Optimization" label="Method Inlining"
|
<Event name="CompilerInlining" category="Java Virtual Machine, Compiler, Optimization" label="Method Inlining"
|
||||||
description="Describes the result of a method inlining attempt"
|
description="Describes the result of a method inlining attempt"
|
||||||
thread="true" startTime="false">
|
thread="true" startTime="false">
|
||||||
<Field type="uint" name="compileId" label="Compilation Identifier" relation="CompileId" />
|
<Field type="int" name="compileId" label="Compilation Identifier" relation="CompileId" />
|
||||||
<Field type="Method" name="caller" label="Caller Method" />
|
<Field type="Method" name="caller" label="Caller Method" />
|
||||||
<Field type="CalleeMethod" name="callee" struct="true" label="Callee Method" />
|
<Field type="CalleeMethod" name="callee" struct="true" label="Callee Method" />
|
||||||
<Field type="boolean" name="succeeded" label="Succeeded" />
|
<Field type="boolean" name="succeeded" label="Succeeded" />
|
||||||
|
@ -637,7 +637,7 @@
|
||||||
<Event name="Deoptimization" category="Java Virtual Machine, Compiler" label="Deoptimization"
|
<Event name="Deoptimization" category="Java Virtual Machine, Compiler" label="Deoptimization"
|
||||||
description="Describes the detection of an uncommon situation in a compiled method which may lead to deoptimization of the method"
|
description="Describes the detection of an uncommon situation in a compiled method which may lead to deoptimization of the method"
|
||||||
thread="true" stackTrace="true" startTime="false">
|
thread="true" stackTrace="true" startTime="false">
|
||||||
<Field type="uint" name="compileId" label="Compilation Identifier" relation="CompileId" />
|
<Field type="int" name="compileId" label="Compilation Identifier" relation="CompileId" />
|
||||||
<Field type="CompilerType" name="compiler" label="Compiler" />
|
<Field type="CompilerType" name="compiler" label="Compiler" />
|
||||||
<Field type="Method" name="method" label="Method" />
|
<Field type="Method" name="method" label="Method" />
|
||||||
<Field type="int" name="lineNumber" label="Line Number" />
|
<Field type="int" name="lineNumber" label="Line Number" />
|
||||||
|
|
|
@ -1066,7 +1066,7 @@
|
||||||
nonstatic_field(CompileTask, _method, Method*) \
|
nonstatic_field(CompileTask, _method, Method*) \
|
||||||
nonstatic_field(CompileTask, _osr_bci, int) \
|
nonstatic_field(CompileTask, _osr_bci, int) \
|
||||||
nonstatic_field(CompileTask, _comp_level, int) \
|
nonstatic_field(CompileTask, _comp_level, int) \
|
||||||
nonstatic_field(CompileTask, _compile_id, uint) \
|
nonstatic_field(CompileTask, _compile_id, int) \
|
||||||
nonstatic_field(CompileTask, _num_inlined_bytecodes, int) \
|
nonstatic_field(CompileTask, _num_inlined_bytecodes, int) \
|
||||||
nonstatic_field(CompileTask, _next, CompileTask*) \
|
nonstatic_field(CompileTask, _next, CompileTask*) \
|
||||||
nonstatic_field(CompileTask, _prev, CompileTask*) \
|
nonstatic_field(CompileTask, _prev, CompileTask*) \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue