Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.
/ jdk16u Public archive

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
robm-openjdk committed May 26, 2021
2 parents 6fc68c2 + 410f742 commit b609c51
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 8 deletions.
5 changes: 5 additions & 0 deletions src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,11 @@ void MacroAssembler::call_VM_base(Register oop_result,
// do the call, remove parameters
MacroAssembler::call_VM_leaf_base(entry_point, number_of_arguments, &l);

// lr could be poisoned with PAC signature during throw_pending_exception
// if it was tail-call optimized by compiler, since lr is not callee-saved
// reload it with proper value
adr(lr, l);

// reset last Java frame
// Only interpreter should have to clear fp
reset_last_Java_frame(true);
Expand Down
4 changes: 3 additions & 1 deletion src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ jint ShenandoahHeap::initialize() {
Universe::check_alignment(init_byte_size, reg_size_bytes, "Shenandoah heap");

_num_regions = ShenandoahHeapRegion::region_count();
assert(_num_regions == (max_byte_size / reg_size_bytes), "Must match");
assert(_num_regions == (max_byte_size / reg_size_bytes),
"Regions should cover entire heap exactly: " SIZE_FORMAT " != " SIZE_FORMAT "/" SIZE_FORMAT,
_num_regions, max_byte_size, reg_size_bytes);

// Now we know the number of regions, initialize the heuristics.
initialize_heuristics();
Expand Down
8 changes: 4 additions & 4 deletions src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -541,10 +541,10 @@ void ShenandoahHeapRegion::setup_sizes(size_t max_heap_size) {
}

// Make sure region size is at least one large page, if enabled.
// Otherwise, uncommitting one region may falsely uncommit the adjacent
// regions too.
// Also see shenandoahArguments.cpp, where it handles UseLargePages.
if (UseLargePages && ShenandoahUncommit) {
// The heap sizes would be rounded by heap initialization code by
// page size, so we need to round up the region size too, to cover
// the heap exactly.
if (UseLargePages) {
region_size = MAX2(region_size, os::large_page_size());
}

Expand Down
8 changes: 5 additions & 3 deletions src/hotspot/share/oops/instanceKlass.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021, 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 @@ -4240,7 +4240,8 @@ void InstanceKlass::log_to_classlist(const ClassFileStream* stream) const {
// For the boot and platform class loaders, skip classes that are not found in the
// java runtime image, such as those found in the --patch-module entries.
// These classes can't be loaded from the archive during runtime.
if (!stream->from_boot_loader_modules_image() && strncmp(stream->source(), "jrt:", 4) != 0) {
if (!stream->from_boot_loader_modules_image() &&
(stream->source() == NULL || strncmp(stream->source(), "jrt:", 4) != 0)) {
skip = true;
}

Expand All @@ -4254,7 +4255,8 @@ void InstanceKlass::log_to_classlist(const ClassFileStream* stream) const {
ResourceMark rm;
if (skip) {
tty->print_cr("skip writing class %s from source %s to classlist file",
name()->as_C_string(), stream->source());
name()->as_C_string(),
stream->source() != NULL ? stream->source() : "(null)");
} else {
ClassListWriter w;
w.stream()->print_cr("%s", name()->as_C_string());
Expand Down
69 changes: 69 additions & 0 deletions test/hotspot/jtreg/gc/shenandoah/options/TestLargePages.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
* Copyright (c) 2021, Red Hat, Inc. 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/

/*
* @test id=default
* @requires vm.gc.Shenandoah
*
* @run main/othervm -XX:+UseShenandoahGC -Xms128m -Xmx128m TestLargePages
* @run main/othervm -XX:+UseShenandoahGC -Xmx128m TestLargePages
* @run main/othervm -XX:+UseShenandoahGC -Xms128m TestLargePages
*
* @run main/othervm -XX:+UseShenandoahGC -Xms131m -Xmx131m TestLargePages
* @run main/othervm -XX:+UseShenandoahGC -Xmx131m TestLargePages
* @run main/othervm -XX:+UseShenandoahGC -Xms131m TestLargePages
*/

/*
* @test id=lp
* @requires vm.gc.Shenandoah
*
* @run main/othervm -XX:+UseShenandoahGC -XX:+UseLargePages -Xms128m -Xmx128m TestLargePages
* @run main/othervm -XX:+UseShenandoahGC -XX:+UseLargePages -Xmx128m TestLargePages
* @run main/othervm -XX:+UseShenandoahGC -XX:+UseLargePages -Xms128m TestLargePages
*
* @run main/othervm -XX:+UseShenandoahGC -XX:+UseLargePages -Xms131m -Xmx131m TestLargePages
* @run main/othervm -XX:+UseShenandoahGC -XX:+UseLargePages -Xmx131m TestLargePages
* @run main/othervm -XX:+UseShenandoahGC -XX:+UseLargePages -Xms131m TestLargePages
*/

/*
* @test id=thp
* @requires vm.gc.Shenandoah
* @requires os.family == "linux"
*
* @run main/othervm -XX:+UseShenandoahGC -XX:+UseTransparentHugePages -Xms128m -Xmx128m TestLargePages
* @run main/othervm -XX:+UseShenandoahGC -XX:+UseTransparentHugePages -Xmx128m TestLargePages
* @run main/othervm -XX:+UseShenandoahGC -XX:+UseTransparentHugePages -Xms128m TestLargePages
*
* @run main/othervm -XX:+UseShenandoahGC -XX:+UseTransparentHugePages -Xms131m -Xmx131m TestLargePages
* @run main/othervm -XX:+UseShenandoahGC -XX:+UseTransparentHugePages -Xmx131m TestLargePages
* @run main/othervm -XX:+UseShenandoahGC -XX:+UseTransparentHugePages -Xms131m TestLargePages
*/

public class TestLargePages {
public static void main(String[] args) {
// Everything is checked on initialization
}
}

0 comments on commit b609c51

Please sign in to comment.