Skip to content

Commit e82d109

Browse files
committed
[GR-25120] Fixed leaked indirect java constants on jdk15.
PullRequest: graal/6909
2 parents 276c627 + 24fe873 commit e82d109

File tree

2 files changed

+72
-1
lines changed

2 files changed

+72
-1
lines changed

compiler/mx.compiler/suite.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,8 +593,9 @@
593593
],
594594
"requiresConcealed" : {
595595
"jdk.internal.vm.ci" : [
596-
"jdk.vm.ci.meta",
597596
"jdk.vm.ci.hotspot",
597+
"jdk.vm.ci.meta",
598+
"jdk.vm.ci.services",
598599
],
599600
},
600601
"annotationProcessors" : [
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/*
2+
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation. Oracle designates this
8+
* particular file as subject to the "Classpath" exception as provided
9+
* by Oracle in the LICENSE file that accompanied this code.
10+
*
11+
* This code is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
* version 2 for more details (a copy is included in the LICENSE file that
15+
* accompanied this code).
16+
*
17+
* You should have received a copy of the GNU General Public License version
18+
* 2 along with this work; if not, write to the Free Software Foundation,
19+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+
*
21+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+
* or visit www.oracle.com if you need additional information or have any
23+
* questions.
24+
*/
25+
package org.graalvm.compiler.hotspot;
26+
27+
import java.util.Objects;
28+
29+
import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime;
30+
import jdk.vm.ci.hotspot.HotSpotMetaData;
31+
import jdk.vm.ci.hotspot.HotSpotObjectConstantScope;
32+
import jdk.vm.ci.hotspot.HotSpotSpeculationLog;
33+
import jdk.vm.ci.meta.SpeculationLog;
34+
import jdk.vm.ci.services.Services;
35+
36+
/**
37+
* JDK 15 version of {@code HotSpotGraalServices}.
38+
*/
39+
public class HotSpotGraalServices {
40+
41+
/**
42+
* Get the implicit exceptions section of a {@code HotSpotMetaData} if it exists.
43+
*/
44+
@SuppressWarnings("unused")
45+
public static byte[] getImplicitExceptionBytes(HotSpotMetaData metaData) {
46+
return metaData.implicitExceptionBytes();
47+
}
48+
49+
public static CompilationContext enterGlobalCompilationContext() {
50+
HotSpotObjectConstantScope impl = HotSpotObjectConstantScope.enterGlobalScope();
51+
return impl == null ? null : new CompilationContext(impl);
52+
}
53+
54+
public static CompilationContext openLocalCompilationContext(Object description) {
55+
HotSpotObjectConstantScope impl = HotSpotObjectConstantScope.openLocalScope(Objects.requireNonNull(description));
56+
return impl == null ? null : new CompilationContext(impl);
57+
}
58+
59+
public static void exit(int status) {
60+
if (Services.IS_IN_NATIVE_IMAGE) {
61+
HotSpotJVMCIRuntime.runtime().exitHotSpot(status);
62+
} else {
63+
System.exit(status);
64+
}
65+
}
66+
67+
public static SpeculationLog newHotSpotSpeculationLog(long cachedFailedSpeculationsAddress) {
68+
return new HotSpotSpeculationLog(cachedFailedSpeculationsAddress);
69+
}
70+
}

0 commit comments

Comments
 (0)