Skip to content

Commit 77214d7

Browse files
author
Vicente Romero
committed
Merge lworld
2 parents 187ac64 + 2ad3ce1 commit 77214d7

File tree

255 files changed

+953
-26972
lines changed

Some content is hidden

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

255 files changed

+953
-26972
lines changed

make/CompileJavaModules.gmk

Lines changed: 24 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2014, 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
@@ -140,25 +140,20 @@ VALUECLASSES_STR := valueclasses
140140
ifneq ($(COMPILER), bootjdk)
141141
MODULE_VALUECLASS_SRC_DIRS := $(call FindModuleValueClassSrcDirs, $(MODULE))
142142
MODULE_VALUECLASS_SOURCEPATH := $(call GetModuleValueClassSrcPath)
143-
144-
# Temporarily compile valueclasses into a separate directory with the form:
145-
# <tempdir>/<module>/<classpath>
146-
# and then copy the class files into:
147-
# <outdir>/<module>/META-INF/preview/<classpath>
148-
# We cannot compile directly into the desired directory because it's the
149-
# compiler which creates the original '<module>/<classpath>/...' hierarchy.
150-
VALUECLASS_OUTPUTDIR := $(SUPPORT_OUTPUTDIR)/$(VALUECLASSES_STR)
151-
PREVIEW_OUTPUTDIR := $(COMPILATION_OUTPUTDIR)/$(MODULE)/META-INF/preview
152-
153143
ifneq ($(MODULE_VALUECLASS_SRC_DIRS),)
144+
# Temporarily compile valueclasses into a separate directory, and then copy
145+
# into the correct "META-INF/preview" path location.
146+
# We cannot compile directly into the desired directory because it's the
147+
# compiler which creates the original '<module>/<classpath>/...' hierarchy.
148+
TEMP_OUTPUTDIR := $(SUPPORT_OUTPUTDIR)/$(VALUECLASSES_STR)
149+
154150
$(eval $(call SetupJavaCompilation, $(MODULE)-$(VALUECLASSES_STR), \
155151
SMALL_JAVA := false, \
156152
MODULE := $(MODULE), \
157153
SRC := $(wildcard $(MODULE_VALUECLASS_SRC_DIRS)), \
158154
INCLUDES := $(JDK_USER_DEFINED_FILTER), \
159155
FAIL_NO_SRC := $(FAIL_NO_SRC), \
160-
BIN := $(VALUECLASS_OUTPUTDIR)/, \
161-
JAR := $(JDK_OUTPUTDIR)/lib/$(VALUECLASSES_STR)/$(MODULE)-$(VALUECLASSES_STR).jar, \
156+
BIN := $(TEMP_OUTPUTDIR)/, \
162157
HEADERS := $(SUPPORT_OUTPUTDIR)/headers, \
163158
DISABLED_WARNINGS := $(DISABLED_WARNINGS_java) preview, \
164159
EXCLUDES := $(EXCLUDES), \
@@ -173,27 +168,24 @@ ifneq ($(COMPILER), bootjdk)
173168
--enable-preview -source $(JDK_SOURCE_TARGET_VERSION), \
174169
))
175170

