Skip to content

Commit

Permalink
Showing 6 changed files with 13 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -52,23 +52,15 @@ public CachedBooleanDispatchNode(

if (falseMethod != null) {
this.falseCallDirect = Truffle.getRuntime().createDirectCallNode(falseMethod.getCallTarget());

if (falseCallDirect.isCallTargetCloningAllowed() && falseMethod.getSharedMethodInfo().shouldAlwaysClone()) {
insert(falseCallDirect);
falseCallDirect.cloneCallTarget();
}
applySplittingStrategy(falseCallDirect, falseMethod);
}

this.trueUnmodifiedAssumption = trueUnmodifiedAssumption;
this.trueMethod = trueMethod;

if (trueMethod != null) {
this.trueCallDirect = Truffle.getRuntime().createDirectCallNode(trueMethod.getCallTarget());

if (trueCallDirect.isCallTargetCloningAllowed() && trueMethod.getSharedMethodInfo().shouldAlwaysClone()) {
insert(trueCallDirect);
trueCallDirect.cloneCallTarget();
}
applySplittingStrategy(trueCallDirect, trueMethod);
}
}

Original file line number Diff line number Diff line change
@@ -44,11 +44,7 @@ public CachedBoxedDispatchNode(
this.next = next;
this.method = method;
this.callNode = Truffle.getRuntime().createDirectCallNode(method.getCallTarget());

if (callNode.isCallTargetCloningAllowed() && method.getSharedMethodInfo().shouldAlwaysClone()) {
insert(callNode);
callNode.cloneCallTarget();
}
applySplittingStrategy(callNode, method);
}

@Override
Original file line number Diff line number Diff line change
@@ -39,11 +39,7 @@ public CachedBoxedSymbolDispatchNode(
this.unmodifiedAssumption = Layouts.MODULE.getFields(context.getCoreLibrary().getSymbolClass()).getUnmodifiedAssumption();
this.method = method;
this.callNode = Truffle.getRuntime().createDirectCallNode(method.getCallTarget());

if (callNode.isCallTargetCloningAllowed() && method.getSharedMethodInfo().shouldAlwaysClone()) {
insert(callNode);
callNode.cloneCallTarget();
}
applySplittingStrategy(callNode, method);
}

@Override
Original file line number Diff line number Diff line change
@@ -80,6 +80,13 @@ protected DynamicObject getCachedNameAsSymbol() {
return cachedNameAsSymbol;
}

protected void applySplittingStrategy(DirectCallNode callNode, InternalMethod method) {
if (callNode.isCallTargetCloningAllowed() && method.getSharedMethodInfo().shouldAlwaysClone()) {
insert(callNode);
callNode.cloneCallTarget();
}
}

protected static Object call(DirectCallNode callNode, VirtualFrame frame, InternalMethod method, Object receiver, DynamicObject block, Object[] arguments) {
return callNode.call(
frame,
Original file line number Diff line number Diff line change
@@ -47,11 +47,7 @@ public CachedSingletonDispatchNode(
this.next = next;
this.method = method;
this.callNode = Truffle.getRuntime().createDirectCallNode(method.getCallTarget());

if (callNode.isCallTargetCloningAllowed() && method.getSharedMethodInfo().shouldAlwaysClone()) {
insert(callNode);
callNode.cloneCallTarget();
}
applySplittingStrategy(callNode, method);
}

@Override
Original file line number Diff line number Diff line change
@@ -41,11 +41,7 @@ public CachedUnboxedDispatchNode(
this.unmodifiedAssumption = unmodifiedAssumption;
this.method = method;
this.callNode = Truffle.getRuntime().createDirectCallNode(method.getCallTarget());

if (callNode.isCallTargetCloningAllowed() && method.getSharedMethodInfo().shouldAlwaysClone()) {
insert(callNode);
callNode.cloneCallTarget();
}
applySplittingStrategy(callNode, method);
}

@Override

0 comments on commit 5a1d1fb

Please sign in to comment.