Skip to content

Commit 377cfd7

Browse files
committed
[GR-17457] CallInternalMethodNode#alwaysInlinedUncached needs a boundary
PullRequest: truffleruby/2648
2 parents 01c3fe7 + 2d0a74e commit 377cfd7

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

src/main/java/org/truffleruby/language/methods/CallInternalMethodNode.java

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
*/
1010
package org.truffleruby.language.methods;
1111

12+
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
1213
import com.oracle.truffle.api.frame.Frame;
1314
import com.oracle.truffle.api.TruffleLanguage.ContextReference;
1415
import com.oracle.truffle.api.dsl.CachedContext;
16+
import com.oracle.truffle.api.frame.MaterializedFrame;
1517
import com.oracle.truffle.api.nodes.Node;
1618
import com.oracle.truffle.api.nodes.NodeUtil;
1719
import com.oracle.truffle.api.profiles.BranchProfile;
@@ -105,23 +107,34 @@ protected Object alwaysInlined(
105107
@Specialization(guards = "method.alwaysInlined()", replaces = "alwaysInlined")
106108
protected Object alwaysInlinedUncached(
107109
Frame frame, Object callerData, InternalMethod method, Object self, Object block, Object[] args,
108-
@Cached BranchProfile checkArityProfile,
109-
@Cached BranchProfile exceptionProfile,
110110
@CachedContext(RubyLanguage.class) ContextReference<RubyContext> contextRef) {
111-
return alwaysInlined(
112-
// alwaysInlinedNode.execute() is a @TruffleBoundary with a Frame argument
111+
return alwaysInlinedBoundary(
113112
frame == null ? null : frame.materialize(),
114113
callerData,
115114
method,
116115
self,
117116
block,
118117
args,
118+
contextRef);
119+
}
120+
121+
@TruffleBoundary // getUncachedAlwaysInlinedMethodNode(method) and arity are not PE constants
122+
private Object alwaysInlinedBoundary(
123+
MaterializedFrame frame, Object callerData, InternalMethod method, Object self, Object block, Object[] args,
124+
ContextReference<RubyContext> contextRef) {
125+
return alwaysInlined(
126+
frame,
127+
callerData,
128+
method,
129+
self,
130+
block,
131+
args,
119132
method.getCallTarget(),
120133
method,
121134
getUncachedAlwaysInlinedMethodNode(method),
122135
method.getSharedMethodInfo().getArity(),
123-
checkArityProfile,
124-
exceptionProfile,
136+
BranchProfile.getUncached(),
137+
BranchProfile.getUncached(),
125138
contextRef);
126139
}
127140

0 commit comments

Comments
 (0)