Skip to content

Commit

Permalink
Merge branch 'master' into issue/GR-7294/improve-host-interop
Browse files Browse the repository at this point in the history
  • Loading branch information
chumer committed Jan 31, 2018
2 parents 38e3489 + 223d702 commit 8169f42
Show file tree
Hide file tree
Showing 67 changed files with 1,135 additions and 544 deletions.
6 changes: 6 additions & 0 deletions common.hocon
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ jdks: {
labsjdk8 : {name : labsjdk, version : "8u151-jvmci-0.40", platformspecific: true}
labsjdk9 : {name : labsjdk, version : "9+181", platformspecific: true}
labsjdk8Debug : {name : labsjdk, version : "8u151-jvmci-0.40-fastdebug", platformspecific: true}

# Strictly speaking, this is labsjdk-jdk-hs-snapshot but for
# readability we use the java.specification.version reported by the snapshot.
# This means the name will change to labsjdk11 at some point.
labsjdk10 : {name : labsjdk, version : "20180130-162725", platformspecific: true}
}

# Overlay placeholder for pinning mx to a specific revision
Expand All @@ -19,6 +24,7 @@ labsjdk8Debug : { downloads : { JAVA_HOME : ${jdks.labsjdk8Debug} }}
# openjdk8 : { downloads : { JAVA_HOME : ${jdks.openjdk8} }}

labsjdk9 : { downloads : { JAVA_HOME : ${jdks.labsjdk9}, EXTRA_JAVA_HOMES : { pathlist :[ ${jdks.labsjdk8} ]} }}
labsjdk10 : { downloads : { JAVA_HOME : ${jdks.labsjdk10}, EXTRA_JAVA_HOMES : { pathlist :[ ${jdks.labsjdk8} ]} }}

