Skip to content

Commit 6d56996

Browse files
committed
8330540: Rename the enum type CompileCommand to CompileCommandEnum
Reviewed-by: kvn, dlong
1 parent f6feeb0 commit 6d56996

19 files changed

+134
-127
lines changed

src/hotspot/share/c1/c1_LIRGenerator.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "ci/ciObjArray.hpp"
3636
#include "ci/ciUtilities.hpp"
3737
#include "compiler/compilerDefinitions.inline.hpp"
38+
#include "compiler/compilerOracle.hpp"
3839
#include "gc/shared/barrierSet.hpp"
3940
#include "gc/shared/c1/barrierSetC1.hpp"
4041
#include "oops/klass.inline.hpp"
@@ -3216,7 +3217,7 @@ void LIRGenerator::do_ProfileInvoke(ProfileInvoke* x) {
32163217
// Notify the runtime very infrequently only to take care of counter overflows
32173218
int freq_log = Tier23InlineeNotifyFreqLog;
32183219
double scale;
3219-
if (_method->has_option_value(CompileCommand::CompileThresholdScaling, scale)) {
3220+
if (_method->has_option_value(CompileCommandEnum::CompileThresholdScaling, scale)) {
32203221
freq_log = CompilerConfig::scaled_freq_log(freq_log, scale);
32213222
}
32223223
increment_event_counter_impl(info, x->inlinee(), LIR_OprFact::intConst(InvocationCounter::count_increment), right_n_bits(freq_log), InvocationEntryBci, false, true);
@@ -3257,7 +3258,7 @@ void LIRGenerator::increment_event_counter(CodeEmitInfo* info, LIR_Opr step, int
32573258
}
32583259
// Increment the appropriate invocation/backedge counter and notify the runtime.
32593260
double scale;
3260-
if (_method->has_option_value(CompileCommand::CompileThresholdScaling, scale)) {
3261+
if (_method->has_option_value(CompileCommandEnum::CompileThresholdScaling, scale)) {
32613262
freq_log = CompilerConfig::scaled_freq_log(freq_log, scale);
32623263
}
32633264
increment_event_counter_impl(info, info->scope()->method(), step, right_n_bits(freq_log), bci, backedge, true);

src/hotspot/share/ci/ciMethod.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "ci/ciUtilities.inline.hpp"
3737
#include "compiler/abstractCompiler.hpp"
3838
#include "compiler/compilerDefinitions.inline.hpp"
39+
#include "compiler/compilerOracle.hpp"
3940
#include "compiler/methodLiveness.hpp"
4041
#include "interpreter/interpreter.hpp"
4142
#include "interpreter/linkResolver.hpp"
@@ -1062,7 +1063,7 @@ MethodCounters* ciMethod::ensure_method_counters() {
10621063
// ------------------------------------------------------------------
10631064
// ciMethod::has_option
10641065
//
1065-
bool ciMethod::has_option(enum CompileCommand option) {
1066+
bool ciMethod::has_option(CompileCommandEnum option) {
10661067
check_is_loaded();
10671068
VM_ENTRY_MARK;
10681069
methodHandle mh(THREAD, get_Method());
@@ -1072,7 +1073,7 @@ bool ciMethod::has_option(enum CompileCommand option) {
10721073
// ------------------------------------------------------------------
10731074
// ciMethod::has_option_value
10741075
//
1075-
bool ciMethod::has_option_value(enum CompileCommand option, double& value) {
1076+
bool ciMethod::has_option_value(CompileCommandEnum option, double& value) {
10761077
check_is_loaded();
10771078
VM_ENTRY_MARK;
10781079
methodHandle mh(THREAD, get_Method());

src/hotspot/share/ci/ciMethod.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -31,10 +31,10 @@
3131
#include "ci/ciSignature.hpp"
3232
#include "classfile/vmIntrinsics.hpp"
3333
#include "compiler/methodLiveness.hpp"
34-
#include "compiler/compilerOracle.hpp"
3534
#include "oops/method.hpp"
3635
#include "runtime/handles.hpp"
3736
#include "utilities/bitMap.hpp"
37+
#include "utilities/vmEnums.hpp"
3838

3939
class ciMethodBlocks;
4040
class MethodLiveness;
@@ -303,8 +303,8 @@ class ciMethod : public ciMetadata {
303303
// Find the proper vtable index to invoke this method.
304304
int resolve_vtable_index(ciKlass* caller, ciKlass* receiver);
305305

306-
bool has_option(enum CompileCommand option);
307-
bool has_option_value(enum CompileCommand option, double& value);
306+
bool has_option(CompileCommandEnum option);
307+
bool has_option_value(CompileCommandEnum option, double& value);
308308
bool can_be_compiled();
309309
bool can_be_parsed() const { return _can_be_parsed; }
310310
bool has_compiled_code();

src/hotspot/share/code/nmethod.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "compiler/compileLog.hpp"
3737
#include "compiler/compileTask.hpp"
3838
#include "compiler/compilerDirectives.hpp"
39+
#include "compiler/compilerOracle.hpp"
3940
#include "compiler/directivesParser.hpp"
4041
#include "compiler/disassembler.hpp"
4142
#include "compiler/oopMap.inline.hpp"
@@ -1605,15 +1606,15 @@ void nmethod::print_nmethod(bool printmethod) {
16051606
#if defined(SUPPORT_DATA_STRUCTS)
16061607
if (AbstractDisassembler::show_structs()) {
16071608
methodHandle mh(Thread::current(), _method);
1608-
if (printmethod || PrintDebugInfo || CompilerOracle::has_option(mh, CompileCommand::PrintDebugInfo)) {
1609+
if (printmethod || PrintDebugInfo || CompilerOracle::has_option(mh, CompileCommandEnum::PrintDebugInfo)) {
16091610
print_scopes();
16101611
tty->print_cr("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ");
16111612
}
1612-
if (printmethod || PrintRelocations || CompilerOracle::has_option(mh, CompileCommand::PrintRelocations)) {
1613+
if (printmethod || PrintRelocations || CompilerOracle::has_option(mh, CompileCommandEnum::PrintRelocations)) {
16131614
print_relocations();
16141615
tty->print_cr("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ");
16151616
}
1616-
if (printmethod || PrintDependencies || CompilerOracle::has_option(mh, CompileCommand::PrintDependencies)) {
1617+
if (printmethod || PrintDependencies || CompilerOracle::has_option(mh, CompileCommandEnum::PrintDependencies)) {
16171618
print_dependencies_on(tty);
16181619
tty->print_cr("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ");
16191620
}

src/hotspot/share/compiler/compilationPolicy.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ class LoopPredicate : AllStatic {
229229
public:
230230
static bool apply_scaled(const methodHandle& method, CompLevel cur_level, int i, int b, double scale) {
231231
double threshold_scaling;
232-
if (CompilerOracle::has_option_value(method, CompileCommand::CompileThresholdScaling, threshold_scaling)) {
232+
if (CompilerOracle::has_option_value(method, CompileCommandEnum::CompileThresholdScaling, threshold_scaling)) {
233233
scale *= threshold_scaling;
234234
}
235235
switch(cur_level) {
@@ -267,7 +267,7 @@ class CallPredicate : AllStatic {
267267
public:
268268
static bool apply_scaled(const methodHandle& method, CompLevel cur_level, int i, int b, double scale) {
269269
double threshold_scaling;
270-
if (CompilerOracle::has_option_value(method, CompileCommand::CompileThresholdScaling, threshold_scaling)) {
270+
if (CompilerOracle::has_option_value(method, CompileCommandEnum::CompileThresholdScaling, threshold_scaling)) {
271271
scale *= threshold_scaling;
272272
}
273273
switch(cur_level) {

src/hotspot/share/compiler/compileBroker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1549,7 +1549,7 @@ bool CompileBroker::compilation_is_prohibited(const methodHandle& method, int os
15491549

15501550
// The method may be explicitly excluded by the user.
15511551
double scale;
1552-
if (excluded || (CompilerOracle::has_option_value(method, CompileCommand::CompileThresholdScaling, scale) && scale == 0)) {
1552+
if (excluded || (CompilerOracle::has_option_value(method, CompileCommandEnum::CompileThresholdScaling, scale) && scale == 0)) {
15531553
bool quietly = CompilerOracle::be_quiet();
15541554
if (PrintCompilation && !quietly) {
15551555
// This does not happen quietly...

src/hotspot/share/compiler/compilerDirectives.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ DirectiveSet* DirectiveSet::compilecommand_compatibility_init(const methodHandle
426426
}
427427

428428
// inline and dontinline (including exclude) are implemented in the directiveset accessors
429-
#define init_default_cc(name, type, dvalue, cc_flag) { type v; if (!_modified[name##Index] && CompileCommand::cc_flag != CompileCommand::Unknown && CompilerOracle::has_option_value(method, CompileCommand::cc_flag, v) && v != this->name##Option) { set.cloned()->name##Option = v; } }
429+
#define init_default_cc(name, type, dvalue, cc_flag) { type v; if (!_modified[name##Index] && CompileCommandEnum::cc_flag != CompileCommandEnum::Unknown && CompilerOracle::has_option_value(method, CompileCommandEnum::cc_flag, v) && v != this->name##Option) { set.cloned()->name##Option = v; } }
430430
compilerdirectives_common_flags(init_default_cc)
431431
compilerdirectives_c2_flags(init_default_cc)
432432
compilerdirectives_c1_flags(init_default_cc)
@@ -438,7 +438,7 @@ DirectiveSet* DirectiveSet::compilecommand_compatibility_init(const methodHandle
438438
if (!_modified[TraceAutoVectorizationIndex]) {
439439
// Parse ccstr and create mask
440440
ccstrlist option;
441-
if (CompilerOracle::has_option_value(method, CompileCommand::TraceAutoVectorization, option)) {
441+
if (CompilerOracle::has_option_value(method, CompileCommandEnum::TraceAutoVectorization, option)) {
442442
TraceAutoVectorizationTagValidator validator(option, false);
443443
if (validator.is_valid()) {
444444
set.cloned()->set_trace_auto_vectorization_tags(validator.tags());
@@ -448,7 +448,7 @@ DirectiveSet* DirectiveSet::compilecommand_compatibility_init(const methodHandle
448448
if (!_modified[PrintIdealPhaseIndex]) {
449449
// Parse ccstr and create set
450450
ccstrlist option;
451-
if (CompilerOracle::has_option_value(method, CompileCommand::PrintIdealPhase, option)) {
451+
if (CompilerOracle::has_option_value(method, CompileCommandEnum::PrintIdealPhase, option)) {
452452
PhaseNameValidator validator(option);
453453
if (validator.is_valid()) {
454454
assert(!validator.phase_name_set().is_empty(), "Phase name set must be non-empty");
@@ -464,7 +464,7 @@ DirectiveSet* DirectiveSet::compilecommand_compatibility_init(const methodHandle
464464
bool need_reset = true; // if Control/DisableIntrinsic redefined, only need to reset control_words once
465465

466466
if (!_modified[ControlIntrinsicIndex] &&
467-
CompilerOracle::has_option_value(method, CompileCommand::ControlIntrinsic, option_value)) {
467+
CompilerOracle::has_option_value(method, CompileCommandEnum::ControlIntrinsic, option_value)) {
468468
ControlIntrinsicIter iter(option_value);
469469

470470
if (need_reset) {
@@ -484,7 +484,7 @@ DirectiveSet* DirectiveSet::compilecommand_compatibility_init(const methodHandle
484484

485485

486486
if (!_modified[DisableIntrinsicIndex] &&
487-
CompilerOracle::has_option_value(method, CompileCommand::DisableIntrinsic, option_value)) {
487+
CompilerOracle::has_option_value(method, CompileCommandEnum::DisableIntrinsic, option_value)) {
488488
ControlIntrinsicIter iter(option_value, true/*disable_all*/);
489489

490490
if (need_reset) {

src/hotspot/share/compiler/compilerDirectives.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#include "ci/ciMethod.hpp"
3131
#include "compiler/compiler_globals.hpp"
3232
#include "compiler/methodMatcher.hpp"
33-
#include "compiler/compilerOracle.hpp"
3433
#include "opto/phasetype.hpp"
3534
#include "utilities/bitMap.hpp"
3635
#include "utilities/exceptions.hpp"

0 commit comments

Comments
 (0)