From e3611c3546431d99283b44e16ccf3721455b8e2b Mon Sep 17 00:00:00 2001 From: Matt D'Souza Date: Fri, 6 Sep 2024 15:28:59 -0400 Subject: [PATCH] Resolve lint/compiler warnings --- .../truffle/api/bytecode/test/ShortCircuitTest.java | 2 +- .../api/bytecode/test/examples/BuiltinTutorial.java | 10 +++++----- .../api/bytecode/test/examples/GettingStarted.java | 8 ++++---- .../bytecode/test/examples/SerializationTutorial.java | 2 +- .../api/bytecode/BytecodeDSLUncheckedAccess.java | 1 + .../oracle/truffle/api/bytecode/GenerateBytecode.java | 1 + .../com/oracle/truffle/api/bytecode/Instruction.java | 1 + .../bytecode/generator/BytecodeRootNodeElement.java | 5 +++-- .../oracle/truffle/sl/bytecode/SLBytecodeRootNode.java | 2 +- 9 files changed, 18 insertions(+), 14 deletions(-) diff --git a/truffle/src/com.oracle.truffle.api.bytecode.test/src/com/oracle/truffle/api/bytecode/test/ShortCircuitTest.java b/truffle/src/com.oracle.truffle.api.bytecode.test/src/com/oracle/truffle/api/bytecode/test/ShortCircuitTest.java index d4d32cf3c134..8c87ff25d53b 100644 --- a/truffle/src/com.oracle.truffle.api.bytecode.test/src/com/oracle/truffle/api/bytecode/test/ShortCircuitTest.java +++ b/truffle/src/com.oracle.truffle.api.bytecode.test/src/com/oracle/truffle/api/bytecode/test/ShortCircuitTest.java @@ -322,7 +322,7 @@ public void testBooleanOr() { int.class})) }) @OperationProxy(value = BooleanConverterOperationProxy.class, javadoc = "Converts a value to its boolean truthy value.") -/** +/* * Note how different boolean converters are used. The converter need not be declared as * an @Operation or @OperationProxy, but if so, it should validate like an implicit @Operation. * diff --git a/truffle/src/com.oracle.truffle.api.bytecode.test/src/com/oracle/truffle/api/bytecode/test/examples/BuiltinTutorial.java b/truffle/src/com.oracle.truffle.api.bytecode.test/src/com/oracle/truffle/api/bytecode/test/examples/BuiltinTutorial.java index e67da52d26ff..912aed4faf56 100644 --- a/truffle/src/com.oracle.truffle.api.bytecode.test/src/com/oracle/truffle/api/bytecode/test/examples/BuiltinTutorial.java +++ b/truffle/src/com.oracle.truffle.api.bytecode.test/src/com/oracle/truffle/api/bytecode/test/examples/BuiltinTutorial.java @@ -183,16 +183,16 @@ static final class InlineBuiltin { @SuppressWarnings("unused") public static Object doDefault(JavaBuiltin builtin, - /** + /* * The variadic annotation allows us to pass any number of arguments to - * the builtin. The concrete number of arguments is contained in - * {@link AbstractBuiltin#args}. We do not statically know them for the + * the builtin. The concrete number of arguments is contained in {@link + * AbstractBuiltin#args}. We do not statically know them for the * builtin. In order to avoid the Object[] allocation one could create * individual operations for a specific number of arguments. */ @Variadic Object[] args, - /** + /* * This instructs the DSL to create a new node for any cached usage of * the builtin. For the uncached initializer builtin.getUncached() is * used. An uncached version of a node is useful to avoid repeated @@ -201,7 +201,7 @@ public static Object doDefault(JavaBuiltin builtin, @Cached(value = "builtin.createNode()", uncached = "builtin.getUncached()", neverDefault = true)// BuiltinNode node) { - /** + /* * The specialization does not do anything special, it just executes the node. This * can either be the cached or the uncached node here. */ diff --git a/truffle/src/com.oracle.truffle.api.bytecode.test/src/com/oracle/truffle/api/bytecode/test/examples/GettingStarted.java b/truffle/src/com.oracle.truffle.api.bytecode.test/src/com/oracle/truffle/api/bytecode/test/examples/GettingStarted.java index 2d119de3c74a..6853ad4da758 100644 --- a/truffle/src/com.oracle.truffle.api.bytecode.test/src/com/oracle/truffle/api/bytecode/test/examples/GettingStarted.java +++ b/truffle/src/com.oracle.truffle.api.bytecode.test/src/com/oracle/truffle/api/bytecode/test/examples/GettingStarted.java @@ -85,7 +85,7 @@ public class GettingStarted { * {@link BytecodeRootNode}. */ @GenerateBytecode(languageClass = BytecodeDSLTestLanguage.class) - /** + /* * Defines a new {@code ScOr} operation. It uses {@code OR} semantics, converts values to * boolean using {@link ToBool}, and produces the converted boolean values. */ @@ -592,10 +592,10 @@ public void testLoopWithBreak() { assertEquals(55, sumToN.getCallTarget().call(10)); } - /** + /* * In addition to the condition and looping contructs, Bytecode DSL has other control flow - * mechanisms for exception handling ({@code TryCatch}, {@code FinallyTry}, and - * {@code FinallyTryCatch}) and continuations ({@code Yield}). We will not cover those here. + * mechanisms for exception handling ({@code TryCatch}, {@code FinallyTry}, and {@code + * FinallyTryCatch}) and continuations ({@code Yield}). We will not cover those here. */ /** diff --git a/truffle/src/com.oracle.truffle.api.bytecode.test/src/com/oracle/truffle/api/bytecode/test/examples/SerializationTutorial.java b/truffle/src/com.oracle.truffle.api.bytecode.test/src/com/oracle/truffle/api/bytecode/test/examples/SerializationTutorial.java index 19e5107c2293..5ea80ae70d74 100644 --- a/truffle/src/com.oracle.truffle.api.bytecode.test/src/com/oracle/truffle/api/bytecode/test/examples/SerializationTutorial.java +++ b/truffle/src/com.oracle.truffle.api.bytecode.test/src/com/oracle/truffle/api/bytecode/test/examples/SerializationTutorial.java @@ -414,7 +414,7 @@ public void testRoundTrip() throws IOException { doTest(rootNode); } - /** + /* * The above example should give you enough information to implement basic serialization in your * language. The rest of this tutorial covers some of the more advanced features of * serialization. diff --git a/truffle/src/com.oracle.truffle.api.bytecode/src/com/oracle/truffle/api/bytecode/BytecodeDSLUncheckedAccess.java b/truffle/src/com.oracle.truffle.api.bytecode/src/com/oracle/truffle/api/bytecode/BytecodeDSLUncheckedAccess.java index 1be01bbb5f6d..0a7b174b8407 100644 --- a/truffle/src/com.oracle.truffle.api.bytecode/src/com/oracle/truffle/api/bytecode/BytecodeDSLUncheckedAccess.java +++ b/truffle/src/com.oracle.truffle.api.bytecode/src/com/oracle/truffle/api/bytecode/BytecodeDSLUncheckedAccess.java @@ -50,6 +50,7 @@ /** * Implementation of BytecodeDSLAccess that uses Unsafe. */ +@SuppressWarnings("deprecation") final class BytecodeDSLUncheckedAccess extends BytecodeDSLAccess { static final Unsafe UNSAFE = initUnsafe(); diff --git a/truffle/src/com.oracle.truffle.api.bytecode/src/com/oracle/truffle/api/bytecode/GenerateBytecode.java b/truffle/src/com.oracle.truffle.api.bytecode/src/com/oracle/truffle/api/bytecode/GenerateBytecode.java index fcf57c2c8896..d18307d41942 100644 --- a/truffle/src/com.oracle.truffle.api.bytecode/src/com/oracle/truffle/api/bytecode/GenerateBytecode.java +++ b/truffle/src/com.oracle.truffle.api.bytecode/src/com/oracle/truffle/api/bytecode/GenerateBytecode.java @@ -96,6 +96,7 @@ */ @Retention(RetentionPolicy.SOURCE) @Target({ElementType.TYPE}) +@SuppressWarnings("dangling-doc-comments") public @interface GenerateBytecode { /** * The {@link TruffleLanguage} class associated with this node. diff --git a/truffle/src/com.oracle.truffle.api.bytecode/src/com/oracle/truffle/api/bytecode/Instruction.java b/truffle/src/com.oracle.truffle.api.bytecode/src/com/oracle/truffle/api/bytecode/Instruction.java index fb2cdacca826..64d38dacf850 100644 --- a/truffle/src/com.oracle.truffle.api.bytecode/src/com/oracle/truffle/api/bytecode/Instruction.java +++ b/truffle/src/com.oracle.truffle.api.bytecode/src/com/oracle/truffle/api/bytecode/Instruction.java @@ -623,6 +623,7 @@ public enum Kind { * * @since 24.2 */ + @SuppressWarnings("dangling-doc-comments") public record BranchProfile( /** * The index of the profile for the branch profile table. diff --git a/truffle/src/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/bytecode/generator/BytecodeRootNodeElement.java b/truffle/src/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/bytecode/generator/BytecodeRootNodeElement.java index 5eaf5e6f09b5..ed6af3fdb7c9 100644 --- a/truffle/src/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/bytecode/generator/BytecodeRootNodeElement.java +++ b/truffle/src/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/bytecode/generator/BytecodeRootNodeElement.java @@ -6437,7 +6437,8 @@ private void buildEmitInstruction(CodeTreeBuilder b, InstructionModel instr, Str int stackEffect = switch (instr.kind) { case BRANCH, BRANCH_BACKWARD, // TAG_ENTER, TAG_LEAVE, TAG_LEAVE_VOID, TAG_RESUME, TAG_YIELD, // - LOAD_LOCAL_MATERIALIZED, CLEAR_LOCAL, YIELD -> 0; + LOAD_LOCAL_MATERIALIZED, CLEAR_LOCAL, YIELD -> + 0; case STORE_NULL, LOAD_VARIADIC, MERGE_VARIADIC -> { /* * NB: These instructions *do* have stack effects. However, they are only used @@ -11660,7 +11661,7 @@ private List createStoreAndRestoreParentFrameMethods() { } final class InterpreterStateElement extends CodeTypeElement { - public InterpreterStateElement() { + InterpreterStateElement() { super(Set.of(PRIVATE, STATIC, FINAL), ElementKind.CLASS, null, "InterpreterState"); if (!model.enableYield) { // Without continuations, this state class is unnecessary. Just pass the sp. diff --git a/truffle/src/com.oracle.truffle.sl/src/com/oracle/truffle/sl/bytecode/SLBytecodeRootNode.java b/truffle/src/com.oracle.truffle.sl/src/com/oracle/truffle/sl/bytecode/SLBytecodeRootNode.java index a4b32cf587e9..3e25563e31b4 100644 --- a/truffle/src/com.oracle.truffle.sl/src/com/oracle/truffle/sl/bytecode/SLBytecodeRootNode.java +++ b/truffle/src/com.oracle.truffle.sl/src/com/oracle/truffle/sl/bytecode/SLBytecodeRootNode.java @@ -103,7 +103,7 @@ languageClass = SLLanguage.class, // boxingEliminationTypes = {long.class, boolean.class}, // enableUncachedInterpreter = true, - /** + /* * Simple language needs to run code before the root body tag to set local * variables, so we disable implicit root-body tagging and do this manually in * {@link SLBytecodeParser#visitFunction}.