Skip to content

Commit bad63e5

Browse files
committed
[GR-62356] Replace ASM in compiler with ClassFile API
PullRequest: graal/20131
2 parents 961cc3f + 2d47134 commit bad63e5

File tree

150 files changed

+1990
-2875
lines changed

Some content is hidden

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

150 files changed

+1990
-2875
lines changed

compiler/mx.compiler/suite.py

Lines changed: 10 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -85,41 +85,6 @@
8585
"urls" : ["https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/batik-all-1.7.jar"],
8686
},
8787

88-
"ASM_9.7.1" : {
89-
"digest" : "sha512:4767b01603dad5c79cc1e2b5f3722f72b1059d928f184f446ba11badeb1b381b3a3a9a801cc43d25d396df950b09d19597c73173c411b1da890de808b94f1f50",
90-
"sourceDigest" : "sha512:d7c0de5912d04949a3d06cad366ff35a877da2682d9c74579625d62686032ea9349aff6102b17f92e9ec7eb4e9b1cd906b649c6a3ac798bfb9e31e5425de009d",
91-
"maven" : {
92-
"groupId" : "org.ow2.asm",
93-
"artifactId" : "asm",
94-
"version" : "9.7.1",
95-
},
96-
"license" : "BSD-new",
97-
},
98-
99-
"ASM_TREE_9.7.1" : {
100-
"digest" : "sha512:e55008c392fdd35e95d3404766b12dd4b46e13d5c362fcd0ab42a65751a82737eaf0ebc857691d1916190d34407adfde4437615d69c278785416fd911e00978d",
101-
"sourceDigest" : "sha512:3cea80bc7b55679dfa3d2065c6cb6951007cc7817082e9fcf4c5e3cdc073c22eddf7c7899cff60b1092049ec9038e8d3aa9a8828ef731739bda8b5afcec30e86",
102-
"maven" : {
103-
"groupId" : "org.ow2.asm",
104-
"artifactId" : "asm-tree",
105-
"version" : "9.7.1",
106-
},
107-
"dependencies" : ["ASM_9.7.1"],
108-
"license" : "BSD-new",
109-
},
110-
111-
"ASM_UTIL_9.7.1" : {
112-
"digest" : "sha512:522d793d15a2c5ea6504a50222cf0750f1eab7b881cf289675042539b1aba8b3868197b1bebe729de728dd10020eb028ae16252dcd5d84fdcbf7f925832bc269",
113-
"sourceDigest" : "sha512:387aa887bfec24aec287d9aacebfdc0c2e1ab16a4adce933aecac6fc41545ce43a3eea0ed139db52dd0d0af910cfd2162aa4d6330a81b32b64b36f03b49db66a",
114-
"maven" : {
115-
"groupId" : "org.ow2.asm",
116-
"artifactId" : "asm-util",
117-
"version" : "9.7.1",
118-
},
119-
"dependencies" : ["ASM_9.7.1"],
120-
"license" : "BSD-new",
121-
},
122-
12388
"HSDIS" : {
12489
"urlbase" : "https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/hsdis",
12590
"packedResource" : True,
@@ -248,8 +213,6 @@
248213
"dependencies" : [
249214
"jdk.graal.compiler",
250215
"mx:JUNIT",
251-
"ASM_TREE_9.7.1",
252-
"ASM_UTIL_9.7.1",
253216
"JAVA_ALLOCATION_INSTRUMENTER",
254217
"truffle:TRUFFLE_SL_TEST",
255218
"truffle:TRUFFLE_TEST",
@@ -296,7 +259,8 @@
296259
"truffle:TRUFFLE_DSL_PROCESSOR"
297260
],
298261
"checkstyle" : "jdk.graal.compiler",
299-
"javaCompliance" : "21+",
262+
"javaCompliance" : "24+",
263+
"forceJavac": True,
300264
"jacoco" : "exclude",
301265
# warning: [incubating] using incubating module(s): jdk.incubator.vector
302266
"javac.lint.overrides" : "-incubating",
@@ -322,42 +286,6 @@
322286
"workingSets" : "Graal,HotSpot",
323287
},
324288

