Skip to content

Commit 8562e51

Browse files
committed
Rename RubyRootNode.forTarget() to RubyRootNode.of()
1 parent ee84d28 commit 8562e51

File tree

9 files changed

+12
-12
lines changed

9 files changed

+12
-12
lines changed

src/main/java/org/truffleruby/builtins/CoreMethodNodeManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ private static void addMethod(
269269
if (alwaysInlined) {
270270
callTarget = callTargetFactory.apply(sharedMethodInfo);
271271
callTargetSupplier = null;
272-
final RubyRootNode rootNode = RubyRootNode.forTarget(callTarget);
272+
final RubyRootNode rootNode = RubyRootNode.of(callTarget);
273273
alwaysInlinedNodeFactory = ((ReRaiseInlinedExceptionNode) rootNode.getBody()).nodeFactory;
274274
} else {
275275
if (context.getLanguageSlow().options.LAZY_CALLTARGETS) {

src/main/java/org/truffleruby/core/method/MethodNodes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ protected RootCallTarget methodCallTarget(InternalMethod method) {
323323
// We need to preserve the method receiver and we want to have the same argument list
324324

325325
final SourceSection sourceSection = method.getSharedMethodInfo().getSourceSection();
326-
final RubyRootNode oldRootNode = RubyRootNode.forTarget(method.getCallTarget());
326+
final RubyRootNode oldRootNode = RubyRootNode.of(method.getCallTarget());
327327

328328
final SetReceiverNode setReceiverNode = new SetReceiverNode(method.getCallTarget());
329329
final RootNode newRootNode = new RubyRootNode(

src/main/java/org/truffleruby/core/module/ModuleNodes.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ public abstract static class GeneratedReaderNode extends AlwaysInlinedMethodNode
397397
protected Object reader(Frame frame, RubyDynamicObject self, Object[] args, Object block, RootCallTarget target,
398398
@CachedLibrary("self") DynamicObjectLibrary objectLibrary) {
399399
// Or a subclass of RubyRootNode with an extra field?
400-
final String ivarName = RubyRootNode.forTarget(target).getSharedMethodInfo().getNotes();
400+
final String ivarName = RubyRootNode.of(target).getSharedMethodInfo().getNotes();
401401
CompilerAsserts.partialEvaluationConstant(ivarName);
402402

403403
return objectLibrary.getOrDefault(self, ivarName, nil);
@@ -420,7 +420,7 @@ public abstract static class GeneratedWriterNode extends AlwaysInlinedMethodNode
420420
protected Object writer(Frame frame, RubyDynamicObject self, Object[] args, Object block, RootCallTarget target,
421421
@CachedLibrary(limit = "getRubyLibraryCacheLimit()") RubyLibrary rubyLibrary,
422422
@Cached WriteObjectFieldNode writeObjectFieldNode) {
423-
final String ivarName = RubyRootNode.forTarget(target).getSharedMethodInfo().getNotes();
423+
final String ivarName = RubyRootNode.of(target).getSharedMethodInfo().getNotes();
424424
CompilerAsserts.partialEvaluationConstant(ivarName);
425425

426426
final Object value = args[0];
@@ -1319,7 +1319,7 @@ private RubySymbol defineMethodInternal(RubyModule module, String name, RubyUnbo
13191319
@TruffleBoundary
13201320
private RubySymbol defineMethod(RubyModule module, String name, RubyProc proc,
13211321
MaterializedFrame callerFrame) {
1322-
final RubyRootNode rootNode = RubyRootNode.forTarget(proc.callTargets.getCallTargetForLambda());
1322+
final RubyRootNode rootNode = RubyRootNode.of(proc.callTargets.getCallTargetForLambda());
13231323
final SharedMethodInfo info = proc.sharedMethodInfo.forDefineMethod(module, name);
13241324

13251325
final RubyNode body = NodeUtil.cloneNode(rootNode.getBody());

src/main/java/org/truffleruby/core/proc/ProcCallTargets.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,6 @@ public RootCallTarget getCallTargetForLambda() {
6868
}
6969

7070
private void copySplit(RootCallTarget src, RootCallTarget dst) {
71-
RubyRootNode.forTarget(dst).setSplit(RubyRootNode.forTarget(src).getSplit());
71+
RubyRootNode.of(dst).setSplit(RubyRootNode.of(src).getSplit());
7272
}
7373
}

src/main/java/org/truffleruby/core/symbol/SymbolNodes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public static RubyProc createProc(RubyContext context, RubyLanguage language,
174174
context.getCoreLibrary().procClass,
175175
language.procShape,
176176
ProcType.PROC,
177-
RubyRootNode.forTarget(callTarget).getSharedMethodInfo(),
177+
RubyRootNode.of(callTarget).getSharedMethodInfo(),
178178
new ProcCallTargets(callTarget, callTarget),
179179
declarationFrame,
180180
variables,

src/main/java/org/truffleruby/extra/TruffleGraalNodes.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ protected Object alwaysSplit(Object executable,
5151
@Cached ToCallTargetNode toCallTargetNode) {
5252
final RootCallTarget callTarget = toCallTargetNode.execute(executable);
5353
if (getContext().getOptions().ALWAYS_SPLIT_HONOR) {
54-
RubyRootNode.forTarget(callTarget).setSplit(Split.ALWAYS);
54+
RubyRootNode.of(callTarget).setSplit(Split.ALWAYS);
5555
}
5656
return executable;
5757
}
@@ -65,7 +65,7 @@ protected Object neverSplit(Object executable,
6565
@Cached ToCallTargetNode toCallTargetNode) {
6666
final RootCallTarget callTarget = toCallTargetNode.execute(executable);
6767
if (getContext().getOptions().NEVER_SPLIT_HONOR) {
68-
RubyRootNode.forTarget(callTarget).setSplit(Split.NEVER);
68+
RubyRootNode.of(callTarget).setSplit(Split.NEVER);
6969
}
7070
return executable;
7171
}

src/main/java/org/truffleruby/language/RubyRootNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
public final class RubyRootNode extends RubyBaseRootNode {
2222

23-
public static RubyRootNode forTarget(RootCallTarget callTarget) {
23+
public static RubyRootNode of(RootCallTarget callTarget) {
2424
return (RubyRootNode) callTarget.getRootNode();
2525
}
2626

src/main/java/org/truffleruby/language/dispatch/DispatchNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public final void applySplittingInliningStrategy(RootCallTarget callTarget, Stri
200200
final boolean isMethodMissing = methodName.equals("method_missing");
201201

202202
if (callNode.isCallTargetCloningAllowed() &&
203-
(RubyRootNode.forTarget(callTarget).shouldAlwaysClone() ||
203+
(RubyRootNode.of(callTarget).shouldAlwaysClone() ||
204204
isMethodMissing && options.METHODMISSING_ALWAYS_CLONE)) {
205205
callNode.cloneCallTarget();
206206
}

src/main/java/org/truffleruby/language/yield/CallBlockNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ private Object[] packArguments(DeclarationContext declarationContext, RubyProc b
8080
protected DirectCallNode createBlockCallNode(RubyContext context, RubyProc block, RootCallTarget callTarget) {
8181
final DirectCallNode callNode = Truffle.getRuntime().createDirectCallNode(callTarget);
8282

83-
final boolean clone = RubyRootNode.forTarget(block.callTarget).shouldAlwaysClone() ||
83+
final boolean clone = RubyRootNode.of(block.callTarget).shouldAlwaysClone() ||
8484
context.getOptions().YIELD_ALWAYS_CLONE;
8585
if (clone && callNode.isCallTargetCloningAllowed()) {
8686
callNode.cloneCallTarget();

0 commit comments

Comments
 (0)