Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "interpreter/interpreter.hpp"
#include "oops/arrayOop.hpp"
#include "oops/markWord.hpp"
#include "runtime/arguments.hpp"
#include "runtime/basicLock.hpp"
#include "runtime/os.hpp"
#include "runtime/sharedRuntime.hpp"
Expand Down Expand Up @@ -101,7 +102,7 @@ void C1_MacroAssembler::try_allocate(Register obj, Register var_size_in_bytes, i
void C1_MacroAssembler::initialize_header(Register obj, Register klass, Register len, Register t1, Register t2) {
assert_different_registers(obj, klass, len);

if (UseCompactObjectHeaders || EnableValhalla) {
if (UseCompactObjectHeaders || Arguments::is_valhalla_enabled()) {
// COH: Markword contains class pointer which is only known at runtime.
// Valhalla: Could have value class which has a different prototype header to a normal object.
// In both cases, we need to fetch dynamically.
Expand Down
3 changes: 2 additions & 1 deletion src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include "oops/compressedOops.inline.hpp"
#include "oops/klass.inline.hpp"
#include "oops/resolvedFieldEntry.hpp"
#include "runtime/arguments.hpp"
#include "runtime/continuation.hpp"
#include "runtime/globals.hpp"
#include "runtime/icache.hpp"
Expand Down Expand Up @@ -5727,7 +5728,7 @@ void MacroAssembler::allocate_instance(Register klass, Register new_obj,
bind(initialize_header);
pop(klass);
Register mark_word = t2;
if (UseCompactObjectHeaders || EnableValhalla) {
if (UseCompactObjectHeaders || Arguments::is_valhalla_enabled()) {
ldr(mark_word, Address(klass, Klass::prototype_header_offset()));
str(mark_word, Address(new_obj, oopDesc::mark_offset_in_bytes()));
} else {
Expand Down
9 changes: 5 additions & 4 deletions src/hotspot/cpu/aarch64/templateTable_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include "oops/resolvedMethodEntry.hpp"
#include "prims/jvmtiExport.hpp"
#include "prims/methodHandles.hpp"
#include "runtime/arguments.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/stubRoutines.hpp"
Expand Down Expand Up @@ -1183,7 +1184,7 @@ void TemplateTable::aastore() {

// Have a null in r0, r3=array, r2=index. Store null at ary[idx]
__ bind(is_null);
if (EnableValhalla) {
if (Arguments::is_valhalla_enabled()) {
Label is_null_into_value_array_npe, store_null;

if (UseArrayFlattening) {
Expand Down Expand Up @@ -2031,7 +2032,7 @@ void TemplateTable::if_acmp(Condition cc) {
Register is_inline_type_mask = rscratch1;
__ mov(is_inline_type_mask, markWord::inline_type_pattern);

if (EnableValhalla) {
if (Arguments::is_valhalla_enabled()) {
__ cmp(r1, r0);
__ br(Assembler::EQ, (cc == equal) ? taken : not_taken);

Expand Down Expand Up @@ -2782,7 +2783,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
__ cmp(tos_state, (u1)atos);
__ br(Assembler::NE, notObj);
// atos
if (!EnableValhalla) {
if (!Arguments::is_valhalla_enabled()) {
do_oop_load(_masm, field, r0, IN_HEAP);
__ push(atos);
if (rc == may_rewrite) {
Expand Down Expand Up @@ -3036,7 +3037,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static, RewriteContr

// atos
{
if (!EnableValhalla) {
if (!Arguments::is_valhalla_enabled()) {
__ pop(atos);
if (!is_static) pop_and_check_object(obj);
// Store into the field
Expand Down
3 changes: 2 additions & 1 deletion src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "interpreter/interpreter.hpp"
#include "oops/arrayOop.hpp"
#include "oops/markWord.hpp"
#include "runtime/arguments.hpp"
#include "runtime/basicLock.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/globals.hpp"
Expand Down Expand Up @@ -83,7 +84,7 @@ void C1_MacroAssembler::try_allocate(Register obj, Register var_size_in_bytes, i

void C1_MacroAssembler::initialize_header(Register obj, Register klass, Register len, Register t1, Register t2) {
assert_different_registers(obj, klass, len, t1, t2);
if (UseCompactObjectHeaders || EnableValhalla) {
if (UseCompactObjectHeaders || Arguments::is_valhalla_enabled()) {
// COH: Markword contains class pointer which is only known at runtime.
// Valhalla: Could have value class which has a different prototype header to a normal object.
// In both cases, we need to fetch dynamically.
Expand Down
5 changes: 3 additions & 2 deletions src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "gc/g1/g1HeapRegion.hpp"
#include "gc/g1/g1ThreadLocalData.hpp"
#include "interpreter/interp_masm.hpp"
#include "runtime/arguments.hpp"
#include "runtime/sharedRuntime.hpp"
#include "utilities/debug.hpp"
#include "utilities/macros.hpp"
Expand Down Expand Up @@ -235,7 +236,7 @@ void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm,

__ bind(runtime);

if (EnableValhalla && InlineTypePassFieldsAsArgs) {
if (Arguments::is_valhalla_enabled() && InlineTypePassFieldsAsArgs) {
// Barriers might be emitted when converting between (scalarized) calling conventions for inline
// types. Save all argument registers before calling into the runtime.
// TODO 8366717: use push_set() (see JDK-8283327 push/pop_call_clobbered_registers & aarch64 )
Expand Down Expand Up @@ -279,7 +280,7 @@ void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm,
__ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_pre_entry), pre_val, thread);
}

if (EnableValhalla && InlineTypePassFieldsAsArgs) {
if (Arguments::is_valhalla_enabled() && InlineTypePassFieldsAsArgs) {
// Restore registers
__ movdbl(j_farg0, Address(rsp, 0));
__ movdbl(j_farg1, Address(rsp, 8));
Expand Down
3 changes: 2 additions & 1 deletion src/hotspot/cpu/x86/macroAssembler_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#include "oops/klass.inline.hpp"
#include "oops/resolvedFieldEntry.hpp"
#include "prims/methodHandles.hpp"
#include "runtime/arguments.hpp"
#include "runtime/continuation.hpp"
#include "runtime/interfaceSupport.inline.hpp"
#include "runtime/javaThread.hpp"
Expand Down Expand Up @@ -3647,7 +3648,7 @@ void MacroAssembler::allocate_instance(Register klass, Register new_obj,

// initialize object header only.
bind(initialize_header);
if (UseCompactObjectHeaders || EnableValhalla) {
if (UseCompactObjectHeaders || Arguments::is_valhalla_enabled()) {
pop(klass);
Register mark_word = t2;
movptr(mark_word, Address(klass, Klass::prototype_header_offset()));
Expand Down
9 changes: 5 additions & 4 deletions src/hotspot/cpu/x86/templateTable_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "oops/resolvedMethodEntry.hpp"
#include "prims/jvmtiExport.hpp"
#include "prims/methodHandles.hpp"
#include "runtime/arguments.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/safepointMechanism.hpp"
#include "runtime/sharedRuntime.hpp"
Expand Down Expand Up @@ -1131,7 +1132,7 @@ void TemplateTable::aastore() {

// Have a null in rax, rdx=array, ecx=index. Store null at ary[idx]
__ bind(is_null);
if (EnableValhalla) {
if (Arguments::is_valhalla_enabled()) {
Label write_null_to_null_free_array, store_null;

// Move array class to rdi
Expand Down Expand Up @@ -1957,7 +1958,7 @@ void TemplateTable::if_acmp(Condition cc) {
__ profile_acmp(rbx, rdx, rax, rcx);

const int is_inline_type_mask = markWord::inline_type_pattern;
if (EnableValhalla) {
if (Arguments::is_valhalla_enabled()) {
__ cmpoop(rdx, rax);
__ jcc(Assembler::equal, (cc == equal) ? taken : not_taken);

Expand Down Expand Up @@ -2679,7 +2680,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
__ cmpl(tos_state, atos);
__ jcc(Assembler::notEqual, notObj);
// atos
if (!EnableValhalla) {
if (!Arguments::is_valhalla_enabled()) {
if (!is_static) pop_and_check_object(obj);
do_oop_load(_masm, field, rax);
__ push(atos);
Expand Down Expand Up @@ -2957,7 +2958,7 @@ void TemplateTable::putfield_or_static_helper(int byte_no, bool is_static, Rewri

// atos
{
if (!EnableValhalla) {
if (!Arguments::is_valhalla_enabled()) {
__ pop(atos);
if (!is_static) pop_and_check_object(obj);
// Store into the field
Expand Down
7 changes: 4 additions & 3 deletions src/hotspot/share/c1/c1_GraphBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "interpreter/bytecode.hpp"
#include "jfr/jfrEvents.hpp"
#include "memory/resourceArea.hpp"
#include "runtime/arguments.hpp"
#include "runtime/sharedRuntime.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/macros.hpp"
Expand Down Expand Up @@ -1362,7 +1363,7 @@ void GraphBuilder::if_node(Value x, If::Condition cond, Value y, ValueStack* sta
bool is_bb = tsux->bci() < stream()->cur_bci() || fsux->bci() < stream()->cur_bci();

bool subst_check = false;
if (EnableValhalla && (stream()->cur_bc() == Bytecodes::_if_acmpeq || stream()->cur_bc() == Bytecodes::_if_acmpne)) {
if (Arguments::is_valhalla_enabled() && (stream()->cur_bc() == Bytecodes::_if_acmpeq || stream()->cur_bc() == Bytecodes::_if_acmpne)) {
ValueType* left_vt = x->type();
ValueType* right_vt = y->type();
if (left_vt->is_object()) {
Expand Down Expand Up @@ -2566,7 +2567,7 @@ void GraphBuilder::monitorenter(Value x, int bci) {
#endif
} else {
// We are compiling a monitorenter bytecode
if (EnableValhalla) {
if (Arguments::is_valhalla_enabled()) {
ciType* obj_type = x->declared_type();
if (obj_type == nullptr || obj_type->as_klass()->can_be_inline_klass()) {
// If we're (possibly) locking on an inline type, check for markWord::always_locked_pattern
Expand Down Expand Up @@ -4301,7 +4302,7 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known, bool ign

// Check if we need a membar at the beginning of the java.lang.Object
// constructor to satisfy the memory model for strict fields.
if (EnableValhalla && method()->intrinsic_id() == vmIntrinsics::_Object_init) {
if (Arguments::is_valhalla_enabled() && method()->intrinsic_id() == vmIntrinsics::_Object_init) {
Value receiver = state()->local_at(0);
ciType* klass = receiver->exact_type();
if (klass == nullptr) {
Expand Down
3 changes: 2 additions & 1 deletion src/hotspot/share/c1/c1_LIRGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "gc/shared/c1/barrierSetC1.hpp"
#include "oops/klass.inline.hpp"
#include "oops/methodCounters.hpp"
#include "runtime/arguments.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/stubRoutines.hpp"
#include "runtime/vm_version.hpp"
Expand Down Expand Up @@ -3008,7 +3009,7 @@ void LIRGenerator::do_Base(Base* x) {

// Check if we need a membar at the beginning of the java.lang.Object
// constructor to satisfy the memory model for strict fields.
if (EnableValhalla && method()->intrinsic_id() == vmIntrinsics::_Object_init) {
if (Arguments::is_valhalla_enabled() && method()->intrinsic_id() == vmIntrinsics::_Object_init) {
__ membar_storestore();
}

Expand Down
9 changes: 5 additions & 4 deletions src/hotspot/share/cds/aotMappedHeapWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include "oops/oopHandle.inline.hpp"
#include "oops/typeArrayKlass.hpp"
#include "oops/typeArrayOop.hpp"
#include "runtime/arguments.hpp"
#include "runtime/java.hpp"
#include "runtime/mutexLocker.hpp"
#include "utilities/bitMap.inline.hpp"
Expand Down Expand Up @@ -300,7 +301,7 @@ objArrayOop AOTMappedHeapWriter::allocate_root_segment(size_t offset, int elemen
if (UseCompactObjectHeaders) {
oopDesc::release_set_mark(mem, Universe::objectArrayKlass()->prototype_header());
} else {
assert(!EnableValhalla || Universe::objectArrayKlass()->prototype_header() == markWord::prototype(), "should be the same");
assert(!Arguments::is_valhalla_enabled() || Universe::objectArrayKlass()->prototype_header() == markWord::prototype(), "should be the same");
oopDesc::set_mark(mem, markWord::prototype());
oopDesc::release_set_klass(mem, Universe::objectArrayKlass());
}
Expand Down Expand Up @@ -475,7 +476,7 @@ HeapWord* AOTMappedHeapWriter::init_filler_array_at_buffer_top(int array_length,
if (UseCompactObjectHeaders) {
oopDesc::release_set_mark(mem, markWord::prototype().set_narrow_klass(nk));
} else {
assert(!EnableValhalla || Universe::objectArrayKlass()->prototype_header() == markWord::prototype(), "should be the same");
assert(!Arguments::is_valhalla_enabled() || Universe::objectArrayKlass()->prototype_header() == markWord::prototype(), "should be the same");
oopDesc::set_mark(mem, markWord::prototype());
cast_to_oop(mem)->set_narrow_klass(nk);
}
Expand Down Expand Up @@ -741,11 +742,11 @@ void AOTMappedHeapWriter::update_header_for_requested_obj(oop requested_obj, oop
}
// We need to retain the identity_hash, because it may have been used by some hashtables
// in the shared heap.
if (!src_obj->fast_no_hash_check() && (!(EnableValhalla && src_obj->mark().is_inline_type()))) {
if (!src_obj->fast_no_hash_check() && (!(Arguments::is_valhalla_enabled() && src_obj->mark().is_inline_type()))) {
intptr_t src_hash = src_obj->identity_hash();
if (UseCompactObjectHeaders) {
fake_oop->set_mark(fake_oop->mark().copy_set_hash(src_hash));
} else if (EnableValhalla) {
} else if (Arguments::is_valhalla_enabled()) {
fake_oop->set_mark(src_klass->prototype_header().copy_set_hash(src_hash));
} else {
fake_oop->set_mark(markWord::prototype().copy_set_hash(src_hash));
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/cds/aotMetaspace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1373,7 +1373,7 @@ bool AOTMetaspace::try_link_class(JavaThread* current, InstanceKlass* ik) {
}

void VM_PopulateDumpSharedSpace::dump_java_heap_objects() {
if (CDSConfig::is_valhalla_preview()) {
if (Arguments::is_valhalla_enabled()) {
log_info(cds)("Archived java heap is not yet supported with Valhalla preview");
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/cds/cdsConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ const char* CDSConfig::default_archive_path() {
tmp.print_raw("_coh");
}
#endif
if (is_valhalla_preview()) {
if (Arguments::is_valhalla_enabled()) {
tmp.print_raw("_valhalla");
}
tmp.print_raw(".jsa");
Expand Down Expand Up @@ -975,7 +975,7 @@ bool CDSConfig::are_vm_options_incompatible_with_dumping_heap() {
}

bool CDSConfig::is_dumping_heap() {
if (is_valhalla_preview()) {
if (Arguments::is_valhalla_enabled()) {
// Not working yet -- e.g., HeapShared::oop_hash() needs to be implemented for value oops
return false;
}
Expand Down
4 changes: 0 additions & 4 deletions src/hotspot/share/cds/cdsConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,6 @@ class CDSConfig : public AllStatic {
static void stop_dumping_full_module_graph(const char* reason = nullptr) NOT_CDS_JAVA_HEAP_RETURN;
static void stop_using_full_module_graph(const char* reason = nullptr) NOT_CDS_JAVA_HEAP_RETURN;

static bool is_valhalla_preview() {
return Arguments::enable_preview() && EnableValhalla;
}

// --- AOT code

static bool is_dumping_aot_code() NOT_CDS_RETURN_(false);
Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/share/cds/filemap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ void FileMapHeader::populate(FileMapInfo *info, size_t core_region_alignment,
_use_optimized_module_handling = CDSConfig::is_using_optimized_module_handling();
_has_aot_linked_classes = CDSConfig::is_dumping_aot_linked_classes();
_has_full_module_graph = CDSConfig::is_dumping_full_module_graph();
_has_valhalla_patched_classes = CDSConfig::is_valhalla_preview();
_has_valhalla_patched_classes = Arguments::is_valhalla_enabled();

// The following fields are for sanity checks for whether this archive
// will function correctly with this JVM and the bootclasspath it's
Expand Down Expand Up @@ -1993,7 +1993,7 @@ bool FileMapHeader::validate() {

if (is_static()) {
const char* err = nullptr;
if (CDSConfig::is_valhalla_preview()) {
if (Arguments::is_valhalla_enabled()) {
if (!_has_valhalla_patched_classes) {
err = "not created";
}
Expand All @@ -2003,7 +2003,7 @@ bool FileMapHeader::validate() {
}
}
if (err != nullptr) {
log_warning(cds)("This archive was %s with --enable-preview -XX:+EnableValhalla. It is "
log_warning(cds)("This archive was %s with --enable-preview. It is "
"incompatible with the current JVM setting", err);
return false;
}
Expand Down
3 changes: 1 addition & 2 deletions src/hotspot/share/cds/filemap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ class FileMapRegion: private CDSFileMapRegion {
};

#define CDS_MUST_MATCH_FLAGS_DO(f) \
f(EnableValhalla) \
f(UseArrayFlattening) \
f(UseFieldFlattening) \
f(InlineTypePassFieldsAsArgs) \
Expand Down Expand Up @@ -173,7 +172,7 @@ class FileMapHeader: private CDSFileMapHeaderBase {
// some expensive operations.
bool _has_aot_linked_classes; // Was the CDS archive created with -XX:+AOTClassLinking
bool _has_full_module_graph; // Does this CDS archive contain the full archived module graph?
bool _has_valhalla_patched_classes; // Is this archived dumped with --enable-preview -XX:+EnableValhalla?
bool _has_valhalla_patched_classes; // Is this archived dumped with --enable-preview
CDSMustMatchFlags _must_match; // These flags must be the same between dumptime and runtime
size_t _rw_ptrmap_start_pos; // The first bit in the ptrmap corresponds to this position in the rw region
size_t _ro_ptrmap_start_pos; // The first bit in the ptrmap corresponds to this position in the ro region
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/cds/heapShared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2260,7 +2260,7 @@ void HeapShared::archive_object_subgraphs(ArchivableStaticFieldInfo fields[],
ArchivableStaticFieldInfo* info = &fields[i];
const char* klass_name = info->klass_name;

if (CDSConfig::is_valhalla_preview() && strcmp(klass_name, "jdk/internal/module/ArchivedModuleGraph") == 0) {
if (Arguments::is_valhalla_enabled() && strcmp(klass_name, "jdk/internal/module/ArchivedModuleGraph") == 0) {
// FIXME -- ArchivedModuleGraph doesn't work when java.base is patched with valhalla classes.
i++;
continue;
Expand Down
3 changes: 2 additions & 1 deletion src/hotspot/share/ci/ciInstanceKlass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "oops/instanceKlass.inline.hpp"
#include "oops/klass.inline.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/arguments.hpp"
#include "runtime/fieldDescriptor.inline.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/jniHandles.inline.hpp"
Expand Down Expand Up @@ -726,7 +727,7 @@ ciInstanceKlass* ciInstanceKlass::implementor() {
}

bool ciInstanceKlass::can_be_inline_klass(bool is_exact) {
if (!EnableValhalla) {
if (!Arguments::is_valhalla_enabled()) {
return false;
}
if (!is_loaded() || is_inlinetype()) {
Expand Down
3 changes: 2 additions & 1 deletion src/hotspot/share/ci/ciKlass.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#include "ci/ciType.hpp"
#include "oops/klass.hpp"
#include "runtime/arguments.hpp"

// ciKlass
//
Expand Down Expand Up @@ -111,7 +112,7 @@ class ciKlass : public ciType {
}

virtual bool can_be_inline_array_klass() {
return EnableValhalla && is_java_lang_Object();
return Arguments::is_valhalla_enabled() && is_java_lang_Object();
}

bool is_in_encoding_range() {
Expand Down
Loading