Skip to content

Commit

Permalink
Merge pull request #17 from SAP/merge-jdk-10+39
Browse files Browse the repository at this point in the history
Merge to tag jdk-10+39
  • Loading branch information
axel7born authored Jan 15, 2018
2 parents fb484d1 + 1d3735c commit 23c53dc
Show file tree
Hide file tree
Showing 74 changed files with 1,261 additions and 639 deletions.
1 change: 1 addition & 0 deletions .hgtags
Original file line number Diff line number Diff line change
Expand Up @@ -462,3 +462,4 @@ bbd692ad4fa300ecca7939ffbe3b1d5e52a28cc6 jdk-10+33
d8c634b016c628622c9abbdc6bf50509e5dedbec jdk-10+35
cb54a299aa91419cb7caef3992592e7b22488163 jdk-10+36
4f830b447edf04fb4a52151a5ad44d9bb60723cd jdk-10+37
e569e83139fdfbecfeb3cd9014d560917787f158 jdk-10+38
8 changes: 5 additions & 3 deletions make/gensrc/Gensrc-java.desktop.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2018, 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 @@ -46,7 +46,6 @@ PROP_SRC_DIRS := \
$(TOPDIR)/src/java.desktop/share/classes/sun/awt/resources \
$(TOPDIR)/src/java.desktop/share/classes/com/sun/accessibility/internal/resources \
$(TOPDIR)/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/resources \
$(TOPDIR)/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/resources \
$(TOPDIR)/src/java.desktop/share/classes/com/sun/swing/internal/plaf/basic/resources \
$(TOPDIR)/src/java.desktop/share/classes/com/sun/swing/internal/plaf/metal/resources \
$(TOPDIR)/src/java.desktop/share/classes/com/sun/swing/internal/plaf/synth/resources \
Expand All @@ -61,7 +60,10 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
endif

ifeq ($(OPENJDK_TARGET_OS), windows)
PROP_SRC_DIRS += $(TOPDIR)/src/java.desktop/windows/classes/sun/awt/windows
PROP_SRC_DIRS += \
$(TOPDIR)/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/resources \
$(TOPDIR)/src/java.desktop/windows/classes/sun/awt/windows \
#
endif

ifeq ($(filter $(OPENJDK_TARGET_OS), windows macosx), )
Expand Down
4 changes: 4 additions & 0 deletions src/hotspot/cpu/ppc/globalDefinitions_ppc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,9 @@ const bool CCallingConventionRequiresIntsAsLongs = true;
#define SUPPORT_RESERVED_STACK_AREA

#define THREAD_LOCAL_POLL
// If UseSIGTRAP is active, we only use the poll bit and no polling page.
// Otherwise, we fall back to usage of the polling page in nmethods.
// Define the condition to use this -XX flag.
#define USE_POLL_BIT_ONLY UseSIGTRAP

#endif // CPU_PPC_VM_GLOBALDEFINITIONS_PPC_HPP
8 changes: 7 additions & 1 deletion src/hotspot/cpu/ppc/macroAssembler_ppc.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "asm/macroAssembler.hpp"
#include "asm/codeBuffer.hpp"
#include "code/codeCache.hpp"
#include "runtime/safepointMechanism.hpp"