325-
"jdk.graal.compiler.hotspot.preview.test" : {
326-
"testProject" : True,
327-
"subDir" : "src",
328-
"sourceDirs" : ["src"],
329-
"dependencies" : [
330-
"jdk.graal.compiler.test",
331-
],
332-
"requiresConcealed" : {
333-
"java.base" : [
334-
"jdk.internal.util",
335-
],
336-
"jdk.internal.vm.ci" : [
337-
"jdk.vm.ci.meta",
338-
],
339-
},
340-
"jacoco" : "exclude",
341-
"checkstyle": "jdk.graal.compiler",
342-
"javaCompliance" : "21+",
343-
"javaPreviewNeeded": "21+",
344-
"workingSets" : "Graal,HotSpot,Test",
345-
"graalCompilerSourceEdition": "ignore",
346-
},
347-
348-
"jdk.graal.compiler.virtual.bench" : {
349-
"subDir" : "src",
350-
"sourceDirs" : ["src"],
351-
"dependencies" : ["mx:JMH_1_21", "jdk.graal.compiler.microbenchmarks"],
352-
"checkstyle" : "jdk.graal.compiler",
353-
"javaCompliance" : "21+",
354-
"annotationProcessors" : ["mx:JMH_1_21"],
355-
"spotbugsIgnoresGenerated" : True,
356-
"workingSets" : "Graal,Bench",
357-
"testProject" : True,
358-
"graalCompilerSourceEdition": "ignore",
359-
},
360-
361289
"jdk.graal.compiler.microbenchmarks" : {
362290
"subDir" : "src",
363291
"sourceDirs" : ["src"],
@@ -373,7 +301,8 @@
373301
],
374302
},
375303
"checkstyle" : "jdk.graal.compiler",
376-
"javaCompliance" : "21+",
304+
"javaCompliance" : "24+",
305+
"forceJavac": True,
377306
"checkPackagePrefix" : "false",
378307
"annotationProcessors" : ["mx:JMH_1_21"],
379308
"spotbugsIgnoresGenerated" : True,
@@ -462,7 +391,8 @@
462391
"subDir" : "src",
463392
"sourceDirs" : ["src"],
464393
"workingSets" : "Graal",
465-
"javaCompliance" : "21+",
394+
"javaCompliance" : "24+",
395+
"forceJavac": True,
466396
"checkstyle" : "jdk.graal.compiler",
467397
"dependencies" : [
468398
"GRAAL",
@@ -496,7 +426,8 @@
496426
"subDir" : "src",
497427
"sourceDirs" : ["src"],
498428
"workingSets" : "Graal",
499-
"javaCompliance" : "21+",
429+
"javaCompliance" : "24+",
430+
"forceJavac": True,
500431
"checkstyle" : "jdk.graal.compiler",
501432
"dependencies" : [
502433
"sdk:NATIVEIMAGE_LIBGRAAL",
@@ -507,6 +438,7 @@
507438
"jdk.internal.jimage",
508439
],
509440
},
441+
"spotbugs": "false",
510442
},
511443
},
512444

@@ -526,8 +458,6 @@
526458
"truffle:TRUFFLE_COMPILER",
527459
"truffle:TRUFFLE_RUNTIME",
528460
"regex:TREGEX",
529-
"ASM_TREE_9.7.1",
530-
"ASM_UTIL_9.7.1",
531461
],
532462
"exclude" : [
533463
"mx:JUNIT",
@@ -538,21 +468,6 @@
538468
"maven": False,
539469
"graalCompilerSourceEdition": "ignore",
540470
},
541-
"GRAAL_TEST_PREVIEW_FEATURES" : {
542-
"subDir" : "src",
543-
"dependencies" : [
544-
"jdk.graal.compiler.hotspot.preview.test",
545-
],
546-
"distDependencies" : [
547-
"GRAAL_TEST",
548-
],
549-
"exclude" : [
550-
],
551-
"testDistribution" : True,
552-
"unittestConfig": "graal",
553-
"maven": False,
554-
"graalCompilerSourceEdition": "ignore",
555-
},
556471

