Skip to content

Commit 51db1d1

Browse files
committed
[GR-7714] Fix invalid replace declarations.
PullRequest: truffleruby/681
2 parents b3e883e + 91fd109 commit 51db1d1

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/main/java/org/truffleruby/core/numeric/IntegerNodes.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,31 +72,31 @@ public abstract static class NegNode extends BignumCoreMethodNode {
7272
public abstract Object executeNeg(Object a);
7373

7474
@Specialization(rewriteOn = ArithmeticException.class)
75-
public int neg(int value) {
75+
public int doInt(int value) {
7676
// TODO CS 13-Oct-16, use negateExact, but this isn't intrinsified by Graal yet
7777
return Math.subtractExact(0, value);
7878
}
7979

80-
@Specialization(replaces = "neg")
81-
public Object negWithOverflow(int value) {
80+
@Specialization(replaces = "doInt")
81+
public Object doIntWithOverflow(int value) {
8282
if (value == Integer.MIN_VALUE) {
8383
return -((long) value);
8484
}
8585
return -value;
8686
}
8787

8888
@Specialization(rewriteOn = ArithmeticException.class)
89-
public long neg(long value) {
89+
public long doLong(long value) {
9090
return Math.subtractExact(0, value);
9191
}
9292

93-
@Specialization
94-
public Object negWithOverflow(long value) {
93+
@Specialization(replaces = "doLong")
94+
public Object doLongWihtOverflow(long value) {
9595
return fixnumOrBignum(BigInteger.valueOf(value).negate());
9696
}
9797

9898
@Specialization
99-
public Object neg(DynamicObject value) {
99+
public Object doObject(DynamicObject value) {
100100
return fixnumOrBignum(Layouts.BIGNUM.getValue(value).negate());
101101
}
102102

src/main/java/org/truffleruby/interop/FromJavaStringNode.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ public static FromJavaStringNode create() {
2828
public abstract DynamicObject executeFromJavaString(Object value);
2929

3030
@Specialization(guards = "stringsEquals(cachedValue, value)", limit = "getLimit()")
31-
public DynamicObject fromJavaString(String value,
31+
public DynamicObject doCached(String value,
3232
@Cached("value") String cachedValue,
3333
@Cached("getRope(value)") Rope cachedRope,
3434
@Cached("create()") StringNodes.MakeStringNode makeStringNode) {
3535
return makeStringNode.fromRope(cachedRope);
3636
}
3737

38-
@Specialization(replaces = "fromJavaString")
39-
public DynamicObject fromJavaString(String value,
38+
@Specialization(replaces = "doCached")
39+
public DynamicObject doGeneric(String value,
4040
@Cached("create()") StringNodes.MakeStringNode makeStringNode) {
4141
return makeStringNode.executeMake(value, UTF8Encoding.INSTANCE, CodeRange.CR_UNKNOWN);
4242
}

0 commit comments

Comments
 (0)