Skip to content

Commit f5187eb

Browse files
committed
8373599: Cleanup arguments.hpp includes
Reviewed-by: coleenp, kbarrett
1 parent 629bf20 commit f5187eb

File tree

7 files changed

+48
-30
lines changed

7 files changed

+48
-30
lines changed

src/hotspot/share/compiler/compilerDefinitions.inline.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
#include "compiler/compiler_globals.hpp"
3131
#include "runtime/arguments.hpp"
32+
#include "runtime/globals.hpp"
3233

3334
inline bool CompilerConfig::is_interpreter_only() {
3435
return Arguments::is_interpreter_only() || TieredStopAtLevel == CompLevel_none;

src/hotspot/share/runtime/abstract_vm_version.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "compiler/compilerDefinitions.hpp"
2727
#include "jvm_io.h"
2828
#include "runtime/arguments.hpp"
29+
#include "runtime/os.hpp"
2930
#include "runtime/vm_version.hpp"
3031
#include "utilities/globalDefinitions.hpp"
3132

src/hotspot/share/runtime/arguments.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,6 +1092,13 @@ void Arguments::print_summary_on(outputStream* st) {
10921092
st->cr();
10931093
}
10941094

1095+
void Arguments::set_jvm_flags_file(const char *value) {
1096+
if (_jvm_flags_file != nullptr) {
1097+
os::free(_jvm_flags_file);
1098+
}
1099+
_jvm_flags_file = os::strdup_check_oom(value);
1100+
}
1101+
10951102
void Arguments::print_jvm_flags_on(outputStream* st) {
10961103
if (_num_jvm_flags > 0) {
10971104
for (int i=0; i < _num_jvm_flags; i++) {
@@ -2844,6 +2851,10 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, JVMFlagOrigin
28442851
return JNI_OK;
28452852
}
28462853

2854+
void Arguments::set_ext_dirs(char *value) {
2855+
_ext_dirs = os::strdup_check_oom(value);
2856+
}
2857+
28472858
void Arguments::add_patch_mod_prefix(const char* module_name, const char* path) {
28482859
// For java.base check for duplicate --patch-module options being specified on the command line.
28492860
// This check is only required for java.base, all other duplicate module specifications

src/hotspot/share/runtime/arguments.hpp

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,17 @@
2525
#ifndef SHARE_RUNTIME_ARGUMENTS_HPP
2626
#define SHARE_RUNTIME_ARGUMENTS_HPP
2727

28-
#include "logging/logLevel.hpp"
29-
#include "logging/logTag.hpp"
28+
#include "jni.h"
3029
#include "memory/allocation.hpp"
3130
#include "memory/allStatic.hpp"
32-
#include "runtime/globals.hpp"
31+
#include "runtime/flags/jvmFlag.hpp"
3332
#include "runtime/java.hpp"
34-
#include "runtime/os.hpp"
35-
#include "utilities/debug.hpp"
36-
#include "utilities/vmEnums.hpp"
33+
#include "utilities/globalDefinitions.hpp"
3734

3835
// Arguments parses the command line and recognizes options
3936

37+
template <typename E>
38+
class GrowableArray;
4039
class JVMFlag;
4140

4241
// Invocation API hook typedefs (these should really be defined in jni.h)
@@ -412,12 +411,8 @@ class Arguments : AllStatic {
412411

413412
// convenient methods to get and set jvm_flags_file
414413
static const char* get_jvm_flags_file() { return _jvm_flags_file; }
415-
static void set_jvm_flags_file(const char *value) {
416-
if (_jvm_flags_file != nullptr) {
417-
os::free(_jvm_flags_file);
418-
}
419-
_jvm_flags_file = os::strdup_check_oom(value);
420-
}
414+
static void set_jvm_flags_file(const char *value);
415+
421416
// convenient methods to obtain / print jvm_flags and jvm_args
422417
static const char* jvm_flags() { return build_resource_string(_jvm_flags_array, _num_jvm_flags); }
423418
static const char* jvm_args() { return build_resource_string(_jvm_args_array, _num_jvm_args); }
@@ -479,7 +474,7 @@ class Arguments : AllStatic {
479474
static void set_dll_dir(const char *value) { _sun_boot_library_path->set_value(value); }
480475
static void set_java_home(const char *value) { _java_home->set_value(value); }
481476
static void set_library_path(const char *value) { _java_library_path->set_value(value); }
482-
static void set_ext_dirs(char *value) { _ext_dirs = os::strdup_check_oom(value); }
477+
static void set_ext_dirs(char *value);
483478

484479
// Set up the underlying pieces of the boot class path
485480
static void add_patch_mod_prefix(const char *module_name, const char *path);

src/hotspot/share/runtime/java.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
#include "runtime/interfaceSupport.inline.hpp"
7272
#include "runtime/java.hpp"
7373
#include "runtime/javaThread.hpp"
74+
#include "runtime/os.hpp"
7475
#include "runtime/sharedRuntime.hpp"
7576
#include "runtime/stubRoutines.hpp"
7677
#include "runtime/task.hpp"
@@ -765,3 +766,23 @@ void JDK_Version::to_string(char* buffer, size_t buflen) const {
765766
}
766767
}
767768
}
769+
770+
void JDK_Version::set_java_version(const char* version) {
771+
_java_version = os::strdup(version);
772+
}
773+
774+
void JDK_Version::set_runtime_name(const char* name) {
775+
_runtime_name = os::strdup(name);
776+
}
777+
778+
void JDK_Version::set_runtime_version(const char* version) {
779+
_runtime_version = os::strdup(version);
780+
}
781+
782+
void JDK_Version::set_runtime_vendor_version(const char* vendor_version) {
783+
_runtime_vendor_version = os::strdup(vendor_version);
784+
}
785+
786+
void JDK_Version::set_runtime_vendor_vm_bug_url(const char* vendor_vm_bug_url) {
787+
_runtime_vendor_vm_bug_url = os::strdup(vendor_vm_bug_url);
788+
}

src/hotspot/share/runtime/java.hpp

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#ifndef SHARE_RUNTIME_JAVA_HPP
2626
#define SHARE_RUNTIME_JAVA_HPP
2727

28-
#include "runtime/os.hpp"
2928
#include "utilities/globalDefinitions.hpp"
3029

3130
class Handle;
@@ -133,38 +132,27 @@ class JDK_Version {
133132
static const char* java_version() {
134133
return _java_version;
135134
}
136-
static void set_java_version(const char* version) {
137-
_java_version = os::strdup(version);
138-
}
135+
static void set_java_version(const char* version);
139136

140137
static const char* runtime_name() {
141138
return _runtime_name;
142139
}
143-
static void set_runtime_name(const char* name) {
144-
_runtime_name = os::strdup(name);
145-
}
140+
static void set_runtime_name(const char* name);
146141

147142
static const char* runtime_version() {
148143
return _runtime_version;
149144
}
150-
static void set_runtime_version(const char* version) {
151-
_runtime_version = os::strdup(version);
152-
}
145+
static void set_runtime_version(const char* version);
153146

154147
static const char* runtime_vendor_version() {
155148
return _runtime_vendor_version;
156149
}
157-
static void set_runtime_vendor_version(const char* vendor_version) {
158-
_runtime_vendor_version = os::strdup(vendor_version);
159-
}
150+
static void set_runtime_vendor_version(const char* vendor_version);
160151

161152
static const char* runtime_vendor_vm_bug_url() {
162153
return _runtime_vendor_vm_bug_url;
163154
}
164-
static void set_runtime_vendor_vm_bug_url(const char* vendor_vm_bug_url) {
165-
_runtime_vendor_vm_bug_url = os::strdup(vendor_vm_bug_url);
166-
}
167-
155+
static void set_runtime_vendor_vm_bug_url(const char* vendor_vm_bug_url);
168156
};
169157

170158
#endif // SHARE_RUNTIME_JAVA_HPP

test/hotspot/gtest/runtime/test_arguments.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "jvm.h"
2525
#include "runtime/arguments.hpp"
2626
#include "runtime/flags/jvmFlag.hpp"
27+
#include "runtime/os.hpp"
2728
#include "utilities/align.hpp"
2829
#include "utilities/globalDefinitions.hpp"
2930

0 commit comments

Comments
 (0)