inline bool MacroAssembler::is_ld_largeoffset(address a) {
const int inst1 = *(int *)a;
Expand Down Expand Up @@ -261,7 +262,12 @@ inline address MacroAssembler::last_calls_return_pc() {

// Read from the polling page, its address is already in a register.
inline void MacroAssembler::load_from_polling_page(Register polling_page_address, int offset) {
ld(R0, offset, polling_page_address);
if (SafepointMechanism::uses_thread_local_poll() && USE_POLL_BIT_ONLY) {
int encoding = SafepointMechanism::poll_bit();
tdi(traptoGreaterThanUnsigned | traptoEqual, polling_page_address, encoding);
} else {
ld(R0, offset, polling_page_address);
}
}

// Trap-instruction-based checks.
Expand Down
6 changes: 6 additions & 0 deletions src/hotspot/cpu/ppc/nativeInst_ppc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "memory/allocation.hpp"
#include "runtime/icache.hpp"
#include "runtime/os.hpp"
#include "runtime/safepointMechanism.hpp"

// We have interfaces for the following instructions:
//
Expand Down Expand Up @@ -93,6 +94,11 @@ class NativeInstruction VALUE_OBJ_CLASS_SPEC {
bool is_safepoint_poll() {
// Is the current instruction a POTENTIAL read access to the polling page?
// The current arguments of the instruction are not checked!
if (SafepointMechanism::uses_thread_local_poll() && USE_POLL_BIT_ONLY) {
int encoding = SafepointMechanism::poll_bit();
return MacroAssembler::is_tdi(long_at(0), Assembler::traptoGreaterThanUnsigned | Assembler::traptoEqual,
-1, encoding);
}
return MacroAssembler::is_load_from_polling_page(long_at(0), NULL);
}

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/x86/vm_version_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ void VM_Version::get_processor_features() {
FLAG_SET_DEFAULT(UseSHA256Intrinsics, false);
}

if (UseSHA) {
if (UseSHA && supports_avx2() && supports_bmi2()) {
if (FLAG_IS_DEFAULT(UseSHA512Intrinsics)) {
FLAG_SET_DEFAULT(UseSHA512Intrinsics, true);
}
Expand Down
33 changes: 26 additions & 7 deletions src/hotspot/os/aix/safepointMechanism_aix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,18 @@
#include <sys/mman.h>

void SafepointMechanism::pd_initialize() {
// No special code needed if we can use SIGTRAP
if (ThreadLocalHandshakes && USE_POLL_BIT_ONLY) {
default_initialize();
return;
}

// Allocate one protected page
char* map_address = (char*)MAP_FAILED;
const size_t page_size = os::vm_page_size();
const int prot = PROT_READ;
const int flags = MAP_PRIVATE | MAP_ANONYMOUS;

// Use optimized addresses for the polling page,
// e.g. map it to a special 32-bit address.
if (OptimizePollingPageLocation) {
Expand All @@ -57,14 +67,14 @@ void SafepointMechanism::pd_initialize() {
// Try to map with current address wish.
// AIX: AIX needs MAP_FIXED if we provide an address and mmap will
// fail if the address is already mapped.
map_address = (char*) ::mmap(address_wishes[i] - (ssize_t)page_size,
page_size, PROT_READ,
MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED,
map_address = (char*) ::mmap(address_wishes[i],
page_size, prot,
flags | MAP_FIXED,
-1, 0);
log_debug(os)("SafePoint Polling Page address: %p (wish) => %p",
address_wishes[i], map_address + (ssize_t)page_size);
log_debug(os)("SafePoint Polling Page address: %p (wish) => %p",
address_wishes[i], map_address);

if (map_address + (ssize_t)page_size == address_wishes[i]) {
if (map_address == address_wishes[i]) {
// Map succeeded and map_address is at wished address, exit loop.
break;
}
Expand All @@ -78,8 +88,17 @@ void SafepointMechanism::pd_initialize() {
}
}
if (map_address == (char*)MAP_FAILED) {
map_address = os::reserve_memory(page_size, NULL, page_size);
map_address = (char*) ::mmap(NULL, page_size, prot, flags, -1, 0);
}
guarantee(map_address != (char*)MAP_FAILED, "SafepointMechanism::pd_initialize: failed to allocate polling page");
log_info(os)("SafePoint Polling address: " INTPTR_FORMAT, p2i(map_address));
os::set_polling_page((address)(map_address));

// Use same page for ThreadLocalHandshakes without SIGTRAP
if (ThreadLocalHandshakes) {
set_uses_thread_local_poll();
intptr_t bad_page_val = reinterpret_cast<intptr_t>(map_address);
_poll_armed_value = reinterpret_cast<void*>(bad_page_val | poll_bit());
_poll_disarmed_value = NULL; // Readable on AIX
}
}
33 changes: 15 additions & 18 deletions src/hotspot/os/linux/osContainer_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,11 @@
#include "logging/log.hpp"
#include "osContainer_linux.hpp"

/*
* Warning: Some linux distros use 0x7FFFFFFFFFFFF000
* and others use 0x7FFFFFFFFFFFFFFF for unlimited.
*/
#define UNLIMITED_MEM CONST64(0x7FFFFFFFFFFFF000)

#define PER_CPU_SHARES 1024

bool OSContainer::_is_initialized = false;
bool OSContainer::_is_containerized = false;
julong _unlimited_memory;

class CgroupSubsystem: CHeapObj<mtInternal> {
friend class OSContainer;
Expand Down Expand Up @@ -217,6 +212,8 @@ void OSContainer::init() {
_is_initialized = true;
_is_containerized = false;

_unlimited_memory = (LONG_MAX / os::vm_page_size()) * os::vm_page_size();

log_trace(os, container)("OSContainer::init: Initializing Container Support");
if (!UseContainerSupport) {
log_trace(os, container)("Container Support not enabled");
Expand Down Expand Up @@ -419,37 +416,37 @@ char * OSContainer::container_type() {
* OSCONTAINER_ERROR for not supported
*/
jlong OSContainer::memory_limit_in_bytes() {
GET_CONTAINER_INFO(jlong, memory, "/memory.limit_in_bytes",
"Memory Limit is: " JLONG_FORMAT, JLONG_FORMAT, memlimit);
GET_CONTAINER_INFO(julong, memory, "/memory.limit_in_bytes",
"Memory Limit is: " JULONG_FORMAT, JULONG_FORMAT, memlimit);

if (memlimit >= UNLIMITED_MEM) {
if (memlimit >= _unlimited_memory) {
log_trace(os, container)("Memory Limit is: Unlimited");
return (jlong)-1;
}
else {
return memlimit;
return (jlong)memlimit;
}
}

jlong OSContainer::memory_and_swap_limit_in_bytes() {
GET_CONTAINER_INFO(jlong, memory, "/memory.memsw.limit_in_bytes",
"Memory and Swap Limit is: " JLONG_FORMAT, JLONG_FORMAT, memswlimit);
if (memswlimit >= UNLIMITED_MEM) {
GET_CONTAINER_INFO(julong, memory, "/memory.memsw.limit_in_bytes",
"Memory and Swap Limit is: " JULONG_FORMAT, JULONG_FORMAT, memswlimit);
if (memswlimit >= _unlimited_memory) {
log_trace(os, container)("Memory and Swap Limit is: Unlimited");
return (jlong)-1;
} else {
return memswlimit;
return (jlong)memswlimit;
}
}

jlong OSContainer::memory_soft_limit_in_bytes() {
GET_CONTAINER_INFO(jlong, memory, "/memory.soft_limit_in_bytes",
"Memory Soft Limit is: " JLONG_FORMAT, JLONG_FORMAT, memsoftlimit);
if (memsoftlimit >= UNLIMITED_MEM) {
GET_CONTAINER_INFO(julong, memory, "/memory.soft_limit_in_bytes",
"Memory Soft Limit is: " JULONG_FORMAT, JULONG_FORMAT, memsoftlimit);
if (memsoftlimit >= _unlimited_memory) {
log_trace(os, container)("Memory Soft Limit is: Unlimited");
return (jlong)-1;
} else {
return memsoftlimit;
return (jlong)memsoftlimit;
}
}

Expand Down
8 changes: 6 additions & 2 deletions src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include "runtime/javaCalls.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/osThread.hpp"
#include "runtime/safepointMechanism.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/stubRoutines.hpp"
#include "runtime/thread.inline.hpp"
Expand Down Expand Up @@ -374,9 +375,12 @@ JVM_handle_aix_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrec
goto run_stub;
}

else if (sig == SIGSEGV && os::is_poll_address(addr)) {
else if ((SafepointMechanism::uses_thread_local_poll() && USE_POLL_BIT_ONLY)
? (sig == SIGTRAP && ((NativeInstruction*)pc)->is_safepoint_poll())
: (sig == SIGSEGV && os::is_poll_address(addr))) {
if (TraceTraps) {
tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (SIGSEGV)", pc);
tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (%s)", p2i(pc),
(SafepointMechanism::uses_thread_local_poll() && USE_POLL_BIT_ONLY) ? "SIGTRAP" : "SIGSEGV");
}
stub = SharedRuntime::get_poll_stub(pc);
goto run_stub;
Expand Down
6 changes: 4 additions & 2 deletions src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#include "runtime/javaCalls.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/osThread.hpp"
#include "runtime/safepointMechanism.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/stubRoutines.hpp"
#include "runtime/thread.inline.hpp"
Expand Down Expand Up @@ -382,7 +383,7 @@ JVM_handle_linux_signal(int sig,
stub = SharedRuntime::get_handle_wrong_method_stub();
}

else if (sig == SIGSEGV &&
else if (sig == ((SafepointMechanism::uses_thread_local_poll() && USE_POLL_BIT_ONLY) ? SIGTRAP : SIGSEGV) &&
// A linux-ppc64 kernel before 2.6.6 doesn't set si_addr on some segfaults
// in 64bit mode (cf. http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.6),
// especially when we try to read from the safepoint polling page. So the check
Expand All @@ -393,7 +394,8 @@ JVM_handle_linux_signal(int sig,
((cb = CodeCache::find_blob(pc)) != NULL) &&
cb->is_compiled()) {
if (TraceTraps) {
tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (SIGSEGV)", p2i(pc));
tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (%s)", p2i(pc),
(SafepointMechanism::uses_thread_local_poll() && USE_POLL_BIT_ONLY) ? "SIGTRAP" : "SIGSEGV");
}
stub = SharedRuntime::get_poll_stub(pc);
}
Expand Down
34 changes: 18 additions & 16 deletions src/hotspot/share/ci/ciEnv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1164,28 +1164,30 @@ ciInstance* ciEnv::unloaded_ciinstance() {

void ciEnv::dump_compile_data(outputStream* out) {
CompileTask* task = this->task();
Method* method = task->method();
int entry_bci = task->osr_bci();
int comp_level = task->comp_level();
out->print("compile %s %s %s %d %d",
method->klass_name()->as_quoted_ascii(),
method->name()->as_quoted_ascii(),
method->signature()->as_quoted_ascii(),
entry_bci, comp_level);
if (compiler_data() != NULL) {
if (is_c2_compile(comp_level)) {
if (task) {
Method* method = task->method();
int entry_bci = task->osr_bci();
int comp_level = task->comp_level();
out->print("compile %s %s %s %d %d",
method->klass_name()->as_quoted_ascii(),
method->name()->as_quoted_ascii(),
method->signature()->as_quoted_ascii(),
entry_bci, comp_level);
if (compiler_data() != NULL) {
if (is_c2_compile(comp_level)) {
#ifdef COMPILER2
// Dump C2 inlining data.
((Compile*)compiler_data())->dump_inline_data(out);
// Dump C2 inlining data.
((Compile*)compiler_data())->dump_inline_data(out);
#endif
} else if (is_c1_compile(comp_level)) {
} else if (is_c1_compile(comp_level)) {
#ifdef COMPILER1
// Dump C1 inlining data.
((Compilation*)compiler_data())->dump_inline_data(out);
// Dump C1 inlining data.
((Compilation*)compiler_data())->dump_inline_data(out);
#endif
}
}
out->cr();
}
out->cr();
}

void ciEnv::dump_replay_data_unsafe(outputStream* out) {
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/gc/g1/g1CollectedHeap.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2018, 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 @@ -4786,7 +4786,7 @@ class G1FreeCollectionSetTask : public AbstractGangTask {
timer->record_time_secs(G1GCPhaseTimes::YoungFreeCSet, worker_id, young_time);
}
if (has_non_young_time) {
timer->record_time_secs(G1GCPhaseTimes::NonYoungFreeCSet, worker_id, young_time);
timer->record_time_secs(G1GCPhaseTimes::NonYoungFreeCSet, worker_id, non_young_time);
}
}
};
Expand Down
3 changes: 3 additions & 0 deletions src/hotspot/share/jvmci/jvmciCodeInstaller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,9 @@ JVMCIEnv::CodeInstallResult CodeInstaller::install(JVMCICompiler* compiler, Hand

if (!compiled_code->is_a(HotSpotCompiledNmethod::klass())) {
oop stubName = HotSpotCompiledCode::name(compiled_code_obj);
if (oopDesc::is_null(stubName)) {
JVMCI_ERROR_OK("stub should have a name");
}
char* name = strdup(java_lang_String::as_utf8_string(stubName));
cb = RuntimeStub::new_runtime_stub(name,
&buffer,
Expand Down
Loading

0 comments on commit 23c53dc

Please sign in to comment.