Skip to content

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 Aug 29, 2023
2 parents 837c6b0 + 059be99 commit cf2025f
Show file tree
Hide file tree
Showing 34 changed files with 964 additions and 441 deletions.
6 changes: 3 additions & 3 deletions .github/actions/get-bootjdk/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2022, 2023, 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 @@ -104,6 +104,6 @@ runs:
- name: 'Export path to where BootJDK is installed'
id: path-name
run: |
# Export the path
echo 'path=bootjdk/jdk' >> $GITHUB_OUTPUT
# Export the absolute path
echo "path=`pwd`/bootjdk/jdk" >> $GITHUB_OUTPUT
shell: bash
5 changes: 4 additions & 1 deletion make/autoconf/build-performance.m4
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,11 @@ AC_DEFUN([BPERF_SETUP_CCACHE_USAGE],
fi
fi
# The CCACHE_BASEDIR needs to end with '/' as ccache will otherwise think
# directories next to it, that have the base dir name as a prefix, are sub
# directories of CCACHE_BASEDIR.
CCACHE="CCACHE_COMPRESS=1 $SET_CCACHE_DIR \
CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS CCACHE_BASEDIR=$TOPDIR $CCACHE"
CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS CCACHE_BASEDIR=$WORKSPACE_ROOT/ $CCACHE"
if test "x$SET_CCACHE_DIR" != x; then
mkdir -p $CCACHE_DIR > /dev/null 2>&1
Expand Down
6 changes: 4 additions & 2 deletions make/autoconf/platform.m4
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,6 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER],
HOTSPOT_$1_CPU_DEFINE=PPC64
elif test "x$OPENJDK_$1_CPU" = xppc64le; then
HOTSPOT_$1_CPU_DEFINE=PPC64
elif test "x$OPENJDK_$1_CPU" = xriscv32; then
HOTSPOT_$1_CPU_DEFINE=RISCV32
elif test "x$OPENJDK_$1_CPU" = xriscv64; then
HOTSPOT_$1_CPU_DEFINE=RISCV64
Expand All @@ -577,10 +575,14 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER],
HOTSPOT_$1_CPU_DEFINE=SPARC
elif test "x$OPENJDK_$1_CPU" = xppc; then
HOTSPOT_$1_CPU_DEFINE=PPC32
elif test "x$OPENJDK_$1_CPU" = xriscv32; then
HOTSPOT_$1_CPU_DEFINE=RISCV32
elif test "x$OPENJDK_$1_CPU" = xs390; then
HOTSPOT_$1_CPU_DEFINE=S390
elif test "x$OPENJDK_$1_CPU" = xs390x; then
HOTSPOT_$1_CPU_DEFINE=S390
elif test "x$OPENJDK_$1_CPU" = xloongarch64; then
HOTSPOT_$1_CPU_DEFINE=LOONGARCH64
elif test "x$OPENJDK_$1_CPU" != x; then
HOTSPOT_$1_CPU_DEFINE=$(echo $OPENJDK_$1_CPU | tr a-z A-Z)
fi
Expand Down
7 changes: 5 additions & 2 deletions make/common/NativeCompilation.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,12 @@ endif
# object files while CCACHE_BASEDIR will make ccache relativize all paths for
# its compiler. The compiler then produces relative dependency files.
# make does not know a relative and absolute filename is the same so it will
# ignore such dependencies.
# ignore such dependencies. This only applies when the OUTPUTDIR is inside
# the WORKSPACE_ROOT.
ifneq ($(CCACHE), )
REWRITE_PATHS_RELATIVE = true
ifneq ($(filter $(WORKSPACE_ROOT)/%, $(OUTPUTDIR)), )
REWRITE_PATHS_RELATIVE = true
endif
endif

