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 3, 2023
2 parents 56536ff + 9e7980c commit de66741
Show file tree
Hide file tree
Showing 77 changed files with 966 additions and 861 deletions.
4 changes: 4 additions & 0 deletions make/modules/java.desktop/lib/Awt2dLibraries.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ ifeq ($(call isTargetOs, windows macosx), false)
DISABLED_WARNINGS_gcc_gtk3_interface.c := parentheses type-limits unused-function, \
DISABLED_WARNINGS_gcc_OGLBufImgOps.c := format-nonliteral, \
DISABLED_WARNINGS_gcc_OGLPaints.c := format-nonliteral, \
DISABLED_WARNINGS_gcc_screencast_pipewire.c := undef, \
DISABLED_WARNINGS_gcc_screencast_portal.c := undef, \
DISABLED_WARNINGS_gcc_sun_awt_X11_GtkFileDialogPeer.c := parentheses, \
DISABLED_WARNINGS_gcc_X11SurfaceData.c := implicit-fallthrough pointer-to-int-cast, \
DISABLED_WARNINGS_gcc_XlibWrapper.c := type-limits pointer-to-int-cast, \
Expand Down Expand Up @@ -446,6 +448,7 @@ else
LIBFREETYPE_LIBS := -lfreetype
endif

# gcc_ftobjs.c := maybe-uninitialized required for GCC 7 builds.
$(eval $(call SetupJdkLibrary, BUILD_LIBFREETYPE, \
NAME := freetype, \
OPTIMIZATION := HIGHEST, \
Expand All @@ -454,6 +457,7 @@ else
EXTRA_HEADER_DIRS := $(BUILD_LIBFREETYPE_HEADER_DIRS), \
DISABLED_WARNINGS_microsoft := 4267 4244 4996, \
DISABLED_WARNINGS_gcc := dangling-pointer stringop-overflow, \
DISABLED_WARNINGS_gcc_ftobjs.c := maybe-uninitialized, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
))
Expand Down
18 changes: 17 additions & 1 deletion src/java.base/share/native/libjli/java.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ static jboolean _is_java_args = JNI_FALSE;
static jboolean _have_classpath = JNI_FALSE;
static const char *_fVersion;
static jboolean _wc_enabled = JNI_FALSE;
static jboolean dumpSharedSpaces = JNI_FALSE; /* -Xshare:dump */

/*
* Entries for splash screen environment variables.
Expand Down Expand Up @@ -461,6 +462,14 @@ JavaMain(void* _args)
LEAVE();
}

/*
* -Xshare:dump does not have a main class so the VM can safely exit now
*/
if (dumpSharedSpaces) {
CHECK_EXCEPTION_LEAVE(1);
LEAVE();
}

/* If the user specified neither a class name nor a JAR file */
if (printXUsage || printUsage || what == 0 || mode == LM_UNKNOWN) {
PrintUsage(env, printXUsage);
Expand Down Expand Up @@ -1442,6 +1451,13 @@ ParseArguments(int *pargc, char ***pargv,
}
AddOption(arg, NULL);
}

/*
* Check for CDS option
*/
if (JLI_StrCmp(arg, "-Xshare:dump") == 0) {
dumpSharedSpaces = JNI_TRUE;
}
}

