Skip to content

Commit

Permalink
8236224: Obsolete the FieldsAllocationStyle and CompactFields options
Browse files Browse the repository at this point in the history
Remove the options and code for options deprecated in JDK 14

Reviewed-by: dholmes, hseigel, fparain
  • Loading branch information
coleenp committed Jan 7, 2020
1 parent ee5729a commit c4b8e38
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 85 deletions.
4 changes: 1 addition & 3 deletions src/hotspot/share/aot/aotCodeHeap.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -181,8 +181,6 @@ void AOTLib::verify_config() {
verify_flag(_config->_useBiasedLocking, UseBiasedLocking, "UseBiasedLocking");
verify_flag(_config->_objectAlignment, ObjectAlignmentInBytes, "ObjectAlignmentInBytes");
verify_flag(_config->_contendedPaddingWidth, ContendedPaddingWidth, "ContendedPaddingWidth");
verify_flag(_config->_fieldsAllocationStyle, FieldsAllocationStyle, "FieldsAllocationStyle");
verify_flag(_config->_compactFields, CompactFields, "CompactFields");
verify_flag(_config->_enableContended, EnableContended, "EnableContended");
verify_flag(_config->_restrictContended, RestrictContended, "RestrictContended");

Expand Down
10 changes: 4 additions & 6 deletions src/hotspot/share/aot/aotCodeHeap.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -92,21 +92,19 @@ typedef struct {
} AOTHeader;

typedef struct {
enum { CONFIG_SIZE = 8 * jintSize + 10 };
// 8 int values
enum { CONFIG_SIZE = 7 * jintSize + 9 };
// 7 int values
int _config_size;
int _narrowOopShift;
int _narrowKlassShift;
int _contendedPaddingWidth;
int _fieldsAllocationStyle;
int _objectAlignment;
int _codeSegmentSize;
int _gc;
// byte[11] array map to boolean values here
// byte[9] array map to boolean values here
bool _debug_VM;
bool _useCompressedOops;
bool _useCompressedClassPointers;
bool _compactFields;
bool _useTLAB;
bool _useBiasedLocking;
bool _tieredAOT;
Expand Down
52 changes: 10 additions & 42 deletions src/hotspot/share/classfile/classFileParser.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -4129,25 +4129,14 @@ void ClassFileParser::layout_fields(ConstantPool* cp,

int first_nonstatic_oop_offset = 0; // will be set for first oop field

bool compact_fields = CompactFields;
int allocation_style = FieldsAllocationStyle;
if( allocation_style < 0 || allocation_style > 2 ) { // Out of range?
assert(false, "0 <= FieldsAllocationStyle <= 2");
allocation_style = 1; // Optimistic
}
bool compact_fields = true;
bool allocate_oops_first = false;

// The next classes have predefined hard-coded fields offsets
// (see in JavaClasses::compute_hard_coded_offsets()).
// Use default fields allocation order for them.
if( (allocation_style != 0 || compact_fields ) && _loader_data->class_loader() == NULL &&
(_class_name == vmSymbols::java_lang_AssertionStatusDirectives() ||
_class_name == vmSymbols::java_lang_Class() ||
_class_name == vmSymbols::java_lang_ClassLoader() ||
_class_name == vmSymbols::java_lang_ref_Reference() ||
_class_name == vmSymbols::java_lang_ref_SoftReference() ||
_class_name == vmSymbols::java_lang_StackTraceElement() ||
_class_name == vmSymbols::java_lang_String() ||
_class_name == vmSymbols::java_lang_Throwable() ||
if (_loader_data->class_loader() == NULL &&
(_class_name == vmSymbols::java_lang_ref_Reference() ||
_class_name == vmSymbols::java_lang_Boolean() ||
_class_name == vmSymbols::java_lang_Character() ||
_class_name == vmSymbols::java_lang_Float() ||
Expand All @@ -4156,43 +4145,22 @@ void ClassFileParser::layout_fields(ConstantPool* cp,
_class_name == vmSymbols::java_lang_Short() ||
_class_name == vmSymbols::java_lang_Integer() ||
_class_name == vmSymbols::java_lang_Long())) {
allocation_style = 0; // Allocate oops first
allocate_oops_first = true; // Allocate oops first
compact_fields = false; // Don't compact fields
}

int next_nonstatic_oop_offset = 0;
int next_nonstatic_double_offset = 0;

// Rearrange fields for a given allocation style
if( allocation_style == 0 ) {
if (allocate_oops_first) {
// Fields order: oops, longs/doubles, ints, shorts/chars, bytes, padded fields
next_nonstatic_oop_offset = next_nonstatic_field_offset;
next_nonstatic_double_offset = next_nonstatic_oop_offset +
(nonstatic_oop_count * heapOopSize);
} else if( allocation_style == 1 ) {
} else {
// Fields order: longs/doubles, ints, shorts/chars, bytes, oops, padded fields
next_nonstatic_double_offset = next_nonstatic_field_offset;
} else if( allocation_style == 2 ) {
// Fields allocation: oops fields in super and sub classes are together.
if( nonstatic_field_size > 0 && _super_klass != NULL &&
_super_klass->nonstatic_oop_map_size() > 0 ) {
const unsigned int map_count = _super_klass->nonstatic_oop_map_count();
const OopMapBlock* const first_map = _super_klass->start_of_nonstatic_oop_maps();
const OopMapBlock* const last_map = first_map + map_count - 1;
const int next_offset = last_map->offset() + (last_map->count() * heapOopSize);
if (next_offset == next_nonstatic_field_offset) {
allocation_style = 0; // allocate oops first
next_nonstatic_oop_offset = next_nonstatic_field_offset;
next_nonstatic_double_offset = next_nonstatic_oop_offset +
(nonstatic_oop_count * heapOopSize);
}
}
if( allocation_style == 2 ) {
allocation_style = 1; // allocate oops last
next_nonstatic_double_offset = next_nonstatic_field_offset;
}
} else {
ShouldNotReachHere();
}

int nonstatic_oop_space_count = 0;
Expand Down Expand Up @@ -4236,7 +4204,7 @@ void ClassFileParser::layout_fields(ConstantPool* cp,
// Allocate oop field in the gap if there are no other fields for that.
nonstatic_oop_space_offset = offset;
if (length >= heapOopSize && nonstatic_oop_count > 0 &&
allocation_style != 0) { // when oop fields not first
!allocate_oops_first) { // when oop fields not first
nonstatic_oop_count -= 1;
nonstatic_oop_space_count = 1; // Only one will fit
length -= heapOopSize;
Expand All @@ -4255,7 +4223,7 @@ void ClassFileParser::layout_fields(ConstantPool* cp,
nonstatic_byte_count;

// let oops jump before padding with this allocation style
if( allocation_style == 1 ) {
if (!allocate_oops_first) {
next_nonstatic_oop_offset = next_nonstatic_padded_offset;
if( nonstatic_oop_count > 0 ) {
next_nonstatic_oop_offset = align_up(next_nonstatic_oop_offset, heapOopSize);
Expand Down
4 changes: 1 addition & 3 deletions src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -197,12 +197,10 @@ JVMCIObjectArray CompilerToVM::initialize_intrinsics(JVMCI_TRAPS) {
do_bool_flag(CITimeEach) \
do_uintx_flag(CodeCacheSegmentSize) \
do_intx_flag(CodeEntryAlignment) \
do_bool_flag(CompactFields) \
do_intx_flag(ContendedPaddingWidth) \
do_bool_flag(DontCompileHugeMethods) \
do_bool_flag(EagerJVMCI) \
do_bool_flag(EnableContended) \
do_intx_flag(FieldsAllocationStyle) \
do_bool_flag(FoldStableValues) \
do_bool_flag(ForceUnreachable) \
do_intx_flag(HugeMethodLimit) \
Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/share/runtime/arguments.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -522,8 +522,6 @@ static SpecialFlag const special_jvm_flags[] = {
{ "UseMembar", JDK_Version::jdk(10), JDK_Version::jdk(12), JDK_Version::undefined() },
{ "AllowRedefinitionToAddDeleteMethods", JDK_Version::jdk(13), JDK_Version::undefined(), JDK_Version::undefined() },
{ "FlightRecorder", JDK_Version::jdk(13), JDK_Version::undefined(), JDK_Version::undefined() },
{ "FieldsAllocationStyle", JDK_Version::jdk(14), JDK_Version::jdk(15), JDK_Version::jdk(16) },
{ "CompactFields", JDK_Version::jdk(14), JDK_Version::jdk(15), JDK_Version::jdk(16) },
{ "MonitorBound", JDK_Version::jdk(14), JDK_Version::jdk(15), JDK_Version::jdk(16) },
{ "UseParallelOldGC", JDK_Version::jdk(14), JDK_Version::jdk(15), JDK_Version::jdk(16) },

Expand All @@ -543,6 +541,8 @@ static SpecialFlag const special_jvm_flags[] = {
{ "UseGCTaskAffinity", JDK_Version::undefined(), JDK_Version::jdk(14), JDK_Version::jdk(16) },
{ "GCTaskTimeStampEntries", JDK_Version::undefined(), JDK_Version::jdk(14), JDK_Version::jdk(16) },
{ "G1RSetScanBlockSize", JDK_Version::jdk(14), JDK_Version::jdk(15), JDK_Version::jdk(16) },
{ "CompactFields", JDK_Version::jdk(14), JDK_Version::jdk(15), JDK_Version::jdk(16) },
{ "FieldsAllocationStyle", JDK_Version::jdk(14), JDK_Version::jdk(15), JDK_Version::jdk(16) },

#ifdef TEST_VERIFY_SPECIAL_JVM_FLAGS
// These entries will generate build errors. Their purpose is to test the macros.
Expand Down
12 changes: 1 addition & 11 deletions src/hotspot/share/runtime/globals.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -778,16 +778,6 @@ const size_t minimumSymbolTableSize = 1024;
product(bool, UseXMMForArrayCopy, false, \
"Use SSE2 MOVQ instruction for Arraycopy") \
\
product(intx, FieldsAllocationStyle, 1, \
"(Deprecated) 0 - type based with oops first, " \
"1 - with oops last, " \
"2 - oops in super and sub classes are together") \
range(0, 2) \
\
product(bool, CompactFields, true, \
"(Deprecated) Allocate nonstatic fields in gaps " \
"between previous fields") \
\
notproduct(bool, PrintFieldLayout, false, \
"Print field layout for each class") \
\
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -338,7 +338,6 @@ private void recordConfiguration(GraalHotSpotVMConfig graalHotSpotVMConfig, Grap
boolean[] booleanFlags = { graalHotSpotVMConfig.cAssertions, // Debug VM
graalHotSpotVMConfig.useCompressedOops,
graalHotSpotVMConfig.useCompressedClassPointers,
graalHotSpotVMConfig.compactFields,
graalHotSpotVMConfig.useTLAB,
graalHotSpotVMConfig.useBiasedLocking,
TieredAOT.getValue(graalOptions),
Expand All @@ -350,7 +349,6 @@ private void recordConfiguration(GraalHotSpotVMConfig graalHotSpotVMConfig, Grap
int[] intFlags = { graalHotSpotVMConfig.getOopEncoding().getShift(),
graalHotSpotVMConfig.getKlassEncoding().getShift(),
graalHotSpotVMConfig.contendedPaddingWidth,
graalHotSpotVMConfig.fieldsAllocationStyle,
1 << graalHotSpotVMConfig.logMinObjAlignment(),
graalHotSpotVMConfig.codeSegmentSize,
gc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -70,8 +70,6 @@ public CompressEncoding getKlassEncoding() {
public final boolean enableContended = getFlag("EnableContended", Boolean.class);
public final boolean restrictContended = getFlag("RestrictContended", Boolean.class);
public final int contendedPaddingWidth = getFlag("ContendedPaddingWidth", Integer.class);
public final int fieldsAllocationStyle = getFlag("FieldsAllocationStyle", Integer.class);
public final boolean compactFields = getFlag("CompactFields", Boolean.class);
public final boolean verifyOops = getFlag("VerifyOops", Boolean.class);
public final boolean ciTime = getFlag("CITime", Boolean.class);
public final boolean ciTimeEach = getFlag("CITimeEach", Boolean.class);
Expand Down
12 changes: 1 addition & 11 deletions test/hotspot/jtreg/runtime/cds/appcds/FieldLayoutFlags.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -47,16 +47,6 @@ public class FieldLayoutFlags {
static final String[][] flags = {
// Dump time // Run time
{}, {}, // All defaults. Ensure that the test itself is correct.
{"-XX:FieldsAllocationStyle=0"}, {"-XX:FieldsAllocationStyle=1"},
{"-XX:FieldsAllocationStyle=0"}, {"-XX:FieldsAllocationStyle=2"},
{"-XX:FieldsAllocationStyle=1"}, {"-XX:FieldsAllocationStyle=0"},
{"-XX:FieldsAllocationStyle=1"}, {"-XX:FieldsAllocationStyle=2"},
{"-XX:FieldsAllocationStyle=2"}, {"-XX:FieldsAllocationStyle=0"},
{"-XX:FieldsAllocationStyle=2"}, {"-XX:FieldsAllocationStyle=1"},

{"-XX:+CompactFields"}, {"-XX:-CompactFields"},
{"-XX:-CompactFields"}, {"-XX:+CompactFields"},

{"-XX:+EnableContended"}, {"-XX:-EnableContended"},
{"-XX:-EnableContended"}, {"-XX:+EnableContended"},

Expand Down

0 comments on commit c4b8e38

Please sign in to comment.