Skip to content

Commit 5091e98

Browse files
committed
Merge branch 'lworld' into JDK-8377775
2 parents a4cc9fc + 81acb62 commit 5091e98

File tree

65 files changed

+1015
-390
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1015
-390
lines changed

make/autoconf/lib-tests.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2018, 2026, 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
@@ -28,7 +28,7 @@
2828
################################################################################
2929

3030
# Minimum supported versions
31-
JTREG_MINIMUM_VERSION=8.1
31+
JTREG_MINIMUM_VERSION=8.2.1
3232
GTEST_MINIMUM_VERSION=1.14.0
3333

3434
################################################################################

make/conf/github-actions.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2020, 2026, 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
@@ -26,7 +26,7 @@
2626
# Versions and download locations for dependencies used by GitHub Actions (GHA)
2727

2828
GTEST_VERSION=1.14.0
29-
JTREG_VERSION=8.1+1
29+
JTREG_VERSION=8.2.1+1
3030

3131
LINUX_X64_BOOT_JDK_EXT=tar.gz
3232
LINUX_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk25/bd75d5f9689641da8e1daabeccb5528b/36/GPL/openjdk-25_linux-x64_bin.tar.gz

make/conf/jib-profiles.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2026, 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
@@ -1174,9 +1174,9 @@ var getJibProfilesDependencies = function (input, common) {
11741174
jtreg: {
11751175
server: "jpg",
11761176
product: "jtreg",
1177-
version: "8.1",
1177+
version: "8.2.1",
11781178
build_number: "1",
1179-
file: "bundles/jtreg-8.1+1.zip",
1179+
file: "bundles/jtreg-8.2.1+1.zip",
11801180
environment_name: "JT_HOME",
11811181
environment_path: input.get("jtreg", "home_path") + "/bin",
11821182
configure_args: "--with-jtreg=" + input.get("jtreg", "home_path"),

src/hotspot/share/cds/heapShared.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1062,6 +1062,9 @@ void KlassSubGraphInfo::add_subgraph_object_klass(Klass* orig_k) {
10621062
// to the list.
10631063
return;
10641064
}
1065+
if (orig_k->is_flatArray_klass()) {
1066+
_subgraph_object_klasses->append_if_missing(FlatArrayKlass::cast(orig_k)->element_klass());
1067+
}
10651068
} else {
10661069
assert(orig_k->is_typeArray_klass(), "must be");
10671070
// Primitive type arrays are created early during Universe::genesis.
@@ -1498,11 +1501,24 @@ HeapShared::resolve_or_init_classes_for_subgraph_of(Klass* k, bool do_init, TRAP
14981501
log_info(aot, heap)("%s subgraph %s ", do_init ? "init" : "resolve", k->external_name());
14991502
}
15001503

1504+
Array<Klass*>* klasses = record->subgraph_object_klasses();
1505+
1506+
if (do_init && klasses != nullptr) {
1507+
// All the classes of the oops in this subgraph are in the klasses array.
1508+
// Link them first in case any of the oops are used in the <clinit> methods
1509+
// invoked in the rest of this function.
1510+
for (int i = 0; i < klasses->length(); i++) {
1511+
Klass* klass = klasses->at(i);
1512+
if (klass->in_aot_cache() && klass->is_instance_klass()) {
1513+
InstanceKlass::cast(klass)->link_class(CHECK_NULL);
1514+
}
1515+
}
1516+
}
1517+
15011518
resolve_or_init(k, do_init, CHECK_NULL);
15021519

15031520
// Load/link/initialize the klasses of the objects in the subgraph.
15041521
// nullptr class loader is used.
1505-
Array<Klass*>* klasses = record->subgraph_object_klasses();
15061522
if (klasses != nullptr) {
15071523
for (int i = 0; i < klasses->length(); i++) {
15081524
Klass* klass = klasses->at(i);

src/hotspot/share/ci/ciConstant.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,26 @@
3131
//
3232
// This class represents a constant value.
3333

34+
ciConstant ciConstant::make_zero_or_null(BasicType bt) {
35+
switch (bt) {
36+
case T_FLOAT: return ciConstant((jfloat).0f);
37+
case T_DOUBLE: return ciConstant((jdouble).0);
38+
case T_LONG: return ciConstant((jlong)0L);
39+
case T_BOOLEAN:
40+
case T_CHAR:
41+
case T_BYTE:
42+
case T_SHORT:
43+
case T_INT:
44+
return ciConstant(bt, 0);
45+
case T_OBJECT:
46+
case T_ARRAY:
47+
return ciConstant(bt, CURRENT_ENV->get_object(nullptr));
48+
default:
49+
ShouldNotReachHere();
50+
return ciConstant();
51+
}
52+
}
53+
3454
// ------------------------------------------------------------------
3555
// ciConstant::is_null_or_zero
3656
// This assumes `this->is_valid()`, otherwise, `as_object` will assert.

src/hotspot/share/ci/ciConstant.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ class ciConstant {
109109
return _value._object;
110110
}
111111

112+
static ciConstant make_zero_or_null(BasicType);
112113
bool is_null_or_zero() const;
113114

114115
bool is_valid() const {

src/hotspot/share/ci/ciField.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ ciConstant ciField::constant_value() {
369369
if (_constant_value.basic_type() == T_ILLEGAL) {
370370
// Static fields are placed in mirror objects.
371371
ciInstance* mirror = _holder->java_mirror();
372-
_constant_value = mirror->field_value_impl(type()->basic_type(), offset_in_bytes());
372+
_constant_value = mirror->field_value_impl(this);
373373
}
374374
if (FoldStableValues && is_stable() && _constant_value.is_null_or_zero()) {
375375
return ciConstant();

src/hotspot/share/ci/ciField.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ class ciField : public ArenaObj {
9999
// In that case the declared holder of f would be B and
100100
// the canonical holder of f would be A.
101101
ciInstanceKlass* holder() const { return _holder; }
102+
ciInstanceKlass* original_holder() const { return _original_holder; }
102103

103104
// Name of this field?
104105
ciSymbol* name() const { return _name; }
@@ -112,9 +113,6 @@ class ciField : public ArenaObj {
112113
// How is this field actually stored in memory?
113114
BasicType layout_type() { return type2field[(_type == nullptr) ? T_OBJECT : _type->basic_type()]; }
114115

115-
// How big is this field in memory?
116-
int size_in_bytes() { return type2aelembytes(layout_type()); }
117-
118116
// What is the offset of this field? (Fields are aligned to the byte level.)
119117
int offset_in_bytes() const {
120118
assert(_offset >= 1, "illegal call to offset()");
@@ -181,6 +179,7 @@ class ciField : public ArenaObj {
181179
bool is_flat () const { return _is_flat; }
182180
bool is_null_free () const { return _is_null_free; }
183181
int null_marker_offset () const { return _null_marker_offset; }
182+
LayoutKind layout_kind () const { return _layout_kind; }
184183

185184
// Whether this field needs to act atomically. Note that it does not actually need accessing
186185
// atomically. For example, if there cannot be racy accesses to this field, then it can be

src/hotspot/share/ci/ciFlatArray.cpp

Lines changed: 25 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -30,53 +30,12 @@
3030
#include "ci/ciUtilities.inline.hpp"
3131
#include "oops/oop.inline.hpp"
3232

33-
ciConstant ciFlatArray::null_marker_of_element_by_offset_impl(arrayOop ary, int index) {
34-
if (ary == nullptr) {
35-
return ciConstant();
36-
}
37-
assert(ary->is_array(), "");
38-
if (index < 0 || index >= ary->length()) {
39-
return ciConstant();
40-
}
41-
assert(ary->is_objArray(), "");
42-
flatArrayOop objary = (flatArrayOop) ary;
43-
jboolean elem = objary->null_marker_of_obj_at(index);
44-
return ciConstant(T_BOOLEAN, elem);
45-
}
46-
47-
ciConstant ciFlatArray::check_constant_null_marker_cache(int off) {
48-
if (_constant_null_markers != nullptr) {
49-
for (int i = 0; i < _constant_null_markers->length(); ++i) {
50-
ConstantValue cached_val = _constant_null_markers->at(i);
51-
if (cached_val.off() == off) {
52-
return cached_val.value();
53-
}
54-
}
55-
}
56-
return ciConstant();
57-
}
58-
59-
void ciFlatArray::add_to_constant_null_marker_cache(int off, ciConstant val) {
60-
assert(val.is_valid(), "value must be valid");
61-
assert(!check_constant_value_cache(off, val.basic_type()).is_valid(), "duplicate");
62-
if (_constant_null_markers == nullptr) {
63-
Arena* arena = CURRENT_ENV->arena();
64-
_constant_null_markers = new (arena) GrowableArray<ConstantValue>(arena, 1, 0, ConstantValue());
65-
}
66-
_constant_null_markers->append(ConstantValue(off, val));
67-
}
68-
6933
// Current value of an element.
7034
// Returns T_ILLEGAL if there is no element at the given index.
7135
ciConstant ciFlatArray::null_marker_of_element_by_index(int index) {
72-
ciConstant value = check_constant_null_marker_cache(index);
73-
if (value.is_valid()) {
74-
return value;
75-
}
76-
GUARDED_VM_ENTRY(
77-
value = null_marker_of_element_by_offset_impl(get_arrayOop(), index);)
78-
add_to_constant_null_marker_cache(index, value);
79-
return value;
36+
ciConstant nm = field_value(index, nullptr);
37+
postcond(!nm.is_valid() || nm.basic_type() == T_BOOLEAN);
38+
return nm;
8039
}
8140

8241
ciConstant ciFlatArray::null_marker_of_element_by_offset(intptr_t element_offset) {
@@ -133,23 +92,36 @@ ciConstant ciFlatArray::field_value_by_offset(intptr_t field_offset) {
13392
}
13493

13594
ciConstant ciFlatArray::field_value(int index, ciField* field) {
95+
auto get_field_from_object_constant = [field](const ciConstant& v) -> ciConstant {
96+
ciObject* obj = v.as_object();
97+
if (obj->is_null_object()) {
98+
if (field == nullptr) {
99+
return ciConstant::make_zero_or_null(T_BOOLEAN);
100+
}
101+
return ciConstant::make_zero_or_null(field->type()->basic_type());
102+
}
103+
// obj cannot be an ciArray since it is an element of a flat array, so it must be a value class, which arrays are not.
104+
ciInstance* inst = obj->as_instance();
105+
if (field == nullptr) {
106+
return ciConstant(T_BOOLEAN, 1);
107+
}
108+
return inst->field_value(field);
109+
};
110+
136111
BasicType elembt = element_basic_type();
137112
ciConstant value = check_constant_value_cache(index, elembt);
138113
if (value.is_valid()) {
139-
if (field == nullptr) {
140-
return value.as_object()->as_instance()->null_marker_value();
141-
}
142-
return value.as_object()->as_instance()->field_value(field);
114+
return get_field_from_object_constant(value);
143115
}
144116
GUARDED_VM_ENTRY(
145117
value = element_value_impl(T_OBJECT, get_arrayOop(), index);
146118
)
147119

148-
add_to_constant_value_cache(index, value);
149-
150-
if (field == nullptr) {
151-
return value.as_object()->as_instance()->null_marker_value();
120+
if (!value.is_valid()) {
121+
return ciConstant();
152122
}
153-
return value.as_object()->as_instance()->field_value(field);
123+
124+
add_to_constant_value_cache(index, value);
125+
return get_field_from_object_constant(value);
154126
}
155127

src/hotspot/share/ci/ciFlatArray.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,6 @@ class ciFlatArray : public ciArray {
5151
ciConstant field_value(int index, ciField* field);
5252
ciConstant null_marker_of_element_by_offset(intptr_t element_offset);
5353
ciConstant null_marker_of_element_by_index(int index);
54-
55-
private:
56-
ciConstant null_marker_of_element_by_offset_impl(arrayOop ary, int index);
57-
ciConstant check_constant_null_marker_cache(int off);
58-
void add_to_constant_null_marker_cache(int off, ciConstant val);
59-
60-
GrowableArray<ConstantValue>* _constant_null_markers = nullptr;
6154
};
6255

6356
#endif // SHARE_VM_CI_CIFLATARRAY_HPP

0 commit comments

Comments
 (0)