@Specialization(rewriteOn=SlowPathException.class) protected int doIntegerSequencePosition(RAbstractVector left,Object leftStore,int leftBase,int leftLength,Object targetDimensions,@SuppressWarnings("unused") int targetDimension,Object[] positions,RIntSequence position,int positionOffset,int positionLength,RTypedValue right,Object rightStore,int rightBase,int rightLength,boolean parentNA,@Cached("create()") IntValueProfile startProfile,@Cached("create()") IntValueProfile strideProfile,@Cached("createBinaryProfile()") ConditionProfile conditionProfile,@Cached("createCountingProfile()") LoopConditionProfile profile) throws SlowPathException {
  int rightIndex=rightBase;
  int start=startProfile.profile(position.getStart() - 1);
  int stride=strideProfile.profile(position.getStride());
  int end=start + positionLength * stride;
  if (start < 0 || end <= 0) {
    throw new SlowPathException("rewrite to doIntegerPosition");
  }
  initRightIndexCheck(rightBase,positionLength,leftLength,rightLength);
  boolean ascending=conditionProfile.profile(start < end);
  profile.profileCounted(positionLength);
  for (int positionValue=start; profile.inject(ascending ? positionValue < end : positionValue > end); positionValue+=stride) {
    rightIndex=applyInner(left,leftStore,leftBase,leftLength,targetDimensions,positions,positionOffset,positionValue,right,rightStore,rightLength,rightIndex,parentNA);
  }
  return rightIndex;
}

@ Specialization ( rewriteOn = SlowPathException . class ) protected int doIntegerSequencePosition ( RAbstractVector left , Object leftStore , int leftBase , int leftLength , Object targetDimensions , @ SuppressWarnings ( "unused" ) int targetDimension , Object [ ] positions , RIntSequence position , int positionOffset , int positionLength , RTypedValue right , Object rightStore , int rightBase , int rightLength , boolean parentNA , @ Cached ( "create()" ) IntValueProfile startProfile , @ Cached ( "create()" ) IntValueProfile strideProfile , @ Cached ( "createBinaryProfile()" ) ConditionProfile conditionProfile , @ Cached ( "createCountingProfile()" ) LoopConditionProfile profile ) throws SlowPathException { int rightIndex = rightBase ; int start = startProfile . profile ( position . getStart ( ) - 1 ) ; int stride = strideProfile . profile ( position . getStride ( ) ) ; int end = start + positionLength * stride ; if ( start < 0 || end <= 0 ) { throw new SlowPathException ( "rewrite to doIntegerPosition" ) ; } initRightIndexCheck ( rightBase , positionLength , leftLength , rightLength ) ; boolean ascending = conditionProfile . profile ( start < end ) ; profile . profileCounted ( positionLength ) ; for ( int positionValue = start ; profile . inject ( ascending ? positionValue < end : positionValue > end ) ; positionValue += stride ) { rightIndex = applyInner ( left , leftStore , leftBase , leftLength , targetDimensions , positions , positionOffset , positionValue , right , rightStore , rightLength , rightIndex , parentNA ) ; } return rightIndex ; }
for integer sequences we need to make sure that start and stride is profiled .