if (*pwhat == NULL && --argc >= 0) {
Expand All @@ -1450,7 +1466,7 @@ ParseArguments(int *pargc, char ***pargv,

if (*pwhat == NULL) {
/* LM_UNKNOWN okay for options that exit */
if (!listModules && !describeModule && !validateModules) {
if (!listModules && !describeModule && !validateModules && !dumpSharedSpaces) {
*pret = 1;
}
} else if (mode == LM_UNKNOWN) {
Expand Down
7 changes: 6 additions & 1 deletion src/java.base/unix/native/libnio/ch/UnixFileDispatcherImpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
#define fstatvfs64 fstatvfs
#endif

#if defined(__linux__)
#include <linux/fs.h>
#include <sys/ioctl.h>
#endif

#include "jni.h"
#include "nio.h"
#include "nio_util.h"
Expand Down Expand Up @@ -169,7 +174,7 @@ Java_sun_nio_ch_UnixFileDispatcherImpl_size0(JNIEnv *env, jobject this, jobject
if (fstat64(fd, &fbuf) < 0)
return handle(env, -1, "Size failed");

#ifdef BLKGETSIZE64
#if defined(__linux__)
if (S_ISBLK(fbuf.st_mode)) {
uint64_t size;
if (ioctl(fd, BLKGETSIZE64, &size) < 0)
Expand Down
2 changes: 2 additions & 0 deletions src/java.xml/share/classes/org/w3c/dom/Attr.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@
* </tbody>
* </table>
* <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
*
* @since 1.4, DOM Level 2
*/
public interface Attr extends Node {
/**
Expand Down
2 changes: 2 additions & 0 deletions src/java.xml/share/classes/org/w3c/dom/CDATASection.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@
* exception when a character is missing from the encoding, making the task
* of ensuring that data is not corrupted on serialization more difficult.
* <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
*
* @since 1.4, DOM Level 2
*/
public interface CDATASection extends Text {
}
2 changes: 2 additions & 0 deletions src/java.xml/share/classes/org/w3c/dom/CharacterData.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
* the following, the term 16-bit units is used whenever necessary to
* indicate that indexing on CharacterData is done in 16-bit units.
* <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
*
* @since 1.4, DOM Level 2
*/
public interface CharacterData extends Node {
/**
Expand Down
2 changes: 2 additions & 0 deletions src/java.xml/share/classes/org/w3c/dom/Comment.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
* presence of this character sequence must generate a fatal error during
* serialization.
* <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
*
* @since 1.4, DOM Level 2
*/
public interface Comment extends CharacterData {
}
2 changes: 2 additions & 0 deletions src/java.xml/share/classes/org/w3c/dom/DOMException.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
* methods may return error codes similar to those listed in the
* corresponding method descriptions.
* <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
*
* @since 1.4, DOM Level 2
*/
public class DOMException extends RuntimeException {
public DOMException(short code, String message) {
Expand Down
2 changes: 2 additions & 0 deletions src/java.xml/share/classes/org/w3c/dom/DOMImplementation.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
* for performing operations that are independent of any particular instance
* of the document object model.
* <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
*
* @since 1.4, DOM Level 2
*/
public interface DOMImplementation {
/**
Expand Down
2 changes: 2 additions & 0 deletions src/java.xml/share/classes/org/w3c/dom/Document.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
* <code>ownerDocument</code> attribute which associates them with the
* <code>Document</code> within whose context they were created.
* <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
*
* @since 1.4, DOM Level 2
*/
public interface Document extends Node {
/**
Expand Down
2 changes: 2 additions & 0 deletions src/java.xml/share/classes/org/w3c/dom/DocumentFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@
* interface, such as <code>Node.insertBefore</code> and
* <code>Node.appendChild</code>.
* <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
*
* @since 1.4, DOM Level 2
*/
public interface DocumentFragment extends Node {
}
2 changes: 2 additions & 0 deletions src/java.xml/share/classes/org/w3c/dom/DocumentType.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
* <p>DOM Level 3 doesn't support editing <code>DocumentType</code> nodes.
* <code>DocumentType</code> nodes are read-only.
* <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
*
* @since 1.4, DOM Level 2
*/
public interface DocumentType extends Node {
/**
Expand Down
2 changes: 2 additions & 0 deletions src/java.xml/share/classes/org/w3c/dom/Element.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
* <p ><b>Note:</b> In DOM Level 2, the method <code>normalize</code> is
* inherited from the <code>Node</code> interface where it was moved.
* <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
*
* @since 1.4, DOM Level 2
*/
public interface Element extends Node {
/**
Expand Down
2 changes: 2 additions & 0 deletions src/java.xml/share/classes/org/w3c/dom/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
* they are created using the <code>createEntityReference</code> method of
* the <code>Document</code> interface.
* <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
*
* @since 1.4, DOM Level 2
*/
public interface Entity extends Node {
/**
Expand Down
2 changes: 2 additions & 0 deletions src/java.xml/share/classes/org/w3c/dom/EntityReference.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
* 1.0 and XML Schema, the normalization is performed after entity reference
* are expanded.
* <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
*
* @since 1.4, DOM Level 2
*/
public interface EntityReference extends Node {
}
2 changes: 2 additions & 0 deletions src/java.xml/share/classes/org/w3c/dom/NamedNodeMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
* and does not imply that the DOM specifies an order to these Nodes.
* <p><code>NamedNodeMap</code> objects in the DOM are live.
* <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
*
* @since 1.4, DOM Level 2
*/
public interface NamedNodeMap {
/**
Expand Down
2 changes: 2 additions & 0 deletions src/java.xml/share/classes/org/w3c/dom/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@
* </tbody>
* </table>
* <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
*
* @since 1.4, DOM Level 2
*/
public interface Node {
// NodeType
Expand Down
2 changes: 2 additions & 0 deletions src/java.xml/share/classes/org/w3c/dom/NodeList.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
* <p>The items in the <code>NodeList</code> are accessible via an integral
* index, starting from 0.
* <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
*
* @since 1.4, DOM Level 2
*/
public interface NodeList {
/**
Expand Down
2 changes: 2 additions & 0 deletions src/java.xml/share/classes/org/w3c/dom/Notation.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
* are therefore readonly.
* <p>A <code>Notation</code> node does not have any parent.
* <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
*
* @since 1.4, DOM Level 2
*/
public interface Notation extends Node {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
* presence of this character sequence must generate a fatal error during
* serialization.
* <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
*
* @since 1.4, DOM Level 2
*/
public interface ProcessingInstruction extends Node {
/**
Expand Down
2 changes: 2 additions & 0 deletions src/java.xml/share/classes/org/w3c/dom/Text.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
* the quotation mark character " or the apostrophe character ' when part of
* an attribute.
* <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
*
* @since 1.4, DOM Level 2
*/
public interface Text extends CharacterData {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,7 @@ else if (tree.sym.kind == VAR) {
}

public void visitStringTemplate(JCStringTemplate tree) {
tree.processor = translate(tree.processor, erasure(tree.processor.type));
tree.expressions = tree.expressions.stream()
.map(e -> translate(e, erasure(e.type))).collect(List.collector());
tree.type = erasure(tree.type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,10 @@ private void scanEmbeddedExpression(int pos, int endPos) {
* escape character. Actual conversion of escape sequences takes place
* during at the end of readToken.
*
* @param pos position of the first character in literal.
* @param pos position of the first character in literal.
* @param isString true if is a string literal
*/
private void scanLitChar(int pos) {
private void scanLitChar(int pos, boolean isString) {
int backslash = position();
if (acceptThenPut('\\')) {
hasEscapeSequences = true;
Expand Down Expand Up @@ -480,9 +481,13 @@ private void scanLitChar(int pos) {
break;

case '{':
scanEmbeddedExpression(pos, backslash);
if (hasStringTemplateErrors) {
return;
if (isString) {
scanEmbeddedExpression(pos, backslash);
if (hasStringTemplateErrors) {
return;
}
} else {
lexError(position(), Errors.IllegalEscChar);
}
break;

Expand Down Expand Up @@ -546,7 +551,7 @@ private void scanString(int pos) {
}
} else {
// Add character to string buffer.
scanLitChar(pos);
scanLitChar(pos, true);
}
}
} else {
Expand All @@ -570,7 +575,7 @@ private void scanString(int pos) {
break;
} else {
// Add character to string buffer.
scanLitChar(pos);
scanLitChar(pos, true);
}
}
}
Expand Down Expand Up @@ -1115,10 +1120,17 @@ public Token readToken() {
lexError(pos, Errors.IllegalLineEndInCharLit);
}

int errorPos = position();
scanLitChar(pos);
scanLitChar(pos, false);

if (accept('\'')) {
if (tk == TokenKind.ERROR) {
while (isAvailable() && !is('\'')) {
if (is('\\')) {
next();
}
next();
}
accept('\'');
} else if (accept('\'')) {
tk = TokenKind.CHARLITERAL;
} else {
lexError(pos, Errors.UnclosedCharLit);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,38 @@
import static jdk.javadoc.internal.doclets.formats.html.HtmlLinkInfo.Kind.SHOW_TYPE_PARAMS_AND_BOUNDS;

/**
* Print method and constructor info.
* Abstract "member writer" for executable elements.
*/
public abstract class AbstractExecutableMemberWriter extends AbstractMemberWriter {

public AbstractExecutableMemberWriter(SubWriterHolderWriter writer, TypeElement typeElement,
/**
* Creates a writer for executable members, for a given enclosing writer, type element, and kind of member.
*
* @param writer the enclosing "page" writer, with an associated type element
* @param typeElement the type element
* @param kind the kind of member: one of {@link VisibleMemberTable.Kind#CONSTRUCTORS} or {@link VisibleMemberTable.Kind#METHODS}
*/
protected AbstractExecutableMemberWriter(SubWriterHolderWriter writer, TypeElement typeElement,
VisibleMemberTable.Kind kind) {
super(writer, typeElement, kind);

// The following would be better before the preceding call to super; see JDK-8300786
switch (kind) {
case CONSTRUCTORS, METHODS -> { }
default -> throw new IllegalArgumentException(kind.toString());
}
}

public AbstractExecutableMemberWriter(SubWriterHolderWriter writer) {
/**
* Creates a writer for executable members, for a given enclosing writer.
* No type element or kind is provided, limiting the set of methods that can be used.
*
* @param writer the enclosing "page" writer.
*/
protected AbstractExecutableMemberWriter(SubWriterHolderWriter writer) {
super(writer);
}


/**
* Get the type parameters for the executable member.
*
Expand Down
Loading

0 comments on commit de66741

Please sign in to comment.