Skip to content

Commit

Permalink
Merge pull request #478 from JasonFengJ9/mergetmp
Browse files Browse the repository at this point in the history
Merge master jdk-11.0.15+2 into openj9-staging
  • Loading branch information
keithc-ca committed Feb 17, 2022
2 parents 24e7209 + 0769c12 commit 78b229e
Show file tree
Hide file tree
Showing 33 changed files with 523 additions and 567 deletions.
2 changes: 1 addition & 1 deletion closed/openjdk-tag.gmk
@@ -1 +1 @@
OPENJDK_TAG := jdk-11.0.15+1
OPENJDK_TAG := jdk-11.0.15+2
2 changes: 1 addition & 1 deletion make/autoconf/build-aux/config.guess
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
Expand Down
6 changes: 4 additions & 2 deletions make/autoconf/flags.m4
Expand Up @@ -115,6 +115,9 @@ AC_DEFUN([FLAGS_SETUP_MACOSX_VERSION],
[
# Additional macosx handling
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
# The expected format for <version> is either nn.n.n or nn.nn.nn. See
# /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h
# MACOSX_VERSION_MIN specifies the lowest version of Macosx that the built
# binaries should be compatible with, even if compiled on a newer version
# of the OS. It currently has a hard coded value. Setting this also limits
Expand All @@ -130,8 +133,7 @@ AC_DEFUN([FLAGS_SETUP_MACOSX_VERSION],
AC_SUBST(MACOSX_VERSION_MIN)
# Setting --with-macosx-version-max=<version> makes it an error to build or
# link to macosx APIs that are newer than the given OS version. The expected
# format for <version> is either nn.n.n or nn.nn.nn. See /usr/include/AvailabilityMacros.h.
# link to macosx APIs that are newer than the given OS version.
AC_ARG_WITH([macosx-version-max], [AS_HELP_STRING([--with-macosx-version-max],
[error on use of newer functionality. @<:@macosx@:>@])],
[
Expand Down
10 changes: 9 additions & 1 deletion make/autoconf/hotspot.m4
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 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 @@ -274,6 +274,14 @@ AC_DEFUN_ONCE([HOTSPOT_ENABLE_DISABLE_CDS],
fi
fi
# Disable CDS on macos-aarch64
if test "x$OPENJDK_TARGET_OS" = "xmacosx" && test "x$OPENJDK_TARGET_CPU" = "xaarch64"; then
ENABLE_CDS="false"
if test "x$enable_cds" = "xyes"; then
AC_MSG_ERROR([CDS is currently not supported on macOS/aarch64. Remove --enable-cds.])
fi
fi
AC_SUBST(ENABLE_CDS)
])

Expand Down
2 changes: 1 addition & 1 deletion make/common/NativeCompilation.gmk
Expand Up @@ -1213,7 +1213,7 @@ define SetupNativeCompilationBody
# This only works if the openjdk_codesign identity is present on the system. Let
# silently fail otherwise.
ifneq ($(CODESIGN), )
$(CODESIGN) -s "$(MACOSX_CODESIGN_IDENTITY)" --timestamp --options runtime \
$(CODESIGN) -f -s "$(MACOSX_CODESIGN_IDENTITY)" --timestamp --options runtime \
--entitlements $$(call GetEntitlementsFile, $$@) $$@
endif
endif
Expand Down
5 changes: 4 additions & 1 deletion make/hotspot/gensrc/GensrcAdlc.gmk
@@ -1,5 +1,5 @@
#
# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013, 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 @@ -99,6 +99,9 @@ ifeq ($(call check-jvm-feature, compiler2), true)
ADLCFLAGS += -DAIX=1
else ifeq ($(OPENJDK_TARGET_OS), macosx)
ADLCFLAGS += -D_ALLBSD_SOURCE=1 -D_GNU_SOURCE=1
ifeq ($(HOTSPOT_TARGET_CPU_ARCH), aarch64)
ADLCFLAGS += -DR18_RESERVED
endif
else ifeq ($(OPENJDK_TARGET_OS), windows)
ifeq ($(call isTargetCpuBits, 64), true)
ADLCFLAGS += -D_WIN64=1
Expand Down
2 changes: 1 addition & 1 deletion make/lib/Awt2dLibraries.gmk
Expand Up @@ -562,7 +562,7 @@ else
maybe-uninitialized class-memaccess
HARFBUZZ_DISABLED_WARNINGS_clang := unused-value incompatible-pointer-types \
tautological-constant-out-of-range-compare int-to-pointer-cast \
undef missing-field-initializers
undef missing-field-initializers deprecated-declarations c++11-narrowing
HARFBUZZ_DISABLED_WARNINGS_microsoft := 4267 4244 4090 4146 4334 4819 4101 4068 4805 4138
HARFBUZZ_DISABLED_WARNINGS_C_solstudio := \
E_INTEGER_OVERFLOW_DETECTED \
Expand Down
2 changes: 1 addition & 1 deletion make/lib/Lib-jdk.hotspot.agent.gmk
Expand Up @@ -36,7 +36,7 @@ else ifeq ($(OPENJDK_TARGET_OS), solaris)
SA_LDFLAGS := -mt

else ifeq ($(OPENJDK_TARGET_OS), macosx)
SA_CFLAGS := -Damd64 -D_GNU_SOURCE -mno-omit-leaf-frame-pointer \
SA_CFLAGS := -D_GNU_SOURCE -mno-omit-leaf-frame-pointer \
-mstack-alignment=16 -fPIC
LIBSA_EXTRA_SRC := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent
else ifeq ($(OPENJDK_TARGET_OS), windows)
Expand Down
4 changes: 3 additions & 1 deletion src/java.base/macosx/native/libjli/java_md_macosx.c
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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 @@ -216,6 +216,8 @@ static InvocationFunctions *GetExportedJNIFunctions() {
preferredJVM = "client";
#elif defined(__aarch64__) || defined(__x86_64__)
preferredJVM = "server";
#elif defined(__aarch64__)
preferredJVM = "server";
#else
#error "Unknown architecture - needs definition"
#endif
Expand Down
22 changes: 19 additions & 3 deletions src/java.base/share/classes/java/text/SimpleDateFormat.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2019, 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 @@ -1189,7 +1189,7 @@ private void subFormat(int patternCharIndex, int count,
}
break;

case PATTERN_MONTH: // 'M' (context seinsive)
case PATTERN_MONTH: // 'M' (context sensitive)
if (useDateFormatSymbols) {
String[] months;
if (count >= 4) {
Expand Down Expand Up @@ -2033,7 +2033,7 @@ private int subParse(String text, int start, int patternCharIndex, int count,
return index;
}
} else {
Map<String, Integer> map = getDisplayNamesMap(field, locale);
Map<String, Integer> map = getDisplayContextNamesMap(field, locale);
if ((index = matchString(text, start, field, map, calb)) > 0) {
return index;
}
Expand Down Expand Up @@ -2449,6 +2449,22 @@ private Map<String, Integer> getDisplayNamesMap(int field, Locale locale) {
return map;
}

/**
* Obtains display names map, taking the context into account. Currently only
* the month name pattern 'M' is context dependent.
*/
private Map<String, Integer> getDisplayContextNamesMap(int field, Locale locale) {
Map<String, Integer> map = calendar.getDisplayNames(field,
forceStandaloneForm ? Calendar.SHORT_STANDALONE : Calendar.SHORT_FORMAT, locale);
// Get the LONG style
Map<String, Integer> m = calendar.getDisplayNames(field,
forceStandaloneForm ? Calendar.LONG_STANDALONE : Calendar.LONG_FORMAT, locale);
if (m != null) {
map.putAll(m);
}
return map;
}

/**
* After reading an object from the input stream, the format
* pattern in the object is verified.
Expand Down
18 changes: 8 additions & 10 deletions src/java.base/windows/native/libnet/DefaultProxySelector.c
Expand Up @@ -104,7 +104,6 @@ static int createProxyList(LPWSTR win_proxy, const WCHAR *pproto, list_item **he
int nr_elems = 0;
wchar_t *context = NULL;
wchar_t *current_proxy = NULL;
BOOL error = FALSE;

/*
* The proxy server list contains one or more of the following strings
Expand All @@ -116,7 +115,6 @@ static int createProxyList(LPWSTR win_proxy, const WCHAR *pproto, list_item **he
LPWSTR pport;
LPWSTR phost;
int portVal = 0;
wchar_t *next_proxy = NULL;
list_item *proxy = NULL;
wchar_t* pos = NULL;

Expand Down Expand Up @@ -290,7 +288,6 @@ Java_sun_net_spi_DefaultProxySelector_getSystemProxies(JNIEnv *env,
}

if (win_proxy != NULL) {
wchar_t *context = NULL;
int defport = 0;
int nr_elems = 0;

Expand All @@ -314,27 +311,28 @@ Java_sun_net_spi_DefaultProxySelector_getSystemProxies(JNIEnv *env,
nr_elems = createProxyList(win_proxy, lpProto, &head);
if (nr_elems != 0 && head != NULL) {
int index = 0;
list_item *current = head;
proxy_array = (*env)->NewObjectArray(env, nr_elems, proxy_class, NULL);
if (proxy_array == NULL || (*env)->ExceptionCheck(env)) {
goto noproxy;
}
while (head != NULL && index < nr_elems) {
while (current != NULL && index < nr_elems) {
jstring jhost;
jobject isa;
jobject proxy;

if (head->host != NULL && proxy_array != NULL) {
if (current->host != NULL && proxy_array != NULL) {
/* Let's create the appropriate Proxy object then. */
if (head->port == 0) {
head->port = defport;
if (current->port == 0) {
current->port = defport;
}
jhost = (*env)->NewString(env, head->host, (jsize)wcslen(head->host));
jhost = (*env)->NewString(env, current->host, (jsize)wcslen(current->host));
if (jhost == NULL || (*env)->ExceptionCheck(env)) {
proxy_array = NULL;
}
isa = (*env)->CallStaticObjectMethod(env, isaddr_class,
isaddr_createUnresolvedID, jhost,
head->port);
current->port);
if (isa == NULL || (*env)->ExceptionCheck(env)) {
proxy_array = NULL;
}
Expand All @@ -348,7 +346,7 @@ Java_sun_net_spi_DefaultProxySelector_getSystemProxies(JNIEnv *env,
}
index++;
}
head = head->next;
current = current->next;
}
}
}
Expand Down
8 changes: 5 additions & 3 deletions src/java.security.jgss/share/native/libj2gss/gssapi.h
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 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 @@ -43,7 +43,9 @@
extern "C" {
#endif /* __cplusplus */

#if TARGET_OS_MAC
// Condition was copied from
// Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/gssapi/gssapi.h
#if TARGET_OS_MAC && (defined(__ppc__) || defined(__ppc64__) || defined(__i386__) || defined(__x86_64__))
# pragma pack(push,2)
#endif

Expand Down Expand Up @@ -695,7 +697,7 @@ GSS_DLLIMP OM_uint32 gss_canonicalize_name(
gss_name_t * /* output_name */
);

#if TARGET_OS_MAC
#if TARGET_OS_MAC && (defined(__ppc__) || defined(__ppc64__) || defined(__i386__) || defined(__x86_64__))
# pragma pack(pop)
#endif

Expand Down
Expand Up @@ -1209,7 +1209,9 @@ public void visitLambda(JCLambda tree) {
.methodParameter(tree, i, param.vartype.pos);
push(param);
try {
separateAnnotationsKinds(param.vartype, param.sym.type, param.sym, pos);
if (!param.declaredUsingVar()) {
separateAnnotationsKinds(param.vartype, param.sym.type, param.sym, pos);
}
} finally {
pop();
}
Expand Down Expand Up @@ -1247,7 +1249,7 @@ public void visitVarDef(final JCVariableDecl tree) {
final TypeAnnotationPosition pos =
TypeAnnotationPosition.localVariable(currentLambda,
tree.pos);
if (!tree.isImplicitlyTyped()) {
if (!tree.declaredUsingVar()) {
separateAnnotationsKinds(tree.vartype, tree.sym.type, tree.sym, pos);
}
} else if (tree.sym.getKind() == ElementKind.EXCEPTION_PARAMETER) {
Expand Down
Expand Up @@ -3054,6 +3054,7 @@ JCVariableDecl variableDeclarator(JCModifiers mods, JCExpression type, boolean r
*/
JCVariableDecl variableDeclaratorRest(int pos, JCModifiers mods, JCExpression type, Name name,
boolean reqInit, Comment dc, boolean localDecl, boolean compound) {
boolean declaredUsingVar = false;
type = bracketsOpt(type);
JCExpression init = null;
if (token.kind == EQ) {
Expand All @@ -3073,6 +3074,7 @@ JCVariableDecl variableDeclaratorRest(int pos, JCModifiers mods, JCExpression ty
//error - 'var' and arrays
reportSyntaxError(pos, Errors.VarNotAllowedArray);
} else {
declaredUsingVar = true;
startPos = TreeInfo.getStartPos(mods);
if (startPos == Position.NOPOS)
startPos = TreeInfo.getStartPos(type);
Expand All @@ -3082,7 +3084,7 @@ JCVariableDecl variableDeclaratorRest(int pos, JCModifiers mods, JCExpression ty
}
}
JCVariableDecl result =
toP(F.at(pos).VarDef(mods, name, type, init));
toP(F.at(pos).VarDef(mods, name, type, init, declaredUsingVar));
attach(result, dc);
result.startPos = startPos;
return result;
Expand Down Expand Up @@ -3162,7 +3164,8 @@ JCVariableDecl variableDeclaratorId(JCModifiers mods, JCExpression type, boolean
log.error(token.pos, Errors.VarargsAndOldArraySyntax);
}
type = bracketsOpt(type);
return toP(F.at(pos).VarDef(mods, name, type, null));
return toP(F.at(pos).VarDef(mods, name, type, null,
type != null && type.hasTag(IDENT) && ((JCIdent)type).name == names.var));
}

/** Resources = Resource { ";" Resources }
Expand Down
Expand Up @@ -922,23 +922,35 @@ public static class JCVariableDecl extends JCStatement implements VariableTree {
public VarSymbol sym;
/** explicit start pos */
public int startPos = Position.NOPOS;
/** declared using `var` */
private boolean declaredUsingVar;

protected JCVariableDecl(JCModifiers mods,
Name name,
JCExpression vartype,
JCExpression init,
VarSymbol sym) {
this(mods, name, vartype, init, sym, false);
}

protected JCVariableDecl(JCModifiers mods,
Name name,
JCExpression vartype,
JCExpression init,
VarSymbol sym,
boolean declaredUsingVar) {
this.mods = mods;
this.name = name;
this.vartype = vartype;
this.init = init;
this.sym = sym;
this.declaredUsingVar = declaredUsingVar;
}

protected JCVariableDecl(JCModifiers mods,
JCExpression nameexpr,
JCExpression vartype) {
this(mods, null, vartype, null, null);
this(mods, null, vartype, null, null, false);
this.nameexpr = nameexpr;
if (nameexpr.hasTag(Tag.IDENT)) {
this.name = ((JCIdent)nameexpr).name;
Expand All @@ -952,6 +964,10 @@ public boolean isImplicitlyTyped() {
return vartype == null;
}

public boolean declaredUsingVar() {
return declaredUsingVar;
}

@Override
public void accept(Visitor v) { v.visitVarDef(this); }

Expand Down
Expand Up @@ -215,6 +215,12 @@ public JCVariableDecl VarDef(JCModifiers mods, Name name, JCExpression vartype,
return tree;
}

public JCVariableDecl VarDef(JCModifiers mods, Name name, JCExpression vartype, JCExpression init, boolean declaredUsingVar) {
JCVariableDecl tree = new JCVariableDecl(mods, name, vartype, init, null, declaredUsingVar);
tree.pos = pos;
return tree;
}

public JCVariableDecl ReceiverVarDef(JCModifiers mods, JCExpression name, JCExpression vartype) {
JCVariableDecl tree = new JCVariableDecl(mods, name, vartype);
tree.pos = pos;
Expand Down

0 comments on commit 78b229e

Please sign in to comment.