ifeq ($(REWRITE_PATHS_RELATIVE), true)
Expand Down
4 changes: 2 additions & 2 deletions make/jdk/src/classes/build/tools/taglet/Incubating.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2023, 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 @@ -52,7 +52,7 @@ public boolean isInlineTag() {

@Override
public String getName() {
return "Incubating";
return "incubating";
}

private static final String MESSAGE =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public interface Element extends AnnotatedConstruct {
* @see TypeElement#asType
* @see TypeParameterElement#asType
* @see VariableElement#asType
* @see RecordComponentElement#asType
*/
TypeMirror asType();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2023, 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 All @@ -25,13 +25,28 @@

package javax.lang.model.element;

import javax.lang.model.type.TypeMirror;
import javax.lang.model.type.TypeKind;

/**
* Represents a record component.
*
* @jls 8.10.1 Record Components
* @since 16
*/
public interface RecordComponentElement extends Element {
/**
* {@return the type of this record component}
*
* Note that the types of record components range over {@linkplain
* TypeKind many kinds} of types, including primitive types,
* declared types, and array types.
*
* @see TypeKind
*/
@Override
TypeMirror asType();

/**
* {@return the enclosing element of this record component}
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,44 @@ public void setVisible(boolean visible) {
execute(CPlatformWindow::nativeSetNSWindowLocationByPlatform);
}

// Manage the extended state when showing
if (visible) {
/* Frame or Dialog should be set property WINDOW_FULLSCREENABLE to true if the
Frame or Dialog is resizable.
*/
final boolean resizable = (target instanceof Frame) ? ((Frame)target).isResizable() :
((target instanceof Dialog) ? ((Dialog)target).isResizable() : false);
if (resizable) {
setCanFullscreen(true);
}

// Apply the extended state as expected in shared code
if (target instanceof Frame) {
if (!wasMaximized && isMaximized()) {
// setVisible could have changed the native maximized state
deliverZoom(true);
} else {
int frameState = ((Frame)target).getExtendedState();
if ((frameState & Frame.ICONIFIED) != 0) {
// Treat all state bit masks with ICONIFIED bit as ICONIFIED state.
frameState = Frame.ICONIFIED;
}

switch (frameState) {
case Frame.ICONIFIED:
execute(CWrapper.NSWindow::miniaturize);
break;
case Frame.MAXIMIZED_BOTH:
maximize();
break;
default: // NORMAL
unmaximize(); // in case it was maximized, otherwise this is a no-op
break;
}
}
}
}

// Actually show or hide the window
LWWindowPeer blocker = (peer == null)? null : peer.getBlocker();
if (blocker == null || !visible) {
Expand Down Expand Up @@ -727,44 +765,6 @@ public void setVisible(boolean visible) {
}
this.visible = visible;

// Manage the extended state when showing
if (visible) {
/* Frame or Dialog should be set property WINDOW_FULLSCREENABLE to true if the
Frame or Dialog is resizable.
**/
final boolean resizable = (target instanceof Frame) ? ((Frame)target).isResizable() :
((target instanceof Dialog) ? ((Dialog)target).isResizable() : false);
if (resizable) {
setCanFullscreen(true);
}

// Apply the extended state as expected in shared code
if (target instanceof Frame) {
if (!wasMaximized && isMaximized()) {
// setVisible could have changed the native maximized state
deliverZoom(true);
} else {
int frameState = ((Frame)target).getExtendedState();
if ((frameState & Frame.ICONIFIED) != 0) {
// Treat all state bit masks with ICONIFIED bit as ICONIFIED state.
frameState = Frame.ICONIFIED;
}

switch (frameState) {
case Frame.ICONIFIED:
execute(CWrapper.NSWindow::miniaturize);
break;
case Frame.MAXIMIZED_BOTH:
maximize();
break;
default: // NORMAL
unmaximize(); // in case it was maximized, otherwise this is a no-op
break;
}
}
}
}

nativeSynthesizeMouseEnteredExitedEvents();

// Configure stuff #2
Expand Down Expand Up @@ -1023,7 +1023,6 @@ public void setWindowState(int windowState) {
// let's return into the normal states first
execute(CWrapper.NSWindow::deminiaturize);
waitForWindowState(Frame.NORMAL);

}
maximize();
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5192,7 +5192,7 @@ public void assembleClassSig(Type type) {
append(rawOuter ? '$' : '.');
Assert.check(c.flatname.startsWith(c.owner.enclClass().flatname));
append(rawOuter
? c.flatname.subName(c.owner.enclClass().flatname.getByteLength() + 1, c.flatname.getByteLength())
? c.flatname.subName(c.owner.enclClass().flatname.length() + 1)
: c.name);
} else {
append(externalize(c.flatname));
Expand Down
10 changes: 5 additions & 5 deletions src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public class Gen extends JCTree.Visitor {
private final TreeMaker make;
private final Names names;
private final Target target;
private final Name accessDollar;
private final String accessDollar;
private final Types types;
private final Lower lower;
private final Annotate annotate;
Expand Down Expand Up @@ -112,8 +112,7 @@ protected Gen(Context context) {
concat = StringConcat.instance(context);

methodType = new MethodType(null, null, null, syms.methodClass);
accessDollar = names.
fromString("access" + target.syntheticNameChar());
accessDollar = "access" + target.syntheticNameChar();
lower = Lower.instance(context);

Options options = Options.instance(context);
Expand Down Expand Up @@ -341,9 +340,10 @@ private boolean isAccessSuper(JCMethodDecl enclMethod) {
/** Does given name start with "access$" and end in an odd digit?
*/
private boolean isOddAccessName(Name name) {
final String string = name.toString();
return
name.startsWith(accessDollar) &&
(name.getByteAt(name.getByteLength() - 1) & 1) == 1;
string.startsWith(accessDollar) &&
(string.charAt(string.length() - 1) & 1) != 0;
}

/* ************************************************************************
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import com.sun.tools.javac.util.ByteBuffer;
import com.sun.tools.javac.util.ByteBuffer.UnderflowException;
import com.sun.tools.javac.util.Convert;
import com.sun.tools.javac.util.Name.NameMapper;

import java.io.IOException;
import java.io.InputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,13 @@ public void appendDouble(double x) {
}
}

/** Append a name.
/** Append a name encoded in Modified UTF-8.
*/
public void appendName(Name name) {
appendBytes(name.getByteArray(), name.getByteOffset(), name.getByteLength());
int utf8len = name.getUtf8Length();
elems = ArrayUtils.ensureCapacity(elems, length + utf8len);
name.getUtf8Bytes(elems, length);
length += utf8len;
}

/** Append the content of the given input stream.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,24 @@ public static String utf2string(byte[] src, int sindex, int len, Validation vali
return new String(dst, 0, len1);
}

/** Count the number of characters encoded in a Modified UTF-8 encoding.
* This method does not check for invalid data.
* @param buf data buffer
* @param off starting offset of UTF-8 data
* @param len number of bytes of UTF-8 data
* @return the number of encoded characters
*/
public static int utfNumChars(byte[] buf, int off, int len) {
int numChars = 0;
while (len-- > 0) {
int byte1 = buf[off++];
if (byte1 < 0)
len -= ((byte1 & 0xe0) == 0xc0) ? 1 : 2;
numChars++;
}
return numChars;
}

/** Copy characters in source array to bytes in target array,
* converting them to Utf8 representation.
* The target array must be large enough to hold the result.
Expand Down Expand Up @@ -346,17 +364,14 @@ public static String escapeUnicode(String s) {

/* Conversion routines for qualified name splitting
*/

/** Return the last part of a qualified name.
* @param name the qualified name
* @return the last part of the qualified name
*/
public static Name shortName(Name name) {
int start = name.lastIndexOf((byte)'.') + 1;
int end = name.getByteLength();
if (start == 0 && end == name.length()) {
return name;
}
return name.subName(start, end);
int start = name.lastIndexOfAscii('.') + 1;
return start > 0 ? name.subName(start) : name;
}

/** Return the last part of a qualified name from its string representation
Expand All @@ -371,7 +386,8 @@ public static String shortName(String name) {
* "" if not existent.
*/
public static Name packagePart(Name classname) {
return classname.subName(0, classname.lastIndexOf((byte)'.'));
int end = Math.max(classname.lastIndexOfAscii('.'), 0);
return classname.subName(0, end);
}

public static String packagePart(String classname) {
Expand All @@ -382,7 +398,7 @@ public static String packagePart(String classname) {
public static List<Name> enclosingCandidates(Name name) {
List<Name> names = List.nil();
int index;
while ((index = name.lastIndexOf((byte)'$')) > 0) {
while ((index = name.lastIndexOfAscii('$')) > 0) {
name = name.subName(0, index);
names = names.prepend(name);
}
Expand Down
Loading

0 comments on commit cf2025f

Please sign in to comment.