Skip to content

Commit 6fbc693

Browse files
committed
[GR-67990] Provide the current BCI from Espresso statement.
PullRequest: graal/21887
2 parents e5276df + da7a656 commit 6fbc693

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

espresso/src/com.oracle.truffle.espresso/src/com/oracle/truffle/espresso/nodes/BytecodeNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2963,7 +2963,7 @@ private static boolean assertionsEnabled() {
29632963
}
29642964
}
29652965
if (!seen) {
2966-
statements[mapper.initIndex(i, entry.getBCI())] = new EspressoStatementNode(entry.getBCI(), method.getMethod().getSource().createSection(lineNumber));
2966+
statements[mapper.initIndex(i, entry.getBCI())] = new EspressoStatementNode(method.getMethod().getSource().createSection(lineNumber));
29672967
seenLines[i] = lineNumber;
29682968
maxSeenLine = Math.max(maxSeenLine, lineNumber);
29692969
}

espresso/src/com.oracle.truffle.espresso/src/com/oracle/truffle/espresso/nodes/EspressoStatementNode.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,10 @@
4242
@ExportLibrary(NodeLibrary.class)
4343
public final class EspressoStatementNode extends EspressoInstrumentableNode implements BciProvider {
4444

45-
private final int startBci;
4645
@Child private volatile ProbeNode eagerProbe;
4746
private final SourceSection sourceSection;
4847

49-
EspressoStatementNode(int startBci, SourceSection section) {
50-
this.startBci = startBci;
48+
EspressoStatementNode(SourceSection section) {
5149
this.sourceSection = section;
5250
}
5351

@@ -57,8 +55,8 @@ public SourceSection getSourceSection() {
5755
}
5856

5957
@Override
60-
public int getBci(@SuppressWarnings("unused") Frame frame) {
61-
return startBci;
58+
public int getBci(Frame frame) {
59+
return EspressoFrame.getBCI(frame);
6260
}
6361

6462
@Override

0 commit comments

Comments
 (0)