Skip to content

Commit d3aaa90

Browse files
author
Datadog Syncup Service
committed
Merge branch 'upstream-master'
2 parents f5feca5 + 266e3d0 commit d3aaa90

File tree

61 files changed

+1233
-459
lines changed

Some content is hidden

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

61 files changed

+1233
-459
lines changed

make/Main.gmk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1310,7 +1310,10 @@ endif
13101310
################################################################################
13111311

13121312
# all-images builds all our deliverables as images.
1313-
all-images: product-images static-jdk-image test-image all-docs-images
1313+
all-images: product-images test-image all-docs-images
1314+
ifeq ($(call isTargetOs, linux macosx windows), true)
1315+
all-images: static-jdk-image
1316+
endif
13141317

13151318
# all-bundles packages all our deliverables as tar.gz bundles.
13161319
all-bundles: product-bundles test-bundles docs-bundles static-libs-bundles

src/hotspot/cpu/zero/frame_zero.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@ bool frame::safe_for_sender(JavaThread *thread) {
125125
bool frame::is_interpreted_frame_valid(JavaThread *thread) const {
126126
assert(is_interpreted_frame(), "Not an interpreted frame");
127127
// These are reasonable sanity checks
128-
if (fp() == 0 || (intptr_t(fp()) & (wordSize-1)) != 0) {
128+
if (fp() == nullptr || (intptr_t(fp()) & (wordSize-1)) != 0) {
129129
return false;
130130
}
131-
if (sp() == 0 || (intptr_t(sp()) & (wordSize-1)) != 0) {
131+
if (sp() == nullptr || (intptr_t(sp()) & (wordSize-1)) != 0) {
132132
return false;
133133
}
134134
// These are hacks to keep us out of trouble.

src/hotspot/share/cds/filemap.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2219,7 +2219,7 @@ address FileMapInfo::heap_region_dumptime_address() {
22192219
assert(CDSConfig::is_using_archive(), "runtime only");
22202220
assert(is_aligned(r->mapping_offset(), sizeof(HeapWord)), "must be");
22212221
if (UseCompressedOops) {
2222-
return /*dumptime*/ narrow_oop_base() + r->mapping_offset();
2222+
return /*dumptime*/ (address)((uintptr_t)narrow_oop_base() + r->mapping_offset());
22232223
} else {
22242224
return heap_region_requested_address();
22252225
}
@@ -2245,7 +2245,7 @@ address FileMapInfo::heap_region_requested_address() {
22452245
// Runtime base = 0x4000 and shift is also 0. If we map this region at 0x5000, then
22462246
// the value P can remain 0x1200. The decoded address = (0x4000 + (0x1200 << 0)) = 0x5200,
22472247
// which is the runtime location of the referenced object.
2248-
return /*runtime*/ CompressedOops::base() + r->mapping_offset();
2248+
return /*runtime*/ (address)((uintptr_t)CompressedOops::base() + r->mapping_offset());
22492249
} else {
22502250
// This was the hard-coded requested base address used at dump time. With uncompressed oops,
22512251
// the heap range is assigned by the OS so we will most likely have to relocate anyway, no matter

src/hotspot/share/gc/shared/genArguments.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ size_t MinNewSize = 0;
3737
size_t MinOldSize = 0;
3838
size_t MaxOldSize = 0;
3939

40-
size_t OldSize = 0;
40+
// If InitialHeapSize or MinHeapSize is not set on cmdline, this variable,
41+
// together with NewSize, is used to derive them.
42+
// Using the same value when it was a configurable flag to avoid breakage.
43+
// See more in JDK-8346005
44+
size_t OldSize = ScaleForWordSize(4*M);
4145

4246
size_t GenAlignment = 0;
4347

src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ HeapWord* ShenandoahFreeSet::allocate_single(ShenandoahAllocRequest& req, bool&
792792
// Free set maintains mutator and collector partitions. Normally, each allocates only from its partition,
793793
// except in special cases when the collector steals regions from the mutator partition.
794794

795-
// Overwrite with non-zero (non-NULL) values only if necessary for allocation bookkeeping.
795+
// Overwrite with non-zero (non-null) values only if necessary for allocation bookkeeping.
796796

797797
switch (req.type()) {
798798
case ShenandoahAllocRequest::_alloc_tlab:

src/hotspot/share/gc/shenandoah/shenandoahGenerationalEvacuationTask.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ void ShenandoahGenerationalEvacuationTask::promote_in_place(ShenandoahHeapRegion
202202
while (obj_addr < tams) {
203203
oop obj = cast_to_oop(obj_addr);
204204
if (marking_context->is_marked(obj)) {
205-
assert(obj->klass() != nullptr, "klass should not be NULL");
205+
assert(obj->klass() != nullptr, "klass should not be null");
206206
// This thread is responsible for registering all objects in this region. No need for lock.
207207
scanner->register_object_without_lock(obj_addr);
208208
obj_addr += obj->size();

src/hotspot/share/gc/z/zUtils.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 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
@@ -25,8 +25,6 @@
2525
#include "gc/z/zUtils.hpp"
2626
#include "runtime/nonJavaThread.hpp"
2727

28-
#include <algorithm>
29-
3028
const char* ZUtils::thread_name() {
3129
const Thread* const thread = Thread::current();
3230
if (thread->is_Named_thread()) {
@@ -38,5 +36,7 @@ const char* ZUtils::thread_name() {
3836
}
3937

4038
void ZUtils::fill(uintptr_t* addr, size_t count, uintptr_t value) {
41-
std::fill_n(addr, count, value);
39+
for (size_t i = 0; i < count; ++i) {
40+
addr[i] = value;
41+
}
4242
}

src/hotspot/share/memory/virtualspace.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ void ReservedHeapSpace::try_reserve_range(char *highest_start,
443443
while (attach_point >= lowest_start &&
444444
attach_point <= highest_start && // Avoid wrap around.
445445
((_base == nullptr) ||
446-
(_base < aligned_heap_base_min_address || _base + size > upper_bound))) {
446+
(_base < aligned_heap_base_min_address || size > (uintptr_t)(upper_bound - _base)))) {
447447
try_reserve_heap(size, alignment, page_size, attach_point);
448448
attach_point -= stepsize;
449449
}

src/hotspot/share/oops/instanceKlass.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,9 @@
9797
#include "utilities/dtrace.hpp"
9898
#include "utilities/events.hpp"
9999
#include "utilities/macros.hpp"
100-
#include "utilities/stringUtils.hpp"
100+
#include "utilities/nativeStackPrinter.hpp"
101101
#include "utilities/pair.hpp"
102+
#include "utilities/stringUtils.hpp"
102103
#ifdef COMPILER1
103104
#include "c1/c1_Compiler.hpp"
104105
#endif
@@ -4009,14 +4010,9 @@ void InstanceKlass::print_class_load_cause_logging() const {
40094010
stringStream stack_stream;
40104011
char buf[O_BUFLEN];
40114012
address lastpc = nullptr;
4012-
if (os::platform_print_native_stack(&stack_stream, nullptr, buf, O_BUFLEN, lastpc)) {
4013-
// We have printed the native stack in platform-specific code,
4014-
// so nothing else to do in this case.
4015-
} else {
4016-
frame f = os::current_frame();
4017-
VMError::print_native_stack(&stack_stream, f, current, true /*print_source_info */,
4018-
-1 /* max stack_stream */, buf, O_BUFLEN);
4019-
}
4013+
NativeStackPrinter nsp(current);
4014+
nsp.print_stack(&stack_stream, buf, sizeof(buf), lastpc,
4015+
true /* print_source_info */, -1 /* max stack */);
40204016

40214017
LogMessage(class, load, cause, native) msg;
40224018
NonInterleavingLogStream info_stream{LogLevelType::Info, msg};

src/hotspot/share/runtime/frame.cpp

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,6 +1558,39 @@ void frame::describe(FrameValues& values, int frame_no, const RegisterMap* reg_m
15581558

15591559
#endif
15601560

1561+
/**
1562+
* Gets the caller frame of `fr` for thread `t`.
1563+
*
1564+
* @returns an invalid frame (i.e. fr.pc() === 0) if the caller cannot be obtained
1565+
*/
1566+
frame frame::next_frame(frame fr, Thread* t) {
1567+
// Compiled code may use EBP register on x86 so it looks like
1568+
// non-walkable C frame. Use frame.sender() for java frames.
1569+
frame invalid;
1570+
if (t != nullptr && t->is_Java_thread()) {
1571+
// Catch very first native frame by using stack address.
1572+
// For JavaThread stack_base and stack_size should be set.
1573+
if (!t->is_in_full_stack((address)(fr.real_fp() + 1))) {
1574+
return invalid;
1575+
}
1576+
if (fr.is_interpreted_frame() || (fr.cb() != nullptr && fr.cb()->frame_size() > 0)) {
1577+
RegisterMap map(JavaThread::cast(t),
1578+
RegisterMap::UpdateMap::skip,
1579+
RegisterMap::ProcessFrames::include,
1580+
RegisterMap::WalkContinuation::skip); // No update
1581+
return fr.sender(&map);
1582+
} else {
1583+
// is_first_C_frame() does only simple checks for frame pointer,
1584+
// it will pass if java compiled code has a pointer in EBP.
1585+
if (os::is_first_C_frame(&fr)) return invalid;
1586+
return os::get_sender_for_C_frame(&fr);
1587+
}
1588+
} else {
1589+
if (os::is_first_C_frame(&fr)) return invalid;
1590+
return os::get_sender_for_C_frame(&fr);
1591+
}
1592+
}
1593+
15611594
#ifndef PRODUCT
15621595

15631596
void FrameValues::describe(int owner, intptr_t* location, const char* description, int priority) {

0 commit comments

Comments
 (0)