Skip to content

Commit

Permalink
Merge pull request ibmruntimes#527 from JasonFengJ9/mergetmp
Browse files Browse the repository at this point in the history
Merge master HEAD into openj9-staging
  • Loading branch information
keithc-ca authored Dec 2, 2022
2 parents fcde629 + 29ee218 commit a5c724a
Show file tree
Hide file tree
Showing 167 changed files with 4,548 additions and 2,693 deletions.
2 changes: 1 addition & 1 deletion closed/openjdk-tag.gmk
Original file line number Diff line number Diff line change
@@ -1 +1 @@
OPENJDK_TAG := jdk-20+25
OPENJDK_TAG := jdk-20+26
49 changes: 1 addition & 48 deletions doc/hotspot-style.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ <h1 class="title">HotSpot Coding Style</h1>
<li><a href="#expression-sfinae" id="toc-expression-sfinae">Expression
SFINAE</a></li>
<li><a href="#enum" id="toc-enum">enum</a></li>
<li><a href="#alignas" id="toc-alignas">alignas</a></li>
<li><a href="#thread_local" id="toc-thread_local">thread_local</a></li>
<li><a href="#nullptr" id="toc-nullptr">nullptr</a></li>
<li><a href="#atomic" id="toc-atomic">&lt;atomic&gt;</a></li>
Expand Down Expand Up @@ -599,7 +598,7 @@ <h3 id="c-standard-library">C++ Standard Library</h3>
<code>std::numeric_limits</code>.</li>
<li><code>#include &lt;type_traits&gt;</code>.</li>
<li><code>#include &lt;cstddef&gt;</code> to use
<code>std::nullptr_t</code> and <code>std::max_align_t</code>.</li>
<code>std::nullptr_t</code>.</li>
</ul>
<p>TODO: Rather than directly #including (permitted) Standard Library
headers, use a convention of #including wrapper headers (in some
Expand Down Expand Up @@ -671,52 +670,6 @@ <h3 id="enum">enum</h3>
constant members. Compilers having such bugs are no longer supported.
Except where an enum is semantically appropriate, new code should use
integral constants.</p>
<h3 id="alignas">alignas</h3>
<p><em>Alignment-specifiers</em> (<code>alignas</code> <a
href="https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf">n2341</a>)
are permitted, with restrictions.</p>
<p><em>Alignment-specifiers</em> are permitted when the requested
alignment is a <em>fundamental alignment</em> (not greater than
<code>alignof(std::max_align_t)</code> <a
href="https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf">C++14
3.11/2</a>).</p>
<p><em>Alignment-specifiers</em> with an <em>extended alignment</em>
(greater than <code>alignof(std::max_align_t)</code> <a
href="https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf">C++14
3.11/3</a>) may only be used to align variables with static or automatic
storage duration (<a
href="https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf">C++14
3.7.1, 3.7.3</a>). As a consequence, <em>over-aligned types</em> are
forbidden; this may change if HotSpot updates to using C++17 or later <a
href="https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0035r4.html">p0035r4</a>.</p>
<p>Large <em>extended alignments</em> should be avoided, particularly
for stack allocated objects. What is a large value may depend on the
platform and configuration. There may also be hard limits for some
platforms.</p>
<p>An <em>alignment-specifier</em> must always be applied to a
definition (<a
href="https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf">C++14
10.6.2/6</a>). (C++ allows an <em>alignment-specifier</em> to optionally
also be applied to a declaration, so long as the definition has
equivalent alignment. There isn't any known benefit from duplicating the
alignment in a non-definition declaration, so such duplication should be
avoided in HotSpot code.)</p>
<p>Enumerations are forbidden from having <em>alignment-specifiers</em>.
Aligned enumerations were originally permitted but insufficiently
specified, and were later (C++20) removed <a
href="https://cplusplus.github.io/CWG/issues/2354.html">CWG 2354</a>.
Permitting such usage in HotSpot now would just cause problems in the
future.</p>
<p><em>Alignment-specifiers</em> are forbidden in <code>typedef</code>
and <em>alias-declarations</em>. This may work or may have worked in
some versions of some compilers, but was later (C++14) explicitly
disallowed <a
href="https://cplusplus.github.io/CWG/issues/1437.html">CWG
1437</a>.</p>
<p>The HotSpot macro <code>ATTRIBUTE_ALIGNED</code> provides similar
capabilities for platforms that define it. This macro predates the use
by HotSpot of C++ versions providing <code>alignas</code>. New code
should use <code>alignas</code>.</p>
<h3 id="thread_local">thread_local</h3>
<p>Avoid use of <code>thread_local</code> (<a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm">n2659</a>);
Expand Down
47 changes: 1 addition & 46 deletions doc/hotspot-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ There are a few exceptions to this rule.
* `#include <new>` to use placement `new`, `std::nothrow`, and `std::nothrow_t`.
* `#include <limits>` to use `std::numeric_limits`.
* `#include <type_traits>`.
* `#include <cstddef>` to use `std::nullptr_t` and `std::max_align_t`.
* `#include <cstddef>` to use `std::nullptr_t`.

TODO: Rather than directly \#including (permitted) Standard Library
headers, use a convention of \#including wrapper headers (in some
Expand Down Expand Up @@ -651,51 +651,6 @@ constant members. Compilers having such bugs are no longer supported.
Except where an enum is semantically appropriate, new code should use
integral constants.

### alignas

_Alignment-specifiers_ (`alignas`
[n2341](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf))
are permitted, with restrictions.

_Alignment-specifiers_ are permitted when the requested alignment is a
_fundamental alignment_ (not greater than `alignof(std::max_align_t)`
[C++14 3.11/2](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf)).

_Alignment-specifiers_ with an _extended alignment_ (greater than
`alignof(std::max_align_t)`
[C++14 3.11/3](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf))
may only be used to align variables with static or automatic storage duration
([C++14 3.7.1, 3.7.3](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf)).
As a consequence, _over-aligned types_ are forbidden; this may change if
HotSpot updates to using C++17 or later
[p0035r4](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0035r4.html).

Large _extended alignments_ should be avoided, particularly for stack
allocated objects. What is a large value may depend on the platform and
configuration. There may also be hard limits for some platforms.

An _alignment-specifier_ must always be applied to a definition
([C++14 10.6.2/6](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf)).
(C++ allows an _alignment-specifier_ to optionally also be applied to a
declaration, so long as the definition has equivalent alignment. There isn't
any known benefit from duplicating the alignment in a non-definition
declaration, so such duplication should be avoided in HotSpot code.)

Enumerations are forbidden from having _alignment-specifiers_. Aligned
enumerations were originally permitted but insufficiently specified, and were
later (C++20) removed
[CWG 2354](https://cplusplus.github.io/CWG/issues/2354.html).
Permitting such usage in HotSpot now would just cause problems in the future.

_Alignment-specifiers_ are forbidden in `typedef` and _alias-declarations_.
This may work or may have worked in some versions of some compilers, but was
later (C++14) explicitly disallowed
[CWG 1437](https://cplusplus.github.io/CWG/issues/1437.html).

The HotSpot macro `ATTRIBUTE_ALIGNED` provides similar capabilities for
platforms that define it. This macro predates the use by HotSpot of C++
versions providing `alignas`. New code should use `alignas`.

### thread_local

Avoid use of `thread_local`
Expand Down
2 changes: 1 addition & 1 deletion make/autoconf/lib-tests.m4
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
################################################################################

# Minimum supported version
JTREG_MINIMUM_VERSION=7
JTREG_MINIMUM_VERSION=7.1

###############################################################################
#
Expand Down
24 changes: 14 additions & 10 deletions make/common/JavaCompilation.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -219,31 +219,35 @@ define SetupJavaCompilationBody
# Use java server if it is enabled, and the user does not want a specialized
# class path.
ifeq ($$(ENABLE_JAVAC_SERVER)+$$($1_CLASSPATH), true+)
$1_JAVAC := $$(INTERIM_LANGTOOLS_ARGS) -cp $(BUILDTOOLS_OUTPUTDIR)/langtools_javacserver_classes javacserver.Main

# Create a configuration file with the needed information for the javac
# server to function properly.
$1_JAVAC_SERVER_CONFIG := $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$$($1_SAFE_NAME)-server.conf
$1_JAVAC_SERVER_CONFIG := $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$$($1_SAFE_NAME)-javacserver.conf

# Arguments needed to launch the javacserver client, as well as for the
# client to launch the server.
$1_JAVAC_SERVER_ARGS := $$(INTERIM_LANGTOOLS_ARGS) \
-cp $(BUILDTOOLS_OUTPUTDIR)/langtools_javacserver_classes

# The portfile contains the tcp/ip on which the server listens
# and the cookie necessary to talk to the server.
$1_JAVAC_PORT_FILE := $$(call FixPath, $$(JAVAC_SERVER_DIR)/server.port)

# The servercmd specifies how to launch the server. This will be executed
# by the client, if needed.
$1_JAVAC_SERVER_CMD := $$(call FixPath, $$(JAVA) $$($1_JAVA_FLAGS) $$($1_JAVAC))
# The javacmd tells the client how to run java to launch the server.
$1_JAVAC_SERVER_JAVA_CMD := $$(call FixPath, $$(JAVA) $$($1_JAVA_FLAGS) \
$$($1_JAVAC_SERVER_ARGS))

$1_CONFIG_VARDEPS := $$($1_JAVAC_PORT_FILE) $$($1_JAVAC_SERVER_CMD)
$1_CONFIG_VARDEPS := $$($1_JAVAC_PORT_FILE) $$($1_JAVAC_SERVER_JAVA_CMD)
$1_CONFIG_VARDEPS_FILE := $$(call DependOnVariable, $1_CONFIG_VARDEPS, \
$$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1.config_vardeps)

# Write these values to a config file
$$($1_JAVAC_SERVER_CONFIG): $$($1_CONFIG_VARDEPS_FILE)
$(ECHO) portfile=$$($1_JAVAC_PORT_FILE) > $$@
$(ECHO) servercmd=$$($1_JAVAC_SERVER_CMD) >> $$@
$(ECHO) javacmd=$$($1_JAVAC_SERVER_JAVA_CMD) >> $$@

# Always use small java to launch client
$1_JAVAC_CMD := $$(JAVA_SMALL) $$($1_JAVA_FLAGS) $$($1_JAVAC) \
--server:conf=$$($1_JAVAC_SERVER_CONFIG)
$1_JAVAC_CMD := $$(JAVA_SMALL) $$($1_JAVA_FLAGS) $$($1_JAVAC_SERVER_ARGS) \
javacserver.Main --conf=$$($1_JAVAC_SERVER_CONFIG)
else
# No javac server
$1_JAVAC := $$(INTERIM_LANGTOOLS_ARGS) -m jdk.compiler.interim/com.sun.tools.javac.Main
Expand Down
2 changes: 1 addition & 1 deletion make/conf/github-actions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# Versions and download locations for dependencies used by GitHub Actions (GHA)

GTEST_VERSION=1.8.1
JTREG_VERSION=7+1
JTREG_VERSION=7.1+1

LINUX_X64_BOOT_JDK_EXT=tar.gz
LINUX_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk19/877d6127e982470ba2a7faa31cc93d04/36/GPL/openjdk-19_linux-x64_bin.tar.gz
Expand Down
4 changes: 2 additions & 2 deletions make/conf/jib-profiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -1135,9 +1135,9 @@ var getJibProfilesDependencies = function (input, common) {
jtreg: {
server: "jpg",
product: "jtreg",
version: "7",
version: "7.1",
build_number: "1",
file: "bundles/jtreg-7+1.zip",
file: "bundles/jtreg-7.1+1.zip",
environment_name: "JT_HOME",
environment_path: input.get("jtreg", "home_path") + "/bin",
configure_args: "--with-jtreg=" + input.get("jtreg", "home_path"),
Expand Down
29 changes: 4 additions & 25 deletions make/langtools/tools/javacserver/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,34 +25,13 @@

package javacserver;

import java.util.Arrays;

import javacserver.client.ClientMain;
import javacserver.server.ServerMain;

import static javacserver.options.Option.STARTSERVER;
import javacserver.client.Client;

/**
* The application entry point of the smart javac wrapper tool.
*
* <p><b>This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.</b>
* The application entry point of the javacserver build tool.
*/
public class Main {

public static void main(String... args) {
System.exit(go(args));
}

public static int go(String[] args) {

// Server or client mode?
boolean serverMode = Arrays.asList(args)
.stream()
.anyMatch(arg -> arg.startsWith(STARTSERVER.arg));

return serverMode ? ServerMain.run(args) : ClientMain.run(args);
public static void main(String... args) {
Client.main(args);
}
}
56 changes: 0 additions & 56 deletions make/langtools/tools/javacserver/Result.java

This file was deleted.

Loading

0 comments on commit a5c724a

Please sign in to comment.