Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 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: 2 additions & 2 deletions src/hotspot/share/memory/metaspace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ MetaWord* Metaspace::allocate(ClassLoaderData* loader_data, size_t word_size,
// Deal with concurrent unloading failed allocation starvation
MetaspaceCriticalAllocation::block_if_concurrent_purge();

MetadataType mdtype = type == MetaspaceObj::ClassType ? ClassType: NonClassType;
MetadataType mdtype = (type == MetaspaceObj::ClassType) ? ClassType : NonClassType;

// Try to allocate metadata.
MetaWord* result = loader_data->metaspace_non_null()->allocate(word_size, mdtype);
Expand Down Expand Up @@ -917,7 +917,7 @@ MetaWord* Metaspace::allocate(ClassLoaderData* loader_data, size_t word_size,
MetaWord* result = allocate(loader_data, word_size, type);

if (result == nullptr) {
MetadataType mdtype = type == MetaspaceObj::ClassType ? ClassType: NonClassType;
MetadataType mdtype = (type == MetaspaceObj::ClassType) ? ClassType : NonClassType;
tracer()->report_metaspace_allocation_failure(loader_data, word_size, type, mdtype);

// Allocation failed.
Expand Down
2 changes: 2 additions & 0 deletions src/hotspot/share/oops/klass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ static markWord make_prototype(const Klass* kls) {
markWord prototype = markWord::prototype();
#ifdef _LP64
if (UseCompactObjectHeaders) {
// With compact object headers, the narrow Klass ID is part of the mark word.
// We therefore seed the mark word with the narrow Klass ID.
precond(CompressedKlassPointers::is_encodable(kls));
const narrowKlass nk = CompressedKlassPointers::encode(const_cast<Klass*>(kls));
prototype = prototype.set_narrow_klass(nk);
Expand Down