|
9 | 9 | */
|
10 | 10 | package org.truffleruby.language.methods;
|
11 | 11 |
|
| 12 | +import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary; |
12 | 13 | import com.oracle.truffle.api.frame.Frame;
|
13 | 14 | import com.oracle.truffle.api.TruffleLanguage.ContextReference;
|
14 | 15 | import com.oracle.truffle.api.dsl.CachedContext;
|
| 16 | +import com.oracle.truffle.api.frame.MaterializedFrame; |
15 | 17 | import com.oracle.truffle.api.nodes.Node;
|
16 | 18 | import com.oracle.truffle.api.nodes.NodeUtil;
|
17 | 19 | import com.oracle.truffle.api.profiles.BranchProfile;
|
@@ -105,23 +107,34 @@ protected Object alwaysInlined(
|
105 | 107 | @Specialization(guards = "method.alwaysInlined()", replaces = "alwaysInlined")
|
106 | 108 | protected Object alwaysInlinedUncached(
|
107 | 109 | Frame frame, Object callerData, InternalMethod method, Object self, Object block, Object[] args,
|
108 |
| - @Cached BranchProfile checkArityProfile, |
109 |
| - @Cached BranchProfile exceptionProfile, |
110 | 110 | @CachedContext(RubyLanguage.class) ContextReference<RubyContext> contextRef) {
|
111 |
| - return alwaysInlined( |
112 |
| - // alwaysInlinedNode.execute() is a @TruffleBoundary with a Frame argument |
| 111 | + return alwaysInlinedBoundary( |
113 | 112 | frame == null ? null : frame.materialize(),
|
114 | 113 | callerData,
|
115 | 114 | method,
|
116 | 115 | self,
|
117 | 116 | block,
|
118 | 117 | 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, |
119 | 132 | method.getCallTarget(),
|
120 | 133 | method,
|
121 | 134 | getUncachedAlwaysInlinedMethodNode(method),
|
122 | 135 | method.getSharedMethodInfo().getArity(),
|
123 |
| - checkArityProfile, |
124 |
| - exceptionProfile, |
| 136 | + BranchProfile.getUncached(), |
| 137 | + BranchProfile.getUncached(), |
125 | 138 | contextRef);
|
126 | 139 | }
|
127 | 140 |
|
|
0 commit comments