Skip to content
Permalink
Browse files

Merge

  • Loading branch information
AlanBateman committed Jan 31, 2020
2 parents a4f5703 + f262092 commit a6469be988cdfd3a8df80ff8df1309f61d366883
Showing 517 changed files with 9,469 additions and 18,036 deletions.
@@ -612,3 +612,5 @@ decd3d2953b640f1043ee76953ff89238bff92e8 jdk-14+31
b97c1773ccafae4a8c16cc6aedb10b2a4f9a07ed jdk-15+5
2776da28515e087cc8849acf1e131a65ea7e77b6 jdk-14+32
ef7d53b4fccd4a0501b17d974e84f37aa99fa813 jdk-15+6
f728b6c7f4910d6bd6070cb4dde8393f4ba95113 jdk-14+33
e2bc57500c1b785837982f7ce8af6751387ed73b jdk-15+7
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2020, 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
@@ -532,10 +532,13 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
if test "x$TOOLCHAIN_TYPE" = xgcc; then
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -fcheck-new -fstack-protector"
TOOLCHAIN_CFLAGS_JDK="-pipe -fstack-protector"
# reduce lib size on s390x in link step, this needs also special compile flags
if test "x$OPENJDK_TARGET_CPU" = xs390x; then
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -ffunction-sections -fdata-sections"
# reduce lib size on linux in link step, this needs also special compile flags
# do this on s390x also for libjvm (where serviceability agent is not supported)
if test "x$ENABLE_LINKTIME_GC" = xtrue; then
TOOLCHAIN_CFLAGS_JDK="$TOOLCHAIN_CFLAGS_JDK -ffunction-sections -fdata-sections"
if test "x$OPENJDK_TARGET_CPU" = xs390x; then
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -ffunction-sections -fdata-sections"
fi
fi
# technically NOT for CXX (but since this gives *worse* performance, use
# no-strict-aliasing everywhere!)
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2020, 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
@@ -72,9 +72,13 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
# Add -z defs, to forbid undefined symbols in object files.
# add relro (mark relocations read only) for all libs
BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,-z,defs -Wl,-z,relro"
# s390x : remove unused code+data in link step
if test "x$OPENJDK_TARGET_CPU" = xs390x; then
BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,--gc-sections -Wl,--print-gc-sections"
# Linux : remove unused code+data in link step
if test "x$ENABLE_LINKTIME_GC" = xtrue; then
if test "x$OPENJDK_TARGET_CPU" = xs390x; then
BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,--gc-sections -Wl,--print-gc-sections"
else
BASIC_LDFLAGS_JDK_ONLY="$BASIC_LDFLAGS_JDK_ONLY -Wl,--gc-sections"
fi
fi
BASIC_LDFLAGS_JVM_ONLY="-Wl,-O1"
@@ -139,6 +139,30 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
AC_SUBST(ENABLE_HEADLESS_ONLY)
# should we linktime gc unused code sections in the JDK build ?
AC_MSG_CHECKING([linktime gc])
AC_ARG_ENABLE([linktime-gc], [AS_HELP_STRING([--enable-linktime-gc],
[linktime gc unused code sections in the JDK build @<:@disabled@:>@])])
if test "x$enable_linktime_gc" = "xyes"; then
ENABLE_LINKTIME_GC="true"
AC_MSG_RESULT([yes])
elif test "x$enable_linktime_gc" = "xno"; then
ENABLE_LINKTIME_GC="false"
AC_MSG_RESULT([no])
elif test "x$OPENJDK_TARGET_OS" = "xlinux" && test "x$OPENJDK_TARGET_CPU" = xs390x; then
ENABLE_LINKTIME_GC="true"
AC_MSG_RESULT([yes])
elif test "x$enable_linktime_gc" = "x"; then
ENABLE_LINKTIME_GC="false"
AC_MSG_RESULT([no])
else
AC_MSG_ERROR([--enable-linktime-gc can only take yes or no])
fi
AC_SUBST(ENABLE_LINKTIME_GC)
# Should we build the complete docs, or just a lightweight version?
AC_ARG_ENABLE([full-docs], [AS_HELP_STRING([--enable-full-docs],
[build complete documentation @<:@enabled if all tools found@:>@])])
@@ -301,6 +301,8 @@ USE_PRECOMPILED_HEADER := @USE_PRECOMPILED_HEADER@
# Only build headless support or not
ENABLE_HEADLESS_ONLY := @ENABLE_HEADLESS_ONLY@

