@@ -3035,10 +3035,10 @@ static ArrayBasedSequenceStorage doIt(Node inliningTarget, SequenceStorage s, in
30353035 @ GenerateUncached
30363036 public abstract static class CreateEmpty2Node extends SequenceStorageBaseNode {
30373037
3038- public abstract ArrayBasedSequenceStorage execute (Node inliningTarget , SequenceStorage s1 , SequenceStorage s2 , int cap );
3038+ public abstract SequenceStorage execute (Node inliningTarget , SequenceStorage s1 , SequenceStorage s2 , int cap );
30393039
30403040 @ Specialization
3041- static ArrayBasedSequenceStorage doIt (Node inliningTarget , SequenceStorage s1 , SequenceStorage s2 , int cap ,
3041+ static SequenceStorage doIt (Node inliningTarget , SequenceStorage s1 , SequenceStorage s2 , int cap ,
30423042 @ Cached GetElementType getElementType1 ,
30433043 @ Cached GetElementType getElementType2 ,
30443044 @ Cached CreateEmptyForTypesNode create ) {
@@ -3087,23 +3087,35 @@ static ObjectSequenceStorage doObject(@SuppressWarnings("unused") StorageType ty
30873087 @ GenerateInline
30883088 @ GenerateCached (false )
30893089 @ GenerateUncached
3090+ @ ImportStatic (StorageType .class )
30903091 abstract static class CreateEmptyForTypesNode extends SequenceStorageBaseNode {
30913092
3092- public abstract ArrayBasedSequenceStorage execute (Node inliningTarget , StorageType type1 , StorageType type2 , int cap );
3093+ public abstract SequenceStorage execute (Node inliningTarget , StorageType type1 , StorageType type2 , int cap );
30933094
3094- @ Specialization (guards = "type1 == type2" )
3095- static ArrayBasedSequenceStorage doSame (Node inliningTarget , StorageType type1 , @ SuppressWarnings ("unused" ) StorageType type2 , int cap ,
3096- @ Cached CreateEmptyForTypeNode create ) {
3095+ @ Specialization (guards = { "type1 == type2 || type2 == Empty" , "type1 != Empty" } )
3096+ static SequenceStorage doSameOr1Empty (Node inliningTarget , StorageType type1 , @ SuppressWarnings ("unused" ) StorageType type2 , int cap ,
3097+ @ Shared @ Cached CreateEmptyForTypeNode create ) {
30973098 return create .execute (inliningTarget , type1 , cap );
30983099 }
30993100
3101+ @ Specialization (guards = {"type1 == Empty" , "type2 != Empty" })
3102+ static SequenceStorage do2Empty (Node inliningTarget , @ SuppressWarnings ("unused" ) StorageType type1 , StorageType type2 , int cap ,
3103+ @ Shared @ Cached CreateEmptyForTypeNode create ) {
3104+ return create .execute (inliningTarget , type2 , cap );
3105+ }
3106+
3107+ @ Specialization (guards = {"type1 == Empty" , "type2 == Empty" , "cap == 0" })
3108+ static SequenceStorage doBothEmpty (@ SuppressWarnings ("unused" ) StorageType type1 , @ SuppressWarnings ("unused" ) StorageType type2 , @ SuppressWarnings ("unused" ) int cap ) {
3109+ return EmptySequenceStorage .INSTANCE ;
3110+ }
3111+
31003112 @ Specialization (guards = "generalizeToLong(type1, type2)" )
3101- static LongSequenceStorage doLong (@ SuppressWarnings ("unused" ) StorageType type1 , @ SuppressWarnings ("unused" ) StorageType type2 , int cap ) {
3113+ static SequenceStorage doLong (@ SuppressWarnings ("unused" ) StorageType type1 , @ SuppressWarnings ("unused" ) StorageType type2 , int cap ) {
31023114 return new LongSequenceStorage (cap );
31033115 }
31043116
31053117 @ Fallback
3106- static ObjectSequenceStorage doObject (@ SuppressWarnings ("unused" ) StorageType type1 , @ SuppressWarnings ("unused" ) StorageType type2 , int cap ) {
3118+ static SequenceStorage doObject (@ SuppressWarnings ("unused" ) StorageType type1 , @ SuppressWarnings ("unused" ) StorageType type2 , int cap ) {
31073119 return new ObjectSequenceStorage (cap );
31083120 }
31093121
0 commit comments