557472
"GRAAL_PROCESSOR" : {
558473
"subDir": "src",
@@ -674,7 +589,7 @@
674589
},
675590
"subDir": "src",
676591
"description" : "Module that builds libgraal",
677-
"javaCompliance" : "21+",
592+
"javaCompliance" : "24+",
678593
"dependencies": [
679594
"jdk.graal.compiler.libgraal",
680595
],
@@ -693,7 +608,6 @@
693608
"GRAAL_COMPILER_WHITEBOX_MICRO_BENCHMARKS" : {
694609
"subDir" : "src",
695610
"dependencies" : [
696-
"jdk.graal.compiler.virtual.bench",
697611
"jdk.graal.compiler.microbenchmarks",
698612
],
699613
"distDependencies" : [

compiler/src/jdk.graal.compiler.hotspot.preview.test/src/jdk/graal/compiler/hotspot/preview/test/PreviewEnabledTest.java

Lines changed: 0 additions & 62 deletions
This file was deleted.

compiler/src/jdk.graal.compiler.virtual.bench/src/jdk/graal/compiler/virtual/bench/PartialEscapeBench.java renamed to compiler/src/jdk.graal.compiler.microbenchmarks/src/jdk/graal/compiler/microbenchmarks/graal/PartialEscapeBench.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2025, 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
@@ -22,15 +22,13 @@
2222
* or visit www.oracle.com if you need additional information or have any
2323
* questions.
2424
*/
25-
package jdk.graal.compiler.virtual.bench;
25+
package jdk.graal.compiler.microbenchmarks.graal;
2626

2727
import org.openjdk.jmh.annotations.Benchmark;
2828
import org.openjdk.jmh.annotations.Scope;
2929
import org.openjdk.jmh.annotations.State;
3030
import org.openjdk.jmh.annotations.Warmup;
3131

32-
import jdk.graal.compiler.microbenchmarks.graal.GraalBenchmark;
33-
3432
public class PartialEscapeBench extends GraalBenchmark {
3533

3634
private static class Thing {

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/api/test/ExportingClassLoader.java

Lines changed: 0 additions & 42 deletions
This file was deleted.

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/api/test/ModuleSupport.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2025, 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
@@ -39,7 +39,6 @@
3939
import java.util.Set;
4040

4141
import jdk.graal.compiler.debug.DebugOptions;
42-
4342
import jdk.internal.module.Modules;
4443

4544
public class ModuleSupport {
@@ -110,7 +109,7 @@ public static List<String> getJRTGraalClassNames() throws IOException {
110109

111110
Path top = fs.getPath("/modules/");
112111
Files.find(top, Integer.MAX_VALUE,
113-
(path, attrs) -> attrs.isRegularFile()).forEach(p -> {
112+
(_, attrs) -> attrs.isRegularFile()).forEach(p -> {
114113
int nameCount = p.getNameCount();
115114
if (nameCount > 2) {
116115
String base = p.getName(nameCount - 1).toString();

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/amd64/test/AMD64MatchRuleTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2025, 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
@@ -26,6 +26,9 @@
2626

2727
import static org.junit.Assume.assumeTrue;
2828

29+
import org.junit.Before;
30+
import org.junit.Test;
31+
2932
import jdk.graal.compiler.core.common.cfg.BasicBlock;
3033
import jdk.graal.compiler.core.test.MatchRuleTest;
3134
import jdk.graal.compiler.lir.LIR;
@@ -37,9 +40,6 @@
3740
import jdk.graal.compiler.lir.amd64.AMD64ControlFlow.CmpConstBranchOp;
3841
import jdk.graal.compiler.lir.amd64.AMD64ControlFlow.CmpDataBranchOp;
3942
import jdk.graal.compiler.lir.amd64.AMD64Unary;
40-
import org.junit.Before;
41-
import org.junit.Test;
42-
4343
import jdk.vm.ci.amd64.AMD64;
4444
import jdk.vm.ci.amd64.AMD64Kind;
4545

@@ -103,7 +103,7 @@ public void testVolatileExtension() {
103103
boolean found = false;
104104
for (LIRInstruction ins : lir.getLIRforBlock(lir.getControlFlowGraph().getBlocks()[lir.codeEmittingOrder()[0]])) {
105105
if (ins instanceof AMD64Unary.MemoryOp) {
106-
ins.visitEachOutput((value, mode, flags) -> assertTrue(value.getPlatformKind().toString(), value.getPlatformKind().equals(AMD64Kind.QWORD)));
106+
ins.visitEachOutput((value, _, _) -> assertTrue(value.getPlatformKind().toString(), value.getPlatformKind().equals(AMD64Kind.QWORD)));
107107
assertFalse("MemoryOp expected only once in first block", found);
108108
found = true;
109109
}
@@ -209,7 +209,7 @@ public void testVolatileExtensionDifferentBlocks() {
209209
boolean found = false;
210210
for (LIRInstruction ins : lir.getLIRforBlock(lir.getControlFlowGraph().getBlocks()[lir.codeEmittingOrder()[0]])) {
211211
if (ins instanceof AMD64Unary.MemoryOp) {
212-
ins.visitEachOutput((value, mode, flags) -> assertTrue(value.getPlatformKind().toString(), value.getPlatformKind().equals(AMD64Kind.QWORD)));
212+
ins.visitEachOutput((value, _, _) -> assertTrue(value.getPlatformKind().toString(), value.getPlatformKind().equals(AMD64Kind.QWORD)));
213213
assertFalse("MemoryOp expected only once in first block", found);
214214
found = true;
215215
}

0 commit comments

Comments
 (0)