Skip to content

Commit

Permalink
The this in @Bind is now discouraged
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Marr <[email protected]>
  • Loading branch information
smarr committed Dec 15, 2024
1 parent 9fe7e34 commit 951c40a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public final Object cachedBlock(final boolean rcvr, final SBlock arg,
@SuppressWarnings("unused") @Cached("arg.getMethod()") final SInvokable method,
@Cached("create(method.getCallTarget())") final DirectCallNode callTarget,
@Shared("all") @Cached final InlinedCountingConditionProfile condProf,
@Bind("this") final Node node) {
@Bind final Node node) {
if (condProf.profile(node, rcvr == expected)) {
return callTarget.call(new Object[] {arg});
} else {
Expand All @@ -78,7 +78,7 @@ public final Object cachedBlock(final boolean rcvr, final SBlock arg,
public final Object fallback(final boolean rcvr, final SBlock arg,
@Cached final IndirectCallNode callNode,
@Shared("all") @Cached final InlinedCountingConditionProfile condProf,
@Bind("this") final Node node) {
@Bind final Node node) {
if (condProf.profile(node, rcvr == expected)) {
return callNode.call(arg.getMethod().getCallTarget(), new Object[] {arg});
} else {
Expand All @@ -93,7 +93,7 @@ protected static final boolean notABlock(final Object arg) {
@Specialization(guards = {"notABlock(arg)"})
public final Object literal(final boolean rcvr, final Object arg,
@Shared("all") @Cached final InlinedCountingConditionProfile condProf,
@Bind("this") final Node node) {
@Bind final Node node) {
if (condProf.profile(node, rcvr == expected)) {
return arg;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public SSymbol getSelector() {
public final Object doIfTrueIfFalseWithInliningTwoBlocks(final boolean receiver,
final SBlock trueBlock, final SBlock falseBlock,
@Shared("all") @Cached final InlinedCountingConditionProfile condProf,
@Bind("this") final Node node) {
@Bind final Node node) {
if (condProf.profile(node, receiver)) {
return trueValueSend.call(new Object[] {trueBlock});
} else {
Expand All @@ -86,7 +86,7 @@ public final Object doIfTrueIfFalseWithInliningTwoBlocks(final boolean receiver,
public final Object doIfTrueIfFalse(final boolean receiver, final SBlock trueBlock,
final SBlock falseBlock,
@Shared("all") @Cached final InlinedCountingConditionProfile condProf,
@Bind("this") final Node node) {
@Bind final Node node) {
CompilerAsserts.neverPartOfCompilation("IfTrueIfFalseMessageNode.10");
if (condProf.profile(node, receiver)) {
return trueBlock.getMethod().invoke(call, new Object[] {trueBlock});
Expand All @@ -99,7 +99,7 @@ public final Object doIfTrueIfFalse(final boolean receiver, final SBlock trueBlo
public final Object doIfTrueIfFalseWithInliningTrueValue(final boolean receiver,
final Object trueValue, final SBlock falseBlock,
@Shared("all") @Cached final InlinedCountingConditionProfile condProf,
@Bind("this") final Node node) {
@Bind final Node node) {
if (condProf.profile(node, receiver)) {
return trueValue;
} else {
Expand All @@ -111,7 +111,7 @@ public final Object doIfTrueIfFalseWithInliningTrueValue(final boolean receiver,
public final Object doIfTrueIfFalseWithInliningFalseValue(final boolean receiver,
final SBlock trueBlock, final Object falseValue,
@Shared("all") @Cached final InlinedCountingConditionProfile condProf,
@Bind("this") final Node node) {
@Bind final Node node) {
if (condProf.profile(node, receiver)) {
return trueValueSend.call(new Object[] {trueBlock});
} else {
Expand All @@ -124,7 +124,7 @@ public final Object doIfTrueIfFalseWithInliningFalseValue(final boolean receiver
public final Object doIfTrueIfFalseTrueValue(final boolean receiver, final Object trueValue,
final SBlock falseBlock,
@Shared("all") @Cached final InlinedCountingConditionProfile condProf,
@Bind("this") final Node node) {
@Bind final Node node) {
if (condProf.profile(node, receiver)) {
return trueValue;
} else {
Expand All @@ -138,7 +138,7 @@ public final Object doIfTrueIfFalseTrueValue(final boolean receiver, final Objec
public final Object doIfTrueIfFalseFalseValue(final boolean receiver, final SBlock trueBlock,
final Object falseValue,
@Shared("all") @Cached final InlinedCountingConditionProfile condProf,
@Bind("this") final Node node) {
@Bind final Node node) {
if (condProf.profile(node, receiver)) {
CompilerAsserts.neverPartOfCompilation("IfTrueIfFalseMessageNode.30");
return trueBlock.getMethod().invoke(call, new Object[] {trueBlock});
Expand All @@ -151,7 +151,7 @@ public final Object doIfTrueIfFalseFalseValue(final boolean receiver, final SBlo
public static final Object doIfTrueIfFalseTwoValues(
final boolean receiver, final Object trueValue, final Object falseValue,
@Shared("all") @Cached final InlinedCountingConditionProfile condProf,
@Bind("this") final Node node) {
@Bind final Node node) {
if (condProf.profile(node, receiver)) {
return trueValue;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public abstract class SqrtPrim extends UnaryExpressionNode {

@Specialization
public static final Object doLong(final long receiver,
@Cached final InlinedConditionProfile longOrDouble, @Bind("this") final Node node) {
@Cached final InlinedConditionProfile longOrDouble, @Bind final Node node) {
double result = Math.sqrt(receiver);

if (longOrDouble.profile(node, result == Math.rint(result))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public SSymbol getSelector() {

@Specialization(rewriteOn = ArithmeticException.class)
public static final long doLong(final long receiver, final long right,
@Cached final InlinedBranchProfile overflow, @Bind("this") final Node node) {
@Cached final InlinedBranchProfile overflow, @Bind final Node node) {
assert right >= 0; // currently not defined for negative values of right

if (Long.SIZE - Long.numberOfLeadingZeros(receiver) + right > Long.SIZE - 1) {
Expand Down

0 comments on commit 951c40a

Please sign in to comment.