Skip to content

Commit 0812854

Browse files
committed
8229201: Update Graal
Reviewed-by: kvn
1 parent 8731e63 commit 0812854

File tree

599 files changed

+5549
-3066
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

599 files changed

+5549
-3066
lines changed

src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/BinaryContainer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it

src/jdk.aot/share/classes/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/NativeOrderOutputStreamTest.java

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -32,63 +32,62 @@
3232

3333
package jdk.tools.jaotc.test;
3434

35-
import jdk.tools.jaotc.utils.NativeOrderOutputStream;
36-
import org.junit.Assert;
37-
import org.junit.Before;
38-
import org.junit.Test;
39-
4035
import java.nio.ByteBuffer;
4136
import java.nio.ByteOrder;
4237

43-
public class NativeOrderOutputStreamTest {
38+
import org.junit.Assert;
39+
import org.junit.Test;
4440

45-
private NativeOrderOutputStream target;
41+
import jdk.tools.jaotc.utils.NativeOrderOutputStream;
4642

47-
@Before
48-
public void setup() {
49-
target = new NativeOrderOutputStream();
50-
}
43+
public class NativeOrderOutputStreamTest {
5144

5245
@Test
5346
public void shouldAdd4BytesForInt() {
47+
NativeOrderOutputStream target = new NativeOrderOutputStream();
5448
target.putInt(5);
5549
Assert.assertEquals(4, target.position());
5650
}
5751

5852
@Test
5953
public void shouldAdd8BytesForLong() {
54+
NativeOrderOutputStream target = new NativeOrderOutputStream();
6055
target.putLong(8);
6156
Assert.assertEquals(8, target.position());
6257
}
6358

6459
@Test
6560
public void shouldHaveCorrectSizeBeforePatch() {
61+
NativeOrderOutputStream target = new NativeOrderOutputStream();
6662
target.patchableInt();
6763
Assert.assertEquals(4, target.position());
6864
}
6965

7066
@Test
7167
public void shouldHaveCorrectSizeAfterPatch() {
68+
NativeOrderOutputStream target = new NativeOrderOutputStream();
7269
NativeOrderOutputStream.PatchableInt patchableInt = target.patchableInt();
7370
patchableInt.set(12);
7471
Assert.assertEquals(4, target.position());
7572
}
7673

7774
@Test
7875
public void shouldSetCorrectValueInPatch() {
76+
NativeOrderOutputStream target = new NativeOrderOutputStream();
7977
NativeOrderOutputStream.PatchableInt patchableInt = target.patchableInt();
8078
patchableInt.set(42);
81-
Assert.assertEquals(42, getInt(0));
79+
Assert.assertEquals(42, getInt(target, 0));
8280
}
8381

84-
private int getInt(int pos) {
82+
private static int getInt(NativeOrderOutputStream target, int pos) {
8583
ByteBuffer buffer = ByteBuffer.wrap(target.array());
8684
buffer.order(ByteOrder.nativeOrder());
8785
return buffer.getInt(pos);
8886
}
8987

9088
@Test
9189
public void shouldPutArrayCorrectly() {
90+
NativeOrderOutputStream target = new NativeOrderOutputStream();
9291
target.put(new byte[]{42, 5, 43, 44});
9392
Assert.assertEquals(4, target.position());
9493
Assert.assertEquals(42, target.array()[0]);
@@ -97,25 +96,28 @@ public void shouldPutArrayCorrectly() {
9796

9897
@Test
9998
public void shouldOnlyPatchSlot() {
99+
NativeOrderOutputStream target = new NativeOrderOutputStream();
100100
NativeOrderOutputStream.PatchableInt patchableInt = target.patchableInt();
101101
target.putInt(7);
102102
patchableInt.set(39);
103-
Assert.assertEquals(39, getInt(0));
104-
Assert.assertEquals(7, getInt(4));
103+
Assert.assertEquals(39, getInt(target, 0));
104+
Assert.assertEquals(7, getInt(target, 4));
105105
}
106106

107107
@Test
108108
public void shouldBeAbleToPatchAnywhere() {
109+
NativeOrderOutputStream target = new NativeOrderOutputStream();
109110
target.putInt(19);
110111
NativeOrderOutputStream.PatchableInt patchableInt = target.patchableInt();
111112
patchableInt.set(242);
112113

113-
Assert.assertEquals(19, getInt(0));
114-
Assert.assertEquals(242, getInt(4));
114+
Assert.assertEquals(19, getInt(target, 0));
115+
Assert.assertEquals(242, getInt(target, 4));
115116
}
116117

117118
@Test
118119
public void shouldHavePatchableAtRightOffset() {
120+
NativeOrderOutputStream target = new NativeOrderOutputStream();
119121
target.putInt(27);
120122
Assert.assertEquals(4, target.position());
121123
NativeOrderOutputStream.PatchableInt patchableInt = target.patchableInt();
@@ -124,6 +126,7 @@ public void shouldHavePatchableAtRightOffset() {
124126

125127
@Test
126128
public void shouldAlign() {
129+
NativeOrderOutputStream target = new NativeOrderOutputStream();
127130
target.putInt(9);
128131
target.align(16);
129132
target.put(new byte[]{3});

src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Collector.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -40,6 +40,7 @@
4040
import jdk.tools.jaotc.collect.directory.DirectorySourceProvider;
4141
import jdk.tools.jaotc.collect.jar.JarSourceProvider;
4242
import jdk.tools.jaotc.collect.module.ModuleSourceProvider;
43+
import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
4344
import jdk.vm.ci.meta.MetaAccessProvider;
4445
import jdk.vm.ci.meta.ResolvedJavaMethod;
4546
import jdk.vm.ci.meta.ResolvedJavaType;
@@ -92,6 +93,7 @@ private void addMethod(AOTCompiledClass aotClass, ResolvedJavaMethod method, Com
9293
if (!main.filters.shouldCompileMethod(method)) {
9394
return;
9495
}
96+
assert ((HotSpotResolvedObjectType) method.getDeclaringClass()).getFingerprint() != 0 : "no fingerprint for " + method.getDeclaringClass().getName();
9597

9698
aotClass.addMethod(method);
9799
main.printer.printlnVerbose(" added " + method.getName() + method.getSignature().toMethodDescriptor());

src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/MarkId.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it

src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/MetadataBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it

src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/HotSpotGraalManagement.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it

src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/HotSpotGraalRuntimeMBean.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it

src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/package-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it

src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.libgraal/src/jdk/internal/vm/compiler/libgraal/LibGraal.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
package jdk.internal.vm.compiler.libgraal;
2626

2727
import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime;
28+
import jdk.vm.ci.hotspot.HotSpotSpeculationLog;
2829
import jdk.vm.ci.services.Services;
2930

3031
/**
@@ -36,6 +37,10 @@ public static boolean isAvailable() {
3637
return inLibGraal() || isolate != 0L;
3738
}
3839

40+
public static boolean isSupported() {
41+
return true;
42+
}
43+
3944
public static boolean inLibGraal() {
4045
return Services.IS_IN_NATIVE_IMAGE;
4146
}
@@ -91,13 +96,17 @@ static boolean isCurrentThreadAttached(HotSpotJVMCIRuntime runtime) {
9196
return runtime.isCurrentThreadAttached();
9297
}
9398

94-
static boolean attachCurrentThread(HotSpotJVMCIRuntime runtime) {
95-
return runtime.attachCurrentThread(false);
99+
public static boolean attachCurrentThread(HotSpotJVMCIRuntime runtime, boolean isDaemon) {
100+
return runtime.attachCurrentThread(isDaemon);
96101
}
97102

98-
static void detachCurrentThread(HotSpotJVMCIRuntime runtime) {
103+
public static void detachCurrentThread(HotSpotJVMCIRuntime runtime) {
99104
runtime.detachCurrentThread();
100105
}
101106

102107
static native long getCurrentIsolateThread(long iso);
108+
109+
public static long getFailedSpeculationsAddress(HotSpotSpeculationLog log) {
110+
return log.getFailedSpeculationsAddress();
111+
}
103112
}

src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.libgraal/src/jdk/internal/vm/compiler/libgraal/LibGraalScope.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public LibGraalScope(HotSpotJVMCIRuntime runtime) {
7777
parent = currentScope.get();
7878
boolean top = false;
7979
if (parent == null) {
80-
top = LibGraal.attachCurrentThread(runtime);
80+
top = LibGraal.attachCurrentThread(runtime, false);
8181
isolateThread = LibGraal.getCurrentIsolateThread(LibGraal.isolate);
8282
} else {
8383
isolateThread = parent.isolateThread;

0 commit comments

Comments
 (0)