Skip to content

Commit

Permalink
Merge branch 'upstream-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Datadog Syncup Service committed Nov 11, 2024
2 parents e2bb112 + babb52a commit d1f67b3
Show file tree
Hide file tree
Showing 89 changed files with 5,233 additions and 1,040 deletions.
4 changes: 4 additions & 0 deletions make/Images.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ JLINK_DISABLE_WARNINGS := | ( $(GREP) -v -e "WARNING: Using incubator module" ||
JDK_IMAGE_SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jdk
JRE_IMAGE_SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jre

ifeq ($(JLINK_PRODUCE_LINKABLE_RUNTIME), true)
JLINK_JDK_EXTRA_OPTS += --generate-linkable-runtime
endif

$(eval $(call SetupExecute, jlink_jdk, \
WARN := Creating jdk image, \
DEPS := $(JDK_JMODS) $(BASE_RELEASE_FILE) \
Expand Down
40 changes: 33 additions & 7 deletions make/autoconf/jdk-options.m4
Original file line number Diff line number Diff line change
Expand Up @@ -586,13 +586,42 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JMOD_OPTIONS],
################################################################################
#
# jlink options.
# We always keep packaged modules in JDK image.
#
AC_DEFUN_ONCE([JDKOPT_SETUP_JLINK_OPTIONS],
[
UTIL_ARG_ENABLE(NAME: keep-packaged-modules, DEFAULT: true,
################################################################################
#
# Configure option for building a JDK that is suitable for linking from the
# run-time image without JMODs.
#
# Determines whether or not a suitable run-time image is being produced from
# packaged modules. If set to 'true, changes the *default* of packaged
# modules to 'false'.
#
UTIL_ARG_ENABLE(NAME: linkable-runtime, DEFAULT: false,
RESULT: JLINK_PRODUCE_LINKABLE_RUNTIME,
DESC: [enable a JDK build suitable for linking from the run-time image],
CHECKING_MSG: [whether or not a JDK suitable for linking from the run-time image should be produced])
AC_SUBST(JLINK_PRODUCE_LINKABLE_RUNTIME)
if test "x$JLINK_PRODUCE_LINKABLE_RUNTIME" = xtrue; then
DEFAULT_PACKAGED_MODULES=false
else
DEFAULT_PACKAGED_MODULES=true
fi
################################################################################
#
# Configure option for packaged modules
#
# We keep packaged modules in the JDK image unless --enable-linkable-runtime is
# requested.
#
UTIL_ARG_ENABLE(NAME: keep-packaged-modules, DEFAULT: $DEFAULT_PACKAGED_MODULES,
RESULT: JLINK_KEEP_PACKAGED_MODULES,
DESC: [enable keeping of packaged modules in jdk image],
DEFAULT_DESC: [enabled by default unless --enable-linkable-runtime is set],
CHECKING_MSG: [if packaged modules are kept])
AC_SUBST(JLINK_KEEP_PACKAGED_MODULES)
])
Expand Down Expand Up @@ -638,14 +667,11 @@ AC_DEFUN([JDKOPT_EXCLUDE_TRANSLATIONS],

################################################################################
#
# Optionally disable man pages
# Optionally disable man pages (deprecated)
#
AC_DEFUN([JDKOPT_ENABLE_DISABLE_MANPAGES],
[
UTIL_ARG_ENABLE(NAME: manpages, DEFAULT: true, RESULT: BUILD_MANPAGES,
DESC: [enable copying of static man pages],
CHECKING_MSG: [if static man pages should be copied])
AC_SUBST(BUILD_MANPAGES)
UTIL_DEPRECATED_ARG_ENABLE(manpages)
])

################################################################################
Expand Down
3 changes: 1 addition & 2 deletions make/autoconf/spec.gmk.template
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,6 @@ ENABLE_GENERATE_CLASSLIST := @ENABLE_GENERATE_CLASSLIST@

EXCLUDE_TRANSLATIONS := @EXCLUDE_TRANSLATIONS@

BUILD_MANPAGES := @BUILD_MANPAGES@

BUILD_CDS_ARCHIVE := @BUILD_CDS_ARCHIVE@
BUILD_CDS_ARCHIVE_COH := @BUILD_CDS_ARCHIVE_COH@

Expand Down Expand Up @@ -708,6 +706,7 @@ NEW_JAVADOC = $(INTERIM_LANGTOOLS_ARGS) $(JAVADOC_MAIN_CLASS)

JMOD_COMPRESS := @JMOD_COMPRESS@
JLINK_KEEP_PACKAGED_MODULES := @JLINK_KEEP_PACKAGED_MODULES@
JLINK_PRODUCE_LINKABLE_RUNTIME := @JLINK_PRODUCE_LINKABLE_RUNTIME@

RCFLAGS := @RCFLAGS@

Expand Down
13 changes: 5 additions & 8 deletions make/common/modules/LauncherCommon.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,11 @@ ifeq ($(call isTargetOsType, unix)+$(MAKEFILE_PREFIX), true+Launcher)
endif
else
# No markdown man pages present
ifeq ($(BUILD_MANPAGES), true)
# BUILD_MANPAGES is a mis-nomer. It really means "copy the pre-generated man pages".
$(eval $(call SetupCopyFiles, COPY_MAN_PAGES, \
DEST := $(SUPPORT_OUTPUTDIR)/modules_man/$(MODULE)/man1, \
FILES := $(MAN_FILES_TROFF), \
))
$(eval $(call SetupCopyFiles, COPY_MAN_PAGES, \
DEST := $(SUPPORT_OUTPUTDIR)/modules_man/$(MODULE)/man1, \
FILES := $(MAN_FILES_TROFF), \
))

TARGETS += $(COPY_MAN_PAGES)
endif
TARGETS += $(COPY_MAN_PAGES)
endif
endif
1 change: 0 additions & 1 deletion make/conf/jib-profiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ var getJibProfilesCommon = function (input, data) {
default_make_targets: ["product-bundles", "test-bundles", "static-libs-bundles"],
configure_args: concat(
"--with-exclude-translations=es,fr,it,ko,pt_BR,sv,ca,tr,cs,sk,ja_JP_A,ja_JP_HA,ja_JP_HI,ja_JP_I,zh_TW,zh_HK",
"--disable-manpages",
"--disable-jvm-feature-shenandoahgc",
versionArgs(input, common))
};
Expand Down
13 changes: 6 additions & 7 deletions src/hotspot/cpu/s390/assembler_s390.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,23 @@ class Immediate {
}

// Test if x is within signed immediate range for nbits.
static bool is_uimm(int64_t x, unsigned int nbits) {
static bool is_uimm(uint64_t x, unsigned int nbits) {
// nbits == 0 --> false
// nbits >= 64 --> true
assert(1 <= nbits && nbits < 64, "don't call, use statically known result");
const uint64_t xu = (unsigned long)x;
const uint64_t maxplus1 = 1UL << nbits;
return xu < maxplus1; // Unsigned comparison. Negative inputs appear to be very large.
return x < maxplus1; // Unsigned comparison. Negative inputs appear to be very large.
}
static bool is_uimm32(int64_t x) {
static bool is_uimm32(uint64_t x) {
return is_uimm(x, 32);
}
static bool is_uimm16(int64_t x) {
static bool is_uimm16(uint64_t x) {
return is_uimm(x, 16);
}
static bool is_uimm12(int64_t x) {
static bool is_uimm12(uint64_t x) {
return is_uimm(x, 12);
}
static bool is_uimm8(int64_t x) {
static bool is_uimm8(uint64_t x) {
return is_uimm(x, 8);
}
};
Expand Down
10 changes: 0 additions & 10 deletions src/hotspot/share/c1/c1_Instruction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,8 @@ class Instruction: public CompilationResourceObj {
NeedsNullCheckFlag = 0,
CanTrapFlag,
DirectCompareFlag,
IsEliminatedFlag,
IsSafepointFlag,
IsStaticFlag,
NeedsStoreCheckFlag,
NeedsWriteBarrierFlag,
PreservesStateFlag,
TargetIsFinalFlag,
TargetIsLoadedFlag,
Expand All @@ -361,7 +358,6 @@ class Instruction: public CompilationResourceObj {
ProfileMDOFlag,
IsLinkedInBlockFlag,
NeedsRangeCheckFlag,
InWorkListFlag,
DeoptimizeOnException,
KillsMemoryFlag,
OmitChecksFlag,
Expand Down Expand Up @@ -840,14 +836,12 @@ LEAF(StoreField, AccessField)
: AccessField(obj, offset, field, is_static, state_before, needs_patching)
, _value(value)
{
set_flag(NeedsWriteBarrierFlag, as_ValueType(field_type())->is_object());
ASSERT_VALUES
pin();
}

// accessors
Value value() const { return _value; }
bool needs_write_barrier() const { return check_flag(NeedsWriteBarrierFlag); }

// generic
virtual void input_values_do(ValueVisitor* f) { AccessField::input_values_do(f); f->visit(&_value); }
Expand Down Expand Up @@ -974,16 +968,12 @@ LEAF(StoreIndexed, AccessIndexed)
: AccessIndexed(array, index, length, elt_type, state_before, mismatched)
, _value(value), _profiled_method(nullptr), _profiled_bci(0), _check_boolean(check_boolean)
{
set_flag(NeedsWriteBarrierFlag, (as_ValueType(elt_type)->is_object()));
set_flag(NeedsStoreCheckFlag, (as_ValueType(elt_type)->is_object()));
ASSERT_VALUES
pin();
}

// accessors
Value value() const { return _value; }
bool needs_write_barrier() const { return check_flag(NeedsWriteBarrierFlag); }
bool needs_store_check() const { return check_flag(NeedsStoreCheckFlag); }
bool check_boolean() const { return _check_boolean; }
// Helpers for MethodData* profiling
void set_should_profile(bool value) { set_flag(ProfileMDOFlag, value); }
Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/share/gc/shared/c2/barrierSetC2.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2024, 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,9 +92,9 @@ class C2AccessValuePtr: public C2AccessValue {

public:
C2AccessValuePtr(Node* node, const TypePtr* type) :
C2AccessValue(node, reinterpret_cast<const Type*>(type)) {}
C2AccessValue(node, type) {}

const TypePtr* type() const { return reinterpret_cast<const TypePtr*>(_type); }
const TypePtr* type() const { return _type->is_ptr(); }
};

// This class wraps a bunch of context parameters that are passed around in the
Expand Down
4 changes: 0 additions & 4 deletions src/hotspot/share/gc/shared/preservedMarks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,6 @@ void PreservedMarksSet::restore(WorkerThreads* workers) {
assert_empty();
}

WorkerTask* PreservedMarksSet::create_task() {
return new RestorePreservedMarksTask(this);
}

void PreservedMarksSet::reclaim() {
assert_empty();

Expand Down
2 changes: 0 additions & 2 deletions src/hotspot/share/gc/shared/preservedMarks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ class PreservedMarksSet : public CHeapObj<mtGC> {
// is null, perform the work serially in the current thread.
void restore(WorkerThreads* workers);

WorkerTask* create_task();

// Reclaim stack array.
void reclaim();

Expand Down
2 changes: 0 additions & 2 deletions src/hotspot/share/oops/compressedKlass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,6 @@ void CompressedKlassPointers::calc_lowest_highest_narrow_klass_id() {
// set this encoding scheme. Used by CDS at runtime to re-instate the scheme used to pre-compute klass ids for
// archived heap objects.
void CompressedKlassPointers::initialize_for_given_encoding(address addr, size_t len, address requested_base, int requested_shift) {
address const end = addr + len;

if (len > max_klass_range_size()) {
stringStream ss;
ss.print("Class space size and CDS archive size combined (%zu) "
Expand Down
50 changes: 11 additions & 39 deletions src/hotspot/share/opto/loopTransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1779,47 +1779,19 @@ bool IdealLoopTree::is_invariant(Node* n) const {

// Search the Assertion Predicates added by loop predication and/or range check elimination and update them according
// to the new stride.
void PhaseIdealLoop::update_main_loop_assertion_predicates(Node* ctrl, CountedLoopNode* loop_head, Node* init,
const int stride_con) {
Node* entry = ctrl;
Node* prev_proj = ctrl;
LoopNode* outer_loop_head = loop_head->skip_strip_mined();
IdealLoopTree* outer_loop = get_loop(outer_loop_head);
void PhaseIdealLoop::update_main_loop_assertion_predicates(CountedLoopNode* main_loop_head) {
Node* init = main_loop_head->init_trip();

// Compute the value of the loop induction variable at the end of the
// first iteration of the unrolled loop: init + new_stride_con - init_inc
int new_stride_con = stride_con * 2;
Node* max_value = _igvn.intcon(new_stride_con);
set_ctrl(max_value, C->root());

while (entry != nullptr && entry->is_Proj() && entry->in(0)->is_If()) {
IfNode* iff = entry->in(0)->as_If();
ProjNode* proj = iff->proj_out(1 - entry->as_Proj()->_con);
if (!proj->unique_ctrl_out()->is_Halt()) {
break;
}
Node* bol = iff->in(1);
if (bol->is_OpaqueTemplateAssertionPredicate()) {
assert(assertion_predicate_has_loop_opaque_node(iff), "must find OpaqueLoop* nodes");
// This is a Template Assertion Predicate for the initial or last access.
// Create an Initialized Assertion Predicates for it accordingly:
// - For the initial access a[init] (same as before)
// - For the last access a[init+new_stride-orig_stride] (with the new unroll stride)
prev_proj = create_initialized_assertion_predicate(iff, init, max_value, prev_proj);
} else if (bol->is_OpaqueInitializedAssertionPredicate()) {
// This is one of the two Initialized Assertion Predicates:
// - For the initial access a[init]
// - For the last access a[init+old_stride-orig_stride]
// We could keep the one for the initial access but we do not know which one we currently have here. Just kill both.
_igvn.replace_input_of(iff, 1, _igvn.intcon(1));
}
assert(!bol->is_OpaqueNotNull() || !loop_head->is_main_loop(), "OpaqueNotNull should not be at main loop");
entry = entry->in(0)->in(0);
}
if (prev_proj != ctrl) {
_igvn.replace_input_of(outer_loop_head, LoopNode::EntryControl, prev_proj);
set_idom(outer_loop_head, prev_proj, dom_depth(outer_loop_head));
}
int unrolled_stride_con = main_loop_head->stride_con() * 2;
Node* unrolled_stride = _igvn.intcon(unrolled_stride_con);
set_ctrl(unrolled_stride, C->root());

Node* loop_entry = main_loop_head->skip_strip_mined()->in(LoopNode::EntryControl);
PredicateIterator predicate_iterator(loop_entry);
UpdateStrideForAssertionPredicates update_stride_for_assertion_predicates(unrolled_stride, this);
predicate_iterator.for_each(update_stride_for_assertion_predicates);
}

// Source Loop: Cloned - peeled_loop_head
Expand Down Expand Up @@ -1936,7 +1908,7 @@ void PhaseIdealLoop::do_unroll(IdealLoopTree *loop, Node_List &old_new, bool adj
assert(old_trip_count > 1 && (!adjust_min_trip || stride_p <=
MIN2<int>(max_jint / 2 - 2, MAX2(1<<3, Matcher::max_vector_size(T_BYTE)) * loop_head->unrolled_count())), "sanity");

update_main_loop_assertion_predicates(ctrl, loop_head, init, stride_con);
update_main_loop_assertion_predicates(loop_head);

// Adjust loop limit to keep valid iterations number after unroll.
// Use (limit - stride) instead of (((limit - init)/stride) & (-2))*stride
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/opto/loopnode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ class PhaseIdealLoop : public PhaseTransform {
private:
DEBUG_ONLY(static void count_opaque_loop_nodes(Node* n, uint& init, uint& stride);)
static void get_assertion_predicates(ParsePredicateSuccessProj* parse_predicate_proj, Unique_Node_List& list, bool get_opaque = false);
void update_main_loop_assertion_predicates(Node* ctrl, CountedLoopNode* loop_head, Node* init, int stride_con);
void update_main_loop_assertion_predicates(CountedLoopNode* main_loop_head);
void initialize_assertion_predicates_for_peeled_loop(CountedLoopNode* peeled_loop_head,
CountedLoopNode* remaining_loop_head,
uint first_node_index_in_cloned_loop_body,
Expand Down
14 changes: 11 additions & 3 deletions src/hotspot/share/opto/phaseX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "gc/shared/c2/barrierSetC2.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
#include "opto/addnode.hpp"
#include "opto/block.hpp"
#include "opto/callnode.hpp"
#include "opto/castnode.hpp"
Expand Down Expand Up @@ -1634,12 +1635,19 @@ void PhaseIterGVN::add_users_of_use_to_worklist(Node* n, Node* use, Unique_Node_
}
}
}
// If changed AddP inputs, check Stores for loop invariant
if( use_op == Op_AddP ) {
// If changed AddP inputs:
// - check Stores for loop invariant, and
// - if the changed input is the offset, check constant-offset AddP users for
// address expression flattening.
if (use_op == Op_AddP) {
bool offset_changed = n == use->in(AddPNode::Offset);
for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) {
Node* u = use->fast_out(i2);
if (u->is_Mem())
if (u->is_Mem()) {
worklist.push(u);
} else if (offset_changed && u->is_AddP() && u->in(AddPNode::Offset)->is_Con()) {
worklist.push(u);
}
}
}
// If changed initialization activity, check dependent Stores
Expand Down
Loading

0 comments on commit d1f67b3

Please sign in to comment.