Skip to content

Commit d900c6d

Browse files
committed
[GR-32841] Update Truffle, which now automatically profiles LoopNode and RepeatingNode
1 parent 2eb8e01 commit d900c6d

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

mx.truffleruby/suite.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{
88
"name": "regex",
99
"subdir": True,
10-
"version": "c7604b7fd48cc8c3509cf215cd5e268748a81d85",
10+
"version": "86651e3bf6af2662ada38eccdf1f5ebe632d30db",
1111
"urls": [
1212
{"url": "https://github.com/oracle/graal.git", "kind": "git"},
1313
{"url": "https://curio.ssw.jku.at/nexus/content/repositories/snapshots", "kind": "binary"},
@@ -16,7 +16,7 @@
1616
{
1717
"name": "sulong",
1818
"subdir": True,
19-
"version": "c7604b7fd48cc8c3509cf215cd5e268748a81d85",
19+
"version": "86651e3bf6af2662ada38eccdf1f5ebe632d30db",
2020
"urls": [
2121
{"url": "https://github.com/oracle/graal.git", "kind": "git"},
2222
{"url": "https://curio.ssw.jku.at/nexus/content/repositories/snapshots", "kind": "binary"},

src/main/java/org/truffleruby/core/format/control/StarNode.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import com.oracle.truffle.api.nodes.LoopNode;
1717
import com.oracle.truffle.api.nodes.Node;
1818
import com.oracle.truffle.api.nodes.RepeatingNode;
19-
import com.oracle.truffle.api.profiles.ConditionProfile;
2019

2120
public class StarNode extends FormatNode {
2221

@@ -36,15 +35,13 @@ private class StarRepeatingNode extends Node implements RepeatingNode {
3635

3736
@Child private FormatNode child;
3837

39-
private final ConditionProfile conditionProfile = ConditionProfile.create();
40-
4138
public StarRepeatingNode(FormatNode child) {
4239
this.child = child;
4340
}
4441

4542
@Override
4643
public boolean executeRepeating(VirtualFrame frame) {
47-
if (conditionProfile.profile(getSourcePosition(frame) >= getSourceLength(frame))) {
44+
if (getSourcePosition(frame) >= getSourceLength(frame)) {
4845
return false;
4946
}
5047

src/main/java/org/truffleruby/language/control/WhileNode.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import com.oracle.truffle.api.nodes.LoopNode;
2323
import com.oracle.truffle.api.nodes.RepeatingNode;
2424
import com.oracle.truffle.api.profiles.BranchProfile;
25-
import com.oracle.truffle.api.profiles.LoopConditionProfile;
2625

2726
public final class WhileNode extends RubyContextSourceNode {
2827

@@ -43,7 +42,6 @@ private abstract static class WhileRepeatingBaseNode extends RubyBaseNode implem
4342
@Child protected BooleanCastNode condition;
4443
@Child protected RubyNode body;
4544

46-
protected final LoopConditionProfile conditionProfile = LoopConditionProfile.createCountingProfile();
4745
protected final BranchProfile redoUsed = BranchProfile.create();
4846
protected final BranchProfile nextUsed = BranchProfile.create();
4947

@@ -67,7 +65,7 @@ public WhileRepeatingNode(RubyNode condition, RubyNode body) {
6765

6866
@Override
6967
public boolean executeRepeating(VirtualFrame frame) {
70-
if (!conditionProfile.profile(condition.executeBoolean(frame))) {
68+
if (!condition.executeBoolean(frame)) {
7169
return false;
7270
}
7371

@@ -106,7 +104,7 @@ public boolean executeRepeating(VirtualFrame frame) {
106104
return true;
107105
}
108106

109-
return conditionProfile.profile(condition.executeBoolean(frame));
107+
return condition.executeBoolean(frame);
110108
}
111109

112110
}

0 commit comments

Comments
 (0)