@@ -3035,10 +3035,10 @@ static ArrayBasedSequenceStorage doIt(Node inliningTarget, SequenceStorage s, in
3035
3035
@ GenerateUncached
3036
3036
public abstract static class CreateEmpty2Node extends SequenceStorageBaseNode {
3037
3037
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 );
3039
3039
3040
3040
@ 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 ,
3042
3042
@ Cached GetElementType getElementType1 ,
3043
3043
@ Cached GetElementType getElementType2 ,
3044
3044
@ Cached CreateEmptyForTypesNode create ) {
@@ -3087,23 +3087,35 @@ static ObjectSequenceStorage doObject(@SuppressWarnings("unused") StorageType ty
3087
3087
@ GenerateInline
3088
3088
@ GenerateCached (false )
3089
3089
@ GenerateUncached
3090
+ @ ImportStatic (StorageType .class )
3090
3091
abstract static class CreateEmptyForTypesNode extends SequenceStorageBaseNode {
3091
3092
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 );
3093
3094
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 ) {
3097
3098
return create .execute (inliningTarget , type1 , cap );
3098
3099
}
3099
3100
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
+
3100
3112
@ 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 ) {
3102
3114
return new LongSequenceStorage (cap );
3103
3115
}
3104
3116
3105
3117
@ 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 ) {
3107
3119
return new ObjectSequenceStorage (cap );
3108
3120
}
3109
3121
0 commit comments