ENABLE_LINKTIME_GC := @ENABLE_LINKTIME_GC@

ENABLE_FULL_DOCS := @ENABLE_FULL_DOCS@

# JDK_OUTPUTDIR specifies where a working jvm is built.
@@ -36,6 +36,7 @@ SRC_DIR := $(TOPDIR)/src/$(MODULE)/share/classes
################################################################################

PROC_SRC_SUBDIRS := \
org.graalvm.compiler.asm.amd64 \
org.graalvm.compiler.code \
org.graalvm.compiler.core \
org.graalvm.compiler.core.aarch64 \
@@ -1,5 +1,5 @@
#
# Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2018, 2020, 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
@@ -176,8 +176,6 @@ ifeq ($(INCLUDE_GRAAL), true)
))

TARGETS_IMAGE += $(COPY_HOTSPOT_JTREG_GRAAL)
else
$(info Skip building of Graal unit tests because 3rd party libraries directory is not specified)
endif
endif

@@ -34,11 +34,10 @@ const bool CCallingConventionRequiresIntsAsLongs = false;

#define SUPPORTS_NATIVE_CX8

// Aarch64 was not originally defined as multi-copy-atomic, but now is.
// See: "Simplifying ARM Concurrency: Multicopy-atomic Axiomatic and
// Operational Models for ARMv8"
// So we could #define CPU_MULTI_COPY_ATOMIC but historically we have
// not done so.
// Aarch64 was not originally defined to be multi-copy-atomic, but now
// is. See: "Simplifying ARM Concurrency: Multicopy-atomic Axiomatic
// and Operational Models for ARMv8"
#define CPU_MULTI_COPY_ATOMIC

