Skip to content

Commit 4b4a483

Browse files
committedJun 20, 2024
8330699: Obsolete -XX:+UseEmptySlotsInSupers
Reviewed-by: shade, fparain, dholmes
1 parent 187710e commit 4b4a483

File tree

4 files changed

+3
-100
lines changed

4 files changed

+3
-100
lines changed
 

‎src/hotspot/share/classfile/fieldLayoutBuilder.cpp

+2-16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 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
@@ -137,7 +137,7 @@ void FieldLayout::initialize_instance_layout(const InstanceKlass* super_klass) {
137137
} else {
138138
bool has_fields = reconstruct_layout(super_klass);
139139
fill_holes(super_klass);
140-
if ((UseEmptySlotsInSupers && !super_klass->has_contended_annotations()) || !has_fields) {
140+
if (!super_klass->has_contended_annotations() || !has_fields) {
141141
_start = _blocks; // start allocating fields from the first empty block
142142
} else {
143143
_start = _last; // append fields at the end of the reconstructed layout
@@ -364,20 +364,6 @@ void FieldLayout::fill_holes(const InstanceKlass* super_klass) {
364364
b = p;
365365
}
366366

367-
if (!UseEmptySlotsInSupers) {
368-
// Add an empty slots to align fields of the subclass on a heapOopSize boundary
369-
// in order to emulate the behavior of the previous algorithm
370-
int align = (b->offset() + b->size()) % heapOopSize;
371-
if (align != 0) {
372-
int sz = heapOopSize - align;
373-
LayoutRawBlock* p = new LayoutRawBlock(LayoutRawBlock::EMPTY, sz);
374-
p->set_offset(b->offset() + b->size());
375-
b->set_next_block(p);
376-
p->set_prev_block(b);
377-
b = p;
378-
}
379-
}
380-
381367
LayoutRawBlock* last = new LayoutRawBlock(LayoutRawBlock::EMPTY, INT_MAX);
382368
last->set_offset(b->offset() + b->size());
383369
assert(last->offset() > 0, "Sanity check");

‎src/hotspot/share/runtime/arguments.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -505,14 +505,14 @@ static SpecialFlag const special_jvm_flags[] = {
505505
{ "DontYieldALot", JDK_Version::jdk(23), JDK_Version::jdk(24), JDK_Version::jdk(25) },
506506
{ "PreserveAllAnnotations", JDK_Version::jdk(23), JDK_Version::jdk(24), JDK_Version::jdk(25) },
507507
{ "UseNotificationThread", JDK_Version::jdk(23), JDK_Version::jdk(24), JDK_Version::jdk(25) },
508-
{ "UseEmptySlotsInSupers", JDK_Version::jdk(23), JDK_Version::jdk(24), JDK_Version::jdk(25) },
509508
// --- Deprecated alias flags (see also aliased_jvm_flags) - sorted by obsolete_in then expired_in:
510509
{ "CreateMinidumpOnCrash", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::undefined() },
511510

512511
// -------------- Obsolete Flags - sorted by expired_in --------------
513512

514513
{ "MetaspaceReclaimPolicy", JDK_Version::undefined(), JDK_Version::jdk(21), JDK_Version::undefined() },
515514

515+
{ "UseEmptySlotsInSupers", JDK_Version::jdk(23), JDK_Version::jdk(24), JDK_Version::jdk(25) },
516516
{ "OldSize", JDK_Version::jdk(23), JDK_Version::jdk(24), JDK_Version::jdk(25) },
517517
#if defined(X86)
518518
{ "UseRTMLocking", JDK_Version::jdk(23), JDK_Version::jdk(24), JDK_Version::jdk(25) },

‎src/hotspot/share/runtime/globals.hpp

-4
Original file line numberDiff line numberDiff line change
@@ -1948,10 +1948,6 @@ const int ObjectAlignmentInBytes = 8;
19481948
product(bool, UseFastUnorderedTimeStamps, false, EXPERIMENTAL, \
19491949
"Use platform unstable time where supported for timestamps only") \
19501950
\
1951-
product(bool, UseEmptySlotsInSupers, true, \
1952-
"(Deprecated) Allow allocating fields in empty slots of " \
1953-
"super-classes") \
1954-
\
19551951
product(bool, DeoptimizeNMethodBarriersALot, false, DIAGNOSTIC, \
19561952
"Make nmethod barriers deoptimise a lot.") \
19571953
\

‎test/hotspot/jtreg/runtime/FieldLayout/OldLayoutCheck.java

-79
This file was deleted.

1 commit comments

Comments
 (1)

openjdk-notifier[bot] commented on Jun 20, 2024

@openjdk-notifier[bot]
Please sign in to comment.