Skip to content
Permalink
Browse files

Merge

  • Loading branch information
JesperIRL committed Dec 20, 2019
2 parents 1691abc + 261f4bf commit 4f22b49c8538120646726d4ae5ddf20aae868f91
Showing with 1,188 additions and 174 deletions.
  1. +1 −0 .hgtags
  2. +18 −1 make/autoconf/hotspot.m4
  3. +16 −0 ...dk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/BinaryContainer.java
  4. +6 −3 src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/MarkProcessor.java
  5. +1 −1 src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacDmgBundler.java
  6. +20 −1 src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/Executor.java
  7. +17 −4 src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/IOUtils.java
  8. +4 −7 ...iler.api.directives.test/src/org/graalvm/compiler/api/directives/test/BlackholeDirectiveTest.java
  9. +5 −8 ....directives.test/src/org/graalvm/compiler/api/directives/test/ControlFlowAnchorDirectiveTest.java
  10. +4 −7 ...ompiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/OpaqueDirectiveTest.java
  11. +311 −0 ....aarch64.test/src/org/graalvm/compiler/asm/aarch64/test/AArch64LoadStoreMergingAssemblerTest.java
  12. +24 −5 ...asses/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Assembler.java
  13. +189 −2 .../org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64MacroAssembler.java
  14. +87 −0 ...mpiler.core.aarch64.test/src/org/graalvm/compiler/core/aarch64/test/AArch64PairLoadStoreTest.java
  15. +5 −0 ...graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeArrayTypeWriter.java
  16. +9 −0 ...asses/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CheckGraalInvariants.java
  17. +2 −4 ...graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTestBase.java
  18. +2 −3 ...re/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CountedLoopTest.java
  19. +13 −7 .../classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalCompilerTest.java
  20. +2 −4 ...ses/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MergeCanonicalizerTest.java
  21. +9 −1 ...lasses/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OptionsVerifierTest.java
  22. +1 −1 ...are/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubprocessTest.java
  23. +1 −1 ...e/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyDebugUsage.java
  24. +4 −7 ...asses/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PEAAssertionsTest.java
  25. +13 −0 ...ompiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugContext.java
  26. +6 −2 ....compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotSafepointOp.java
  27. +12 −3 ...raalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSafepointOp.java
  28. +1 −1 ...iler.hotspot.lir.test/src/org/graalvm/compiler/hotspot/lir/test/BenchmarkCounterOverflowTest.java
  29. +4 −4 ...m.compiler.hotspot.sparc.test/src/org/graalvm/compiler/hotspot/sparc/test/SPARCAllocatorTest.java
  30. +16 −3 ...raalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotSafepointOp.java
  31. +15 −23 ...g.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompilationWrapperTest.java
  32. +2 −1 ....graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ReservedStackAccessTest.java
  33. +1 −0 ...e/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java
  34. +3 −0 .../org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfigVersioned.java
  35. +6 −9 ...sses/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConditionalElimination02.java
  36. +21 −3 ...re/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Move.java
  37. +14 −4 ...e/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Unary.java
  38. +11 −0 ...e/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/CompilationResultBuilder.java
  39. +247 −43 ...ompiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphDecoder.java
  40. +1 −1 ...replacements.test/src/org/graalvm/compiler/replacements/test/classfile/RedefineIntrinsicTest.java
  41. +63 −9 ...ompiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/SubprocessUtil.java
  42. +1 −1 test/jdk/ProblemList-graal.txt
@@ -602,4 +602,5 @@ c16ac7a2eba4e73cb4f7ee9294dd647860eebff0 jdk-14+21
2c724dba4c3cf9516b2152e151c9aea66b21b30b jdk-15+0
91a3f092682fc715d991a87eb6ec6f28886d2035 jdk-14+27
63e17cf29bed191ea21020b4648c9cdf893f80f5 jdk-15+1
2069b4bfd23b56b6fc659fba8b75aaaa23debbe0 jdk-14+28
f33197adda9ad82fdef46ac0f7dc0126204f35b2 jdk-15+2
@@ -345,10 +345,27 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
fi
# Only enable ZGC on supported platforms
if (test "x$OPENJDK_TARGET_OS" = "xwindows" && test "x$OPENJDK_TARGET_CPU" = "xx86_64"); then
AC_MSG_CHECKING([if zgc can be built on windows])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <windows.h>]],
[[struct MEM_EXTENDED_PARAMETER x;]])
],
[
AC_MSG_RESULT([yes])
CAN_BUILD_ZGC_ON_WINDOWS="yes"
],
[
AC_MSG_RESULT([no, missing required APIs])
CAN_BUILD_ZGC_ON_WINDOWS="no"
]
)
fi
AC_MSG_CHECKING([if zgc can be built])
if (test "x$OPENJDK_TARGET_OS" = "xlinux" && test "x$OPENJDK_TARGET_CPU" = "xx86_64") || \
(test "x$OPENJDK_TARGET_OS" = "xlinux" && test "x$OPENJDK_TARGET_CPU" = "xaarch64") || \
(test "x$OPENJDK_TARGET_OS" = "xwindows" && test "x$OPENJDK_TARGET_CPU" = "xx86_64") || \
(test "x$CAN_BUILD_ZGC_ON_WINDOWS" = "xyes") || \
(test "x$OPENJDK_TARGET_OS" = "xmacosx" && test "x$OPENJDK_TARGET_CPU" = "xx86_64"); then
AC_MSG_RESULT([yes])
else
@@ -31,6 +31,7 @@
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -43,6 +44,7 @@
import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig;
import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration;
import org.graalvm.compiler.options.OptionValues;
import org.graalvm.compiler.serviceprovider.JavaVersionUtil;

