@@ -112,7 +112,8 @@ void fastdecode_docopy(upb_Decoder* d, const char* ptr, uint32_t size, int copy,
112112 bool validate_utf8 = type == kUpb_DecodeFast_String; \
113113 int tagbytes = upb_DecodeFast_TagSizeBytes(tagsize); \
114114 \
115- UPB_ASSERT(!upb_EpsCopyInputStream_AliasingAvailable(&d->input, ptr, 0)); \
115+ UPB_ASSERT(!UPB_PRIVATE(upb_EpsCopyInputStream_AliasingAvailable)(&d->input, \
116+ ptr, 0)); \
116117 UPB_ASSERT(fastdecode_checktag(data, tagbytes)); \
117118 \
118119 dst = fastdecode_getfield(d, ptr, msg, &data, &hasbits, &farr, \
@@ -129,8 +130,9 @@ void fastdecode_docopy(upb_Decoder* d, const char* ptr, uint32_t size, int copy,
129130 \
130131 buf = d->arena.UPB_PRIVATE(ptr); \
131132 arena_has = UPB_PRIVATE(_upb_ArenaHas)(&d->arena); \
132- common_has = UPB_MIN(arena_has, \
133- upb_EpsCopyInputStream_BytesAvailable(&d->input, ptr)); \
133+ common_has = UPB_MIN( \
134+ arena_has, \
135+ UPB_PRIVATE(upb_EpsCopyInputStream_BytesAvailable)(&d->input, ptr)); \
134136 \
135137 if (UPB_LIKELY(size <= 15 - tagbytes)) { \
136138 if (arena_has < 16) goto longstr; \
@@ -190,75 +192,75 @@ void fastdecode_docopy(upb_Decoder* d, const char* ptr, uint32_t size, int copy,
190192 hasbits, (uint64_t)dst); \
191193 }
192194
193- #define FASTDECODE_STRING (d , ptr , msg , table , hasbits , data , type , card , \
194- tagsize , copyfunc ) \
195- upb_StringView* dst; \
196- fastdecode_arr farr; \
197- int64_t size; \
198- bool validate_utf8 = type == kUpb_DecodeFast_String; \
199- int tagbytes = upb_DecodeFast_TagSizeBytes(tagsize); \
200- \
201- if (UPB_UNLIKELY(!fastdecode_checktag(data, tagbytes))) { \
202- RETURN_GENERIC("string field tag mismatch\n"); \
203- } \
204- \
205- if (UPB_UNLIKELY( \
206- !upb_EpsCopyInputStream_AliasingAvailable( &d->input, ptr, 0))) { \
207- UPB_MUSTTAIL return copyfunc(UPB_PARSE_ARGS); \
208- } \
209- \
210- dst = fastdecode_getfield(d, ptr, msg, &data, &hasbits, &farr, \
211- sizeof(upb_StringView), card); \
212- \
213- again: \
214- if (card == kUpb_DecodeFast_Repeated) { \
215- dst = fastdecode_resizearr(d, dst, &farr, sizeof(upb_StringView)); \
216- } \
217- \
218- size = (int8_t)ptr[tagbytes]; \
219- ptr += tagbytes + 1; \
220- \
221- if (UPB_UNLIKELY( \
222- !upb_EpsCopyInputStream_AliasingAvailable( &d->input, ptr, size))) { \
223- ptr--; \
224- if (validate_utf8) { \
225- return fastdecode_longstring_utf8(d, ptr, msg, table, hasbits, \
226- (uint64_t)dst); \
227- } else { \
228- return fastdecode_longstring_noutf8(d, ptr, msg, table, hasbits, \
229- (uint64_t)dst); \
230- } \
231- } \
232- \
233- dst->data = ptr; \
234- dst->size = size; \
235- ptr = upb_EpsCopyInputStream_ReadStringAliased(&d->input, &dst->data, \
236- dst->size); \
237- \
238- if (card == kUpb_DecodeFast_Repeated) { \
239- if (validate_utf8 && \
240- !_upb_Decoder_VerifyUtf8Inline(dst->data, dst->size)) { \
241- _upb_FastDecoder_ErrorJmp(d, kUpb_DecodeStatus_BadUtf8); \
242- } \
243- fastdecode_nextret ret = fastdecode_nextrepeated( \
244- d, dst, &ptr, &farr, data, tagbytes, sizeof(upb_StringView)); \
245- switch (ret.next) { \
246- case FD_NEXT_SAMEFIELD: \
247- dst = ret.dst; \
248- goto again; \
249- case FD_NEXT_OTHERFIELD: \
250- data = ret.tag; \
251- UPB_MUSTTAIL return _upb_FastDecoder_TagDispatch(UPB_PARSE_ARGS); \
252- case FD_NEXT_ATLIMIT: \
253- return ptr; \
254- } \
255- } \
256- \
257- if (card != kUpb_DecodeFast_Repeated && validate_utf8) { \
258- data = (uint64_t)dst; \
259- UPB_MUSTTAIL return fastdecode_verifyutf8(UPB_PARSE_ARGS); \
260- } \
261- \
195+ #define FASTDECODE_STRING (d , ptr , msg , table , hasbits , data , type , card , \
196+ tagsize , copyfunc ) \
197+ upb_StringView* dst; \
198+ fastdecode_arr farr; \
199+ int64_t size; \
200+ bool validate_utf8 = type == kUpb_DecodeFast_String; \
201+ int tagbytes = upb_DecodeFast_TagSizeBytes(tagsize); \
202+ \
203+ if (UPB_UNLIKELY(!fastdecode_checktag(data, tagbytes))) { \
204+ RETURN_GENERIC("string field tag mismatch\n"); \
205+ } \
206+ \
207+ if (UPB_UNLIKELY(!UPB_PRIVATE(upb_EpsCopyInputStream_AliasingAvailable)( \
208+ &d->input, ptr, 0))) { \
209+ UPB_MUSTTAIL return copyfunc(UPB_PARSE_ARGS); \
210+ } \
211+ \
212+ dst = fastdecode_getfield(d, ptr, msg, &data, &hasbits, &farr, \
213+ sizeof(upb_StringView), card); \
214+ \
215+ again: \
216+ if (card == kUpb_DecodeFast_Repeated) { \
217+ dst = fastdecode_resizearr(d, dst, &farr, sizeof(upb_StringView)); \
218+ } \
219+ \
220+ size = (int8_t)ptr[tagbytes]; \
221+ ptr += tagbytes + 1; \
222+ \
223+ if (UPB_UNLIKELY(!UPB_PRIVATE(upb_EpsCopyInputStream_AliasingAvailable)( \
224+ &d->input, ptr, size))) { \
225+ ptr--; \
226+ if (validate_utf8) { \
227+ return fastdecode_longstring_utf8(d, ptr, msg, table, hasbits, \
228+ (uint64_t)dst); \
229+ } else { \
230+ return fastdecode_longstring_noutf8(d, ptr, msg, table, hasbits, \
231+ (uint64_t)dst); \
232+ } \
233+ } \
234+ \
235+ dst->data = ptr; \
236+ dst->size = size; \
237+ ptr = upb_EpsCopyInputStream_ReadStringAliased(&d->input, &dst->data, \
238+ dst->size); \
239+ \
240+ if (card == kUpb_DecodeFast_Repeated) { \
241+ if (validate_utf8 && \
242+ !_upb_Decoder_VerifyUtf8Inline(dst->data, dst->size)) { \
243+ _upb_FastDecoder_ErrorJmp(d, kUpb_DecodeStatus_BadUtf8); \
244+ } \
245+ fastdecode_nextret ret = fastdecode_nextrepeated( \
246+ d, dst, &ptr, &farr, data, tagbytes, sizeof(upb_StringView)); \
247+ switch (ret.next) { \
248+ case FD_NEXT_SAMEFIELD: \
249+ dst = ret.dst; \
250+ goto again; \
251+ case FD_NEXT_OTHERFIELD: \
252+ data = ret.tag; \
253+ UPB_MUSTTAIL return _upb_FastDecoder_TagDispatch(UPB_PARSE_ARGS); \
254+ case FD_NEXT_ATLIMIT: \
255+ return ptr; \
256+ } \
257+ } \
258+ \
259+ if (card != kUpb_DecodeFast_Repeated && validate_utf8) { \
260+ data = (uint64_t)dst; \
261+ UPB_MUSTTAIL return fastdecode_verifyutf8(UPB_PARSE_ARGS); \
262+ } \
263+ \
262264 UPB_MUSTTAIL return upb_DecodeFast_Dispatch(UPB_PARSE_ARGS);
263265
264266/* Generate all combinations:
0 commit comments