Skip to content
This repository has been archived by the owner on Dec 13, 2024. It is now read-only.

Commit

Permalink
Merge master HEAD into openj9-staging
Browse files Browse the repository at this point in the history
Signed-off-by: J9 Build <j9build@ca.ibm.com>
  • Loading branch information
j9build committed Jun 9, 2022
2 parents 4cb7483 + fc2399d commit a94388c
Show file tree
Hide file tree
Showing 57 changed files with 1,298 additions and 852 deletions.
19 changes: 18 additions & 1 deletion make/jdk/src/classes/build/tools/classlist/HelloClasslist.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,12 @@ public static void main(String ... args) throws Throwable {
String CSCSC = "string" + s + "string" + s + "string";
String SCSCS = s + "string" + s + "string" + s;
String SSCSS = s + s + "string" + s + s;
String SSSSS = s + s + s + s + s;
String S5 = s + s + s + s + s;
String S6 = s + s + s + s + s + s;
String S7 = s + s + s + s + s + s + s;
String S8 = s + s + s + s + s + s + s + s;
String S9 = s + s + s + s + s + s + s + s + s;
String S10 = s + s + s + s + s + s + s + s + s + s;

String CI = "string" + i;
String IC = i + "string";
Expand All @@ -100,6 +105,16 @@ public static void main(String ... args) throws Throwable {
String CIC = "string" + i + "string";
String CICI = "string" + i + "string" + i;

float f = 0.1f;
String CF = "string" + f;
String CFS = "string" + f + s;
String CSCF = "string" + s + "string" + f;

char c = 'a';
String CC = "string" + c;
String CCS = "string" + c + s;
String CSCC = "string" + s + "string" + c;

long l = System.currentTimeMillis();
String CJ = "string" + l;
String JC = l + "string";
Expand All @@ -108,6 +123,8 @@ public static void main(String ... args) throws Throwable {
String CJCJC = "string" + l + "string" + l + "string";
double d = i / 2.0;
String CD = "string" + d;
String CDS = "string" + d + s;
String CSCD = "string" + s + "string" + d;

String newDate = DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(
LocalDateTime.now(ZoneId.of("GMT")));
Expand Down
10 changes: 8 additions & 2 deletions make/modules/jdk.jdi/Lib.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2022, 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 @@ -29,10 +29,16 @@ include LibCommon.gmk

ifeq ($(call isTargetOs, windows), true)

CFLAGS_LIBDT_SHMEM := $(CFLAGS_JDKLIB)

ifneq ($(HOTSPOT_BUILD_TIME), )
CFLAGS_LIBDT_SHMEM += -DSHMEM_BUILD_TIME='"$(HOTSPOT_BUILD_TIME)"'
endif

$(eval $(call SetupJdkLibrary, BUILD_LIBDT_SHMEM, \
NAME := dt_shmem, \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB), \
CFLAGS := $(CFLAGS_LIBDT_SHMEM), \
EXTRA_HEADER_DIRS := \
jdk.jdwp.agent:include \
jdk.jdwp.agent:libjdwp/export, \
Expand Down
9 changes: 8 additions & 1 deletion src/java.base/share/classes/java/lang/Class.java
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,11 @@ static String typeVarBounds(TypeVariable<?> typeVar) {
* A call to {@code forName("X")} causes the class named
* {@code X} to be initialized.
*
* <p>
* In cases where this method is called from a context where there is no
* caller frame on the stack (e.g. when called directly from a JNI
* attached thread), the system class loader is used.
*
* @param className the fully qualified name of the desired class.
* @return the {@code Class} object for the class with the
* specified name.
Expand All @@ -380,7 +385,9 @@ public static Class<?> forName(String className)
@CallerSensitiveAdapter
private static Class<?> forName(String className, Class<?> caller)
throws ClassNotFoundException {
return forName0(className, true, ClassLoader.getClassLoader(caller), caller);
ClassLoader loader = (caller == null) ? ClassLoader.getSystemClassLoader()
: ClassLoader.getClassLoader(caller);
return forName0(className, true, loader, caller);
}

/**
Expand Down
10 changes: 5 additions & 5 deletions src/java.base/share/classes/java/lang/InterruptedException.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2022, 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 @@ -32,10 +32,10 @@
* thread has been interrupted, and if so, to immediately throw
* this exception. The following code can be used to achieve
* this effect:
* <pre>
* if (Thread.interrupted()) // Clears interrupted status!
* throw new InterruptedException();
* </pre>
* {@snippet lang=java :
* if (Thread.interrupted()) // Clears interrupted status!
* throw new InterruptedException();
* }
*
* @author Frank Yellin
* @see java.lang.Object#wait()
Expand Down
7 changes: 2 additions & 5 deletions src/java.base/share/classes/java/lang/String.java
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,8 @@ private static byte[] encodeWithEncoder(Charset cs, byte coder, byte[] val, bool
CharsetEncoder ce = cs.newEncoder();
int len = val.length >> coder; // assume LATIN1=0/UTF16=1;
int en = scale(len, ce.maxBytesPerChar());
if (ce instanceof ArrayEncoder ae) {
// fastpath with ArrayEncoder implies `doReplace`.
if (doReplace && ce instanceof ArrayEncoder ae) {
// fastpath for ascii compatible
if (coder == LATIN1 &&
ae.isASCIICompatible() &&
Expand All @@ -1034,10 +1035,6 @@ private static byte[] encodeWithEncoder(Charset cs, byte coder, byte[] val, bool
if (len == 0) {
return ba;
}
if (doReplace) {
ce.onMalformedInput(CodingErrorAction.REPLACE)
.onUnmappableCharacter(CodingErrorAction.REPLACE);
}

int blen = (coder == LATIN1) ? ae.encodeFromLatin1(val, 0, len, ba)
: ae.encodeFromUTF16(val, 0, len, ba);
Expand Down
6 changes: 3 additions & 3 deletions src/java.base/share/classes/java/lang/foreign/Linker.java
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ static Linker nativeLinker() {
*
* @param symbol the address of the target function.
* @param function the function descriptor of the target function.
* @return a downcall method handle. The method handle type is <a href="CLinker.html#downcall-method-handles"><em>inferred</em></a>
* @return a downcall method handle. The method handle type is <a href="Linker.html#downcall-method-handles"><em>inferred</em></a>
* @throws IllegalArgumentException if the provided function descriptor is not supported by this linker.
* or if the symbol is {@link MemoryAddress#NULL}
*/
Expand All @@ -235,7 +235,7 @@ default MethodHandle downcallHandle(Addressable symbol, FunctionDescriptor funct
* associated with the {@link MemoryAddress#NULL} address, or a {@link NullPointerException} if that parameter is {@code null}.
*
* @param function the function descriptor of the target function.
* @return a downcall method handle. The method handle type is <a href="CLinker.html#downcall-method-handles"><em>inferred</em></a>
* @return a downcall method handle. The method handle type is <a href="Linker.html#downcall-method-handles"><em>inferred</em></a>
* from the provided function descriptor.
* @throws IllegalArgumentException if the provided function descriptor is not supported by this linker.
*/
Expand All @@ -261,7 +261,7 @@ default MethodHandle downcallHandle(Addressable symbol, FunctionDescriptor funct
* @return a zero-length segment whose base address is the address of the upcall stub.
* @throws IllegalArgumentException if the provided function descriptor is not supported by this linker.
* @throws IllegalArgumentException if it is determined that the target method handle can throw an exception, or if the target method handle
* has a type that does not match the upcall stub <a href="CLinker.html#upcall-stubs"><em>inferred type</em></a>.
* has a type that does not match the upcall stub <a href="Linker.html#upcall-stubs"><em>inferred type</em></a>.
* @throws IllegalStateException if {@code session} is not {@linkplain MemorySession#isAlive() alive}.
* @throws WrongThreadException if this method is called from a thread other than the thread
* {@linkplain MemorySession#ownerThread() owning} {@code session}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
* FunctionDescriptor intCompareDescriptor = FunctionDescriptor.of(ValueLayout.JAVA_INT, ValueLayout.ADDRESS, ValueLayout.ADDRESS);
* MethodHandle intCompareHandle = MethodHandles.lookup().findStatic(IntComparator.class,
* "intCompare",
* CLinker.upcallType(comparFunction));
* Linker.upcallType(comparFunction));
* }
*
* As before, we need to create a {@link java.lang.foreign.FunctionDescriptor} instance, this time describing the signature
Expand All @@ -199,7 +199,7 @@
*
* {@snippet lang=java :
* MemorySession session = ...
* Addressable comparFunc = CLinker.nativeLinker().upcallStub(
* Addressable comparFunc = Linker.nativeLinker().upcallStub(
* intCompareHandle, intCompareDescriptor, session);
* );
* }
Expand Down
7 changes: 1 addition & 6 deletions src/java.base/share/classes/java/lang/invoke/LambdaForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,8 @@ static BasicType basicType(char type) {
default -> throw newInternalError("Unknown type char: '" + type + "'");
};
}
static BasicType basicType(Wrapper type) {
char c = type.basicTypeChar();
return basicType(c);
}
static BasicType basicType(Class<?> type) {
if (!type.isPrimitive()) return L_TYPE;
return basicType(Wrapper.forPrimitiveType(type));
return basicType(Wrapper.basicTypeChar(type));
}
static int[] basicTypeOrds(BasicType[] types) {
if (types == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ static MethodHandle throwException(MethodType type) {
int arity = type.parameterCount();
if (arity > 1) {
MethodHandle mh = throwException(type.dropParameterTypes(1, arity));
mh = MethodHandles.dropArguments(mh, 1, Arrays.copyOfRange(type.parameterArray(), 1, arity));
mh = MethodHandles.dropArgumentsTrusted(mh, 1, Arrays.copyOfRange(type.ptypes(), 1, arity));
return mh;
}
return makePairwiseConvert(getFunction(NF_throwException).resolvedHandle(), type, false, true);
Expand Down Expand Up @@ -1947,7 +1947,7 @@ static Object iterateNext(Iterator<?> it) {
*
* @return a handle on the constructed {@code try-finally} block.
*/
static MethodHandle makeTryFinally(MethodHandle target, MethodHandle cleanup, Class<?> rtype, List<Class<?>> argTypes) {
static MethodHandle makeTryFinally(MethodHandle target, MethodHandle cleanup, Class<?> rtype, Class<?>[] argTypes) {
MethodType type = MethodType.methodType(rtype, argTypes);
LambdaForm form = makeTryFinallyForm(type.basicType());

Expand Down
Loading

0 comments on commit a94388c

Please sign in to comment.