Skip to content

Commit 88dca10

Browse files
committed
Fix linting, SL compilation tests, and signatures
1 parent 89e147a commit 88dca10

File tree

7 files changed

+11
-14
lines changed

7 files changed

+11
-14
lines changed

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/BytecodeDSLPartialEvaluationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,8 @@ public void testUnwindTagInstrumentation() {
470470
b.endSource();
471471
});
472472

473-
ProxyInstrument.findEnv(c).getInstrumenter().attachExecutionEventListener(SourceSectionFilter.newBuilder(). //
474-
tagIs(ExpressionTag.class).indexIn(text.indexOf("20"), 2).build(),
473+
ProxyInstrument.findEnv(c).getInstrumenter().attachExecutionEventListener(SourceSectionFilter.newBuilder() //
474+
.tagIs(ExpressionTag.class).indexIn(text.indexOf("20"), 2).build(),
475475
new ExecutionEventListener() {
476476

477477
@Override

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/SLCompileBytecodeTestSuite.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
@RunWith(SLTestRunner.class)
3535
@SLTestSuite(value = {"sl"}, options = {//
3636
"engine.BackgroundCompilation", "false",
37-
"engine.SingleTierCompilationThreshold", "10",
37+
"engine.SingleTierCompilationThreshold", "20", // enough to transition to cached
3838
"engine.MultiTier", "false",
3939
"engine.CompileImmediately", "false",
4040
"sl.UseBytecode", "true"

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/builtins/SLCallFunctionsWithBuiltin.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import com.oracle.truffle.api.strings.TruffleString;
3636
import com.oracle.truffle.sl.SLException;
3737
import com.oracle.truffle.sl.SLLanguage;
38+
import com.oracle.truffle.sl.nodes.SLRootNode;
3839
import com.oracle.truffle.sl.runtime.SLContext;
3940
import com.oracle.truffle.sl.runtime.SLFunction;
4041
import com.oracle.truffle.sl.runtime.SLNull;
@@ -67,7 +68,7 @@ public SLNull runTests(TruffleString startsWith, SLFunction harness,
6768
}
6869

6970
private static Source getSource(SLFunction function) {
70-
SourceSection section = function.getCallTarget().getRootNode().getSourceSection();
71+
SourceSection section = ((SLRootNode) function.getCallTarget().getRootNode()).ensureSourceSection();
7172
if (section != null) {
7273
return section.getSource();
7374
}

truffle/src/com.oracle.truffle.api.bytecode.test/src/com/oracle/truffle/api/bytecode/test/basic_interpreter/BasicInterpreterTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ private static void assertInstructionEquals(Instruction actual, ExpectedInstruct
172172
case BRANCH_PROFILE -> assertEquals((double) expectedArgument.value, actualArgument.asBranchProfile().getFrequency(), 0.0001d);
173173
default -> throw new AssertionError(String.format("Testing arguments of kind %s not yet implemented", expectedArgument.kind));
174174
}
175-
;
176175
}
177176
}
178177

truffle/src/com.oracle.truffle.api.bytecode/snapshot.sigtest

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ CLSS public abstract interface !annotation com.oracle.truffle.api.bytecode.Gener
291291
intf java.lang.annotation.Annotation
292292
meth public abstract !hasdefault boolean allowUnsafe()
293293
meth public abstract !hasdefault boolean enableBlockScoping()
294+
meth public abstract !hasdefault boolean enableBytecodeDebugListener()
294295
meth public abstract !hasdefault boolean enableQuickening()
295296
meth public abstract !hasdefault boolean enableRootBodyTagging()
296297
meth public abstract !hasdefault boolean enableRootTagging()
@@ -590,6 +591,10 @@ CLSS public abstract interface !annotation com.oracle.truffle.api.bytecode.Varia
590591
intf java.lang.annotation.Annotation
591592

592593
CLSS public abstract interface com.oracle.truffle.api.bytecode.debug.BytecodeDebugListener
594+
meth public void afterInstructionExecute(com.oracle.truffle.api.bytecode.Instruction,java.lang.Throwable)
595+
meth public void afterRootExecute(com.oracle.truffle.api.bytecode.Instruction,java.lang.Object,java.lang.Throwable)
596+
meth public void beforeInstructionExecute(com.oracle.truffle.api.bytecode.Instruction)
597+
meth public void beforeRootExecute(com.oracle.truffle.api.bytecode.Instruction)
593598
meth public void onBytecodeStackTransition(com.oracle.truffle.api.bytecode.Instruction,com.oracle.truffle.api.bytecode.Instruction)
594599
meth public void onInvalidateInstruction(com.oracle.truffle.api.bytecode.Instruction,com.oracle.truffle.api.bytecode.Instruction)
595600
meth public void onQuicken(com.oracle.truffle.api.bytecode.Instruction,com.oracle.truffle.api.bytecode.Instruction)

truffle/src/com.oracle.truffle.api.bytecode/src/com/oracle/truffle/api/bytecode/debug/BytecodeDebugListener.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
*/
4141
package com.oracle.truffle.api.bytecode.debug;
4242

43-
import com.oracle.truffle.api.bytecode.BytecodeDSLAccess;
4443
import com.oracle.truffle.api.bytecode.GenerateBytecode;
4544
import com.oracle.truffle.api.bytecode.Instruction;
4645

truffle/src/com.oracle.truffle.sl/src/com/oracle/truffle/sl/parser/SLBytecodeParser.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -428,14 +428,7 @@ public Void visitLogic_term(Logic_termContext ctx) {
428428

429429
private void emitShortCircuitOperands(List<? extends ParseTree> operands) {
430430
for (int i = 0; i < operands.size(); i++) {
431-
if (i == operands.size() - 1) {
432-
// Short circuit operations don't convert the last operand to a boolean.
433-
b.beginSLToBoolean();
434-
visit(operands.get(i));
435-
b.endSLToBoolean();
436-
} else {
437-
visit(operands.get(i));
438-
}
431+
visit(operands.get(i));
439432
}
440433
}
441434

0 commit comments

Comments
 (0)