@@ -356,7 +356,7 @@ static PrimitiveNativeWrapper doIntegerSmall(@SuppressWarnings("unused") CExtCon
356
356
@ Specialization (replaces = "doIntegerSmall" )
357
357
static PrimitiveNativeWrapper doInteger (@ SuppressWarnings ("unused" ) CExtContext cextContext , int i ,
358
358
@ Shared ("contextRef" ) @ CachedContext (PythonLanguage .class ) ContextReference <PythonContext > contextRef ) {
359
- if (CApiGuards .isSmallInteger (i )) {
359
+ if (CompilerDirectives . inInterpreter () && CApiGuards .isSmallInteger (i )) {
360
360
return doIntegerSmall (cextContext , i , contextRef );
361
361
}
362
362
return PrimitiveNativeWrapper .createInt (i );
@@ -375,7 +375,7 @@ static PrimitiveNativeWrapper doLongSmall(@SuppressWarnings("unused") CExtContex
375
375
@ Specialization (replaces = "doLongSmall" )
376
376
static PrimitiveNativeWrapper doLong (@ SuppressWarnings ("unused" ) CExtContext cextContext , long l ,
377
377
@ Shared ("contextRef" ) @ CachedContext (PythonLanguage .class ) ContextReference <PythonContext > contextRef ) {
378
- if (CApiGuards .isSmallLong (l )) {
378
+ if (CompilerDirectives . inInterpreter () && CApiGuards .isSmallLong (l )) {
379
379
return doLongSmall (cextContext , l , contextRef );
380
380
}
381
381
return PrimitiveNativeWrapper .createLong (l );
@@ -604,7 +604,7 @@ static PrimitiveNativeWrapper doLongSmall(@SuppressWarnings("unused") CExtContex
604
604
@ Specialization (replaces = "doIntegerSmall" )
605
605
static PrimitiveNativeWrapper doInteger (CExtContext cextContext , int i ,
606
606
@ Shared ("contextRef" ) @ CachedContext (PythonLanguage .class ) ContextReference <PythonContext > contextRef ) {
607
- if (CApiGuards .isSmallInteger (i )) {
607
+ if (CompilerDirectives . inInterpreter () && CApiGuards .isSmallInteger (i )) {
608
608
return doIntegerSmall (cextContext , i , contextRef );
609
609
}
610
610
return PrimitiveNativeWrapper .createInt (i );
@@ -613,7 +613,7 @@ static PrimitiveNativeWrapper doInteger(CExtContext cextContext, int i,
613
613
@ Specialization (replaces = "doLongSmall" )
614
614
static PrimitiveNativeWrapper doLong (CExtContext cextContext , long l ,
615
615
@ Shared ("contextRef" ) @ CachedContext (PythonLanguage .class ) ContextReference <PythonContext > contextRef ) {
616
- if (CApiGuards .isSmallLong (l )) {
616
+ if (CompilerDirectives . inInterpreter () && CApiGuards .isSmallLong (l )) {
617
617
return doLongSmall (cextContext , l , contextRef );
618
618
}
619
619
return PrimitiveNativeWrapper .createLong (l );
0 commit comments