// According to the ARMv8 ARM, "Concurrent modification and execution
// of instructions can lead to the resulting instruction performing
@@ -61,7 +61,7 @@ void CodeInstaller::pd_patch_OopConstant(int pc_offset, JVMCIObject constant, JV
#endif // ASSERT
Handle obj = jvmci_env()->asConstant(constant, JVMCI_CHECK);
jobject value = JNIHandles::make_local(obj());
MacroAssembler::patch_oop(pc, (address)obj());
MacroAssembler::patch_oop(pc, cast_from_oop<address>(obj()));
int oop_index = _oop_recorder->find_index(value);
RelocationHolder rspec = oop_Relocation::spec(oop_index);
_instructions->relocate(pc, rspec);
@@ -1,6 +1,6 @@
/*
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2019, Red Hat Inc. All rights reserved.
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, 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
@@ -4977,8 +4977,6 @@ void MacroAssembler::string_compare(Register str1, Register str2,
sub(cnt2, zr, cnt2, LSL, str2_chr_shift);
} else if (isLU) {
ldrs(vtmp, Address(str1));
cmp(str1, str2);
br(Assembler::EQ, DONE);
ldr(tmp2, Address(str2));
cmp(cnt2, stub_threshold);
br(GE, STUB);
@@ -4993,8 +4991,6 @@ void MacroAssembler::string_compare(Register str1, Register str2,
fmovd(tmp1, vtmp);
} else { // UL case
ldr(tmp1, Address(str1));
cmp(str1, str2);
br(Assembler::EQ, DONE);
ldrs(vtmp, Address(str2));
cmp(cnt2, stub_threshold);
br(GE, STUB);
@@ -351,14 +351,6 @@ class AddressLiteral {
: _address((address) addr),
_rspec(rspec_from_rtype(rtype, (address) addr)) {}

AddressLiteral(oop addr, relocInfo::relocType rtype = relocInfo::none)
: _address((address) addr),
_rspec(rspec_from_rtype(rtype, (address) addr)) {}

AddressLiteral(oop* addr, relocInfo::relocType rtype = relocInfo::none)
: _address((address) addr),
_rspec(rspec_from_rtype(rtype, (address) addr)) {}

AddressLiteral(float* addr, relocInfo::relocType rtype = relocInfo::none)
: _address((address) addr),
_rspec(rspec_from_rtype(rtype, (address) addr)) {}
@@ -390,7 +382,6 @@ class ExternalAddress: public AddressLiteral {

public:
ExternalAddress(address target) : AddressLiteral(target, reloc_for_target( target)) {}
ExternalAddress(oop* target) : AddressLiteral(target, reloc_for_target((address) target)) {}
};

// Argument is an abstraction used to represent an outgoing actual
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016 SAP SE. All rights reserved.
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2020 SAP SE. 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
@@ -1095,12 +1095,6 @@ static void pd_zero_to_words(HeapWord* tohw, size_t count) {
pd_zero_to_bytes(tohw, count*HeapWordSize);
}

// Delegate to pd_zero_to_bytes. It also works HeapWord-atomic.
static void pd_zero_to_words_large(HeapWord* tohw, size_t count) {
// JVM2008: generally frequent, some tests show very frequent calls.
pd_zero_to_bytes(tohw, count*HeapWordSize);
}

static void pd_zero_to_bytes(void* to, size_t count) {
// JVM2008: some calls (generally), some tests frequent
#ifdef USE_INLINE_ASM
@@ -1233,7 +1233,7 @@ static void fix_stack_chunk(oop chunk) {
assert (oopDesc::is_oop(base), "");
intptr_t offset = *(intptr_t*)derived_loc;
assert (offset >= 0 && offset <= (base->size() << LogHeapWordSize), "");
*derived_loc = (oop)(((address)base) + offset);
*derived_loc = (oop)(cast_from_oop<address>(base) + offset);
} else {
assert (*derived_loc == (oop)NULL, "");
}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2020, 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
@@ -371,19 +371,21 @@ static int get_boot_time(uint64_t* time) {

static int perf_context_switch_rate(double* rate) {
static pthread_mutex_t contextSwitchLock = PTHREAD_MUTEX_INITIALIZER;
static uint64_t lastTime;
static uint64_t bootTime;
static uint64_t lastTimeNanos;
static uint64_t lastSwitches;
static double lastRate;

uint64_t lt = 0;
uint64_t bt = 0;
int res = 0;

if (lastTime == 0) {
// First time through bootTime will be zero.
if (bootTime == 0) {
uint64_t tmp;
if (get_boot_time(&tmp) < 0) {
return OS_ERR;
}
lt = tmp * 1000;
bt = tmp * 1000;
}

res = OS_OK;
@@ -394,20 +396,29 @@ static int perf_context_switch_rate(double* rate) {
uint64_t sw;
s8 t, d;

if (lastTime == 0) {
lastTime = lt;
if (bootTime == 0) {
// First interval is measured from boot time which is
// seconds since the epoch. Thereafter we measure the
// elapsed time using javaTimeNanos as it is monotonic-
// non-decreasing.
lastTimeNanos = os::javaTimeNanos();
t = os::javaTimeMillis();
d = t - bt;
// keep bootTime zero for now to use as a first-time-through flag
} else {
t = os::javaTimeNanos();
d = nanos_to_millis(t - lastTimeNanos);
}

t = os::javaTimeMillis();
d = t - lastTime;

if (d == 0) {
*rate = lastRate;
} else if (!get_noof_context_switches(&sw)) {
} else if (get_noof_context_switches(&sw) == 0) {
*rate = ( (double)(sw - lastSwitches) / d ) * 1000;
lastRate = *rate;
lastSwitches = sw;
lastTime = t;
if (bootTime != 0) {
lastTimeNanos = t;
}
} else {
*rate = 0;
res = OS_ERR;
@@ -416,6 +427,10 @@ static int perf_context_switch_rate(double* rate) {
*rate = 0;
lastRate = 0;
}

if (bootTime == 0) {
bootTime = bt;
}
}
pthread_mutex_unlock(&contextSwitchLock);

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2020, 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
@@ -76,17 +76,17 @@ bool OSXSemaphore::timedwait(int64_t millis) {
// kernel semaphores take a relative timeout
mach_timespec_t waitspec;
int secs = millis / MILLIUNITS;
int nsecs = (millis % MILLIUNITS) * NANOSECS_PER_MILLISEC;
int nsecs = millis_to_nanos(millis % MILLIUNITS);
waitspec.tv_sec = secs;
waitspec.tv_nsec = nsecs;

int64_t starttime = os::javaTimeMillis() * NANOSECS_PER_MILLISEC;
int64_t starttime = os::javaTimeNanos();

kr = semaphore_timedwait(_semaphore, waitspec);
while (kr == KERN_ABORTED) {
// reduce the timout and try again
int64_t totalwait = millis * NANOSECS_PER_MILLISEC;
int64_t current = os::javaTimeMillis() * NANOSECS_PER_MILLISEC;
int64_t totalwait = millis_to_nanos(millis);
int64_t current = os::javaTimeNanos();
int64_t passedtime = current - starttime;

if (passedtime >= totalwait) {

0 comments on commit a6469be

Please sign in to comment.