reflection.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009-2021, Google LLC
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * * Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * * Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * * Neither the name of Google LLC nor the
13  * names of its contributors may be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
20  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 #include "upb/reflection.h"
29 
30 #include <string.h>
31 
32 #include "upb/msg.h"
33 #include "upb/port_def.inc"
34 #include "upb/table_internal.h"
35 
36 static size_t get_field_size(const upb_MiniTable_Field* f) {
37  static unsigned char sizes[] = {
38  0, /* 0 */
39  8, /* kUpb_FieldType_Double */
40  4, /* kUpb_FieldType_Float */
41  8, /* kUpb_FieldType_Int64 */
42  8, /* kUpb_FieldType_UInt64 */
43  4, /* kUpb_FieldType_Int32 */
44  8, /* kUpb_FieldType_Fixed64 */
45  4, /* kUpb_FieldType_Fixed32 */
46  1, /* kUpb_FieldType_Bool */
47  sizeof(upb_StringView), /* kUpb_FieldType_String */
48  sizeof(void*), /* kUpb_FieldType_Group */
49  sizeof(void*), /* kUpb_FieldType_Message */
50  sizeof(upb_StringView), /* kUpb_FieldType_Bytes */
51  4, /* kUpb_FieldType_UInt32 */
52  4, /* kUpb_FieldType_Enum */
53  4, /* kUpb_FieldType_SFixed32 */
54  8, /* kUpb_FieldType_SFixed64 */
55  4, /* kUpb_FieldType_SInt32 */
56  8, /* kUpb_FieldType_SInt64 */
57  };
58  return upb_IsRepeatedOrMap(f) ? sizeof(void*) : sizes[f->descriptortype];
59 }
60 
61 /* Strings/bytes are special-cased in maps. */
62 static char _upb_CTypeo_mapsize[12] = {
63  0,
64  1, /* kUpb_CType_Bool */
65  4, /* kUpb_CType_Float */
66  4, /* kUpb_CType_Int32 */
67  4, /* kUpb_CType_UInt32 */
68  4, /* kUpb_CType_Enum */
69  sizeof(void*), /* kUpb_CType_Message */
70  8, /* kUpb_CType_Double */
71  8, /* kUpb_CType_Int64 */
72  8, /* kUpb_CType_UInt64 */
73  0, /* kUpb_CType_String */
74  0, /* kUpb_CType_Bytes */
75 };
76 
77 static const char _upb_CTypeo_sizelg2[12] = {
78  0,
79  0, /* kUpb_CType_Bool */
80  2, /* kUpb_CType_Float */
81  2, /* kUpb_CType_Int32 */
82  2, /* kUpb_CType_UInt32 */
83  2, /* kUpb_CType_Enum */
84  UPB_SIZE(2, 3), /* kUpb_CType_Message */
85  3, /* kUpb_CType_Double */
86  3, /* kUpb_CType_Int64 */
87  3, /* kUpb_CType_UInt64 */
88  UPB_SIZE(3, 4), /* kUpb_CType_String */
89  UPB_SIZE(3, 4), /* kUpb_CType_Bytes */
90 };
91 
97 }
98 
99 static bool in_oneof(const upb_MiniTable_Field* field) {
100  return field->presence < 0;
101 }
102 
104  const upb_FieldDef* f) {
106  const char* mem = UPB_PTR_AT(msg, field->offset, char);
107  upb_MessageValue val = {0};
108  memcpy(&val, mem, get_field_size(field));
109  return val;
110 }
111 
113  assert(upb_FieldDef_HasPresence(f));
116  return _upb_Message_Getext(msg, ext) != NULL;
117  } else {
119  if (in_oneof(field)) {
120  return _upb_getoneofcase_field(msg, field) == field->number;
121  } else if (field->presence > 0) {
122  return _upb_hasbit_field(msg, field);
123  } else {
124  UPB_ASSERT(field->descriptortype == kUpb_FieldType_Message ||
125  field->descriptortype == kUpb_FieldType_Group);
126  return _upb_Message_Getraw(msg, f).msg_val != NULL;
127  }
128  }
129 }
130 
132  const upb_OneofDef* o) {
133  const upb_FieldDef* f = upb_OneofDef_Field(o, 0);
136  return upb_Message_Has(msg, f) ? f : NULL;
137  } else {
139  uint32_t oneof_case = _upb_getoneofcase_field(msg, field);
140  f = oneof_case ? upb_OneofDef_LookupNumber(o, oneof_case) : NULL;
141  UPB_ASSERT((f != NULL) == (oneof_case != 0));
142  return f;
143  }
144 }
145 
147  const upb_FieldDef* f) {
149  const upb_Message_Extension* ext =
151  if (ext) {
152  upb_MessageValue val;
153  memcpy(&val, &ext->data, sizeof(val));
154  return val;
155  } else if (upb_FieldDef_IsRepeated(f)) {
156  return (upb_MessageValue){.array_val = NULL};
157  }
158  } else if (!upb_FieldDef_HasPresence(f) || upb_Message_Has(msg, f)) {
159  return _upb_Message_Getraw(msg, f);
160  }
161  return upb_FieldDef_Default(f);
162 }
163 
165  const upb_FieldDef* f,
166  upb_Arena* a) {
169  // We need to skip the upb_Message_Get() call in this case.
170  goto make;
171  }
172 
174  if (val.array_val) {
175  return (upb_MutableMessageValue){.array = (upb_Array*)val.array_val};
176  }
177 
179 make:
180  if (!a) return (upb_MutableMessageValue){.array = NULL};
181  if (upb_FieldDef_IsMap(f)) {
183  const upb_FieldDef* key =
185  const upb_FieldDef* value =
187  ret.map =
189  } else if (upb_FieldDef_IsRepeated(f)) {
191  } else {
194  }
195 
196  val.array_val = ret.array;
197  upb_Message_Set(msg, f, val, a);
198 
199  return ret;
200 }
201 
203  upb_MessageValue val, upb_Arena* a) {
207  if (!ext) return false;
208  memcpy(&ext->data, &val, sizeof(val));
209  } else {
211  char* mem = UPB_PTR_AT(msg, field->offset, char);
212  memcpy(mem, &val, get_field_size(field));
213  if (field->presence > 0) {
215  } else if (in_oneof(field)) {
216  *_upb_oneofcase_field(msg, field) = field->number;
217  }
218  }
219  return true;
220 }
221 
225  } else {
227  char* mem = UPB_PTR_AT(msg, field->offset, char);
228 
229  if (field->presence > 0) {
231  } else if (in_oneof(field)) {
232  uint32_t* oneof_case = _upb_oneofcase_field(msg, field);
233  if (*oneof_case != field->number) return;
234  *oneof_case = 0;
235  }
236 
238  }
239 }
240 
243 }
244 
246  const upb_DefPool* ext_pool, const upb_FieldDef** out_f,
247  upb_MessageValue* out_val, size_t* iter) {
248  size_t i = *iter;
249  size_t n = upb_MessageDef_FieldCount(m);
250  const upb_MessageValue zero = {0};
251  UPB_UNUSED(ext_pool);
252 
253  /* Iterate over normal fields, returning the first one that is set. */
254  while (++i < n) {
257 
258  /* Skip field if unset or empty. */
260  if (!upb_Message_Has(msg, f)) continue;
261  } else {
262  upb_MessageValue test = val;
264  /* Clear string pointer, only size matters (ptr could be non-NULL). */
265  test.str_val.data = NULL;
266  }
267  /* Continue if NULL or 0. */
268  if (memcmp(&test, &zero, sizeof(test)) == 0) continue;
269 
270  /* Continue on empty array or map. */
271  if (upb_FieldDef_IsMap(f)) {
272  if (upb_Map_Size(test.map_val) == 0) continue;
273  } else if (upb_FieldDef_IsRepeated(f)) {
274  if (upb_Array_Size(test.array_val) == 0) continue;
275  }
276  }
277 
278  *out_val = val;
279  *out_f = f;
280  *iter = i;
281  return true;
282  }
283 
284  if (ext_pool) {
285  /* Return any extensions that are set. */
286  size_t count;
288  if (i - n < count) {
289  ext += count - 1 - (i - n);
290  memcpy(out_val, &ext->data, sizeof(*out_val));
291  *out_f = _upb_DefPool_FindExtensionByMiniTable(ext_pool, ext->ext);
292  *iter = i;
293  return true;
294  }
295  }
296 
297  *iter = i;
298  return false;
299 }
300 
302  int depth) {
303  size_t iter = kUpb_Message_Begin;
304  const upb_FieldDef* f;
305  upb_MessageValue val;
306  bool ret = true;
307 
308  if (--depth == 0) return false;
309 
311 
312  while (upb_Message_Next(msg, m, NULL /*ext_pool*/, &f, &val, &iter)) {
314  if (!subm) continue;
315  if (upb_FieldDef_IsMap(f)) {
316  const upb_FieldDef* val_f = upb_MessageDef_FindFieldByNumber(subm, 2);
317  const upb_MessageDef* val_m = upb_FieldDef_MessageSubDef(val_f);
318  upb_Map* map = (upb_Map*)val.map_val;
319  size_t iter = kUpb_Map_Begin;
320 
321  if (!val_m) continue;
322 
323  while (upb_MapIterator_Next(map, &iter)) {
325  if (!_upb_Message_DiscardUnknown((upb_Message*)map_val.msg_val, val_m,
326  depth)) {
327  ret = false;
328  }
329  }
330  } else if (upb_FieldDef_IsRepeated(f)) {
331  const upb_Array* arr = val.array_val;
332  size_t i, n = upb_Array_Size(arr);
333  for (i = 0; i < n; i++) {
335  if (!_upb_Message_DiscardUnknown((upb_Message*)elem.msg_val, subm,
336  depth)) {
337  ret = false;
338  }
339  }
340  } else {
342  depth)) {
343  ret = false;
344  }
345  }
346  }
347 
348  return ret;
349 }
350 
352  int maxdepth) {
353  return _upb_Message_DiscardUnknown(msg, m, maxdepth);
354 }
355 
360 }
361 
362 size_t upb_Array_Size(const upb_Array* arr) { return arr->len; }
363 
366  const char* data = _upb_array_constptr(arr);
367  int lg2 = arr->data & 7;
368  UPB_ASSERT(i < arr->len);
369  memcpy(&ret, data + (i << lg2), 1 << lg2);
370  return ret;
371 }
372 
373 void upb_Array_Set(upb_Array* arr, size_t i, upb_MessageValue val) {
374  char* data = _upb_array_ptr(arr);
375  int lg2 = arr->data & 7;
376  UPB_ASSERT(i < arr->len);
377  memcpy(data + (i << lg2), &val, 1 << lg2);
378 }
379 
381  if (!upb_Array_Resize(arr, arr->len + 1, arena)) {
382  return false;
383  }
384  upb_Array_Set(arr, arr->len - 1, val);
385  return true;
386 }
387 
388 void upb_Array_Move(upb_Array* arr, size_t dst_idx, size_t src_idx,
389  size_t count) {
390  char* data = _upb_array_ptr(arr);
391  int lg2 = arr->data & 7;
392  memmove(&data[dst_idx << lg2], &data[src_idx << lg2], count << lg2);
393 }
394 
395 bool upb_Array_Insert(upb_Array* arr, size_t i, size_t count,
396  upb_Arena* arena) {
397  UPB_ASSERT(i <= arr->len);
398  UPB_ASSERT(count + arr->len >= count);
399  size_t oldsize = arr->len;
400  if (!upb_Array_Resize(arr, arr->len + count, arena)) {
401  return false;
402  }
403  upb_Array_Move(arr, i + count, i, oldsize - i);
404  return true;
405 }
406 
407 /*
408  * i end arr->len
409  * |------------|XXXXXXXX|--------|
410  */
411 void upb_Array_Delete(upb_Array* arr, size_t i, size_t count) {
412  size_t end = i + count;
413  UPB_ASSERT(i <= end);
414  UPB_ASSERT(end <= arr->len);
415  upb_Array_Move(arr, i, end, arr->len - end);
416  arr->len -= count;
417 }
418 
420  return _upb_Array_Resize(arr, size, arena);
421 }
422 
428 }
429 
430 size_t upb_Map_Size(const upb_Map* map) { return _upb_Map_Size(map); }
431 
433  upb_MessageValue* val) {
434  return _upb_Map_Get(map, &key, map->key_size, val, map->val_size);
435 }
436 
438 
440  upb_Arena* arena) {
441  return _upb_Map_Set(map, &key, map->key_size, &val, map->val_size, arena);
442 }
443 
445  return _upb_Map_Delete(map, &key, map->key_size);
446 }
447 
448 bool upb_MapIterator_Next(const upb_Map* map, size_t* iter) {
449  return _upb_map_next(map, iter);
450 }
451 
452 bool upb_MapIterator_Done(const upb_Map* map, size_t iter) {
455  i.t = &map->table;
456  i.index = iter;
457  return upb_strtable_done(&i);
458 }
459 
460 /* Returns the key and value for this entry of the map. */
464  i.t = &map->table;
465  i.index = iter;
467  return ret;
468 }
469 
473  i.t = &map->table;
474  i.index = iter;
476  return ret;
477 }
478 
479 /* void upb_MapIterator_SetValue(upb_Map *map, size_t iter, upb_MessageValue
480  * value); */
upb_Array_New
upb_Array * upb_Array_New(upb_Arena *a, upb_CType type)
Definition: reflection.c:358
upb_MapIterator_Key
upb_MessageValue upb_MapIterator_Key(const upb_Map *map, size_t iter)
Definition: reflection.c:461
_upb_Map_Delete
UPB_INLINE bool _upb_Map_Delete(upb_Map *map, const void *key, size_t key_size)
Definition: msg_internal.h:693
_upb_clearhas_field
UPB_INLINE void _upb_clearhas_field(const upb_msg *msg, const upb_msglayout_field *f)
Definition: php-upb.h:1296
upb_Array_Delete
void upb_Array_Delete(upb_Array *arr, size_t i, size_t count)
Definition: reflection.c:411
upb_CType
upb_CType
Definition: upb/upb/upb.h:286
_upb_Message_Getext
const upb_Message_Extension * _upb_Message_Getext(const upb_Message *msg, const upb_MiniTable_Extension *e)
Definition: msg.c:125
upb_strtable_done
bool upb_strtable_done(const upb_strtable_iter *i)
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.c:1645
upb_Map_Size
size_t upb_Map_Size(const upb_Map *map)
Definition: reflection.c:430
upb_Message_Clear
void upb_Message_Clear(upb_Message *msg, const upb_MessageDef *m)
Definition: reflection.c:241
kUpb_Map_Begin
#define kUpb_Map_Begin
Definition: upb/upb/upb.h:329
memset
return memset(p, 0, total)
upb_Array_Resize
bool upb_Array_Resize(upb_Array *arr, size_t size, upb_Arena *arena)
Definition: reflection.c:419
get_field_size
static size_t get_field_size(const upb_MiniTable_Field *f)
Definition: reflection.c:36
upb_MessageDef_MiniTable
const upb_MiniTable * upb_MessageDef_MiniTable(const upb_MessageDef *m)
Definition: upb/upb/def.c:818
upb_MiniTable_Field
Definition: msg_internal.h:71
_upb_Map_Size
UPB_INLINE size_t _upb_Map_Size(const upb_Map *map)
Definition: msg_internal.h:657
upb_OneofDef_LookupNumber
const upb_FieldDef * upb_OneofDef_LookupNumber(const upb_OneofDef *o, uint32_t num)
Definition: upb/upb/def.c:903
test
Definition: spinlock_test.cc:36
upb_MessageDef
Definition: upb/upb/def.c:100
ext
void * ext
Definition: x509v3.h:87
string.h
_upb_map_next
UPB_INLINE void * _upb_map_next(const upb_map *map, size_t *iter)
Definition: php-upb.h:1578
upb_MiniTable_Extension
Definition: msg_internal.h:202
upb_Message_ClearField
void upb_Message_ClearField(upb_Message *msg, const upb_FieldDef *f)
Definition: reflection.c:222
elem
Timer elem
Definition: event_engine/iomgr_event_engine/timer_heap_test.cc:109
_upb_sethas_field
UPB_INLINE void _upb_sethas_field(const upb_msg *msg, const upb_msglayout_field *f)
Definition: php-upb.h:1291
_upb_DefPool_FindExtensionByMiniTable
const upb_FieldDef * _upb_DefPool_FindExtensionByMiniTable(const upb_DefPool *s, const upb_MiniTable_Extension *ext)
Definition: upb/upb/def.c:3207
_upb_Message_Getorcreateext
upb_Message_Extension * _upb_Message_Getorcreateext(upb_Message *msg, const upb_MiniTable_Extension *e, upb_Arena *arena)
Definition: msg.c:156
upb_OneofDef
Definition: upb/upb/def.c:157
a
int a
Definition: abseil-cpp/absl/container/internal/hash_policy_traits_test.cc:88
upb_FieldDef_MiniTable
const upb_MiniTable_Field * upb_FieldDef_MiniTable(const upb_FieldDef *f)
Definition: upb/upb/def.c:627
kUpb_MapEntry_ValueFieldNumber
#define kUpb_MapEntry_ValueFieldNumber
Definition: upb/upb/def.h:161
upb_Array_Get
upb_MessageValue upb_Array_Get(const upb_Array *arr, size_t i)
Definition: reflection.c:364
_upb_Map_Set
UPB_INLINE bool _upb_Map_Set(upb_Map *map, const void *key, size_t key_size, void *val, size_t val_size, upb_Arena *a)
Definition: msg_internal.h:682
UPB_PTR_AT
#define UPB_PTR_AT(msg, ofs, type)
Definition: php-upb.c:71
map
zval * map
Definition: php/ext/google/protobuf/encode_decode.c:480
_upb_getoneofcase_field
UPB_INLINE uint32_t _upb_getoneofcase_field(const upb_msg *msg, const upb_msglayout_field *f)
Definition: php-upb.h:1321
upb_strtable_iter_key
const char * upb_strtable_iter_key(const upb_strtable_iter *i)
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.c:1651
in_oneof
static bool in_oneof(const upb_MiniTable_Field *field)
Definition: reflection.c:99
upb_Array_Move
void upb_Array_Move(upb_Array *arr, size_t dst_idx, size_t src_idx, size_t count)
Definition: reflection.c:388
arena
grpc_core::ScopedArenaPtr arena
Definition: binder_transport_test.cc:237
kUpb_MapEntry_KeyFieldNumber
#define kUpb_MapEntry_KeyFieldNumber
Definition: upb/upb/def.h:160
msg.h
upb_MessageValue::array_val
const upb_Array * array_val
Definition: upb/upb/reflection.h:50
upb_Message_New
upb_Message * upb_Message_New(const upb_MessageDef *m, upb_Arena *a)
Definition: reflection.c:95
o
UnboundConversion o
Definition: third_party/abseil-cpp/absl/strings/internal/str_format/parser_test.cc:97
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
upb_MessageValue
Definition: upb/upb/reflection.h:40
_upb_array_ptr
UPB_INLINE void * _upb_array_ptr(upb_array *arr)
Definition: php-upb.h:1350
memcpy
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
_upb_Message_Getexts
const upb_Message_Extension * _upb_Message_Getexts(const upb_Message *msg, size_t *count)
Definition: msg.c:112
_upb_Map_Get
UPB_INLINE bool _upb_Map_Get(const upb_Map *map, const void *key, size_t key_size, void *val, size_t val_size)
Definition: msg_internal.h:661
_upb_Message_New
upb_Message * _upb_Message_New(const upb_MiniTable *l, upb_Arena *a)
Definition: msg.c:44
autogen_x86imm.f
f
Definition: autogen_x86imm.py:9
end
char * end
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1008
kUpb_Message_Begin
#define kUpb_Message_Begin
Definition: upb/upb/reflection.h:113
upb_FieldDef_IsMap
bool upb_FieldDef_IsMap(const upb_FieldDef *f)
Definition: upb/upb/def.c:659
upb_MapIterator_Next
bool upb_MapIterator_Next(const upb_Map *map, size_t *iter)
Definition: reflection.c:448
upb_FieldDef_HasPresence
bool upb_FieldDef_HasPresence(const upb_FieldDef *f)
Definition: upb/upb/def.c:671
upb_IsRepeatedOrMap
UPB_INLINE bool upb_IsRepeatedOrMap(const upb_MiniTable_Field *field)
Definition: msg_internal.h:114
_upb_Message_Getraw
static upb_MessageValue _upb_Message_Getraw(const upb_Message *msg, const upb_FieldDef *f)
Definition: reflection.c:103
_upb_Message_DiscardUnknown_shallow
void _upb_Message_DiscardUnknown_shallow(upb_Message *msg)
Definition: msg.c:94
upb_Message_Extension
Definition: msg_internal.h:327
upb_Array
Definition: msg_internal.h:424
UPB_SIZE
#define UPB_SIZE(size32, size64)
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.c:32
_upb_map_fromvalue
UPB_INLINE void _upb_map_fromvalue(upb_value val, void *out, size_t size)
Definition: php-upb.h:1552
upb_OneofDef_FieldCount
int upb_OneofDef_FieldCount(const upb_OneofDef *o)
Definition: upb/upb/def.c:878
table_internal.h
_upb_Message_DiscardUnknown
bool _upb_Message_DiscardUnknown(upb_Message *msg, const upb_MessageDef *m, int depth)
Definition: reflection.c:301
upb_Message_DiscardUnknown
bool upb_Message_DiscardUnknown(upb_Message *msg, const upb_MessageDef *m, int maxdepth)
Definition: reflection.c:351
_upb_Map_Clear
UPB_INLINE void _upb_Map_Clear(upb_Map *map)
Definition: msg_internal.h:699
upb_FieldDef_Default
upb_MessageValue upb_FieldDef_Default(const upb_FieldDef *f)
Definition: upb/upb/def.c:581
upb_FieldDef_IsExtension
bool upb_FieldDef_IsExtension(const upb_FieldDef *f)
Definition: upb/upb/def.c:543
reflection.h
absl::compare_internal::value_type
int8_t value_type
Definition: abseil-cpp/absl/types/compare.h:45
upb_Message_Next
bool upb_Message_Next(const upb_Message *msg, const upb_MessageDef *m, const upb_DefPool *ext_pool, const upb_FieldDef **out_f, upb_MessageValue *out_val, size_t *iter)
Definition: reflection.c:245
_upb_Map_New
upb_Map * _upb_Map_New(upb_Arena *a, size_t key_size, size_t value_size)
Definition: msg.c:236
UPB_ASSERT
#define UPB_ASSERT(expr)
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.c:135
data
char data[kBufferLength]
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1006
upb_MessageValue::msg_val
const upb_Message * msg_val
Definition: upb/upb/reflection.h:49
upb_Array_Append
bool upb_Array_Append(upb_Array *arr, upb_MessageValue val, upb_Arena *arena)
Definition: reflection.c:380
upb_FieldDef_CType
upb_CType upb_FieldDef_CType(const upb_FieldDef *f)
Definition: upb/upb/def.c:500
upb_Message
void upb_Message
Definition: msg.h:49
upb_FieldDef_MessageSubDef
const upb_MessageDef * upb_FieldDef_MessageSubDef(const upb_FieldDef *f)
Definition: upb/upb/def.c:619
n
int n
Definition: abseil-cpp/absl/container/btree_test.cc:1080
_upb_hasbit_field
UPB_INLINE bool _upb_hasbit_field(const upb_msg *msg, const upb_msglayout_field *f)
Definition: php-upb.h:1286
msg
std::string msg
Definition: client_interceptors_end2end_test.cc:372
upb_Map_Set
bool upb_Map_Set(upb_Map *map, upb_MessageValue key, upb_MessageValue val, upb_Arena *arena)
Definition: reflection.c:439
upb_FieldDef
Definition: upb/upb/def.c:56
_upb_CTypeo_mapsize
static char _upb_CTypeo_mapsize[12]
Definition: reflection.c:62
upb_MessageValue::map_val
const upb_Map * map_val
Definition: upb/upb/reflection.h:48
upb_Array_Size
size_t upb_Array_Size(const upb_Array *arr)
Definition: reflection.c:362
upb_Message_Has
bool upb_Message_Has(const upb_Message *msg, const upb_FieldDef *f)
Definition: reflection.c:112
mem
void * mem
Definition: libc.cpp:91
upb_Array::data
uintptr_t data
Definition: msg_internal.h:425
upb_Array_Set
void upb_Array_Set(upb_Array *arr, size_t i, upb_MessageValue val)
Definition: reflection.c:373
value
const char * value
Definition: hpack_parser_table.cc:165
upb_OneofDef_IsSynthetic
bool upb_OneofDef_IsSynthetic(const upb_OneofDef *o)
Definition: upb/upb/def.c:892
field
const FieldDescriptor * field
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/parser_unittest.cc:2692
key
const char * key
Definition: hpack_parser_table.cc:164
upb_StringView
Definition: upb/upb/upb.h:72
upb_Map_Delete
bool upb_Map_Delete(upb_Map *map, upb_MessageValue key)
Definition: reflection.c:444
upb_OneofDef_Field
const upb_FieldDef * upb_OneofDef_Field(const upb_OneofDef *o, int i)
Definition: upb/upb/def.c:880
count
int * count
Definition: bloaty/third_party/googletest/googlemock/test/gmock_stress_test.cc:96
upb_Message_Mutable
upb_MutableMessageValue upb_Message_Mutable(upb_Message *msg, const upb_FieldDef *f, upb_Arena *a)
Definition: reflection.c:164
UPB_UNUSED
#define UPB_UNUSED(var)
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.c:128
upb_Message_Get
upb_MessageValue upb_Message_Get(const upb_Message *msg, const upb_FieldDef *f)
Definition: reflection.c:146
upb_FieldDef_IsRepeated
bool upb_FieldDef_IsRepeated(const upb_FieldDef *f)
Definition: upb/upb/def.c:651
upb_Message_WhichOneof
const upb_FieldDef * upb_Message_WhichOneof(const upb_Message *msg, const upb_OneofDef *o)
Definition: reflection.c:131
ret
UniquePtr< SSL_SESSION > ret
Definition: ssl_x509.cc:1029
kUpb_FieldType_Group
@ kUpb_FieldType_Group
Definition: upb/upb/upb.h:318
upb_FieldDef_IsString
bool upb_FieldDef_IsString(const upb_FieldDef *f)
Definition: upb/upb/def.c:646
upb_Array::len
size_t len
Definition: msg_internal.h:426
_upb_Message_Clearext
void _upb_Message_Clearext(upb_Message *msg, const upb_MiniTable_Extension *ext_l)
Definition: msg.c:142
_upb_Array_Resize
UPB_INLINE bool _upb_Array_Resize(upb_Array *arr, size_t size, upb_Arena *arena)
Definition: msg_internal.h:478
_upb_Array_New
UPB_INLINE upb_Array * _upb_Array_New(upb_Arena *a, size_t init_size, int elem_size_lg2)
Definition: msg_internal.h:451
_upb_CTypeo_sizelg2
static const char _upb_CTypeo_sizelg2[12]
Definition: reflection.c:77
upb_strtable_iter_value
upb_value upb_strtable_iter_value(const upb_strtable_iter *i)
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.c:1663
_upb_array_constptr
const UPB_INLINE void * _upb_array_constptr(const upb_array *arr)
Definition: php-upb.h:1340
upb_MutableMessageValue
Definition: upb/upb/reflection.h:54
kUpb_FieldType_Message
@ kUpb_FieldType_Message
Definition: upb/upb/upb.h:319
upb_Map_Get
bool upb_Map_Get(const upb_Map *map, upb_MessageValue key, upb_MessageValue *val)
Definition: reflection.c:432
upb_FieldDef_IsSubMessage
bool upb_FieldDef_IsSubMessage(const upb_FieldDef *f)
Definition: upb/upb/def.c:642
upb_Map
Definition: msg_internal.h:581
_upb_Message_Clear
void _upb_Message_Clear(upb_Message *msg, const upb_MiniTable *l)
Definition: msg.c:48
iter
Definition: test_winkernel.cpp:47
upb_Map_New
upb_Map * upb_Map_New(upb_Arena *a, upb_CType key_type, upb_CType value_type)
Definition: reflection.c:425
asyncio_get_stats.type
type
Definition: asyncio_get_stats.py:37
upb_Map_Clear
void upb_Map_Clear(upb_Map *map)
Definition: reflection.c:437
len
int len
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:46
upb_MessageDef_FieldCount
int upb_MessageDef_FieldCount(const upb_MessageDef *m)
Definition: upb/upb/def.c:794
size
voidpf void uLong size
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
upb_strtable_iter
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.h:1086
key_type
upb_fieldtype_t key_type
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:1071
upb_MessageDef_Field
const upb_FieldDef * upb_MessageDef_Field(const upb_MessageDef *m, int i)
Definition: upb/upb/def.c:828
mkowners.depth
depth
Definition: mkowners.py:114
regress.m
m
Definition: regress/regress.py:25
upb_Message_Set
bool upb_Message_Set(upb_Message *msg, const upb_FieldDef *f, upb_MessageValue val, upb_Arena *a)
Definition: reflection.c:202
_upb_map_fromkey
UPB_INLINE void _upb_map_fromkey(upb_strview key, void *out, size_t size)
Definition: php-upb.h:1531
upb_MapIterator_Value
upb_MessageValue upb_MapIterator_Value(const upb_Map *map, size_t iter)
Definition: reflection.c:470
upb_Array_Insert
bool upb_Array_Insert(upb_Array *arr, size_t i, size_t count, upb_Arena *arena)
Definition: reflection.c:395
upb_DefPool
Definition: upb/upb/def.c:217
upb_MessageDef_FindFieldByNumber
const upb_FieldDef * upb_MessageDef_FindFieldByNumber(const upb_MessageDef *m, uint32_t i)
Definition: upb/upb/def.c:721
upb_Arena
Definition: upb_internal.h:36
if
if(p->owned &&p->wrapped !=NULL)
Definition: call.c:42
_upb_oneofcase_field
UPB_INLINE uint32_t * _upb_oneofcase_field(upb_msg *msg, const upb_msglayout_field *f)
Definition: php-upb.h:1316
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
upb_MapIterator_Done
bool upb_MapIterator_Done(const upb_Map *map, size_t iter)
Definition: reflection.c:452
_upb_FieldDef_ExtensionMiniTable
const upb_MiniTable_Extension * _upb_FieldDef_ExtensionMiniTable(const upb_FieldDef *f)
Definition: upb/upb/def.c:632


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:07