Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8269231: Fix 32-bit Valhalla (Zero) builds #460

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 4 additions & 0 deletions src/hotspot/share/oops/flatArrayKlass.cpp
Original file line number Diff line number Diff line change
@@ -66,8 +66,12 @@ FlatArrayKlass::FlatArrayKlass(Klass* element_klass, Symbol* name) : ArrayKlass(
assert(is_flatArray_klass(), "sanity");
assert(is_null_free_array_klass(), "sanity");

#ifdef _LP64
set_prototype_header(markWord::flat_array_prototype());
assert(prototype_header().is_flat_array(), "sanity");
#else
set_prototype_header(markWord::inline_type_prototype());
#endif

#ifndef PRODUCT
if (PrintFlatArrayLayout) {
10 changes: 10 additions & 0 deletions src/hotspot/share/oops/markWord.hpp
Original file line number Diff line number Diff line change
@@ -472,6 +472,16 @@ class markWord {
bool is_null_free_array() const {
return (mask_bits(value(), null_free_array_mask_in_place) == null_free_array_pattern);
}
#else
bool is_flat_array() const {
fatal("Should not ask this for mark word, ask oopDesc");
return false;
}

bool is_null_free_array() const {
fatal("Should not ask this for mark word, ask oopDesc");
return false;
}
#endif
// Prototype mark for initialization
static markWord prototype() {
11 changes: 7 additions & 4 deletions src/hotspot/share/oops/markWord.inline.hpp
Original file line number Diff line number Diff line change
@@ -71,10 +71,13 @@ inline bool markWord::must_be_preserved_for_promotion_failure(const oopDesc* obj
inline markWord markWord::prototype_for_klass(const Klass* klass) {
markWord prototype_header = klass->prototype_header();
assert(prototype_header == prototype() ||
(UseBiasedLocking && prototype_header.has_bias_pattern()) ||
prototype_header.is_inline_type() ||
prototype_header.is_flat_array() ||
prototype_header.is_null_free_array(), "corrupt prototype header");
(UseBiasedLocking && prototype_header.has_bias_pattern())
|| prototype_header.is_inline_type()
#ifdef _LP64
|| prototype_header.is_flat_array()
|| prototype_header.is_null_free_array()
#endif
, "corrupt prototype header");

return prototype_header;
}
4 changes: 4 additions & 0 deletions src/hotspot/share/oops/objArrayKlass.cpp
Original file line number Diff line number Diff line change
@@ -162,8 +162,12 @@ ObjArrayKlass::ObjArrayKlass(int n, Klass* element_klass, Symbol* name, bool nul
if (null_free) {
assert(n == 1, "Bytecode does not support null-free multi-dim");
lh = layout_helper_set_null_free(lh);
#ifdef _LP64
set_prototype_header(markWord::null_free_array_prototype());
assert(prototype_header().is_null_free_array(), "sanity");
#else
set_prototype_header(markWord::inline_type_prototype());
#endif
}
set_layout_helper(lh);
assert(is_array_klass(), "sanity");
2 changes: 1 addition & 1 deletion src/hotspot/share/oops/oop.inline.hpp
Original file line number Diff line number Diff line change
@@ -207,7 +207,7 @@ bool oopDesc::is_objArray() const { return klass()->is_objArray_klass(); }
bool oopDesc::is_typeArray() const { return klass()->is_typeArray_klass(); }

bool oopDesc::is_inline_type() const { return mark().is_inline_type(); }
#if _LP64
#ifdef _LP64
bool oopDesc::is_flatArray() const {
markWord mrk = mark();
return (mrk.is_unlocked()) ? mrk.is_flat_array() : klass()->is_flatArray_klass();
1 change: 1 addition & 0 deletions src/hotspot/share/opto/output.cpp
Original file line number Diff line number Diff line change
@@ -33,6 +33,7 @@
#include "compiler/disassembler.hpp"
#include "compiler/oopMap.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/shared/c2/barrierSetC2.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/allocation.hpp"
6 changes: 3 additions & 3 deletions src/hotspot/share/prims/unsafe.cpp
Original file line number Diff line number Diff line change
@@ -298,7 +298,7 @@ static void assert_and_log_unsafe_value_access(oop p, jlong offset, InlineKlass*
assert(fd.is_inlined(), "field not flat");
} else {
if (log_is_enabled(Trace, valuetypes)) {
log_trace(valuetypes)("not a field in %s at offset " SIZE_FORMAT_HEX,
log_trace(valuetypes)("not a field in %s at offset " JLONG_FORMAT_X,
p->klass()->external_name(), offset);
}
}
@@ -316,11 +316,11 @@ static void assert_and_log_unsafe_value_access(oop p, jlong offset, InlineKlass*
FlatArrayKlass* vak = FlatArrayKlass::cast(k);
int index = (offset - vak->array_header_in_bytes()) / vak->element_byte_size();
address dest = (address)((flatArrayOop)p)->value_at_addr(index, vak->layout_helper());
log_trace(valuetypes)("%s array type %s index %d element size %d offset " SIZE_FORMAT_HEX " at " INTPTR_FORMAT,
log_trace(valuetypes)("%s array type %s index %d element size %d offset " JLONG_FORMAT_X " at " INTPTR_FORMAT,
p->klass()->external_name(), vak->external_name(),
index, vak->element_byte_size(), offset, p2i(dest));
} else {
log_trace(valuetypes)("%s field type %s at offset " SIZE_FORMAT_HEX,
log_trace(valuetypes)("%s field type %s at offset " JLONG_FORMAT_X,
p->klass()->external_name(), vk->external_name(), offset);
}
}
4 changes: 4 additions & 0 deletions src/hotspot/share/utilities/globalDefinitions.hpp
Original file line number Diff line number Diff line change
@@ -104,6 +104,7 @@ class oopDesc;
// Format 64-bit quantities.
#define INT64_FORMAT "%" PRId64
#define UINT64_FORMAT "%" PRIu64
#define INT64_FORMAT_X "%" PRIx64
#define UINT64_FORMAT_X "%" PRIx64
#define INT64_FORMAT_W(width) "%" #width PRId64
#define UINT64_FORMAT_W(width) "%" #width PRIu64
@@ -118,6 +119,9 @@ class oopDesc;
#ifndef JLONG_FORMAT_W
#define JLONG_FORMAT_W(width) INT64_FORMAT_W(width)
#endif
#ifndef JLONG_FORMAT_X
#define JLONG_FORMAT_X INT64_FORMAT_X
#endif
#ifndef JULONG_FORMAT
#define JULONG_FORMAT UINT64_FORMAT
#endif