Skip to content

Commit 059c51d

Browse files
committed
Accept int arg in GraalHPyLongFromInt32
1 parent b4f694d commit 059c51d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/hpy/GraalHPyContextFunctions.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@
377377
import com.oracle.truffle.api.TruffleLogger;
378378
import com.oracle.truffle.api.dsl.Bind;
379379
import com.oracle.truffle.api.dsl.Cached;
380+
import com.oracle.truffle.api.dsl.Cached.Exclusive;
380381
import com.oracle.truffle.api.dsl.Cached.Shared;
381382
import com.oracle.truffle.api.dsl.GenerateCached;
382383
import com.oracle.truffle.api.dsl.GenerateUncached;
@@ -1212,9 +1213,16 @@ static PInt doByte(GraalHPyContext hpyContext, byte value) {
12121213
public abstract static class GraalHPyLongFromInt32 extends HPyBinaryContextFunction {
12131214

12141215
@Specialization
1215-
static Object doGeneric(@SuppressWarnings("unused") Object hpyContext, long value,
1216+
static Object doInt(@SuppressWarnings("unused") Object hpyContext, int value,
12161217
@Bind("this") Node inliningTarget,
1217-
@Cached HPyLongFromLong fromLongNode) {
1218+
@Exclusive @Cached HPyLongFromLong fromLongNode) {
1219+
return fromLongNode.execute(inliningTarget, value, true);
1220+
}
1221+
1222+
@Specialization
1223+
static Object doLong(@SuppressWarnings("unused") Object hpyContext, long value,
1224+
@Bind("this") Node inliningTarget,
1225+
@Exclusive @Cached HPyLongFromLong fromLongNode) {
12181226
return fromLongNode.execute(inliningTarget, value, true);
12191227
}
12201228
}

0 commit comments

Comments
 (0)