/**
* A format-agnostic container class that holds various components of a binary.
@@ -67,6 +69,8 @@

private final int codeEntryAlignment;

private final boolean threadLocalHandshakes;

/**
* Container holding code bits and any other related information.
*/
@@ -292,6 +296,8 @@ public BinaryContainer(OptionValues graalOptions, GraalHotSpotVMConfig graalHotS

this.codeEntryAlignment = graalHotSpotVMConfig.codeEntryAlignment;

this.threadLocalHandshakes = graalHotSpotVMConfig.threadLocalHandshakes;

// Section unique name is limited to 8 characters due to limitation on Windows.
// Name could be longer but only first 8 characters are stored on Windows.

@@ -350,6 +356,12 @@ private void recordConfiguration(GraalHotSpotVMConfig graalHotSpotVMConfig, Grap
// @formatter:on
// @Checkstyle: resume

if (JavaVersionUtil.JAVA_SPEC < 14) {
// See JDK-8220049. Thread local handshakes are on by default since JDK14, the command line option has been removed.
booleanFlags = Arrays.copyOf(booleanFlags, booleanFlags.length + 1);
booleanFlags[booleanFlags.length - 1] = graalHotSpotVMConfig.threadLocalHandshakes;
}

byte[] booleanFlagsAsBytes = flagsToByteArray(booleanFlags);
int size0 = configContainer.getByteStreamSize();

@@ -449,6 +461,10 @@ public int getCodeEntryAlignment() {
return codeEntryAlignment;
}

public boolean getThreadLocalHandshakes() {
return threadLocalHandshakes;
}

/**
* Gets the global AOT symbol associated with the function name.
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2018, 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
@@ -56,8 +56,11 @@ void process(CompiledMethodInfo methodInfo, Mark mark) {
break;
case POLL_FAR:
case POLL_RETURN_FAR:
// skip relocation
break;
if (binaryContainer.getThreadLocalHandshakes()) {
// skip relocation
break;
}
// fallthrough
case CARD_TABLE_ADDRESS:
case HEAP_TOP_ADDRESS:
case HEAP_END_ADDRESS:
@@ -290,7 +290,7 @@ private File buildDMG(
protoDMG.getAbsolutePath(),
hdiUtilVerbosityFlag,
"-mountroot", imagesRoot.getAbsolutePath());
IOUtils.exec(pb);
IOUtils.exec(pb, false, null, true);

File mountedRoot = new File(imagesRoot.getAbsolutePath(),
APP_NAME.fetchFrom(params));
@@ -48,6 +48,11 @@ Executor saveOutput(boolean v) {
return this;
}

Executor setWaitBeforeOutput(boolean v) {
waitBeforeOutput = v;
return this;
}

Executor setProcessBuilder(ProcessBuilder v) {
pb = v;
return this;
@@ -88,6 +93,16 @@ int execute() throws IOException {
Log.verbose(String.format("Running %s", createLogMessage(pb)));
Process p = pb.start();

int code = 0;
if (waitBeforeOutput) {
try {
code = p.waitFor();
} catch (InterruptedException ex) {
Log.verbose(ex);
throw new RuntimeException(ex);
}
}

if (needProcessOutput) {
try (var br = new BufferedReader(new InputStreamReader(
p.getInputStream()))) {
@@ -131,7 +146,10 @@ int execute() throws IOException {
}

try {
return p.waitFor();
if (!waitBeforeOutput) {
code = p.waitFor();
}
return code;
} catch (InterruptedException ex) {
Log.verbose(ex);
throw new RuntimeException(ex);
@@ -157,6 +175,7 @@ private static String createLogMessage(ProcessBuilder pb) {

private ProcessBuilder pb;
private boolean saveOutput;
private boolean waitBeforeOutput;
private List<String> output;
private Consumer<Stream<String>> outputConsumer;
}
@@ -133,20 +133,33 @@ public static void run(String launcher, File paramFile)

public static void exec(ProcessBuilder pb)
throws IOException {
exec(pb, false, null);
exec(pb, false, null, false);
}

static void exec(ProcessBuilder pb, boolean testForPresenseOnly,
// Reading output from some processes (currently known "hdiutil attach" might hang even if process already
// exited. Only possible workaround found in "hdiutil attach" case is to wait for process to exit before
// reading output.
public static void exec(ProcessBuilder pb, boolean waitBeforeOutput)
throws IOException {
exec(pb, false, null, waitBeforeOutput);
}

static void exec(ProcessBuilder pb, boolean testForPresenceOnly,
PrintStream consumer) throws IOException {
exec(pb, testForPresenceOnly, consumer, false);
}

static void exec(ProcessBuilder pb, boolean testForPresenceOnly,
PrintStream consumer, boolean waitBeforeOutput) throws IOException {
List<String> output = new ArrayList<>();
Executor exec = Executor.of(pb).setOutputConsumer(lines -> {
Executor exec = Executor.of(pb).setWaitBeforeOutput(waitBeforeOutput).setOutputConsumer(lines -> {
lines.forEach(output::add);
if (consumer != null) {
output.forEach(consumer::println);
}
});

if (testForPresenseOnly) {
if (testForPresenceOnly) {
exec.execute();
} else {
exec.executeExpectSuccess();
@@ -29,16 +29,13 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.junit.Assert;
import org.junit.Test;

import org.graalvm.compiler.api.directives.GraalDirectives;
import org.graalvm.compiler.core.test.GraalCompilerTest;
import org.graalvm.compiler.nodes.ParameterNode;
import org.graalvm.compiler.nodes.StructuredGraph;
import org.graalvm.compiler.phases.OptimisticOptimizations;
import org.graalvm.compiler.phases.OptimisticOptimizations.Optimization;
import org.graalvm.compiler.phases.tiers.HighTierContext;
import org.junit.Assert;
import org.junit.Test;

/**
* Tests for {@link GraalDirectives#blackhole}.
@@ -134,8 +131,8 @@ public void testObject() {
}

@Override
protected HighTierContext getDefaultHighTierContext() {
return new HighTierContext(getProviders(), getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL.remove(Optimization.RemoveNeverExecutedCode));
protected OptimisticOptimizations getOptimisticOptimizations() {
return OptimisticOptimizations.ALL.remove(OptimisticOptimizations.Optimization.RemoveNeverExecutedCode);
}

@Override
@@ -33,9 +33,6 @@
import java.util.Collections;
import java.util.List;

import org.junit.Assert;
import org.junit.Test;

import org.graalvm.compiler.api.directives.GraalDirectives;
import org.graalvm.compiler.core.test.GraalCompilerTest;
import org.graalvm.compiler.graph.Node;
@@ -46,11 +43,11 @@
import org.graalvm.compiler.nodes.StructuredGraph;
import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions;
import org.graalvm.compiler.nodes.debug.ControlFlowAnchorNode;
import org.graalvm.compiler.phases.OptimisticOptimizations;
import org.junit.Assert;
import org.junit.Test;

import jdk.vm.ci.meta.ResolvedJavaMethod;
import org.graalvm.compiler.phases.OptimisticOptimizations;
import org.graalvm.compiler.phases.OptimisticOptimizations.Optimization;
import org.graalvm.compiler.phases.tiers.HighTierContext;

public class ControlFlowAnchorDirectiveTest extends GraalCompilerTest {

@@ -244,8 +241,8 @@ public void testClone() {
}

@Override
protected HighTierContext getDefaultHighTierContext() {
return new HighTierContext(getProviders(), getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL.remove(Optimization.RemoveNeverExecutedCode));
protected OptimisticOptimizations getOptimisticOptimizations() {
return OptimisticOptimizations.ALL.remove(OptimisticOptimizations.Optimization.RemoveNeverExecutedCode);
}

@Override
@@ -29,9 +29,6 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.junit.Assert;
import org.junit.Test;

import org.graalvm.compiler.api.directives.GraalDirectives;
import org.graalvm.compiler.core.test.GraalCompilerTest;
import org.graalvm.compiler.nodes.ConstantNode;
@@ -40,8 +37,8 @@
import org.graalvm.compiler.nodes.calc.AddNode;
import org.graalvm.compiler.nodes.calc.ConditionalNode;
import org.graalvm.compiler.phases.OptimisticOptimizations;
import org.graalvm.compiler.phases.OptimisticOptimizations.Optimization;
import org.graalvm.compiler.phases.tiers.HighTierContext;
import org.junit.Assert;
import org.junit.Test;

/**
* Tests for {@link GraalDirectives#opaque}.
@@ -133,8 +130,8 @@ public void testObject() {
}

@Override
protected HighTierContext getDefaultHighTierContext() {
return new HighTierContext(getProviders(), getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL.remove(Optimization.RemoveNeverExecutedCode));
protected OptimisticOptimizations getOptimisticOptimizations() {
return OptimisticOptimizations.ALL.remove(OptimisticOptimizations.Optimization.RemoveNeverExecutedCode);
}

@Override

0 comments on commit 4f22b49

Please sign in to comment.
You can’t perform that action at this time.