2222#include "upb/port/def.inc"
2323
2424UPB_FORCEINLINE
25- int upb_DecodeFast_UnpackedFixed (upb_Decoder * d , const char * * ptr ,
26- upb_Message * msg , intptr_t table ,
27- uint64_t * hasbits , uint64_t * data ,
28- upb_DecodeFast_Type type ,
29- upb_DecodeFast_Cardinality card ,
30- upb_DecodeFast_TagSize tagsize ) {
31- upb_DecodeFastNext ret ;
25+ void upb_DecodeFast_UnpackedFixed (upb_Decoder * d , const char * * ptr ,
26+ upb_Message * msg , intptr_t table ,
27+ uint64_t * hasbits , uint64_t * data ,
28+ upb_DecodeFastNext * ret ,
29+ upb_DecodeFast_Type type ,
30+ upb_DecodeFast_Cardinality card ,
31+ upb_DecodeFast_TagSize tagsize ) {
3232 upb_DecodeFastField field ;
3333 int valbytes = upb_DecodeFast_ValueBytes (type );
3434
35- if (!upb_DecodeFast_CheckPackableTag (type , card , tagsize , data ,
36- kUpb_DecodeFastNext_TailCallPacked ,
37- & ret ) ||
38- !Upb_DecodeFast_GetField (d , * ptr , msg , * data , hasbits , & ret , & field , type ,
35+ if (!upb_DecodeFast_CheckPackableTag (
36+ type , card , tagsize , data , kUpb_DecodeFastNext_TailCallPacked , ret ) ||
37+ !Upb_DecodeFast_GetField (d , * ptr , msg , * data , hasbits , ret , & field , type ,
3938 card )) {
40- return ret ;
39+ return ;
4140 }
4241
4342 do {
4443 * ptr += upb_DecodeFast_TagSizeBytes (tagsize );
4544 memcpy (field .dst , * ptr , valbytes );
4645 * ptr += valbytes ;
4746 _upb_Decoder_Trace (d , 'F' );
48- } while (upb_DecodeFast_NextRepeated (d , ptr , * data , & ret , & field , type , card ,
47+ } while (upb_DecodeFast_NextRepeated (d , ptr , * data , ret , & field , type , card ,
4948 tagsize ));
50-
51- return kUpb_DecodeFastNext_TailCallDispatch ;
5249}
5350
5451UPB_FORCEINLINE
55- int upb_DecodeFast_PackedFixed (upb_Decoder * d , const char * * ptr ,
56- upb_Message * msg , intptr_t table ,
57- uint64_t * hasbits , uint64_t * data ,
58- upb_DecodeFast_Type type ,
59- upb_DecodeFast_Cardinality card ,
60- upb_DecodeFast_TagSize tagsize ) {
61- upb_DecodeFastNext ret ;
52+ void upb_DecodeFast_PackedFixed (upb_Decoder * d , const char * * ptr ,
53+ upb_Message * msg , intptr_t table ,
54+ uint64_t * hasbits , uint64_t * data ,
55+ upb_DecodeFastNext * ret ,
56+ upb_DecodeFast_Type type ,
57+ upb_DecodeFast_Cardinality card ,
58+ upb_DecodeFast_TagSize tagsize ) {
6259 int size ;
6360 upb_DecodeFastField field ;
6461 uint8_t valbytes = upb_DecodeFast_ValueBytes (type );
@@ -67,21 +64,21 @@ int upb_DecodeFast_PackedFixed(upb_Decoder* d, const char** ptr,
6764
6865 if (!upb_DecodeFast_CheckPackableTag (type , card , tagsize , data ,
6966 kUpb_DecodeFastNext_TailCallUnpacked ,
70- & ret ) ||
67+ ret ) ||
7168 !upb_DecodeFast_DecodeShortSizeForImmediateRead (d , & data_ptr , & size ,
72- & ret )) {
73- return ret ;
69+ ret )) {
70+ return ;
7471 }
7572
7673 if (size != 0 ) {
7774 if (size % valbytes != 0 ) {
78- UPB_DECODEFAST_ERROR (d , kUpb_DecodeStatus_Malformed , & ret );
79- return ret ;
75+ UPB_DECODEFAST_ERROR (d , kUpb_DecodeStatus_Malformed , ret );
76+ return ;
8077 }
8178
8279 if (!upb_DecodeFast_GetArrayForAppend (d , * ptr , msg , * data , hasbits , & field ,
83- type , size / valbytes , & ret )) {
84- return ret ;
80+ type , size / valbytes , ret )) {
81+ return ;
8582 }
8683
8784 upb_DecodeFast_InlineMemcpy (field .dst , data_ptr , size );
@@ -90,37 +87,36 @@ int upb_DecodeFast_PackedFixed(upb_Decoder* d, const char** ptr,
9087
9188 * ptr = data_ptr + size ;
9289 _upb_Decoder_Trace (d , 'F' );
93-
94- return kUpb_DecodeFastNext_TailCallDispatch ;
9590}
9691
9792UPB_FORCEINLINE
98- int upb_DecodeFast_Fixed (upb_Decoder * d , const char * * ptr , upb_Message * msg ,
99- intptr_t table , uint64_t * hasbits , uint64_t * data ,
100- upb_DecodeFast_Type type ,
101- upb_DecodeFast_Cardinality card ,
102- upb_DecodeFast_TagSize tagsize ) {
93+ void upb_DecodeFast_Fixed (upb_Decoder * d , const char * * ptr , upb_Message * msg ,
94+ intptr_t table , uint64_t * hasbits , uint64_t * data ,
95+ upb_DecodeFastNext * ret , upb_DecodeFast_Type type ,
96+ upb_DecodeFast_Cardinality card ,
97+ upb_DecodeFast_TagSize tagsize ) {
10398 if (card == kUpb_DecodeFast_Packed ) {
104- return upb_DecodeFast_PackedFixed (d , ptr , msg , table , hasbits , data , type ,
105- card , tagsize );
99+ upb_DecodeFast_PackedFixed (d , ptr , msg , table , hasbits , data , ret , type ,
100+ card , tagsize );
106101 } else {
107- return upb_DecodeFast_UnpackedFixed (d , ptr , msg , table , hasbits , data , type ,
108- card , tagsize );
102+ upb_DecodeFast_UnpackedFixed (d , ptr , msg , table , hasbits , data , ret , type ,
103+ card , tagsize );
109104 }
110105}
111106
112107/* Generate all combinations:
113108 * {s,o,r,p} x {f4,f8} x {1bt,2bt} */
114109
115- #define F (type , card , tagbytes ) \
116- UPB_NOINLINE UPB_PRESERVE_NONE const char* UPB_DECODEFAST_FUNCNAME( \
117- type, card, tagbytes)(UPB_PARSE_PARAMS) { \
118- int next = upb_DecodeFast_Fixed( \
119- d, &ptr, msg, table, &hasbits, &data, kUpb_DecodeFast_##type, \
120- kUpb_DecodeFast_##card, kUpb_DecodeFast_##tagbytes); \
121- UPB_DECODEFAST_NEXTMAYBEPACKED( \
122- next, UPB_DECODEFAST_FUNCNAME(type, Repeated, tagbytes), \
123- UPB_DECODEFAST_FUNCNAME(type, Packed, tagbytes)); \
110+ #define F (type , card , tagbytes ) \
111+ UPB_NOINLINE UPB_PRESERVE_NONE const char* UPB_DECODEFAST_FUNCNAME( \
112+ type, card, tagbytes)(UPB_PARSE_PARAMS) { \
113+ upb_DecodeFastNext next = kUpb_DecodeFastNext_Dispatch; \
114+ upb_DecodeFast_Fixed(d, &ptr, msg, table, &hasbits, &data, &next, \
115+ kUpb_DecodeFast_##type, kUpb_DecodeFast_##card, \
116+ kUpb_DecodeFast_##tagbytes); \
117+ UPB_DECODEFAST_NEXTMAYBEPACKED( \
118+ next, UPB_DECODEFAST_FUNCNAME(type, Repeated, tagbytes), \
119+ UPB_DECODEFAST_FUNCNAME(type, Packed, tagbytes)); \
124120 }
125121
126122UPB_DECODEFAST_CARDINALITIES (UPB_DECODEFAST_TAGSIZES , F , Fixed32 )
0 commit comments