@@ -2074,18 +2074,17 @@ SequenceStorage doWithStorage(SequenceStorage left, PSequence seq, int len,
2074
2074
} else {
2075
2075
lenResult = lengthResult (lenLeft , right .length ());
2076
2076
}
2077
- SequenceStorage dest = null ;
2078
2077
while (true ) {
2079
2078
// unbounded loop should not be a problem for PE because generalizeStore() in the
2080
2079
// catch block immediately de-opts in the first iteration, i.e. if the storages are
2081
2080
// compatible and SequenceStoreException does not happen, then this compiles as if
2082
2081
// the while loop was not here at all
2083
2082
try {
2084
2083
// EnsureCapacityNode handles the overflow and raises an error
2085
- dest = ensureCapacityNode .execute (inliningTarget , left , lenResult );
2086
- return concatStoragesNode .execute (dest , left , right );
2084
+ ensureCapacityNode .execute (inliningTarget , left , lenResult );
2085
+ return concatStoragesNode .execute (left , left , right );
2087
2086
} catch (SequenceStoreException e ) {
2088
- left = generalizeStore (dest , e .getIndicationValue ());
2087
+ left = generalizeStore (left , e .getIndicationValue ());
2089
2088
}
2090
2089
}
2091
2090
}
@@ -2777,40 +2776,39 @@ static ObjectSequenceStorage doObject(@SuppressWarnings("unused") StorageType ty
2777
2776
@ GenerateCached (false )
2778
2777
public abstract static class EnsureCapacityNode extends SequenceStorageBaseNode {
2779
2778
2780
- public abstract SequenceStorage execute (Node inliningTarget , SequenceStorage s , int cap );
2779
+ public abstract void execute (Node inliningTarget , SequenceStorage s , int cap );
2781
2780
2782
2781
@ Specialization
2783
- static EmptySequenceStorage doEmpty (EmptySequenceStorage s , @ SuppressWarnings ("unused" ) int cap ) {
2784
- return s ;
2782
+ static void doEmpty (EmptySequenceStorage s , @ SuppressWarnings ("unused" ) int cap ) {
2783
+ // do nothing
2785
2784
}
2786
2785
2787
2786
@ Specialization (limit = "MAX_BASIC_STORAGES" , guards = "s.getClass() == cachedClass" )
2788
- static BasicSequenceStorage doManaged (Node inliningTarget , BasicSequenceStorage s , int cap ,
2787
+ static void doManaged (Node inliningTarget , BasicSequenceStorage s , int cap ,
2789
2788
@ Cached PRaiseNode .Lazy raiseNode ,
2790
2789
@ Cached ("s.getClass()" ) Class <? extends BasicSequenceStorage > cachedClass ) {
2791
2790
try {
2792
2791
BasicSequenceStorage profiled = cachedClass .cast (s );
2793
2792
profiled .ensureCapacity (cap );
2794
- return profiled ;
2795
2793
} catch (OutOfMemoryError | ArithmeticException e ) {
2796
2794
throw raiseNode .get (inliningTarget ).raise (MemoryError );
2797
2795
}
2798
2796
}
2799
2797
2800
2798
@ Specialization
2801
2799
@ InliningCutoff
2802
- static NativeSequenceStorage doNative (NativeSequenceStorage s , int cap ,
2800
+ static void doNative (NativeSequenceStorage s , int cap ,
2803
2801
@ Cached (inline = false ) EnsureCapacityNativeNode helper ) {
2804
- return helper .execute (s , cap );
2802
+ helper .execute (s , cap );
2805
2803
}
2806
2804
2807
2805
@ GenerateInline (false )
2808
2806
@ GenerateUncached
2809
2807
abstract static class EnsureCapacityNativeNode extends Node {
2810
- abstract NativeSequenceStorage execute (NativeSequenceStorage s , int cap );
2808
+ abstract void execute (NativeSequenceStorage s , int cap );
2811
2809
2812
2810
@ Specialization
2813
- static NativeByteSequenceStorage doNativeByte (NativeByteSequenceStorage s , int cap ,
2811
+ static void doNativeByte (NativeByteSequenceStorage s , int cap ,
2814
2812
@ Bind ("this" ) Node inliningTarget ,
2815
2813
@ Shared @ CachedLibrary (limit = "2" ) InteropLibrary lib ,
2816
2814
@ Shared @ Cached CStructAccess .AllocateNode alloc ,
@@ -2834,11 +2832,10 @@ static NativeByteSequenceStorage doNativeByte(NativeByteSequenceStorage s, int c
2834
2832
s .setPtr (newMem );
2835
2833
s .setCapacity (newCapacity );
2836
2834
}
2837
- return s ;
2838
2835
}
2839
2836
2840
2837
@ Specialization
2841
- static NativeObjectSequenceStorage doNativeObject (NativeObjectSequenceStorage s , int cap ,
2838
+ static void doNativeObject (NativeObjectSequenceStorage s , int cap ,
2842
2839
@ Bind ("this" ) Node inliningTarget ,
2843
2840
@ Shared @ CachedLibrary (limit = "2" ) InteropLibrary lib ,
2844
2841
@ Shared @ Cached CStructAccess .AllocateNode alloc ,
@@ -2863,7 +2860,6 @@ static NativeObjectSequenceStorage doNativeObject(NativeObjectSequenceStorage s,
2863
2860
s .setPtr (newMem );
2864
2861
s .setCapacity (newCapacity );
2865
2862
}
2866
- return s ;
2867
2863
}
2868
2864
2869
2865
private static int computeNewCapacity (int cap ) {
0 commit comments