176-
TARGETS += $($(MODULE)-$(VALUECLASSES_STR))
177-
178-
# Restructure the value class hierarchy from "<module>/<classpath>/..."
179-
# to "<module>/META-INF/preview/<classpath>/..."
180-
# When module patching is removed, this could probably be a move rather than a copy.
181-
182-
# FIXME: The marker file should probably go in modules root dir.
183-
# FIXME: Copying value classes should not also copy marker files.
184-
$(PREVIEW_OUTPUTDIR)/_the.copy_valueclasses.marker: $($(MODULE)-$(VALUECLASSES_STR))
185-
$(call MakeTargetDir)
186-
$(CP) -R $(VALUECLASS_OUTPUTDIR)/$(MODULE)/. $(@D)/
171+
# Don't add '$($(MODULE)-$(VALUECLASSES_STR))' to TARGETS (it's transient).
172+
# The 'valueclasses' target below depends on it, and that's the non-transient
173+
# result we care about.
174+
175+
# Copy compiled output from "$TEMP_OUTPUTDIR/$MODULE/<classpath>/..."
176+
# to "$COMPILATION_OUTPUTDIR/$MODULE/META-INF/preview/<classpath>/...".
177+
MOD_SRC := $(TEMP_OUTPUTDIR)/$(MODULE)
178+
MOD_DST := $(COMPILATION_OUTPUTDIR)/$(MODULE)
179+
180+
# NOTE: We cannot use '$(CP) -R $(MOD_SRC)/*/ ...' to select sub-directories (it
181+
# does not work on MacOS/BSD). Use 'filter-out' to explicitly exclude marker files.
182+
$(MOD_DST)/_the.$(MODULE).valueclasses: $($(MODULE)-$(VALUECLASSES_STR))
183+
$(RM) -r $(@D)/META-INF/preview
184+
$(MKDIR) -p $(@D)/META-INF/preview
185+
$(CP) -R $(filter-out $(MOD_SRC)/_%, $(wildcard $(MOD_SRC)/*)) $(@D)/META-INF/preview
187186
$(TOUCH) $@
188187

189-
TARGETS += $(PREVIEW_OUTPUTDIR)/_the.copy_valueclasses.marker
190-
191-
$(eval $(call SetupCopyFiles, $(MODULE)-copy-valueclass-jar, \
192-
FILES := $(JDK_OUTPUTDIR)/lib/$(VALUECLASSES_STR)/$(MODULE)-$(VALUECLASSES_STR).jar, \
193-
DEST := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE)/$(VALUECLASSES_STR), \
194-
))
195-
196-
TARGETS += $($(MODULE)-copy-valueclass-jar)
188+
TARGETS += $(MOD_DST)/_the.$(MODULE).valueclasses
197189
endif
198190
endif
199191

src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7261,17 +7261,17 @@ bool MacroAssembler::unpack_inline_helper(const GrowableArray<SigEntry>* sig, in
72617261
b(L_notNull);
72627262
bind(L_null);
72637263
// Set null marker to zero to signal that the argument is null.
7264-
// Also set all oop fields to zero to make the GC happy.
7264+
// Also set all fields to zero since the runtime requires a canonical
7265+
// representation of a flat null.
72657266
stream.reset(sig_index, to_index);
72667267
while (stream.next(toReg, bt)) {
7267-
if (sig->at(stream.sig_index())._offset == -1 ||
7268-
bt == T_OBJECT || bt == T_ARRAY) {
7269-
if (toReg->is_stack()) {
7270-
int st_off = toReg->reg2stack() * VMRegImpl::stack_slot_size;
7271-
str(zr, Address(sp, st_off));
7272-
} else {
7273-
mov(toReg->as_Register(), zr);
7274-
}
7268+
if (toReg->is_stack()) {
7269+
int st_off = toReg->reg2stack() * VMRegImpl::stack_slot_size;
7270+
str(zr, Address(sp, st_off));
7271+
} else if (toReg->is_FloatRegister()) {
7272+
mov(toReg->as_FloatRegister(), T2S, 0);
7273+
} else {
7274+
mov(toReg->as_Register(), zr);
72757275
}
72767276
}
72777277
bind(L_notNull);

src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3055,7 +3055,7 @@ BufferedInlineTypeBlob* SharedRuntime::generate_buffered_inline_type_adapter(con
30553055
j++;
30563056
}
30573057
assert(j == regs->length(), "missed a field?");
3058-
if (vk->has_nullable_atomic_layout()) {
3058+
if (vk->supports_nullable_layouts()) {
30593059
// Zero the null marker (setting it to 1 would be better but would require an additional register)
30603060
__ strb(zr, Address(r0, vk->null_marker_offset()));
30613061
}
@@ -3067,7 +3067,8 @@ BufferedInlineTypeBlob* SharedRuntime::generate_buffered_inline_type_adapter(con
30673067
Label not_null;
30683068
__ cbnz(r0, not_null);
30693069

3070-
// Return value is null. Zero oop registers to make the GC happy.
3070+
// Return value is null. Zero all registers because the runtime requires a canonical
3071+
// representation of a flat null.
30713072
j = 1;
30723073
for (int i = 0; i < sig_vk->length(); i++) {
30733074
BasicType bt = sig_vk->at(i)._bt;
@@ -3081,9 +3082,12 @@ BufferedInlineTypeBlob* SharedRuntime::generate_buffered_inline_type_adapter(con
30813082
}
30823083
continue;
30833084
}
3084-
if (bt == T_OBJECT || bt == T_ARRAY) {
3085-
VMRegPair pair = regs->at(j);
3086-
VMReg r_1 = pair.first();
3085+
3086+
VMRegPair pair = regs->at(j);
3087+
VMReg r_1 = pair.first();
3088+
if (r_1->is_FloatRegister()) {
3089+
__ mov(r_1->as_FloatRegister(), Assembler::T2S, 0);
3090+
} else {
30873091
__ mov(r_1->as_Register(), zr);
30883092
}
30893093
j++;

src/hotspot/cpu/x86/macroAssembler_x86.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6380,17 +6380,17 @@ bool MacroAssembler::unpack_inline_helper(const GrowableArray<SigEntry>* sig, in
63806380
jmp(L_notNull);
63816381
bind(L_null);
63826382
// Set null marker to zero to signal that the argument is null.
6383-
// Also set all oop fields to zero to make the GC happy.
6383+
// Also set all fields to zero since the runtime requires a canonical
6384+
// representation of a flat null.
63846385
stream.reset(sig_index, to_index);
63856386
while (stream.next(toReg, bt)) {
6386-
if (sig->at(stream.sig_index())._offset == -1 ||
6387-
bt == T_OBJECT || bt == T_ARRAY) {
6388-
if (toReg->is_stack()) {
6389-
int st_off = toReg->reg2stack() * VMRegImpl::stack_slot_size + wordSize;
6390-
movq(Address(rsp, st_off), 0);
6391-
} else {
6392-
xorq(toReg->as_Register(), toReg->as_Register());
6393-
}
6387+
if (toReg->is_stack()) {
6388+
int st_off = toReg->reg2stack() * VMRegImpl::stack_slot_size + wordSize;
6389+
movq(Address(rsp, st_off), 0);
6390+
} else if (toReg->is_XMMRegister()) {
6391+
xorps(toReg->as_XMMRegister(), toReg->as_XMMRegister());
6392+
} else {
6393+
xorl(toReg->as_Register(), toReg->as_Register());
63946394
}
63956395
}
63966396
bind(L_notNull);

src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3848,7 +3848,7 @@ BufferedInlineTypeBlob* SharedRuntime::generate_buffered_inline_type_adapter(con
38483848
j++;
38493849
}
38503850
assert(j == regs->length(), "missed a field?");
3851-
if (vk->has_nullable_atomic_layout()) {
3851+
if (vk->supports_nullable_layouts()) {
38523852
// Set the null marker
38533853
__ movb(Address(rax, vk->null_marker_offset()), 1);
38543854
}
@@ -3861,7 +3861,8 @@ BufferedInlineTypeBlob* SharedRuntime::generate_buffered_inline_type_adapter(con
38613861
__ testptr(rax, rax);
38623862
__ jcc(Assembler::notZero, not_null);
38633863

3864-
// Return value is null. Zero oop registers to make the GC happy.
3864+
// Return value is null. Zero all registers because the runtime requires a canonical
3865+
// representation of a flat null.
38653866
j = 1;
38663867
for (int i = 0; i < sig_vk->length(); i++) {
38673868
BasicType bt = sig_vk->at(i)._bt;
@@ -3875,10 +3876,13 @@ BufferedInlineTypeBlob* SharedRuntime::generate_buffered_inline_type_adapter(con
38753876
}
38763877
continue;
38773878
}
3878-
if (bt == T_OBJECT || bt == T_ARRAY) {
3879-
VMRegPair pair = regs->at(j);
3880-
VMReg r_1 = pair.first();
3881-
__ xorq(r_1->as_Register(), r_1->as_Register());
3879+
3880+
VMRegPair pair = regs->at(j);
3881+
VMReg r_1 = pair.first();
3882+
if (r_1->is_XMMRegister()) {
3883+
__ xorps(r_1->as_XMMRegister(), r_1->as_XMMRegister());
3884+
} else {
3885+
__ xorl(r_1->as_Register(), r_1->as_Register());
38823886
}
38833887
j++;
38843888
}

src/hotspot/share/c1/c1_Canonicalizer.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 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
@@ -468,11 +468,8 @@ void Canonicalizer::do_CompareOp (CompareOp* x) {
468468

469469

470470
void Canonicalizer::do_IfOp(IfOp* x) {
471-
// Currently, Canonicalizer is only used by GraphBuilder,
472-
// and IfOp is not created by GraphBuilder but only later
473-
// when eliminating conditional expressions with CE_Eliminator,
474-
// so this method will not be called.
475-
ShouldNotReachHere();
471+
// Currently, Canonicalizer is only used by GraphBuilder, and IfOp is only created by
472+
// GraphBuilder when loading/storing flat fields, do nothing for now.
476473
}
477474

478475

0 commit comments

Comments
 (0)