common : ${mx} {
timelimit : "30:00"
Expand Down
11 changes: 8 additions & 3 deletions compiler/ci_common/gate_tasks.hocon
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,28 @@ builds += [
# Darwin AMD64
${gateTest} ${labsjdk8} ${gateDarwinAMD64} {name: "weekly-test-compiler-test-8-darwin-amd64", targets : [weekly]}
${gateTest} ${labsjdk9} ${gateDarwinAMD64} {name: "weekly-test-compiler-test-9-darwin-amd64", targets : [weekly]}
# ${gateTestBenchmark} ${labsjdk8} ${gateDarwinAMD64} {name: "gate-compiler-benchmarktest-8-darwin-amd64", targets : [weekly]}
${gateTest} ${labsjdk10} ${gateDarwinAMD64} {name: "weekly-test-compiler-test-10-darwin-amd64", targets : [weekly]}
# ${gateTestBenchmark} ${labsjdk8} ${gateDarwinAMD64} {name: "weekly-test-compiler-benchmarktest-8-darwin-amd64", targets : [weekly]}

# Linux AMD64
${gateTest} ${labsjdk8} ${gateLinuxAMD64} {name: "gate-compiler-test-8-linux-amd64"}
${gateTest} ${labsjdk9} ${gateLinuxAMD64} {name: "gate-compiler-test-9-linux-amd64"} {capabilities: ${gateLinuxAMD64.capabilities} ["!x4150"]}
${gateTest} ${labsjdk9} ${gateLinuxAMD64} {name: "weekly-test-compiler-test-9-linux-amd64", targets : [weekly]} {capabilities: ${gateLinuxAMD64.capabilities} ["!x4150"]}
${gateTest} ${labsjdk10} ${gateLinuxAMD64} {name: "gate-compiler-test-10-linux-amd64"} {capabilities: ${gateLinuxAMD64.capabilities} ["!x4150"]}
${gateTestCTW} ${labsjdk8} ${gateLinuxAMD64} {name: "gate-compiler-ctw-8-linux-amd64"}
${gateTestCTW} ${labsjdk9} ${gateLinuxAMD64} {name: "weekly-test-compiler-ctw-9-linux-amd64", targets : [weekly]}
${gateTestCTW} ${labsjdk10} ${gateLinuxAMD64} {name: "weekly-test-compiler-ctw-10-linux-amd64", targets : [weekly]}
${gateTest} ${labsjdk8Debug} ${gateLinuxAMD64} {name: "weekly-test-compiler-test-8-linux-amd64-fastdebug", timelimit: "1:00:00", targets : [weekly]}
${gateTestBenchmark} ${labsjdk8} ${gateLinuxAMD64} {name: "gate-compiler-benchmarktest-8-linux-amd64"}
${gateTestBenchmark} ${labsjdk8Debug} ${gateLinuxAMD64} {name: "weekly-test-compiler-benchmarktest-8-linux-amd64-fastdebug", targets : [weekly]}
${gateStyle} ${labsjdk8} ${gateLinuxAMD64} {name: "gate-compiler-style-linux-amd64"}

# Solaris SPARC
${gateTest} ${labsjdk8} ${gateSolarisSPARC} {name: "gate-compiler-test-8-solaris-sparcv9", timelimit: "1:00:00"}
${gateTest} ${labsjdk9} ${gateSolarisSPARC} {name: "gate-compiler-test-9-solaris-sparcv9", timelimit: "1:00:00"}
${gateTest} ${labsjdk9} ${gateSolarisSPARC} {name: "weekly-test-compiler-test-9-solaris-sparcv9", timelimit: "1:00:00", targets : [weekly]}
${gateTest} ${labsjdk10} ${gateSolarisSPARC} {name: "gate-compiler-test-10-solaris-sparcv9", timelimit: "1:00:00"}
${gateTestCTW} ${labsjdk8} ${gateSolarisSPARC} {name: "gate-compiler-ctw-8-solaris-sparcv9", timelimit: "1:00:00"}
${gateTestCTW} ${labsjdk9} ${gateSolarisSPARC} {name: "weekly-test-compiler-ctw-9-solaris-sparcv9", timelimit: "1:00:00", targets : [weekly]}
${gateTestCTW} ${labsjdk10} ${gateSolarisSPARC} {name: "weekly-test-compiler-ctw-10-solaris-sparcv9", timelimit: "1:00:00", targets : [weekly]}
${gateTest} ${labsjdk8Debug} ${gateSolarisSPARC} {name: "weekly-test-compiler-test-8-solaris-sparcv9-fastdebug", timelimit: "1:00:00", targets : [weekly]}
${gateTestBenchmark} ${labsjdk8} ${gateSolarisSPARC} {name: "gate-compiler-benchmarktest-8-solaris-sparcv9", timelimit: "1:00:00"}
# ${gateTestBenchmark} ${labsjdk8Debug} ${gateSolarisSPARC} {name: "gate-compiler-benchmarktest-8-solaris-sparcv9-fastdebug", timelimit: "1:00:00"}
Expand Down
8 changes: 4 additions & 4 deletions compiler/ci_common/gate_tasks_bootstrap.hocon
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
builds += [
# Darwin AMD64
${gateBootstrapLite} ${labsjdk8} ${gateDarwinAMD64Bootstrap} {name: "gate-compiler-bootstraplite-8-darwin-amd64"}
${gateBootstrapLite} ${labsjdk8} ${gateDarwinAMD64Bootstrap} {name: "weekly-test-compiler-bootstraplite-labsjdk8-darwin-amd64", targets : [weekly]}
${gateBootstrapLite} ${labsjdk9} ${gateDarwinAMD64Bootstrap} {name: "weekly-test-compiler-bootstraplite-9-darwin-amd64", targets : [weekly]}
${gateBootstrapLite} ${labsjdk10} ${gateDarwinAMD64Bootstrap} {name: "weekly-test-compiler-bootstraplite-10-darwin-amd64", targets : [weekly]}

# Linux AMD64
${gateBootstrap} ${labsjdk8} ${gateLinuxAMD64Bootstrap} {name: "gate-compiler-bootstrap-8-linux-amd64"}
${gateBootstrap} ${labsjdk8} ${gateLinuxAMD64Bootstrap} {name: "weekly-test-compiler-bootstrap-labsjdk8-linux-amd64", targets : [weekly]}
${gateBootstrapFullVerify} ${labsjdk8} ${gateLinuxAMD64Bootstrap} {name: "gate-compiler-bootstrapfullverify-8-linux-amd64"}
${gateBootstrap} ${labsjdk9} ${gateLinuxAMD64Bootstrap} {name: "gate-compiler-bootstrap-9-linux-amd64"}
${gateBootstrap} ${labsjdk9} ${gateLinuxAMD64Bootstrap} {name: "weekly-test-compiler-bootstrap-9-linux-amd64", targets : [weekly]}
${gateBootstrap} ${labsjdk10} ${gateLinuxAMD64Bootstrap} {name: "gate-compiler-bootstrap-10-linux-amd64"}

# Solaris SPARC
${gateBootstrap} ${labsjdk8} ${gateSolarisSPARCBootstrap} {name: "gate-compiler-bootstrap-8-solaris-sparcv9", timelimit: "1:00:00"}
${gateBootstrap} ${labsjdk8} ${gateSolarisSPARCBootstrap} {name: "weekly-test-compiler-bootstrap-labsjdk8-solaris-sparcv9", timelimit: "1:00:00", targets : [weekly]}
${gateBootstrap} ${labsjdk9} ${gateSolarisSPARCBootstrap} {name: "weekly-test-compiler-bootstrap-9-solaris-sparcv9", timelimit: "1:00:00", targets : [weekly]}
${gateBootstrap} ${labsjdk10} ${gateSolarisSPARCBootstrap} {name: "weekly-test-compiler-bootstrap-10-solaris-sparcv9", timelimit: "1:00:00", targets : [weekly]}

# Linux SPARC
${gateBootstrap} ${labsjdk8} ${gateLinuxSPARCBootstrap} {name: "weekly-test-compiler-bootstrap-labsjdk8-linux-sparcv9", timelimit: "1:00:00", targets : [weekly]}
Expand Down
20 changes: 20 additions & 0 deletions compiler/mx.compiler/mx_graal_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,26 @@ def run_java(self, args, out=None, err=None, cwd=None, nonZeroIsFatal=False):
return mx.get_jdk(tag=mx_compiler._JVMCI_JDK_TAG).run_java(
args, out=out, err=out, cwd=cwd, nonZeroIsFatal=False)

def rules(self, output, benchmarks, bmSuiteArgs):
if benchmarks and len(benchmarks) == 1:
return [
mx_benchmark.StdOutRule(
# r"Statistics for (?P<methods>[0-9]+) bytecoded nmethods for JVMCI:\n total in heap = (?P<value>[0-9]+)",
r"Statistics for (?P<methods>[0-9]+) bytecoded nmethods for JVMCI:\n total in heap = (?P<value>[0-9]+)",
{
"benchmark": benchmarks[0],
"vm": "jvmci",
"metric.name": "code-size",
"metric.value": ("<value>", int),
"metric.unit": "B",
"metric.type": "numeric",
"metric.score-function": "id",
"metric.better": "lower",
"metric.iteration": 0,
})
]
return []


mx_benchmark.add_java_vm(JvmciJdkVm('server', 'default', ['-server', '-XX:-EnableJVMCI']), _suite, 2)
mx_benchmark.add_java_vm(JvmciJdkVm('server', 'hosted', ['-server', '-XX:+EnableJVMCI']), _suite, 3)
Expand Down
5 changes: 3 additions & 2 deletions compiler/mx.compiler/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -1026,10 +1026,11 @@
"workingSets" : "Graal,SPARC",
},

"org.graalvm.compiler.core.sparc.test" : {
"org.graalvm.compiler.hotspot.sparc.test" : {
"subDir" : "src",
"sourceDirs" : ["src"],
"dependencies" : [
"org.graalvm.compiler.hotspot",
"org.graalvm.compiler.lir.jtt",
"JVMCI_HOTSPOT"
],
Expand Down Expand Up @@ -1458,11 +1459,11 @@
"org.graalvm.compiler.asm.amd64.test",
"org.graalvm.compiler.core.aarch64.test",
"org.graalvm.compiler.core.amd64.test",
"org.graalvm.compiler.core.sparc.test",
"org.graalvm.compiler.debug.test",
"org.graalvm.compiler.hotspot.aarch64.test",
"org.graalvm.compiler.hotspot.amd64.test",
"org.graalvm.compiler.hotspot.lir.test",
"org.graalvm.compiler.hotspot.sparc.test",
"org.graalvm.compiler.options.test",
"org.graalvm.compiler.jtt",
"org.graalvm.compiler.lir.jtt",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public final class DataSection implements Iterable<Data> {

public interface Patches {

void registerPatch(VMConstant c);
void registerPatch(int position, VMConstant c);
}

public abstract static class Data {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.graalvm.compiler.core.common.NumUtil;
import org.graalvm.compiler.core.common.type.AbstractPointerStamp;
import org.graalvm.compiler.core.common.type.IntegerStamp;
import org.graalvm.compiler.core.common.type.PrimitiveStamp;
import org.graalvm.compiler.debug.DebugContext;
import org.graalvm.compiler.nodes.NodeView;
import org.graalvm.compiler.nodes.StructuredGraph;
Expand Down Expand Up @@ -190,7 +189,7 @@ private static ValueNode improveInput(AMD64AddressNode address, ValueNode node,
return improveConstDisp(address, node, c, null, shift, negateExtractedDisplacement);
} else {
if (node.stamp(NodeView.DEFAULT) instanceof IntegerStamp) {
assert PrimitiveStamp.getBits(node.stamp(NodeView.DEFAULT)) == ADDRESS_BITS;
assert IntegerStamp.getBits(node.stamp(NodeView.DEFAULT)) == ADDRESS_BITS;

/*
* we can't swallow zero-extends because of multiple reasons:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Copyright (c) 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package org.graalvm.compiler.hotspot.amd64.test;

import jdk.vm.ci.hotspot.HotSpotSpeculationLog;
import jdk.vm.ci.meta.SpeculationLog;

import org.graalvm.compiler.core.test.GraalCompilerTest;
import org.junit.Test;

public class ArrayAccessInLoopToAddressTest extends GraalCompilerTest {

public static int positiveInductionVariable(short[] array) {
int sum = 0;
for (int i = 0; i < array.length - 1; i++) {
sum += array[i + 1];
}
return sum;
}

@Test
public void testPositiveInductionVariable() {
test("positiveInductionVariable", new short[]{1, 3, 7, 9});
}

public static int negativeInductionVariable(short[] array) {
int sum = 0;
for (int i = -array.length; i < array.length - 4; i++) {
sum += array[i + 4];
}
return sum;
}

@Test
public void testNegativeInductionVariable() {
test("negativeInductionVariable", new short[]{1, 3, 7, 9});
}

@Override
protected SpeculationLog getSpeculationLog() {
return new HotSpotSpeculationLog();
}

}
Loading

0 comments on commit 8169f42

Please sign in to comment.