Merge branch 'fastest-table' into fast-table

pull/13171/head
Joshua Haberman 4 years ago
commit 8b38e8f214
  1. 768
      cmake/google/protobuf/descriptor.upb.c
  2. 212
      cmake/google/protobuf/descriptor.upb.h
  3. 16
      tests/bindings/lua/test.proto
  4. 59
      tests/bindings/lua/test_upb.lua
  5. 11
      tests/conformance_upb.c
  6. 25
      tests/test_cpp.cc
  7. 6
      tests/test_generated_code.c
  8. 257
      upb/decode.c
  9. 82
      upb/decode.int.h
  10. 973
      upb/decode_fast.c
  11. 58
      upb/decode_fast.h
  12. 2
      upb/msg.h
  13. 6
      upb/upb.c
  14. 8
      upb/upb.h
  15. 8
      upb/upb.hpp
  16. 181
      upbc/generator.cc
  17. 2
      upbc/message_layout.cc
  18. 17
      upbc/message_layout.h

@ -25,8 +25,8 @@ const upb_msglayout google_protobuf_FileDescriptorSet_msginit = {
&google_protobuf_FileDescriptorSet__fields[0],
UPB_SIZE(8, 8), 1, false, 8,
{
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_prm_1bt_max192b, UPB_SIZE(10, 10)},
{0x0000000000000000, &fastdecode_generic},
{0x000000003f00000a, &upb_prm_1bt_max192b},
},
};
@ -47,11 +47,11 @@ static const upb_msglayout_field google_protobuf_FileDescriptorProto__fields[12]
{5, UPB_SIZE(44, 88), 0, 1, 11, 3},
{6, UPB_SIZE(48, 96), 0, 4, 11, 3},
{7, UPB_SIZE(52, 104), 0, 2, 11, 3},
{8, UPB_SIZE(28, 56), 4, 3, 11, 1},
{9, UPB_SIZE(32, 64), 5, 5, 11, 1},
{8, UPB_SIZE(28, 56), 3, 3, 11, 1},
{9, UPB_SIZE(32, 64), 4, 5, 11, 1},
{10, UPB_SIZE(56, 112), 0, 0, 5, 3},
{11, UPB_SIZE(60, 120), 0, 0, 5, 3},
{12, UPB_SIZE(20, 40), 3, 0, 12, 1},
{12, UPB_SIZE(20, 40), 5, 0, 12, 1},
};
const upb_msglayout google_protobuf_FileDescriptorProto_msginit = {
@ -59,22 +59,22 @@ const upb_msglayout google_protobuf_FileDescriptorProto_msginit = {
&google_protobuf_FileDescriptorProto__fields[0],
UPB_SIZE(64, 128), 12, false, 120,
{
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_pss_1bt, UPB_SIZE(1125899906973706, 2251799813816330)},
{&upb_pss_1bt, UPB_SIZE(3377699720790034, 6755399441317906)},
{&upb_prs_1bt, UPB_SIZE(10133099161583642, 20266198323167258)},
{&upb_prm_1bt_max128b, UPB_SIZE(11258999068426274, 22517998136852514)},
{&upb_prm_1bt_max128b, UPB_SIZE(12384898975334442, 24769797950603306)},
{&upb_prm_1bt_max64b, UPB_SIZE(13510798882373682, 27021597764485170)},
{&upb_prm_1bt_max128b, UPB_SIZE(14636698789085242, 29273397578039354)},
{&upb_psm_1bt_max256b, UPB_SIZE(7881385247440962, 15762684595339330)},
{&upb_psm_1bt_max64b, UPB_SIZE(9007289449381962, 18014488704122954)},
{&upb_prv4_1bt, UPB_SIZE(15762598695796816, 31525197391593552)},
{&upb_prv4_1bt, UPB_SIZE(16888498602639448, 33776997205278808)},
{&upb_pss_1bt, UPB_SIZE(5629499534737506, 11258999068950626)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{0x0000000000000000, &fastdecode_generic},
{0x000800000100000a, &upb_pss_1bt},
{0x0018000002000012, &upb_pss_1bt},
{0x004800003f00001a, &upb_prs_1bt},
{0x005000003f000022, &upb_prm_1bt_max128b},
{0x005800003f01002a, &upb_prm_1bt_max128b},
{0x006000003f040032, &upb_prm_1bt_max64b},
{0x006800003f02003a, &upb_prm_1bt_max128b},
{0x0038000003030042, &upb_psm_1bt_max256b},
{0x004000000405004a, &upb_psm_1bt_max64b},
{0x007000003f000050, &upb_prv4_1bt},
{0x007800003f000058, &upb_prv4_1bt},
{0x0028000005000062, &upb_pss_1bt},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
},
};
@ -106,22 +106,22 @@ const upb_msglayout google_protobuf_DescriptorProto_msginit = {
&google_protobuf_DescriptorProto__fields[0],
UPB_SIZE(48, 96), 10, false, 120,
{
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_pss_1bt, UPB_SIZE(1125899906973706, 2251799813816330)},
{&upb_prm_1bt_max128b, UPB_SIZE(4503599627632658, 9007199255003154)},
{&upb_prm_1bt_max128b, UPB_SIZE(5629499534213146, 11258999068426266)},
{&upb_prm_1bt_max128b, UPB_SIZE(6755399441252386, 13510798882308130)},
{&upb_prm_1bt_max64b, UPB_SIZE(7881299347963946, 15762598695862314)},
{&upb_prm_1bt_max128b, UPB_SIZE(9007199255003186, 18014398509744178)},
{&upb_psm_1bt_max64b, UPB_SIZE(3377777030266938, 6755476750794810)},
{&upb_prm_1bt_max64b, UPB_SIZE(10133099161976898, 20266198323560514)},
{&upb_prm_1bt_max64b, UPB_SIZE(11258999068557386, 22517998136983626)},
{&upb_prs_1bt, UPB_SIZE(12384898975268946, 24769797950537810)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{0x0000000000000000, &fastdecode_generic},
{0x000800000100000a, &upb_pss_1bt},
{0x002000003f040012, &upb_prm_1bt_max128b},
{0x002800003f00001a, &upb_prm_1bt_max128b},
{0x003000003f030022, &upb_prm_1bt_max128b},
{0x003800003f01002a, &upb_prm_1bt_max64b},
{0x004000003f040032, &upb_prm_1bt_max128b},
{0x001800000205003a, &upb_psm_1bt_max64b},
{0x004800003f060042, &upb_prm_1bt_max64b},
{0x005000003f02004a, &upb_prm_1bt_max64b},
{0x005800003f000052, &upb_prs_1bt},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
},
};
@ -140,10 +140,10 @@ const upb_msglayout google_protobuf_DescriptorProto_ExtensionRange_msginit = {
&google_protobuf_DescriptorProto_ExtensionRange__fields[0],
UPB_SIZE(16, 24), 3, false, 24,
{
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_psv4_1bt, UPB_SIZE(1125899906973704, 1125899906973704)},
{&upb_psv4_1bt, UPB_SIZE(2251799813947408, 2251799813947408)},
{&upb_psm_1bt_max64b, UPB_SIZE(3377781324906522, 4503681231749146)},
{0x0000000000000000, &fastdecode_generic},
{0x0004000001000008, &upb_psv4_1bt},
{0x0008000002000010, &upb_psv4_1bt},
{0x001000000300001a, &upb_psm_1bt_max64b},
},
};
@ -157,10 +157,10 @@ const upb_msglayout google_protobuf_DescriptorProto_ReservedRange_msginit = {
&google_protobuf_DescriptorProto_ReservedRange__fields[0],
UPB_SIZE(16, 16), 2, false, 24,
{
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_psv4_1bt, UPB_SIZE(1125899906973704, 1125899906973704)},
{&upb_psv4_1bt, UPB_SIZE(2251799813947408, 2251799813947408)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{0x0000000000000000, &fastdecode_generic},
{0x0004000001000008, &upb_psv4_1bt},
{0x0008000002000010, &upb_psv4_1bt},
{0x0000000000000000, &fastdecode_generic},
},
};
@ -175,9 +175,40 @@ static const upb_msglayout_field google_protobuf_ExtensionRangeOptions__fields[1
const upb_msglayout google_protobuf_ExtensionRangeOptions_msginit = {
&google_protobuf_ExtensionRangeOptions_submsgs[0],
&google_protobuf_ExtensionRangeOptions__fields[0],
UPB_SIZE(8, 8), 1, false, 0,
UPB_SIZE(8, 8), 1, false, 248,
{
{&fastdecode_generic, UPB_SIZE(0, 0)},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x000000003f003eba, &upb_prm_2bt_max128b},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
},
};
@ -186,17 +217,17 @@ static const upb_msglayout *const google_protobuf_FieldDescriptorProto_submsgs[1
};
static const upb_msglayout_field google_protobuf_FieldDescriptorProto__fields[11] = {
{1, UPB_SIZE(24, 24), 6, 0, 12, 1},
{2, UPB_SIZE(32, 40), 7, 0, 12, 1},
{1, UPB_SIZE(24, 24), 1, 0, 12, 1},
{2, UPB_SIZE(32, 40), 2, 0, 12, 1},
{3, UPB_SIZE(12, 12), 3, 0, 5, 1},
{4, UPB_SIZE(4, 4), 1, 0, 14, 1},
{5, UPB_SIZE(8, 8), 2, 0, 14, 1},
{6, UPB_SIZE(40, 56), 8, 0, 12, 1},
{7, UPB_SIZE(48, 72), 9, 0, 12, 1},
{8, UPB_SIZE(64, 104), 11, 0, 11, 1},
{9, UPB_SIZE(16, 16), 4, 0, 5, 1},
{4, UPB_SIZE(4, 4), 4, 0, 14, 1},
{5, UPB_SIZE(8, 8), 5, 0, 14, 1},
{6, UPB_SIZE(40, 56), 6, 0, 12, 1},
{7, UPB_SIZE(48, 72), 7, 0, 12, 1},
{8, UPB_SIZE(64, 104), 8, 0, 11, 1},
{9, UPB_SIZE(16, 16), 9, 0, 5, 1},
{10, UPB_SIZE(56, 88), 10, 0, 12, 1},
{17, UPB_SIZE(20, 20), 5, 0, 8, 1},
{17, UPB_SIZE(20, 20), 11, 0, 8, 1},
};
const upb_msglayout google_protobuf_FieldDescriptorProto_msginit = {
@ -204,38 +235,38 @@ const upb_msglayout google_protobuf_FieldDescriptorProto_msginit = {
&google_protobuf_FieldDescriptorProto__fields[0],
UPB_SIZE(72, 112), 11, false, 248,
{
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_pss_1bt, UPB_SIZE(6755399445250058, 6755399445250058)},
{&upb_pss_1bt, UPB_SIZE(9007199263129618, 11258999076814866)},
{&upb_psv4_1bt, UPB_SIZE(3377699721052184, 3377699721052184)},
{&upb_psv4_1bt, UPB_SIZE(1125899906973728, 1125899906973728)},
{&upb_psv4_1bt, UPB_SIZE(2251799813947432, 2251799813947432)},
{&upb_pss_1bt, UPB_SIZE(11258999085203506, 15762598712574002)},
{&upb_pss_1bt, UPB_SIZE(13510798915665978, 20266198356721722)},
{&upb_psm_1bt_max64b, UPB_SIZE(18014514473599042, 29273513542025282)},
{&upb_psv4_1bt, UPB_SIZE(4503599628419144, 4503599628419144)},
{&upb_pss_1bt, UPB_SIZE(15762598762905682, 24769798017646674)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_psb1_2bt, UPB_SIZE(5629499536310664, 5629499536310664)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{0x0000000000000000, &fastdecode_generic},
{0x001800000100000a, &upb_pss_1bt},
{0x0028000002000012, &upb_pss_1bt},
{0x000c000003000018, &upb_psv4_1bt},
{0x0004000004000020, &upb_psv4_1bt},
{0x0008000005000028, &upb_psv4_1bt},
{0x0038000006000032, &upb_pss_1bt},
{0x004800000700003a, &upb_pss_1bt},
{0x0068000008000042, &upb_psm_1bt_max64b},
{0x0010000009000048, &upb_psv4_1bt},
{0x005800000a000052, &upb_pss_1bt},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x001400000b000188, &upb_psb1_2bt},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
},
};
@ -253,10 +284,10 @@ const upb_msglayout google_protobuf_OneofDescriptorProto_msginit = {
&google_protobuf_OneofDescriptorProto__fields[0],
UPB_SIZE(16, 32), 2, false, 24,
{
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_pss_1bt, UPB_SIZE(1125899906973706, 2251799813816330)},
{&upb_psm_1bt_max64b, UPB_SIZE(3377777029939218, 6755476750467090)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{0x0000000000000000, &fastdecode_generic},
{0x000800000100000a, &upb_pss_1bt},
{0x0018000002000012, &upb_psm_1bt_max64b},
{0x0000000000000000, &fastdecode_generic},
},
};
@ -279,14 +310,14 @@ const upb_msglayout google_protobuf_EnumDescriptorProto_msginit = {
&google_protobuf_EnumDescriptorProto__fields[0],
UPB_SIZE(32, 64), 5, false, 56,
{
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_pss_1bt, UPB_SIZE(1125899906973706, 2251799813816330)},
{&upb_prm_1bt_max64b, UPB_SIZE(4503599627501586, 9007199254872082)},
{&upb_psm_1bt_max64b, UPB_SIZE(3377777030004762, 6755476750532634)},
{&upb_prm_1bt_max64b, UPB_SIZE(5629499534213154, 11258999068426274)},
{&upb_prs_1bt, UPB_SIZE(6755399441055786, 13510798882111530)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{0x0000000000000000, &fastdecode_generic},
{0x000800000100000a, &upb_pss_1bt},
{0x002000003f020012, &upb_prm_1bt_max64b},
{0x001800000201001a, &upb_psm_1bt_max64b},
{0x002800003f000022, &upb_prm_1bt_max64b},
{0x003000003f00002a, &upb_prs_1bt},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
},
};
@ -300,10 +331,10 @@ const upb_msglayout google_protobuf_EnumDescriptorProto_EnumReservedRange_msgini
&google_protobuf_EnumDescriptorProto_EnumReservedRange__fields[0],
UPB_SIZE(16, 16), 2, false, 24,
{
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_psv4_1bt, UPB_SIZE(1125899906973704, 1125899906973704)},
{&upb_psv4_1bt, UPB_SIZE(2251799813947408, 2251799813947408)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{0x0000000000000000, &fastdecode_generic},
{0x0004000001000008, &upb_psv4_1bt},
{0x0008000002000010, &upb_psv4_1bt},
{0x0000000000000000, &fastdecode_generic},
},
};
@ -312,8 +343,8 @@ static const upb_msglayout *const google_protobuf_EnumValueDescriptorProto_subms
};
static const upb_msglayout_field google_protobuf_EnumValueDescriptorProto__fields[3] = {
{1, UPB_SIZE(8, 8), 2, 0, 12, 1},
{2, UPB_SIZE(4, 4), 1, 0, 5, 1},
{1, UPB_SIZE(8, 8), 1, 0, 12, 1},
{2, UPB_SIZE(4, 4), 2, 0, 5, 1},
{3, UPB_SIZE(16, 24), 3, 0, 11, 1},
};
@ -322,10 +353,10 @@ const upb_msglayout google_protobuf_EnumValueDescriptorProto_msginit = {
&google_protobuf_EnumValueDescriptorProto__fields[0],
UPB_SIZE(24, 32), 3, false, 24,
{
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_pss_1bt, UPB_SIZE(2251799813947402, 2251799813947402)},
{&upb_psv4_1bt, UPB_SIZE(1125899906973712, 1125899906973712)},
{&upb_psm_1bt_max64b, UPB_SIZE(4503681231749146, 6755481045434394)},
{0x0000000000000000, &fastdecode_generic},
{0x000800000100000a, &upb_pss_1bt},
{0x0004000002000010, &upb_psv4_1bt},
{0x001800000300001a, &upb_psm_1bt_max64b},
},
};
@ -345,10 +376,10 @@ const upb_msglayout google_protobuf_ServiceDescriptorProto_msginit = {
&google_protobuf_ServiceDescriptorProto__fields[0],
UPB_SIZE(24, 48), 3, false, 24,
{
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_pss_1bt, UPB_SIZE(1125899906973706, 2251799813816330)},
{&upb_prm_1bt_max128b, UPB_SIZE(4503599627370514, 9007199254741010)},
{&upb_psm_1bt_max64b, UPB_SIZE(3377777030004762, 6755476750532634)},
{0x0000000000000000, &fastdecode_generic},
{0x000800000100000a, &upb_pss_1bt},
{0x002000003f000012, &upb_prm_1bt_max128b},
{0x001800000201001a, &upb_psm_1bt_max64b},
},
};
@ -357,12 +388,12 @@ static const upb_msglayout *const google_protobuf_MethodDescriptorProto_submsgs[
};
static const upb_msglayout_field google_protobuf_MethodDescriptorProto__fields[6] = {
{1, UPB_SIZE(4, 8), 3, 0, 12, 1},
{2, UPB_SIZE(12, 24), 4, 0, 12, 1},
{3, UPB_SIZE(20, 40), 5, 0, 12, 1},
{4, UPB_SIZE(28, 56), 6, 0, 11, 1},
{5, UPB_SIZE(1, 1), 1, 0, 8, 1},
{6, UPB_SIZE(2, 2), 2, 0, 8, 1},
{1, UPB_SIZE(4, 8), 1, 0, 12, 1},
{2, UPB_SIZE(12, 24), 2, 0, 12, 1},
{3, UPB_SIZE(20, 40), 3, 0, 12, 1},
{4, UPB_SIZE(28, 56), 4, 0, 11, 1},
{5, UPB_SIZE(1, 1), 5, 0, 8, 1},
{6, UPB_SIZE(2, 2), 6, 0, 8, 1},
};
const upb_msglayout google_protobuf_MethodDescriptorProto_msginit = {
@ -370,14 +401,14 @@ const upb_msglayout google_protobuf_MethodDescriptorProto_msginit = {
&google_protobuf_MethodDescriptorProto__fields[0],
UPB_SIZE(32, 64), 6, false, 56,
{
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_pss_1bt, UPB_SIZE(1125899907366922, 2251799814209546)},
{&upb_pss_1bt, UPB_SIZE(3377699721576466, 6755399442104338)},
{&upb_pss_1bt, UPB_SIZE(5629499536310298, 11258999070523418)},
{&upb_psm_1bt_max64b, UPB_SIZE(7881393837178914, 15762693185077282)},
{&upb_psb1_1bt, UPB_SIZE(281474976841768, 281474976841768)},
{&upb_psb1_1bt, UPB_SIZE(562949953683504, 562949953683504)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{0x0000000000000000, &fastdecode_generic},
{0x000800000100000a, &upb_pss_1bt},
{0x0018000002000012, &upb_pss_1bt},
{0x002800000300001a, &upb_pss_1bt},
{0x0038000004000022, &upb_psm_1bt_max64b},
{0x0001000005000028, &upb_psb1_1bt},
{0x0002000006000030, &upb_psb1_1bt},
{0x0000000000000000, &fastdecode_generic},
},
};
@ -386,24 +417,24 @@ static const upb_msglayout *const google_protobuf_FileOptions_submsgs[1] = {
};
static const upb_msglayout_field google_protobuf_FileOptions__fields[21] = {
{1, UPB_SIZE(20, 24), 11, 0, 12, 1},
{8, UPB_SIZE(28, 40), 12, 0, 12, 1},
{9, UPB_SIZE(4, 4), 1, 0, 14, 1},
{10, UPB_SIZE(8, 8), 2, 0, 8, 1},
{11, UPB_SIZE(36, 56), 13, 0, 12, 1},
{16, UPB_SIZE(9, 9), 3, 0, 8, 1},
{17, UPB_SIZE(10, 10), 4, 0, 8, 1},
{18, UPB_SIZE(11, 11), 5, 0, 8, 1},
{20, UPB_SIZE(12, 12), 6, 0, 8, 1},
{23, UPB_SIZE(13, 13), 7, 0, 8, 1},
{27, UPB_SIZE(14, 14), 8, 0, 8, 1},
{31, UPB_SIZE(15, 15), 9, 0, 8, 1},
{36, UPB_SIZE(44, 72), 14, 0, 12, 1},
{37, UPB_SIZE(52, 88), 15, 0, 12, 1},
{39, UPB_SIZE(60, 104), 16, 0, 12, 1},
{40, UPB_SIZE(68, 120), 17, 0, 12, 1},
{41, UPB_SIZE(76, 136), 18, 0, 12, 1},
{42, UPB_SIZE(16, 16), 10, 0, 8, 1},
{1, UPB_SIZE(20, 24), 1, 0, 12, 1},
{8, UPB_SIZE(28, 40), 2, 0, 12, 1},
{9, UPB_SIZE(4, 4), 3, 0, 14, 1},
{10, UPB_SIZE(8, 8), 4, 0, 8, 1},
{11, UPB_SIZE(36, 56), 5, 0, 12, 1},
{16, UPB_SIZE(9, 9), 6, 0, 8, 1},
{17, UPB_SIZE(10, 10), 7, 0, 8, 1},
{18, UPB_SIZE(11, 11), 8, 0, 8, 1},
{20, UPB_SIZE(12, 12), 9, 0, 8, 1},
{23, UPB_SIZE(13, 13), 10, 0, 8, 1},
{27, UPB_SIZE(14, 14), 11, 0, 8, 1},
{31, UPB_SIZE(15, 15), 12, 0, 8, 1},
{36, UPB_SIZE(44, 72), 13, 0, 12, 1},
{37, UPB_SIZE(52, 88), 14, 0, 12, 1},
{39, UPB_SIZE(60, 104), 15, 0, 12, 1},
{40, UPB_SIZE(68, 120), 16, 0, 12, 1},
{41, UPB_SIZE(76, 136), 17, 0, 12, 1},
{42, UPB_SIZE(16, 16), 18, 0, 8, 1},
{44, UPB_SIZE(84, 152), 19, 0, 12, 1},
{45, UPB_SIZE(92, 168), 20, 0, 12, 1},
{999, UPB_SIZE(100, 184), 0, 0, 11, 3},
@ -414,38 +445,38 @@ const upb_msglayout google_protobuf_FileOptions_msginit = {
&google_protobuf_FileOptions__fields[0],
UPB_SIZE(104, 192), 21, false, 248,
{
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_pss_1bt, UPB_SIZE(5629499668430858, 6755399575273482)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_pss_1bt, UPB_SIZE(7881299616333890, 11258999336861762)},
{&upb_psv4_1bt, UPB_SIZE(1125899906973768, 1125899906973768)},
{&upb_psb1_1bt, UPB_SIZE(2251799813947472, 2251799813947472)},
{&upb_pss_1bt, UPB_SIZE(10133099698454618, 15762599232667738)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_psb1_2bt, UPB_SIZE(2533274790920576, 2533274790920576)},
{&upb_psb1_2bt, UPB_SIZE(2814749768155528, 2814749768155528)},
{&upb_psb1_2bt, UPB_SIZE(3096224745914768, 3096224745914768)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_psb1_2bt, UPB_SIZE(3377699724722592, 3377699724722592)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_psb1_2bt, UPB_SIZE(3659174705627576, 3659174705627576)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_psb1_2bt, UPB_SIZE(3940649690726872, 3940649690726872)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_psb1_2bt, UPB_SIZE(4222124684214776, 4222124684214776)},
{0x0000000000000000, &fastdecode_generic},
{0x001800000100000a, &upb_pss_1bt},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0028000002000042, &upb_pss_1bt},
{0x0004000003000048, &upb_psv4_1bt},
{0x0008000004000050, &upb_psb1_1bt},
{0x003800000500005a, &upb_pss_1bt},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0009000006000180, &upb_psb1_2bt},
{0x000a000007000188, &upb_psb1_2bt},
{0x000b000008000190, &upb_psb1_2bt},
{0x0000000000000000, &fastdecode_generic},
{0x000c0000090001a0, &upb_psb1_2bt},
{0x005800000e0002aa, &upb_pss_2bt},
{0x0000000000000000, &fastdecode_generic},
{0x000d00000a0001b8, &upb_psb1_2bt},
{0x00780000100002c2, &upb_pss_2bt},
{0x00880000110002ca, &upb_pss_2bt},
{0x00100000120002d0, &upb_psb1_2bt},
{0x000e00000b0001d8, &upb_psb1_2bt},
{0x00980000130002e2, &upb_pss_2bt},
{0x00a80000140002ea, &upb_pss_2bt},
{0x0000000000000000, &fastdecode_generic},
{0x000f00000c0001f8, &upb_psb1_2bt},
},
};
@ -464,16 +495,40 @@ static const upb_msglayout_field google_protobuf_MessageOptions__fields[5] = {
const upb_msglayout google_protobuf_MessageOptions_msginit = {
&google_protobuf_MessageOptions_submsgs[0],
&google_protobuf_MessageOptions__fields[0],
UPB_SIZE(16, 16), 5, false, 56,
UPB_SIZE(16, 16), 5, false, 248,
{
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_psb1_1bt, UPB_SIZE(281474976841736, 281474976841736)},
{&upb_psb1_1bt, UPB_SIZE(562949953683472, 562949953683472)},
{&upb_psb1_1bt, UPB_SIZE(844424930656280, 844424930656280)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_psb1_1bt, UPB_SIZE(1125899907891256, 1125899907891256)},
{0x0000000000000000, &fastdecode_generic},
{0x0001000001000008, &upb_psb1_1bt},
{0x0002000002000010, &upb_psb1_1bt},
{0x0003000003000018, &upb_psb1_1bt},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0004000004000038, &upb_psb1_1bt},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x000800003f003eba, &upb_prm_2bt_max128b},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
},
};
@ -483,10 +538,10 @@ static const upb_msglayout *const google_protobuf_FieldOptions_submsgs[1] = {
static const upb_msglayout_field google_protobuf_FieldOptions__fields[7] = {
{1, UPB_SIZE(4, 4), 1, 0, 14, 1},
{2, UPB_SIZE(12, 12), 3, 0, 8, 1},
{3, UPB_SIZE(13, 13), 4, 0, 8, 1},
{5, UPB_SIZE(14, 14), 5, 0, 8, 1},
{6, UPB_SIZE(8, 8), 2, 0, 14, 1},
{2, UPB_SIZE(12, 12), 2, 0, 8, 1},
{3, UPB_SIZE(13, 13), 3, 0, 8, 1},
{5, UPB_SIZE(14, 14), 4, 0, 8, 1},
{6, UPB_SIZE(8, 8), 5, 0, 14, 1},
{10, UPB_SIZE(15, 15), 6, 0, 8, 1},
{999, UPB_SIZE(16, 16), 0, 0, 11, 3},
};
@ -494,24 +549,40 @@ static const upb_msglayout_field google_protobuf_FieldOptions__fields[7] = {
const upb_msglayout google_protobuf_FieldOptions_msginit = {
&google_protobuf_FieldOptions_submsgs[0],
&google_protobuf_FieldOptions__fields[0],
UPB_SIZE(24, 24), 7, false, 120,
UPB_SIZE(24, 24), 7, false, 248,
{
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_psv4_1bt, UPB_SIZE(1125899906973704, 1125899906973704)},
{&upb_psb1_1bt, UPB_SIZE(3377699721052176, 3377699721052176)},
{&upb_psb1_1bt, UPB_SIZE(3659174698287128, 3659174698287128)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_psb1_1bt, UPB_SIZE(3940649676046376, 3940649676046376)},
{&upb_psv4_1bt, UPB_SIZE(2251799813947440, 2251799813947440)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_psb1_1bt, UPB_SIZE(4222124654854224, 4222124654854224)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{0x0000000000000000, &fastdecode_generic},
{0x0004000001000008, &upb_psv4_1bt},
{0x000c000002000010, &upb_psb1_1bt},
{0x000d000003000018, &upb_psb1_1bt},
{0x0000000000000000, &fastdecode_generic},
{0x000e000004000028, &upb_psb1_1bt},
{0x0008000005000030, &upb_psv4_1bt},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x000f000006000050, &upb_psb1_1bt},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x001000003f003eba, &upb_prm_2bt_max128b},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
},
};
@ -526,9 +597,40 @@ static const upb_msglayout_field google_protobuf_OneofOptions__fields[1] = {
const upb_msglayout google_protobuf_OneofOptions_msginit = {
&google_protobuf_OneofOptions_submsgs[0],
&google_protobuf_OneofOptions__fields[0],
UPB_SIZE(8, 8), 1, false, 0,
UPB_SIZE(8, 8), 1, false, 248,
{
{&fastdecode_generic, UPB_SIZE(0, 0)},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x000000003f003eba, &upb_prm_2bt_max128b},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
},
};
@ -545,12 +647,40 @@ static const upb_msglayout_field google_protobuf_EnumOptions__fields[3] = {
const upb_msglayout google_protobuf_EnumOptions_msginit = {
&google_protobuf_EnumOptions_submsgs[0],
&google_protobuf_EnumOptions__fields[0],
UPB_SIZE(8, 16), 3, false, 24,
UPB_SIZE(8, 16), 3, false, 248,
{
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_psb1_1bt, UPB_SIZE(281474976841744, 281474976841744)},
{&upb_psb1_1bt, UPB_SIZE(562949953683480, 562949953683480)},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0001000001000010, &upb_psb1_1bt},
{0x0002000002000018, &upb_psb1_1bt},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x000800003f003eba, &upb_prm_2bt_max128b},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
},
};
@ -566,10 +696,40 @@ static const upb_msglayout_field google_protobuf_EnumValueOptions__fields[2] = {
const upb_msglayout google_protobuf_EnumValueOptions_msginit = {
&google_protobuf_EnumValueOptions_submsgs[0],
&google_protobuf_EnumValueOptions__fields[0],
UPB_SIZE(8, 16), 2, false, 8,
UPB_SIZE(8, 16), 2, false, 248,
{
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_psb1_1bt, UPB_SIZE(281474976841736, 281474976841736)},
{0x0000000000000000, &fastdecode_generic},
{0x0001000001000008, &upb_psb1_1bt},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x000800003f003eba, &upb_prm_2bt_max128b},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
},
};
@ -585,9 +745,40 @@ static const upb_msglayout_field google_protobuf_ServiceOptions__fields[2] = {
const upb_msglayout google_protobuf_ServiceOptions_msginit = {
&google_protobuf_ServiceOptions_submsgs[0],
&google_protobuf_ServiceOptions__fields[0],
UPB_SIZE(8, 16), 2, false, 0,
UPB_SIZE(8, 16), 2, false, 248,
{
{&fastdecode_generic, UPB_SIZE(0, 0)},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0001000001000288, &upb_psb1_2bt},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x000800003f003eba, &upb_prm_2bt_max128b},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
},
};
@ -596,17 +787,48 @@ static const upb_msglayout *const google_protobuf_MethodOptions_submsgs[1] = {
};
static const upb_msglayout_field google_protobuf_MethodOptions__fields[3] = {
{33, UPB_SIZE(8, 8), 2, 0, 8, 1},
{34, UPB_SIZE(4, 4), 1, 0, 14, 1},
{33, UPB_SIZE(8, 8), 1, 0, 8, 1},
{34, UPB_SIZE(4, 4), 2, 0, 14, 1},
{999, UPB_SIZE(12, 16), 0, 0, 11, 3},
};
const upb_msglayout google_protobuf_MethodOptions_msginit = {
&google_protobuf_MethodOptions_submsgs[0],
&google_protobuf_MethodOptions__fields[0],
UPB_SIZE(16, 24), 3, false, 0,
UPB_SIZE(16, 24), 3, false, 248,
{
{&fastdecode_generic, UPB_SIZE(0, 0)},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0008000001000288, &upb_psb1_2bt},
{0x0004000002000290, &upb_psv4_2bt},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x001000003f003eba, &upb_prm_2bt_max128b},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
},
};
@ -616,10 +838,10 @@ static const upb_msglayout *const google_protobuf_UninterpretedOption_submsgs[1]
static const upb_msglayout_field google_protobuf_UninterpretedOption__fields[7] = {
{2, UPB_SIZE(56, 80), 0, 0, 11, 3},
{3, UPB_SIZE(32, 32), 4, 0, 12, 1},
{4, UPB_SIZE(8, 8), 1, 0, 4, 1},
{5, UPB_SIZE(16, 16), 2, 0, 3, 1},
{6, UPB_SIZE(24, 24), 3, 0, 1, 1},
{3, UPB_SIZE(32, 32), 1, 0, 12, 1},
{4, UPB_SIZE(8, 8), 2, 0, 4, 1},
{5, UPB_SIZE(16, 16), 3, 0, 3, 1},
{6, UPB_SIZE(24, 24), 4, 0, 1, 1},
{7, UPB_SIZE(40, 48), 5, 0, 12, 1},
{8, UPB_SIZE(48, 64), 6, 0, 12, 1},
};
@ -629,28 +851,28 @@ const upb_msglayout google_protobuf_UninterpretedOption_msginit = {
&google_protobuf_UninterpretedOption__fields[0],
UPB_SIZE(64, 96), 7, false, 120,
{
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_prm_1bt_max64b, UPB_SIZE(15762598695796754, 22517998136852498)},
{&upb_pss_1bt, UPB_SIZE(9007199255789594, 9007199255789594)},
{&upb_psv8_1bt, UPB_SIZE(2251799813816352, 2251799813816352)},
{&upb_psv8_1bt, UPB_SIZE(4503599627632680, 4503599627632680)},
{&upb_psf8_1bt, UPB_SIZE(6755399441580081, 6755399441580081)},
{&upb_pss_1bt, UPB_SIZE(11258999070523450, 13510798884208698)},
{&upb_pss_1bt, UPB_SIZE(13510798886305858, 18014398513676354)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x005000003f000012, &upb_prm_1bt_max64b},
{0x002000000100001a, &upb_pss_1bt},
{0x0008000002000020, &upb_psv8_1bt},
{0x0010000003000028, &upb_psv8_1bt},
{0x0018000004000031, &upb_psf8_1bt},
{0x003000000500003a, &upb_pss_1bt},
{0x0040000006000042, &upb_pss_1bt},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
},
};
static const upb_msglayout_field google_protobuf_UninterpretedOption_NamePart__fields[2] = {
{1, UPB_SIZE(4, 8), 2, 0, 12, 2},
{2, UPB_SIZE(1, 1), 1, 0, 8, 2},
{1, UPB_SIZE(4, 8), 1, 0, 12, 2},
{2, UPB_SIZE(1, 1), 2, 0, 8, 2},
};
const upb_msglayout google_protobuf_UninterpretedOption_NamePart_msginit = {
@ -658,10 +880,10 @@ const upb_msglayout google_protobuf_UninterpretedOption_NamePart_msginit = {
&google_protobuf_UninterpretedOption_NamePart__fields[0],
UPB_SIZE(16, 32), 2, false, 24,
{
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_pss_1bt, UPB_SIZE(1125899907104778, 2251799813947402)},
{&upb_psb1_1bt, UPB_SIZE(281474976841744, 281474976841744)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{0x0000000000000000, &fastdecode_generic},
{0x000800000100000a, &upb_pss_1bt},
{0x0001000002000010, &upb_psb1_1bt},
{0x0000000000000000, &fastdecode_generic},
},
};
@ -678,8 +900,8 @@ const upb_msglayout google_protobuf_SourceCodeInfo_msginit = {
&google_protobuf_SourceCodeInfo__fields[0],
UPB_SIZE(8, 8), 1, false, 8,
{
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_prm_1bt_max128b, UPB_SIZE(10, 10)},
{0x0000000000000000, &fastdecode_generic},
{0x000000003f00000a, &upb_prm_1bt_max128b},
},
};
@ -696,14 +918,14 @@ const upb_msglayout google_protobuf_SourceCodeInfo_Location_msginit = {
&google_protobuf_SourceCodeInfo_Location__fields[0],
UPB_SIZE(32, 64), 5, false, 56,
{
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_pss_1bt, UPB_SIZE(1125899906973722, 2251799813816346)},
{&upb_pss_1bt, UPB_SIZE(3377699720790050, 6755399441317922)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_prs_1bt, UPB_SIZE(7881299347898418, 15762598695796786)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{0x0000000000000000, &fastdecode_generic},
{0x002800003f00000a, &upb_ppv4_1bt},
{0x003000003f000012, &upb_ppv4_1bt},
{0x000800000100001a, &upb_pss_1bt},
{0x0018000002000022, &upb_pss_1bt},
{0x0000000000000000, &fastdecode_generic},
{0x003800003f000032, &upb_prs_1bt},
{0x0000000000000000, &fastdecode_generic},
},
};
@ -720,16 +942,16 @@ const upb_msglayout google_protobuf_GeneratedCodeInfo_msginit = {
&google_protobuf_GeneratedCodeInfo__fields[0],
UPB_SIZE(8, 8), 1, false, 8,
{
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_prm_1bt_max64b, UPB_SIZE(10, 10)},
{0x0000000000000000, &fastdecode_generic},
{0x000000003f00000a, &upb_prm_1bt_max64b},
},
};
static const upb_msglayout_field google_protobuf_GeneratedCodeInfo_Annotation__fields[4] = {
{1, UPB_SIZE(20, 32), 0, 0, 5, _UPB_LABEL_PACKED},
{2, UPB_SIZE(12, 16), 3, 0, 12, 1},
{3, UPB_SIZE(4, 4), 1, 0, 5, 1},
{4, UPB_SIZE(8, 8), 2, 0, 5, 1},
{2, UPB_SIZE(12, 16), 1, 0, 12, 1},
{3, UPB_SIZE(4, 4), 2, 0, 5, 1},
{4, UPB_SIZE(8, 8), 3, 0, 5, 1},
};
const upb_msglayout google_protobuf_GeneratedCodeInfo_Annotation_msginit = {
@ -737,14 +959,14 @@ const upb_msglayout google_protobuf_GeneratedCodeInfo_Annotation_msginit = {
&google_protobuf_GeneratedCodeInfo_Annotation__fields[0],
UPB_SIZE(24, 48), 4, false, 56,
{
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&upb_pss_1bt, UPB_SIZE(3377699721052178, 4503599627894802)},
{&upb_psv4_1bt, UPB_SIZE(1125899906973720, 1125899906973720)},
{&upb_psv4_1bt, UPB_SIZE(2251799813947424, 2251799813947424)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{&fastdecode_generic, UPB_SIZE(0, 0)},
{0x0000000000000000, &fastdecode_generic},
{0x002000003f00000a, &upb_ppv4_1bt},
{0x0010000001000012, &upb_pss_1bt},
{0x0004000002000018, &upb_psv4_1bt},
{0x0008000003000020, &upb_psv4_1bt},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
{0x0000000000000000, &fastdecode_generic},
},
};

@ -212,13 +212,13 @@ UPB_INLINE bool google_protobuf_FileDescriptorProto_has_service(const google_pro
UPB_INLINE const google_protobuf_ServiceDescriptorProto* const* google_protobuf_FileDescriptorProto_service(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (const google_protobuf_ServiceDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(48, 96), len); }
UPB_INLINE bool google_protobuf_FileDescriptorProto_has_extension(const google_protobuf_FileDescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(52, 104)); }
UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_FileDescriptorProto_extension(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(52, 104), len); }
UPB_INLINE bool google_protobuf_FileDescriptorProto_has_options(const google_protobuf_FileDescriptorProto *msg) { return _upb_hasbit(msg, 4); }
UPB_INLINE bool google_protobuf_FileDescriptorProto_has_options(const google_protobuf_FileDescriptorProto *msg) { return _upb_hasbit(msg, 3); }
UPB_INLINE const google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_options(const google_protobuf_FileDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const google_protobuf_FileOptions*); }
UPB_INLINE bool google_protobuf_FileDescriptorProto_has_source_code_info(const google_protobuf_FileDescriptorProto *msg) { return _upb_hasbit(msg, 5); }
UPB_INLINE bool google_protobuf_FileDescriptorProto_has_source_code_info(const google_protobuf_FileDescriptorProto *msg) { return _upb_hasbit(msg, 4); }
UPB_INLINE const google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_source_code_info(const google_protobuf_FileDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const google_protobuf_SourceCodeInfo*); }
UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_public_dependency(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(56, 112), len); }
UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_weak_dependency(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(60, 120), len); }
UPB_INLINE bool google_protobuf_FileDescriptorProto_has_syntax(const google_protobuf_FileDescriptorProto *msg) { return _upb_hasbit(msg, 3); }
UPB_INLINE bool google_protobuf_FileDescriptorProto_has_syntax(const google_protobuf_FileDescriptorProto *msg) { return _upb_hasbit(msg, 5); }
UPB_INLINE upb_strview google_protobuf_FileDescriptorProto_syntax(const google_protobuf_FileDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview); }
UPB_INLINE void google_protobuf_FileDescriptorProto_set_name(google_protobuf_FileDescriptorProto *msg, upb_strview value) {
@ -292,7 +292,7 @@ UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_FileDesc
return sub;
}
UPB_INLINE void google_protobuf_FileDescriptorProto_set_options(google_protobuf_FileDescriptorProto *msg, google_protobuf_FileOptions* value) {
_upb_sethas(msg, 4);
_upb_sethas(msg, 3);
*UPB_PTR_AT(msg, UPB_SIZE(28, 56), google_protobuf_FileOptions*) = value;
}
UPB_INLINE struct google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_mutable_options(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) {
@ -305,7 +305,7 @@ UPB_INLINE struct google_protobuf_FileOptions* google_protobuf_FileDescriptorPro
return sub;
}
UPB_INLINE void google_protobuf_FileDescriptorProto_set_source_code_info(google_protobuf_FileDescriptorProto *msg, google_protobuf_SourceCodeInfo* value) {
_upb_sethas(msg, 5);
_upb_sethas(msg, 4);
*UPB_PTR_AT(msg, UPB_SIZE(32, 64), google_protobuf_SourceCodeInfo*) = value;
}
UPB_INLINE struct google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_mutable_source_code_info(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) {
@ -338,7 +338,7 @@ UPB_INLINE bool google_protobuf_FileDescriptorProto_add_weak_dependency(google_p
arena);
}
UPB_INLINE void google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto *msg, upb_strview value) {
_upb_sethas(msg, 3);
_upb_sethas(msg, 5);
*UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview) = value;
}
@ -611,35 +611,35 @@ UPB_INLINE char *google_protobuf_FieldDescriptorProto_serialize(const google_pro
return upb_encode(msg, &google_protobuf_FieldDescriptorProto_msginit, arena, len);
}
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 6); }
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 1); }
UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_name(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_strview); }
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 7); }
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 2); }
UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_extendee(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), upb_strview); }
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_number(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 3); }
UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_number(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t); }
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 1); }
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 4); }
UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 2); }
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 5); }
UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 8); }
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 6); }
UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 56), upb_strview); }
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 9); }
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 7); }
UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_default_value(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 72), upb_strview); }
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 11); }
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 8); }
UPB_INLINE const google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_options(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(64, 104), const google_protobuf_FieldOptions*); }
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 4); }
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 9); }
UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_oneof_index(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); }
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_json_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 10); }
UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_json_name(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(56, 88), upb_strview); }
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_proto3_optional(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 5); }
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_proto3_optional(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 11); }
UPB_INLINE bool google_protobuf_FieldDescriptorProto_proto3_optional(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool); }
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_name(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
_upb_sethas(msg, 6);
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_strview) = value;
}
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_extendee(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
_upb_sethas(msg, 7);
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(32, 40), upb_strview) = value;
}
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_number(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
@ -647,23 +647,23 @@ UPB_INLINE void google_protobuf_FieldDescriptorProto_set_number(google_protobuf_
*UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = value;
}
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_label(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
_upb_sethas(msg, 1);
_upb_sethas(msg, 4);
*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
}
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
_upb_sethas(msg, 2);
_upb_sethas(msg, 5);
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
}
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
_upb_sethas(msg, 8);
_upb_sethas(msg, 6);
*UPB_PTR_AT(msg, UPB_SIZE(40, 56), upb_strview) = value;
}
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_default_value(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
_upb_sethas(msg, 9);
_upb_sethas(msg, 7);
*UPB_PTR_AT(msg, UPB_SIZE(48, 72), upb_strview) = value;
}
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_options(google_protobuf_FieldDescriptorProto *msg, google_protobuf_FieldOptions* value) {
_upb_sethas(msg, 11);
_upb_sethas(msg, 8);
*UPB_PTR_AT(msg, UPB_SIZE(64, 104), google_protobuf_FieldOptions*) = value;
}
UPB_INLINE struct google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_mutable_options(google_protobuf_FieldDescriptorProto *msg, upb_arena *arena) {
@ -676,7 +676,7 @@ UPB_INLINE struct google_protobuf_FieldOptions* google_protobuf_FieldDescriptorP
return sub;
}
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_oneof_index(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
_upb_sethas(msg, 4);
_upb_sethas(msg, 9);
*UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value;
}
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_json_name(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
@ -684,7 +684,7 @@ UPB_INLINE void google_protobuf_FieldDescriptorProto_set_json_name(google_protob
*UPB_PTR_AT(msg, UPB_SIZE(56, 88), upb_strview) = value;
}
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_proto3_optional(google_protobuf_FieldDescriptorProto *msg, bool value) {
_upb_sethas(msg, 5);
_upb_sethas(msg, 11);
*UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool) = value;
}
@ -845,19 +845,19 @@ UPB_INLINE char *google_protobuf_EnumValueDescriptorProto_serialize(const google
return upb_encode(msg, &google_protobuf_EnumValueDescriptorProto_msginit, arena, len);
}
UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_name(const google_protobuf_EnumValueDescriptorProto *msg) { return _upb_hasbit(msg, 2); }
UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_name(const google_protobuf_EnumValueDescriptorProto *msg) { return _upb_hasbit(msg, 1); }
UPB_INLINE upb_strview google_protobuf_EnumValueDescriptorProto_name(const google_protobuf_EnumValueDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_number(const google_protobuf_EnumValueDescriptorProto *msg) { return _upb_hasbit(msg, 1); }
UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_number(const google_protobuf_EnumValueDescriptorProto *msg) { return _upb_hasbit(msg, 2); }
UPB_INLINE int32_t google_protobuf_EnumValueDescriptorProto_number(const google_protobuf_EnumValueDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_options(const google_protobuf_EnumValueDescriptorProto *msg) { return _upb_hasbit(msg, 3); }
UPB_INLINE const google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_options(const google_protobuf_EnumValueDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const google_protobuf_EnumValueOptions*); }
UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_name(google_protobuf_EnumValueDescriptorProto *msg, upb_strview value) {
_upb_sethas(msg, 2);
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
}
UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_number(google_protobuf_EnumValueDescriptorProto *msg, int32_t value) {
_upb_sethas(msg, 1);
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
}
UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_options(google_protobuf_EnumValueDescriptorProto *msg, google_protobuf_EnumValueOptions* value) {
@ -940,33 +940,33 @@ UPB_INLINE char *google_protobuf_MethodDescriptorProto_serialize(const google_pr
return upb_encode(msg, &google_protobuf_MethodDescriptorProto_msginit, arena, len);
}
UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_name(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 3); }
UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_name(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 1); }
UPB_INLINE upb_strview google_protobuf_MethodDescriptorProto_name(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_input_type(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 4); }
UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_input_type(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 2); }
UPB_INLINE upb_strview google_protobuf_MethodDescriptorProto_input_type(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_output_type(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 5); }
UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_output_type(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 3); }
UPB_INLINE upb_strview google_protobuf_MethodDescriptorProto_output_type(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview); }
UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_options(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 6); }
UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_options(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 4); }
UPB_INLINE const google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_options(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const google_protobuf_MethodOptions*); }
UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_client_streaming(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 1); }
UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_client_streaming(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 5); }
UPB_INLINE bool google_protobuf_MethodDescriptorProto_client_streaming(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_server_streaming(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 2); }
UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_server_streaming(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 6); }
UPB_INLINE bool google_protobuf_MethodDescriptorProto_server_streaming(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); }
UPB_INLINE void google_protobuf_MethodDescriptorProto_set_name(google_protobuf_MethodDescriptorProto *msg, upb_strview value) {
_upb_sethas(msg, 3);
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
}
UPB_INLINE void google_protobuf_MethodDescriptorProto_set_input_type(google_protobuf_MethodDescriptorProto *msg, upb_strview value) {
_upb_sethas(msg, 4);
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
}
UPB_INLINE void google_protobuf_MethodDescriptorProto_set_output_type(google_protobuf_MethodDescriptorProto *msg, upb_strview value) {
_upb_sethas(msg, 5);
_upb_sethas(msg, 3);
*UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview) = value;
}
UPB_INLINE void google_protobuf_MethodDescriptorProto_set_options(google_protobuf_MethodDescriptorProto *msg, google_protobuf_MethodOptions* value) {
_upb_sethas(msg, 6);
_upb_sethas(msg, 4);
*UPB_PTR_AT(msg, UPB_SIZE(28, 56), google_protobuf_MethodOptions*) = value;
}
UPB_INLINE struct google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_mutable_options(google_protobuf_MethodDescriptorProto *msg, upb_arena *arena) {
@ -979,11 +979,11 @@ UPB_INLINE struct google_protobuf_MethodOptions* google_protobuf_MethodDescripto
return sub;
}
UPB_INLINE void google_protobuf_MethodDescriptorProto_set_client_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) {
_upb_sethas(msg, 1);
_upb_sethas(msg, 5);
*UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
UPB_INLINE void google_protobuf_MethodDescriptorProto_set_server_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) {
_upb_sethas(msg, 2);
_upb_sethas(msg, 6);
*UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
}
@ -1001,41 +1001,41 @@ UPB_INLINE char *google_protobuf_FileOptions_serialize(const google_protobuf_Fil
return upb_encode(msg, &google_protobuf_FileOptions_msginit, arena, len);
}
UPB_INLINE bool google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 11); }
UPB_INLINE bool google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 1); }
UPB_INLINE upb_strview google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 24), upb_strview); }
UPB_INLINE bool google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 12); }
UPB_INLINE bool google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 2); }
UPB_INLINE upb_strview google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 40), upb_strview); }
UPB_INLINE bool google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 1); }
UPB_INLINE bool google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 3); }
UPB_INLINE int32_t google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
UPB_INLINE bool google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 2); }
UPB_INLINE bool google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 4); }
UPB_INLINE bool google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); }
UPB_INLINE bool google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 13); }
UPB_INLINE bool google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 5); }
UPB_INLINE upb_strview google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 56), upb_strview); }
UPB_INLINE bool google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 3); }
UPB_INLINE bool google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 6); }
UPB_INLINE bool google_protobuf_FileOptions_cc_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool); }
UPB_INLINE bool google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 4); }
UPB_INLINE bool google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 7); }
UPB_INLINE bool google_protobuf_FileOptions_java_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool); }
UPB_INLINE bool google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 5); }
UPB_INLINE bool google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 8); }
UPB_INLINE bool google_protobuf_FileOptions_py_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool); }
UPB_INLINE bool google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 6); }
UPB_INLINE bool google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 9); }
UPB_INLINE bool google_protobuf_FileOptions_java_generate_equals_and_hash(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool); }
UPB_INLINE bool google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 7); }
UPB_INLINE bool google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 10); }
UPB_INLINE bool google_protobuf_FileOptions_deprecated(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool); }
UPB_INLINE bool google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 8); }
UPB_INLINE bool google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 11); }
UPB_INLINE bool google_protobuf_FileOptions_java_string_check_utf8(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(14, 14), bool); }
UPB_INLINE bool google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 9); }
UPB_INLINE bool google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 12); }
UPB_INLINE bool google_protobuf_FileOptions_cc_enable_arenas(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(15, 15), bool); }
UPB_INLINE bool google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 14); }
UPB_INLINE bool google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 13); }
UPB_INLINE upb_strview google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 72), upb_strview); }
UPB_INLINE bool google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 15); }
UPB_INLINE bool google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 14); }
UPB_INLINE upb_strview google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 88), upb_strview); }
UPB_INLINE bool google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 16); }
UPB_INLINE bool google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 15); }
UPB_INLINE upb_strview google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 104), upb_strview); }
UPB_INLINE bool google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 17); }
UPB_INLINE bool google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 16); }
UPB_INLINE upb_strview google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 120), upb_strview); }
UPB_INLINE bool google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 18); }
UPB_INLINE bool google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 17); }
UPB_INLINE upb_strview google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 136), upb_strview); }
UPB_INLINE bool google_protobuf_FileOptions_has_php_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 10); }
UPB_INLINE bool google_protobuf_FileOptions_has_php_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 18); }
UPB_INLINE bool google_protobuf_FileOptions_php_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool); }
UPB_INLINE bool google_protobuf_FileOptions_has_php_metadata_namespace(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 19); }
UPB_INLINE upb_strview google_protobuf_FileOptions_php_metadata_namespace(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(84, 152), upb_strview); }
@ -1045,75 +1045,75 @@ UPB_INLINE bool google_protobuf_FileOptions_has_uninterpreted_option(const googl
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FileOptions_uninterpreted_option(const google_protobuf_FileOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(100, 184), len); }
UPB_INLINE void google_protobuf_FileOptions_set_java_package(google_protobuf_FileOptions *msg, upb_strview value) {
_upb_sethas(msg, 11);
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(20, 24), upb_strview) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_java_outer_classname(google_protobuf_FileOptions *msg, upb_strview value) {
_upb_sethas(msg, 12);
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(28, 40), upb_strview) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_optimize_for(google_protobuf_FileOptions *msg, int32_t value) {
_upb_sethas(msg, 1);
_upb_sethas(msg, 3);
*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_java_multiple_files(google_protobuf_FileOptions *msg, bool value) {
_upb_sethas(msg, 2);
_upb_sethas(msg, 4);
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_go_package(google_protobuf_FileOptions *msg, upb_strview value) {
_upb_sethas(msg, 13);
_upb_sethas(msg, 5);
*UPB_PTR_AT(msg, UPB_SIZE(36, 56), upb_strview) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_cc_generic_services(google_protobuf_FileOptions *msg, bool value) {
_upb_sethas(msg, 3);
_upb_sethas(msg, 6);
*UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_java_generic_services(google_protobuf_FileOptions *msg, bool value) {
_upb_sethas(msg, 4);
_upb_sethas(msg, 7);
*UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_py_generic_services(google_protobuf_FileOptions *msg, bool value) {
_upb_sethas(msg, 5);
_upb_sethas(msg, 8);
*UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_java_generate_equals_and_hash(google_protobuf_FileOptions *msg, bool value) {
_upb_sethas(msg, 6);
_upb_sethas(msg, 9);
*UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_deprecated(google_protobuf_FileOptions *msg, bool value) {
_upb_sethas(msg, 7);
_upb_sethas(msg, 10);
*UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_java_string_check_utf8(google_protobuf_FileOptions *msg, bool value) {
_upb_sethas(msg, 8);
_upb_sethas(msg, 11);
*UPB_PTR_AT(msg, UPB_SIZE(14, 14), bool) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_cc_enable_arenas(google_protobuf_FileOptions *msg, bool value) {
_upb_sethas(msg, 9);
_upb_sethas(msg, 12);
*UPB_PTR_AT(msg, UPB_SIZE(15, 15), bool) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_objc_class_prefix(google_protobuf_FileOptions *msg, upb_strview value) {
_upb_sethas(msg, 14);
_upb_sethas(msg, 13);
*UPB_PTR_AT(msg, UPB_SIZE(44, 72), upb_strview) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_csharp_namespace(google_protobuf_FileOptions *msg, upb_strview value) {
_upb_sethas(msg, 15);
_upb_sethas(msg, 14);
*UPB_PTR_AT(msg, UPB_SIZE(52, 88), upb_strview) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_swift_prefix(google_protobuf_FileOptions *msg, upb_strview value) {
_upb_sethas(msg, 16);
_upb_sethas(msg, 15);
*UPB_PTR_AT(msg, UPB_SIZE(60, 104), upb_strview) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_php_class_prefix(google_protobuf_FileOptions *msg, upb_strview value) {
_upb_sethas(msg, 17);
_upb_sethas(msg, 16);
*UPB_PTR_AT(msg, UPB_SIZE(68, 120), upb_strview) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_php_namespace(google_protobuf_FileOptions *msg, upb_strview value) {
_upb_sethas(msg, 18);
_upb_sethas(msg, 17);
*UPB_PTR_AT(msg, UPB_SIZE(76, 136), upb_strview) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_php_generic_services(google_protobuf_FileOptions *msg, bool value) {
_upb_sethas(msg, 10);
_upb_sethas(msg, 18);
*UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_php_metadata_namespace(google_protobuf_FileOptions *msg, upb_strview value) {
@ -1209,13 +1209,13 @@ UPB_INLINE char *google_protobuf_FieldOptions_serialize(const google_protobuf_Fi
UPB_INLINE bool google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 1); }
UPB_INLINE int32_t google_protobuf_FieldOptions_ctype(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
UPB_INLINE bool google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 3); }
UPB_INLINE bool google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 2); }
UPB_INLINE bool google_protobuf_FieldOptions_packed(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool); }
UPB_INLINE bool google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 4); }
UPB_INLINE bool google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 3); }
UPB_INLINE bool google_protobuf_FieldOptions_deprecated(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool); }
UPB_INLINE bool google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 5); }
UPB_INLINE bool google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 4); }
UPB_INLINE bool google_protobuf_FieldOptions_lazy(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(14, 14), bool); }
UPB_INLINE bool google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 2); }
UPB_INLINE bool google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 5); }
UPB_INLINE int32_t google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
UPB_INLINE bool google_protobuf_FieldOptions_has_weak(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 6); }
UPB_INLINE bool google_protobuf_FieldOptions_weak(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(15, 15), bool); }
@ -1227,19 +1227,19 @@ UPB_INLINE void google_protobuf_FieldOptions_set_ctype(google_protobuf_FieldOpti
*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
}
UPB_INLINE void google_protobuf_FieldOptions_set_packed(google_protobuf_FieldOptions *msg, bool value) {
_upb_sethas(msg, 3);
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = value;
}
UPB_INLINE void google_protobuf_FieldOptions_set_deprecated(google_protobuf_FieldOptions *msg, bool value) {
_upb_sethas(msg, 4);
_upb_sethas(msg, 3);
*UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool) = value;
}
UPB_INLINE void google_protobuf_FieldOptions_set_lazy(google_protobuf_FieldOptions *msg, bool value) {
_upb_sethas(msg, 5);
_upb_sethas(msg, 4);
*UPB_PTR_AT(msg, UPB_SIZE(14, 14), bool) = value;
}
UPB_INLINE void google_protobuf_FieldOptions_set_jstype(google_protobuf_FieldOptions *msg, int32_t value) {
_upb_sethas(msg, 2);
_upb_sethas(msg, 5);
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
}
UPB_INLINE void google_protobuf_FieldOptions_set_weak(google_protobuf_FieldOptions *msg, bool value) {
@ -1422,19 +1422,19 @@ UPB_INLINE char *google_protobuf_MethodOptions_serialize(const google_protobuf_M
return upb_encode(msg, &google_protobuf_MethodOptions_msginit, arena, len);
}
UPB_INLINE bool google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions *msg) { return _upb_hasbit(msg, 2); }
UPB_INLINE bool google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions *msg) { return _upb_hasbit(msg, 1); }
UPB_INLINE bool google_protobuf_MethodOptions_deprecated(const google_protobuf_MethodOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); }
UPB_INLINE bool google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions *msg) { return _upb_hasbit(msg, 1); }
UPB_INLINE bool google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions *msg) { return _upb_hasbit(msg, 2); }
UPB_INLINE int32_t google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
UPB_INLINE bool google_protobuf_MethodOptions_has_uninterpreted_option(const google_protobuf_MethodOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 16)); }
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MethodOptions_uninterpreted_option(const google_protobuf_MethodOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(12, 16), len); }
UPB_INLINE void google_protobuf_MethodOptions_set_deprecated(google_protobuf_MethodOptions *msg, bool value) {
_upb_sethas(msg, 2);
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
}
UPB_INLINE void google_protobuf_MethodOptions_set_idempotency_level(google_protobuf_MethodOptions *msg, int32_t value) {
_upb_sethas(msg, 1);
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
}
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_mutable_uninterpreted_option(google_protobuf_MethodOptions *msg, size_t *len) {
@ -1467,13 +1467,13 @@ UPB_INLINE char *google_protobuf_UninterpretedOption_serialize(const google_prot
UPB_INLINE bool google_protobuf_UninterpretedOption_has_name(const google_protobuf_UninterpretedOption *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(56, 80)); }
UPB_INLINE const google_protobuf_UninterpretedOption_NamePart* const* google_protobuf_UninterpretedOption_name(const google_protobuf_UninterpretedOption *msg, size_t *len) { return (const google_protobuf_UninterpretedOption_NamePart* const*)_upb_array_accessor(msg, UPB_SIZE(56, 80), len); }
UPB_INLINE bool google_protobuf_UninterpretedOption_has_identifier_value(const google_protobuf_UninterpretedOption *msg) { return _upb_hasbit(msg, 4); }
UPB_INLINE bool google_protobuf_UninterpretedOption_has_identifier_value(const google_protobuf_UninterpretedOption *msg) { return _upb_hasbit(msg, 1); }
UPB_INLINE upb_strview google_protobuf_UninterpretedOption_identifier_value(const google_protobuf_UninterpretedOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), upb_strview); }
UPB_INLINE bool google_protobuf_UninterpretedOption_has_positive_int_value(const google_protobuf_UninterpretedOption *msg) { return _upb_hasbit(msg, 1); }
UPB_INLINE bool google_protobuf_UninterpretedOption_has_positive_int_value(const google_protobuf_UninterpretedOption *msg) { return _upb_hasbit(msg, 2); }
UPB_INLINE uint64_t google_protobuf_UninterpretedOption_positive_int_value(const google_protobuf_UninterpretedOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t); }
UPB_INLINE bool google_protobuf_UninterpretedOption_has_negative_int_value(const google_protobuf_UninterpretedOption *msg) { return _upb_hasbit(msg, 2); }
UPB_INLINE bool google_protobuf_UninterpretedOption_has_negative_int_value(const google_protobuf_UninterpretedOption *msg) { return _upb_hasbit(msg, 3); }
UPB_INLINE int64_t google_protobuf_UninterpretedOption_negative_int_value(const google_protobuf_UninterpretedOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t); }
UPB_INLINE bool google_protobuf_UninterpretedOption_has_double_value(const google_protobuf_UninterpretedOption *msg) { return _upb_hasbit(msg, 3); }
UPB_INLINE bool google_protobuf_UninterpretedOption_has_double_value(const google_protobuf_UninterpretedOption *msg) { return _upb_hasbit(msg, 4); }
UPB_INLINE double google_protobuf_UninterpretedOption_double_value(const google_protobuf_UninterpretedOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), double); }
UPB_INLINE bool google_protobuf_UninterpretedOption_has_string_value(const google_protobuf_UninterpretedOption *msg) { return _upb_hasbit(msg, 5); }
UPB_INLINE upb_strview google_protobuf_UninterpretedOption_string_value(const google_protobuf_UninterpretedOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 48), upb_strview); }
@ -1494,19 +1494,19 @@ UPB_INLINE struct google_protobuf_UninterpretedOption_NamePart* google_protobuf_
return sub;
}
UPB_INLINE void google_protobuf_UninterpretedOption_set_identifier_value(google_protobuf_UninterpretedOption *msg, upb_strview value) {
_upb_sethas(msg, 4);
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(32, 32), upb_strview) = value;
}
UPB_INLINE void google_protobuf_UninterpretedOption_set_positive_int_value(google_protobuf_UninterpretedOption *msg, uint64_t value) {
_upb_sethas(msg, 1);
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value;
}
UPB_INLINE void google_protobuf_UninterpretedOption_set_negative_int_value(google_protobuf_UninterpretedOption *msg, int64_t value) {
_upb_sethas(msg, 2);
_upb_sethas(msg, 3);
*UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t) = value;
}
UPB_INLINE void google_protobuf_UninterpretedOption_set_double_value(google_protobuf_UninterpretedOption *msg, double value) {
_upb_sethas(msg, 3);
_upb_sethas(msg, 4);
*UPB_PTR_AT(msg, UPB_SIZE(24, 24), double) = value;
}
UPB_INLINE void google_protobuf_UninterpretedOption_set_string_value(google_protobuf_UninterpretedOption *msg, upb_strview value) {
@ -1532,17 +1532,17 @@ UPB_INLINE char *google_protobuf_UninterpretedOption_NamePart_serialize(const go
return upb_encode(msg, &google_protobuf_UninterpretedOption_NamePart_msginit, arena, len);
}
UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_name_part(const google_protobuf_UninterpretedOption_NamePart *msg) { return _upb_hasbit(msg, 2); }
UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_name_part(const google_protobuf_UninterpretedOption_NamePart *msg) { return _upb_hasbit(msg, 1); }
UPB_INLINE upb_strview google_protobuf_UninterpretedOption_NamePart_name_part(const google_protobuf_UninterpretedOption_NamePart *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_is_extension(const google_protobuf_UninterpretedOption_NamePart *msg) { return _upb_hasbit(msg, 1); }
UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_is_extension(const google_protobuf_UninterpretedOption_NamePart *msg) { return _upb_hasbit(msg, 2); }
UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_is_extension(const google_protobuf_UninterpretedOption_NamePart *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_name_part(google_protobuf_UninterpretedOption_NamePart *msg, upb_strview value) {
_upb_sethas(msg, 2);
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
}
UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_is_extension(google_protobuf_UninterpretedOption_NamePart *msg, bool value) {
_upb_sethas(msg, 1);
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
@ -1684,11 +1684,11 @@ UPB_INLINE char *google_protobuf_GeneratedCodeInfo_Annotation_serialize(const go
}
UPB_INLINE int32_t const* google_protobuf_GeneratedCodeInfo_Annotation_path(const google_protobuf_GeneratedCodeInfo_Annotation *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(20, 32), len); }
UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_source_file(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return _upb_hasbit(msg, 3); }
UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_source_file(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return _upb_hasbit(msg, 1); }
UPB_INLINE upb_strview google_protobuf_GeneratedCodeInfo_Annotation_source_file(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview); }
UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_begin(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return _upb_hasbit(msg, 1); }
UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_begin(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return _upb_hasbit(msg, 2); }
UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_begin(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_end(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return _upb_hasbit(msg, 2); }
UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_end(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return _upb_hasbit(msg, 3); }
UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_end(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_mutable_path(google_protobuf_GeneratedCodeInfo_Annotation *msg, size_t *len) {
@ -1702,15 +1702,15 @@ UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_add_path(google_pro
arena);
}
UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_source_file(google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_strview value) {
_upb_sethas(msg, 3);
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview) = value;
}
UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_begin(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) {
_upb_sethas(msg, 1);
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
}
UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_end(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) {
_upb_sethas(msg, 2);
_upb_sethas(msg, 3);
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
}

@ -6,3 +6,19 @@ package upb_test;
message MapTest {
map<string, double> map_string_double = 1;
}
message PackedTest {
repeated bool bool_packed = 1 [packed = true];
repeated int32 i32_packed = 2 [packed = true];
repeated int64 i64_packed = 3 [packed = true];
repeated fixed32 f32_packed = 4 [packed = true];
repeated fixed64 f64_packed = 5 [packed = true];
}
message UnpackedTest {
repeated bool bool_packed = 1 [packed = false];
repeated int32 i32_packed = 2 [packed = false];
repeated int64 i64_packed = 3 [packed = false];
repeated fixed32 f32_packed = 4 [packed = false];
repeated fixed64 f64_packed = 5 [packed = false];
}

@ -133,6 +133,65 @@ function test_string_double_map()
assert_equal(2.5, msg2.map_string_double["two point five"])
end
function test_string_double_map()
local function fill_msg(msg)
msg.i32_packed[1] = 100
msg.i32_packed[2] = 200
msg.i32_packed[3] = 50000
msg.i64_packed[1] = 101
msg.i64_packed[2] = 201
msg.i64_packed[3] = 50001
msg.f32_packed[1] = 102
msg.f32_packed[2] = 202
msg.f32_packed[3] = 50002
msg.f64_packed[1] = 103
msg.f64_packed[2] = 203
msg.f64_packed[3] = 50003
end
local function check_msg(msg)
assert_equal(100, msg.i32_packed[1])
assert_equal(200, msg.i32_packed[2])
assert_equal(50000, msg.i32_packed[3])
assert_equal(3, #msg.i32_packed)
assert_equal(101, msg.i64_packed[1])
assert_equal(201, msg.i64_packed[2])
assert_equal(50001, msg.i64_packed[3])
assert_equal(3, #msg.i64_packed)
assert_equal(102, msg.f32_packed[1])
assert_equal(202, msg.f32_packed[2])
assert_equal(50002, msg.f32_packed[3])
assert_equal(3, #msg.f32_packed)
assert_equal(103, msg.f64_packed[1])
assert_equal(203, msg.f64_packed[2])
assert_equal(50003, msg.f64_packed[3])
assert_equal(3, #msg.f64_packed)
end
local msg = upb_test.PackedTest()
fill_msg(msg)
check_msg(msg)
local serialized_packed = upb.encode(msg)
local msg2 = upb.decode(upb_test.PackedTest, serialized_packed)
local msg3 = upb.decode(upb_test.UnpackedTest, serialized_packed)
check_msg(msg2)
check_msg(msg3)
serialized_unpacked = upb.encode(msg3)
local msg4 = upb.decode(upb_test.PackedTest, serialized_unpacked)
local msg5 = upb.decode(upb_test.PackedTest, serialized_unpacked)
check_msg(msg4)
check_msg(msg5)
end
function test_msg_string_map()
msg = test_messages_proto3.TestAllTypesProto3()
msg.map_string_string["foo"] = "bar"

@ -201,6 +201,16 @@ void DoTest(const ctx* c) {
upb_msg *msg;
upb_strview name = conformance_ConformanceRequest_message_type(c->request);
const upb_msgdef *m = upb_symtab_lookupmsg2(c->symtab, name.data, name.size);
#if 0
// Handy code for limiting conformance tests to a single input payload.
// This is a hack since the conformance runner doesn't give an easy way to
// specify what test should be run.
const char skip[] = "\343>\010\301\002\344>\230?\001\230?\002\230?\003";
upb_strview skip_str = upb_strview_make(skip, sizeof(skip) - 1);
upb_strview pb_payload =
conformance_ConformanceRequest_protobuf_payload(c->request);
if (!upb_strview_eql(pb_payload, skip_str)) m = NULL;
#endif
if (!m) {
static const char msg[] = "Unknown message type.";
@ -286,6 +296,7 @@ int main(void) {
if (!DoTestIo(symtab)) {
fprintf(stderr, "conformance_upb: received EOF from test runner "
"after %d tests, exiting\n", test_count);
upb_symtab_free(symtab);
return 0;
}
}

@ -952,6 +952,31 @@ void TestArena() {
}
}
void TestInlinedArena() {
int n = 100000;
struct Decrementer {
Decrementer(int* _p) : p(_p) {}
~Decrementer() { (*p)--; }
int* p;
};
{
upb::InlinedArena<1024> arena;
for (int i = 0; i < n; i++) {
arena.Own(new Decrementer(&n));
// Intersperse allocation and ensure we can write to it.
int* val = static_cast<int*>(upb_arena_malloc(arena.ptr(), sizeof(int)));
*val = i;
}
// Test a large allocation.
upb_arena_malloc(arena.ptr(), 1000000);
}
ASSERT(n == 0);
}
extern "C" {
int run_tests() {

@ -30,6 +30,7 @@ static void test_scalars() {
protobuf_test_messages_proto3_TestAllTypesProto3_new(arena);
protobuf_test_messages_proto3_TestAllTypesProto3 *msg2;
upb_strview serialized;
upb_strview val;
protobuf_test_messages_proto3_TestAllTypesProto3_set_optional_int32(msg, 10);
protobuf_test_messages_proto3_TestAllTypesProto3_set_optional_int64(msg, 20);
@ -61,9 +62,8 @@ static void test_scalars() {
msg2) == 60.6);
ASSERT(protobuf_test_messages_proto3_TestAllTypesProto3_optional_bool(
msg2) == 1);
ASSERT(upb_strview_eql(
protobuf_test_messages_proto3_TestAllTypesProto3_optional_string(msg2),
test_str_view));
val = protobuf_test_messages_proto3_TestAllTypesProto3_optional_string(msg2);
ASSERT(upb_strview_eql(val, test_str_view));
upb_arena_free(arena);
}

@ -142,11 +142,12 @@ typedef union {
bool bool_val;
uint32_t uint32_val;
uint64_t uint64_val;
upb_strview str_val;
uint32_t size;
} wireval;
static const char *decode_msg(upb_decstate *d, const char *ptr, upb_msg *msg,
const upb_msglayout *layout);
#include <stdlib.h>
UPB_NORETURN static void decode_err(upb_decstate *d) { longjmp(d->err, 1); }
@ -197,41 +198,48 @@ static bool decode_reserve(upb_decstate *d, upb_array *arr, size_t elem) {
return need_realloc;
}
typedef struct {
const char *ptr;
uint64_t val;
} decode_vret;
UPB_NOINLINE
static const char *decode_longvarint64(upb_decstate *d, const char *ptr,
const char *limit, uint64_t *val) {
uint8_t byte;
int bitpos = 0;
uint64_t out = 0;
do {
if (bitpos >= 70 || ptr == limit) decode_err(d);
byte = *ptr;
out |= (uint64_t)(byte & 0x7F) << bitpos;
ptr++;
bitpos += 7;
} while (byte & 0x80);
*val = out;
return ptr;
static decode_vret decode_longvarint64(const char *ptr, uint64_t val) {
decode_vret ret = {NULL, 0};
uint64_t byte;
int i;
for (i = 1; i < 10; i++) {
byte = (uint8_t)ptr[i];
val += (byte - 1) << (i * 7);
if (!(byte & 0x80)) {
ret.ptr = ptr + i + 1;
ret.val = val;
return ret;
}
}
return ret;
}
UPB_FORCEINLINE
static const char *decode_varint64(upb_decstate *d, const char *ptr,
const char *limit, uint64_t *val) {
if (UPB_LIKELY(ptr < limit && (*ptr & 0x80) == 0)) {
*val = (uint8_t)*ptr;
uint64_t *val) {
uint64_t byte = (uint8_t)*ptr;
if (UPB_LIKELY((byte & 0x80) == 0)) {
*val = byte;
return ptr + 1;
} else {
return decode_longvarint64(d, ptr, limit, val);
decode_vret res = decode_longvarint64(ptr, byte);
if (!res.ptr) decode_err(d);
*val = res.val;
return res.ptr;
}
}
UPB_FORCEINLINE
static const char *decode_varint32(upb_decstate *d, const char *ptr,
const char *limit, uint32_t *val) {
uint32_t *val) {
uint64_t u64;
ptr = decode_varint64(d, ptr, limit, &u64);
ptr = decode_varint64(d, ptr, &u64);
if (u64 > UINT32_MAX) decode_err(d);
*val = (uint32_t)u64;
return ptr;
@ -284,20 +292,44 @@ static upb_msg *decode_newsubmsg(upb_decstate *d, const upb_msglayout *layout,
return _upb_msg_new_inl(subl, &d->arena);
}
static void decode_tosubmsg(upb_decstate *d, upb_msg *submsg,
const upb_msglayout *layout,
const upb_msglayout_field *field, upb_strview val) {
UPB_NOINLINE
const char *decode_isdonefallback(upb_decstate *d, const char *ptr,
int overrun) {
ptr = decode_isdonefallback_inl(d, ptr, overrun);
if (ptr == NULL) {
decode_err(d);
}
return ptr;
}
static const char *decode_readstr(upb_decstate *d, const char *ptr, int size,
upb_strview *str) {
if (d->alias) {
str->data = ptr;
} else {
char *data = upb_arena_malloc(&d->arena, size);
if (!data) decode_err(d);
memcpy(data, ptr, size);
str->data = data;
}
str->size = size;
return ptr + size;
}
static const char *decode_tosubmsg(upb_decstate *d, const char *ptr,
upb_msg *submsg, const upb_msglayout *layout,
const upb_msglayout_field *field, int size) {
if (size > 0) {
const upb_msglayout *subl = layout->submsgs[field->submsg_index];
const char *saved_limit = d->limit;
int saved_delta = decode_pushlimit(d, ptr, size);
if (--d->depth < 0) decode_err(d);
d->limit = val.data + val.size;
d->fastlimit = UPB_MIN(d->limit, d->fastend);
decode_msg(d, val.data, submsg, subl);
d->limit = saved_limit;
d->fastlimit = UPB_MIN(d->limit, d->fastend);
ptr = decode_msg(d, ptr, submsg, subl);
decode_poplimit(d, saved_delta);
if (d->end_group != 0) decode_err(d);
d->depth++;
}
return ptr;
}
static const char *decode_group(upb_decstate *d, const char *ptr,
upb_msg *submsg, const upb_msglayout *subl,
@ -317,7 +349,6 @@ static const char *decode_togroup(upb_decstate *d, const char *ptr,
return decode_group(d, ptr, submsg, subl, field->number);
}
UPB_FORCEINLINE
static const char *decode_toarray(upb_decstate *d, const char *ptr,
upb_msg *msg, const upb_msglayout *layout,
const upb_msglayout_field *field, wireval val,
@ -345,15 +376,14 @@ static const char *decode_toarray(upb_decstate *d, const char *ptr,
memcpy(mem, &val, 1 << op);
return ptr;
case OP_STRING:
decode_verifyutf8(d, val.str_val.data, val.str_val.size);
decode_verifyutf8(d, ptr, val.size);
/* Fallthrough. */
case OP_BYTES:
case OP_BYTES: {
/* Append bytes. */
mem =
UPB_PTR_AT(_upb_array_ptr(arr), arr->len * sizeof(upb_strview), void);
upb_strview *str = (upb_strview*)_upb_array_ptr(arr) + arr->len;
arr->len++;
memcpy(mem, &val, sizeof(upb_strview));
return ptr;
return decode_readstr(d, ptr, val.size, str);
}
case OP_SUBMSG: {
/* Append submessage / group. */
upb_msg *submsg = decode_newsubmsg(d, layout, field);
@ -361,26 +391,25 @@ static const char *decode_toarray(upb_decstate *d, const char *ptr,
submsg;
arr->len++;
if (UPB_UNLIKELY(field->descriptortype == UPB_DTYPE_GROUP)) {
ptr = decode_togroup(d, ptr, submsg, layout, field);
return decode_togroup(d, ptr, submsg, layout, field);
} else {
decode_tosubmsg(d, submsg, layout, field, val.str_val);
return decode_tosubmsg(d, ptr, submsg, layout, field, val.size);
}
return ptr;
}
case OP_FIXPCK_LG2(2):
case OP_FIXPCK_LG2(3): {
/* Fixed packed. */
int lg2 = op - OP_FIXPCK_LG2(0);
int mask = (1 << lg2) - 1;
size_t count = val.str_val.size >> lg2;
if ((val.str_val.size & mask) != 0) {
size_t count = val.size >> lg2;
if ((val.size & mask) != 0) {
decode_err(d); /* Length isn't a round multiple of elem size. */
}
decode_reserve(d, arr, count);
mem = UPB_PTR_AT(_upb_array_ptr(arr), arr->len << lg2, void);
arr->len += count;
memcpy(mem, val.str_val.data, val.str_val.size);
return ptr;
memcpy(mem, ptr, val.size); /* XXX: ptr boundary. */
return ptr + val.size;
}
case OP_VARPCK_LG2(0):
case OP_VARPCK_LG2(2):
@ -388,12 +417,11 @@ static const char *decode_toarray(upb_decstate *d, const char *ptr,
/* Varint packed. */
int lg2 = op - OP_VARPCK_LG2(0);
int scale = 1 << lg2;
const char *ptr = val.str_val.data;
const char *end = ptr + val.str_val.size;
int saved_limit = decode_pushlimit(d, ptr, val.size);
char *out = UPB_PTR_AT(_upb_array_ptr(arr), arr->len << lg2, void);
while (ptr < end) {
while (!decode_isdone(d, &ptr)) {
wireval elem;
ptr = decode_varint64(d, ptr, end, &elem.uint64_val);
ptr = decode_varint64(d, ptr, &elem.uint64_val);
decode_munge(field->descriptortype, &elem);
if (decode_reserve(d, arr, 1)) {
out = UPB_PTR_AT(_upb_array_ptr(arr), arr->len << lg2, void);
@ -402,7 +430,7 @@ static const char *decode_toarray(upb_decstate *d, const char *ptr,
memcpy(out, &elem, scale);
out += scale;
}
if (ptr != end) decode_err(d);
decode_poplimit(d, saved_limit);
return ptr;
}
default:
@ -410,7 +438,7 @@ static const char *decode_toarray(upb_decstate *d, const char *ptr,
}
}
static void decode_tomap(upb_decstate *d, upb_msg *msg,
static const char *decode_tomap(upb_decstate *d, const char *ptr, upb_msg *msg,
const upb_msglayout *layout,
const upb_msglayout_field *field, wireval val) {
upb_map **map_p = UPB_PTR_AT(msg, field->offset, upb_map *);
@ -440,13 +468,11 @@ static void decode_tomap(upb_decstate *d, upb_msg *msg,
ent.v.val = upb_value_ptr(_upb_msg_new(entry->submsgs[0], &d->arena));
}
decode_tosubmsg(d, &ent.k, layout, field, val.str_val);
/* Insert into map. */
ptr = decode_tosubmsg(d, ptr, &ent.k, layout, field, val.size);
_upb_map_set(map, &ent.k, map->key_size, &ent.v, map->val_size, &d->arena);
return ptr;
}
UPB_FORCEINLINE
static const char *decode_tomsg(upb_decstate *d, const char *ptr, upb_msg *msg,
const upb_msglayout *layout,
const upb_msglayout_field *field, wireval val,
@ -478,16 +504,15 @@ static const char *decode_tomsg(upb_decstate *d, const char *ptr, upb_msg *msg,
if (UPB_UNLIKELY(type == UPB_DTYPE_GROUP)) {
ptr = decode_togroup(d, ptr, submsg, layout, field);
} else {
decode_tosubmsg(d, submsg, layout, field, val.str_val);
ptr = decode_tosubmsg(d, ptr, submsg, layout, field, val.size);
}
break;
}
case OP_STRING:
decode_verifyutf8(d, val.str_val.data, val.str_val.size);
decode_verifyutf8(d, ptr, val.size);
/* Fallthrough. */
case OP_BYTES:
memcpy(mem, &val, sizeof(upb_strview));
break;
return decode_readstr(d, ptr, val.size, mem);
case OP_SCALAR_LG2(3):
memcpy(mem, &val, 8);
break;
@ -504,14 +529,23 @@ static const char *decode_tomsg(upb_decstate *d, const char *ptr, upb_msg *msg,
return ptr;
}
typedef struct {
const char *ptr;
bool group_end;
} decode_parseret;
UPB_FORCEINLINE
static decode_parseret decode_field(upb_decstate *d, const char *ptr,
static bool decode_tryfastdispatch(upb_decstate *d, const char **ptr,
upb_msg *msg, const upb_msglayout *layout) {
if (layout && layout->table_mask != (unsigned char)-1) {
uint16_t tag = fastdecode_loadtag(*ptr);
intptr_t table = decode_totable(layout);
*ptr = fastdecode_tagdispatch(d, *ptr, msg, table, 0, tag);
return true;
} else {
return false;
}
}
UPB_NOINLINE
static const char *decode_msg(upb_decstate *d, const char *ptr, upb_msg *msg,
const upb_msglayout *layout) {
while (true) {
uint32_t tag;
const upb_msglayout_field *field;
int field_number;
@ -519,9 +553,8 @@ static decode_parseret decode_field(upb_decstate *d, const char *ptr,
const char *field_start = ptr;
wireval val;
int op;
decode_parseret ret;
ptr = decode_varint32(d, ptr, d->limit, &tag);
ptr = decode_varint32(d, ptr, &tag);
field_number = tag >> 3;
wire_type = tag & 7;
@ -529,12 +562,11 @@ static decode_parseret decode_field(upb_decstate *d, const char *ptr,
switch (wire_type) {
case UPB_WIRE_TYPE_VARINT:
ptr = decode_varint64(d, ptr, d->limit, &val.uint64_val);
ptr = decode_varint64(d, ptr, &val.uint64_val);
op = varint_ops[field->descriptortype];
decode_munge(field->descriptortype, &val);
break;
case UPB_WIRE_TYPE_32BIT:
if (d->limit - ptr < 4) decode_err(d);
memcpy(&val.uint32_val, ptr, 4);
val.uint32_val = _upb_be_swap32(val.uint32_val);
ptr += 4;
@ -542,7 +574,6 @@ static decode_parseret decode_field(upb_decstate *d, const char *ptr,
if (((1 << field->descriptortype) & fixed32_ok) == 0) goto unknown;
break;
case UPB_WIRE_TYPE_64BIT:
if (d->limit - ptr < 8) decode_err(d);
memcpy(&val.uint64_val, ptr, 8);
val.uint64_val = _upb_be_swap64(val.uint64_val);
ptr += 8;
@ -550,16 +581,12 @@ static decode_parseret decode_field(upb_decstate *d, const char *ptr,
if (((1 << field->descriptortype) & fixed64_ok) == 0) goto unknown;
break;
case UPB_WIRE_TYPE_DELIMITED: {
uint32_t size;
int ndx = field->descriptortype;
if (_upb_isrepeated(field)) ndx += 18;
ptr = decode_varint32(d, ptr, d->limit, &size);
if (size >= INT32_MAX || (size_t)(d->limit - ptr) < size) {
ptr = decode_varint32(d, ptr, &val.size);
if (val.size >= INT32_MAX || ptr - d->end + val.size > d->limit) {
decode_err(d); /* Length overflow. */
}
val.str_val.data = ptr;
val.str_val.size = size;
ptr += size;
op = delim_ops[ndx];
break;
}
@ -570,9 +597,7 @@ static decode_parseret decode_field(upb_decstate *d, const char *ptr,
break;
case UPB_WIRE_TYPE_END_GROUP:
d->end_group = field_number;
ret.ptr = ptr;
ret.group_end = true;
return ret;
return ptr;
default:
decode_err(d);
}
@ -585,7 +610,7 @@ static decode_parseret decode_field(upb_decstate *d, const char *ptr,
ptr = decode_toarray(d, ptr, msg, layout, field, val, op);
break;
case _UPB_LABEL_MAP:
decode_tomap(d, msg, layout, field, val);
ptr = decode_tomap(d, ptr, msg, layout, field, val);
break;
default:
ptr = decode_tomsg(d, ptr, msg, layout, field, val, op);
@ -595,49 +620,35 @@ static decode_parseret decode_field(upb_decstate *d, const char *ptr,
unknown:
/* Skip unknown field. */
if (field_number == 0) decode_err(d);
if (wire_type == UPB_WIRE_TYPE_DELIMITED) ptr += val.size;
if (msg) {
if (wire_type == UPB_WIRE_TYPE_START_GROUP) {
d->unknown = field_start;
d->unknown_msg = msg;
ptr = decode_group(d, ptr, NULL, NULL, field_number);
d->unknown_msg = NULL;
field_start = d->unknown;
}
if (msg) {
if (!_upb_msg_addunknown(msg, field_start, ptr - field_start,
&d->arena)) {
decode_err(d);
}
} else if (wire_type == UPB_WIRE_TYPE_START_GROUP) {
ptr = decode_group(d, ptr, NULL, NULL, field_number);
}
}
ret.ptr = ptr;
ret.group_end = false;
return ret;
if (decode_isdone(d, &ptr)) return ptr;
if (decode_tryfastdispatch(d, &ptr, msg, layout)) return ptr;
}
}
UPB_NOINLINE
const char *fastdecode_generic(upb_decstate *d, const char *ptr, upb_msg *msg,
intptr_t table, uint64_t hasbits,
const char *fastdecode_generic(struct upb_decstate *d, const char *ptr,
upb_msg *msg, intptr_t table, uint64_t hasbits,
uint64_t data) {
decode_parseret ret;
*(uint32_t*)msg |= hasbits >> 16; /* Sync hasbits. */
(void)data;
if (ptr == d->limit) return ptr;
ret = decode_field(d, ptr, msg, decode_totablep(table));
if (ret.group_end) return ptr;
return fastdecode_dispatch(d, ret.ptr, msg, table, hasbits);
}
UPB_NOINLINE
static const char *decode_msg(upb_decstate *d, const char *ptr, upb_msg *msg,
const upb_msglayout *layout) {
if (msg && layout->table_mask != (unsigned char)-1) {
ptr = fastdecode_dispatch(d, ptr, msg, decode_totable(layout), 0);
} else {
while (ptr < d->limit) {
decode_parseret ret = decode_field(d, ptr, msg, layout);
ptr = ret.ptr;
if (ret.group_end) return ptr;
}
}
if (ptr != d->limit) decode_err(d);
return ptr;
*(uint32_t*)msg |= hasbits;
return decode_msg(d, ptr, msg, decode_totablep(table));
}
bool upb_decode(const char *buf, size_t size, void *msg, const upb_msglayout *l,
@ -645,25 +656,35 @@ bool upb_decode(const char *buf, size_t size, void *msg, const upb_msglayout *l,
bool ok;
upb_decstate state;
if (size == 0) return true;
if (size == 0) {
return true;
} else if (size < 16) {
memset(&state.patch, 0, 32);
memcpy(&state.patch, buf, size);
buf = state.patch;
state.end = buf + size;
state.limit = 0;
state.alias = false;
} else {
state.end = buf + size - 16;
state.limit = 16;
state.alias = true;
}
state.limit = buf + size;
state.fastlimit = state.limit - 16;
state.fastend = state.fastlimit;
state.limit_ptr = state.end;
state.unknown_msg = NULL;
state.depth = 64;
state.end_group = 0;
state.arena.head = arena->head;
state.arena.last_size = arena->last_size;
state.arena.parent = arena;
#ifdef __APPLE__
if (UPB_UNLIKELY(_setjmp(state.err))) {
#else
if (UPB_UNLIKELY(setjmp(state.err))) {
#endif
ok = false;
} else {
if (!decode_tryfastdispatch(&state, &buf, msg, l)) {
decode_msg(&state, buf, msg, l);
}
ok = state.end_group == 0;
}

@ -16,12 +16,16 @@
#include "upb/port_def.inc"
typedef struct upb_decstate {
const char *limit; /* End of delimited region or end of buffer. */
const char *fastend; /* The end of the entire buffer - 16 */
const char *fastlimit; /* UPB_MIN(limit, fastend) */
upb_arena arena;
const char *end; /* Can read up to 16 bytes slop beyond this. */
const char *limit_ptr; /* = end + UPB_MIN(limit, 0) */
upb_msg *unknown_msg; /* If non-NULL, add unknown data at buffer flip. */
const char *unknown; /* Start of unknown data. */
int limit; /* Submessage limit relative to end. */
int depth;
uint32_t end_group; /* Set to field number of END_GROUP tag, if any. */
bool alias;
char patch[32];
upb_arena arena;
jmp_buf err;
} upb_decstate;
@ -44,7 +48,50 @@ UPB_INLINE const upb_msglayout *decode_totablep(intptr_t table) {
return (void*)(table >> 8);
}
UPB_FORCEINLINE static
UPB_INLINE
const char *decode_isdonefallback_inl(upb_decstate *d, const char *ptr,
int overrun) {
if (overrun < d->limit) {
/* Need to copy remaining data into patch buffer. */
UPB_ASSERT(overrun < 16);
if (d->unknown_msg) {
if (!_upb_msg_addunknown(d->unknown_msg, d->unknown, ptr - d->unknown,
&d->arena)) {
return NULL;
}
d->unknown = &d->patch[0] + overrun;
}
memset(d->patch + 16, 0, 16);
memcpy(d->patch, d->end, 16);
ptr = &d->patch[0] + overrun;
d->end = &d->patch[16];
d->limit -= 16;
d->limit_ptr = d->end + d->limit;
d->alias = false;
UPB_ASSERT(ptr < d->limit_ptr);
return ptr;
} else {
return NULL;
}
}
const char *decode_isdonefallback(upb_decstate *d, const char *ptr,
int overrun);
UPB_INLINE
bool decode_isdone(upb_decstate *d, const char **ptr) {
int overrun = *ptr - d->end;
if (UPB_LIKELY(*ptr < d->limit_ptr)) {
return false;
} else if (UPB_LIKELY(overrun == d->limit)) {
return true;
} else {
*ptr = decode_isdonefallback(d, *ptr, overrun);
return false;
}
}
UPB_INLINE
const char *fastdecode_tagdispatch(upb_decstate *d, const char *ptr,
upb_msg *msg, intptr_t table,
uint64_t hasbits, uint32_t tag) {
@ -58,25 +105,24 @@ const char *fastdecode_tagdispatch(upb_decstate *d, const char *ptr,
return table_p->fasttable[idx].field_parser(d, ptr, msg, table, hasbits, data);
}
UPB_FORCEINLINE static
uint32_t fastdecode_loadtag(const char* ptr) {
UPB_INLINE uint32_t fastdecode_loadtag(const char* ptr) {
uint16_t tag;
memcpy(&tag, ptr, 2);
return tag;
}
UPB_FORCEINLINE static
const char *fastdecode_dispatch(upb_decstate *d, const char *ptr, upb_msg *msg,
intptr_t table, uint64_t hasbits) {
if (UPB_UNLIKELY(ptr >= d->fastlimit)) {
if (UPB_LIKELY(ptr == d->limit)) {
*(uint32_t*)msg |= hasbits >> 16; /* Sync hasbits. */
return ptr;
}
uint64_t data = 0;
return fastdecode_generic(d, ptr, msg, table, hasbits, data);
UPB_INLINE int decode_pushlimit(upb_decstate *d, const char *ptr, int size) {
int limit = size + (int)(ptr - d->end);
int delta = d->limit - limit;
d->limit = limit;
d->limit_ptr = d->end + UPB_MIN(0, limit);
return delta;
}
return fastdecode_tagdispatch(d, ptr, msg, table, hasbits, fastdecode_loadtag(ptr));
UPB_INLINE void decode_poplimit(upb_decstate *d, int saved_delta) {
d->limit += saved_delta;
d->limit_ptr = d->end + UPB_MIN(0, d->limit);
UPB_ASSERT(d->limit_ptr == d->end + UPB_MIN(0, d->limit));
}
#include "upb/port_undef.inc"

File diff suppressed because it is too large Load Diff

@ -1,8 +1,31 @@
// These are the specialized field parser functions for the fast parser.
// Generated tables will refer to these by name.
//
// Here we follow the same pattern of macros used in decode_fast.c to declare
// all of the variants.
// The function names are encoded with names like:
//
// // 123
// upb_pss_1bt(); // Parse singular string, 1 byte tag.
//
// In position 1:
// - 'p' for parse, most function use this
// - 'c' for copy, for when we are copying strings instead of aliasing
//
// In position 2 (cardinality):
// - 's' for singular, with or without hasbit
// - 'o' for oneof
// - 'r' for non-packed repeated
// - 'p' for packed repeated
//
// In position 3 (type):
// - 'b1' for bool
// - 'v4' for 4-byte varint
// - 'v8' for 8-byte varint
// - 'z4' for zig-zag-encoded 4-byte varint
// - 'z8' for zig-zag-encoded 8-byte varint
// - 'f4' for 4-byte fixed
// - 'f8' for 8-byte fixed
// - 'm' for sub-message
// - 's' for string
#ifndef UPB_DECODE_FAST_H_
#define UPB_DECODE_FAST_H_
@ -21,6 +44,8 @@ const char *fastdecode_generic(struct upb_decstate *d, const char *ptr,
struct upb_decstate *d, const char *ptr, upb_msg *msg, intptr_t table, \
uint64_t hasbits, uint64_t data
/* primitive fields ***********************************************************/
#define F(card, type, valbytes, tagbytes) \
const char *upb_p##card##type##valbytes##_##tagbytes##bt(UPB_PARSE_PARAMS);
@ -38,20 +63,33 @@ const char *fastdecode_generic(struct upb_decstate *d, const char *ptr,
TYPES(card, 2)
TAGBYTES(s)
// TAGBYTES(o)
TAGBYTES(o)
TAGBYTES(r)
const char *upb_pss_1bt(UPB_PARSE_PARAMS);
const char *upb_pss_2bt(UPB_PARSE_PARAMS);
const char *upb_pos_1bt(UPB_PARSE_PARAMS);
const char *upb_pos_2bt(UPB_PARSE_PARAMS);
const char *upb_prs_1bt(UPB_PARSE_PARAMS);
const char *upb_prs_2bt(UPB_PARSE_PARAMS);
TAGBYTES(p)
#undef F
#undef TYPES
#undef TAGBYTES
/* string fields **************************************************************/
#define F(card, tagbytes) \
const char *upb_p##card##s_##tagbytes##bt(UPB_PARSE_PARAMS); \
const char *upb_c##card##s_##tagbytes##bt(UPB_PARSE_PARAMS);
#define TAGBYTES(card) \
F(card, 1) \
F(card, 2)
TAGBYTES(s)
TAGBYTES(o)
TAGBYTES(r)
#undef F
#undef TAGBYTES
/* sub-message fields *********************************************************/
#define F(card, tagbytes, size_ceil, ceil_arg) \
const char *upb_p##card##m_##tagbytes##bt_max##size_ceil##b(UPB_PARSE_PARAMS);

@ -54,8 +54,8 @@ typedef const char *_upb_field_parser(struct upb_decstate *d, const char *ptr,
uint64_t hasbits, uint64_t data);
typedef struct {
_upb_field_parser *field_parser;
uint64_t field_data;
_upb_field_parser *field_parser;
} _upb_fasttable_entry;
typedef struct upb_msglayout {

@ -129,7 +129,7 @@ static bool upb_arena_allocblock(upb_arena *a, size_t size) {
void *_upb_arena_slowmalloc(upb_arena *a, size_t size) {
if (!upb_arena_allocblock(a, size)) return NULL; /* Out of memory. */
UPB_ASSERT(_upb_arenahas(a, size));
UPB_ASSERT(_upb_arenahas(a) >= size);
return upb_arena_malloc(a, size);
}
@ -224,9 +224,9 @@ void upb_arena_free(upb_arena *a) {
bool upb_arena_addcleanup(upb_arena *a, void *ud, upb_cleanup_func *func) {
cleanup_ent *ent;
if (!a->cleanups || !_upb_arenahas(a, sizeof(cleanup_ent))) {
if (!a->cleanups || _upb_arenahas(a) < sizeof(cleanup_ent)) {
if (!upb_arena_allocblock(a, 128)) return false; /* Out of memory. */
UPB_ASSERT(_upb_arenahas(a, sizeof(cleanup_ent)));
UPB_ASSERT(_upb_arenahas(a) >= sizeof(cleanup_ent));
}
a->head.end -= sizeof(cleanup_ent);

@ -161,9 +161,9 @@ void *_upb_arena_slowmalloc(upb_arena *a, size_t size);
UPB_INLINE upb_alloc *upb_arena_alloc(upb_arena *a) { return (upb_alloc*)a; }
UPB_INLINE bool _upb_arenahas(upb_arena *a, size_t size) {
UPB_INLINE size_t _upb_arenahas(upb_arena *a) {
_upb_arena_head *h = (_upb_arena_head*)a;
return (size_t)(h->end - h->ptr) >= size;
return (size_t)(h->end - h->ptr);
}
UPB_INLINE void *upb_arena_malloc(upb_arena *a, size_t size) {
@ -171,7 +171,7 @@ UPB_INLINE void *upb_arena_malloc(upb_arena *a, size_t size) {
void* ret;
size = UPB_ALIGN_MALLOC(size);
if (UPB_UNLIKELY(!_upb_arenahas(a, size))) {
if (UPB_UNLIKELY(_upb_arenahas(a) < size)) {
return _upb_arena_slowmalloc(a, size);
}
@ -182,7 +182,7 @@ UPB_INLINE void *upb_arena_malloc(upb_arena *a, size_t size) {
#if UPB_ASAN
{
size_t guard_size = 32;
if (_upb_arenahas(a, guard_size)) {
if (_upb_arenahas(a) >= guard_size) {
h->ptr += guard_size;
} else {
h->ptr = h->end;

@ -41,6 +41,9 @@ class Arena {
public:
// A simple arena with no initial memory block and the default allocator.
Arena() : ptr_(upb_arena_new(), upb_arena_free) {}
Arena(char *initial_block, size_t size)
: ptr_(upb_arena_init(initial_block, size, &upb_alloc_global),
upb_arena_free) {}
upb_arena* ptr() { return ptr_.get(); }
@ -71,15 +74,12 @@ class Arena {
template <int N>
class InlinedArena : public Arena {
public:
InlinedArena() : ptr_(upb_arena_new(&initial_block_, N, &upb_alloc_global)) {}
upb_arena* ptr() { return ptr_.get(); }
InlinedArena() : Arena(initial_block_, N) {}
private:
InlinedArena(const InlinedArena*) = delete;
InlinedArena& operator=(const InlinedArena*) = delete;
std::unique_ptr<upb_arena, decltype(&upb_arena_free)> ptr_;
char initial_block_[N];
};

@ -1,4 +1,6 @@
#include "upbc/generator.h"
#include <memory>
#include "absl/container/flat_hash_map.h"
@ -9,8 +11,7 @@
#include "google/protobuf/descriptor.h"
#include "google/protobuf/descriptor.pb.h"
#include "google/protobuf/io/zero_copy_stream.h"
#include "upbc/generator.h"
#include "google/protobuf/wire_format.h"
#include "upbc/message_layout.h"
namespace protoc = ::google::protobuf::compiler;
@ -140,16 +141,16 @@ std::vector<const protobuf::EnumDescriptor*> SortedEnums(
std::vector<const protobuf::FieldDescriptor*> FieldNumberOrder(
const protobuf::Descriptor* message) {
std::vector<const protobuf::FieldDescriptor*> messages;
std::vector<const protobuf::FieldDescriptor*> fields;
for (int i = 0; i < message->field_count(); i++) {
messages.push_back(message->field(i));
fields.push_back(message->field(i));
}
std::sort(messages.begin(), messages.end(),
std::sort(fields.begin(), fields.end(),
[](const protobuf::FieldDescriptor* a,
const protobuf::FieldDescriptor* b) {
return a->number() < b->number();
});
return messages;
return fields;
}
std::vector<const protobuf::FieldDescriptor*> SortedSubmessages(
@ -736,16 +737,37 @@ struct SubmsgArray {
absl::flat_hash_map<const protobuf::Descriptor*, int> indexes_;
};
typedef std::pair<std::string, MessageLayout::Size> TableEntry;
typedef std::pair<std::string, uint64_t> TableEntry;
void TryFillTableEntry(const protobuf::Descriptor* message,
const MessageLayout& layout, int num, TableEntry& ent) {
const protobuf::FieldDescriptor* field = message->FindFieldByNumber(num);
if (!field) return;
uint64_t GetEncodedTag(const protobuf::FieldDescriptor* field) {
protobuf::internal::WireFormatLite::WireType wire_type =
protobuf::internal::WireFormat::WireTypeForField(field);
uint32_t unencoded_tag =
protobuf::internal::WireFormatLite::MakeTag(field->number(), wire_type);
uint8_t tag_bytes[10] = {0};
protobuf::io::CodedOutputStream::WriteVarint32ToArray(unencoded_tag,
tag_bytes);
uint64_t encoded_tag = 0;
memcpy(&encoded_tag, tag_bytes, sizeof(encoded_tag));
// TODO: byte-swap for big endian.
return encoded_tag;
}
int GetTableSlot(const protobuf::FieldDescriptor* field) {
uint64_t tag = GetEncodedTag(field);
if (tag > 0x7fff) {
// Tag must fit within a two-byte varint.
return -1;
}
return (tag & 0xf8) >> 3;
}
bool TryFillTableEntry(const protobuf::Descriptor* message,
const MessageLayout& layout,
const protobuf::FieldDescriptor* field,
TableEntry& ent) {
std::string type = "";
std::string cardinality = "";
uint8_t wire_type = 0;
switch (field->type()) {
case protobuf::FieldDescriptor::TYPE_BOOL:
type = "b1";
@ -759,6 +781,16 @@ void TryFillTableEntry(const protobuf::Descriptor* message,
case protobuf::FieldDescriptor::TYPE_UINT64:
type = "v8";
break;
case protobuf::FieldDescriptor::TYPE_FIXED32:
case protobuf::FieldDescriptor::TYPE_SFIXED32:
case protobuf::FieldDescriptor::TYPE_FLOAT:
type = "f4";
break;
case protobuf::FieldDescriptor::TYPE_FIXED64:
case protobuf::FieldDescriptor::TYPE_SFIXED64:
case protobuf::FieldDescriptor::TYPE_DOUBLE:
type = "f8";
break;
case protobuf::FieldDescriptor::TYPE_SINT32:
type = "z4";
break;
@ -768,80 +800,80 @@ void TryFillTableEntry(const protobuf::Descriptor* message,
case protobuf::FieldDescriptor::TYPE_STRING:
case protobuf::FieldDescriptor::TYPE_BYTES:
type = "s";
wire_type = 2;
break;
case protobuf::FieldDescriptor::TYPE_MESSAGE:
if (field->is_map()) {
return; // Not supported yet (ever?).
return false; // Not supported yet (ever?).
}
type = "m";
wire_type = 2;
break;
case protobuf::FieldDescriptor::TYPE_FIXED32:
case protobuf::FieldDescriptor::TYPE_SFIXED32:
case protobuf::FieldDescriptor::TYPE_FLOAT:
type = "f4";
wire_type = 5;
break;
case protobuf::FieldDescriptor::TYPE_FIXED64:
case protobuf::FieldDescriptor::TYPE_SFIXED64:
case protobuf::FieldDescriptor::TYPE_DOUBLE:
type = "f8";
wire_type = 1;
break;
default:
return; // Not supported yet.
return false; // Not supported yet.
}
switch (field->label()) {
case protobuf::FieldDescriptor::LABEL_REPEATED:
if (field->is_packed()) return; // Packed fields are not supported
if (field->is_packed()) {
cardinality = "p";
} else {
cardinality = "r";
}
break;
case protobuf::FieldDescriptor::LABEL_OPTIONAL:
case protobuf::FieldDescriptor::LABEL_REQUIRED:
if (field->real_containing_oneof()) {
return; // Not supported yet.
cardinality = "o";
} else {
cardinality = "s";
}
break;
}
uint16_t expected_tag = (num << 3) | wire_type;
if (num > 15) expected_tag |= 0x100;
uint64_t expected_tag = GetEncodedTag(field);
MessageLayout::Size offset = layout.GetFieldOffset(field);
uint64_t hasbit_index = 0; // Zero means no hasbits.
// Data is:
//
// 48 32 16 0
// |--------|--------|--------|--------|--------|--------|--------|--------|
// | offset (16) |case offset (16) |presence| submsg | exp. tag (16) |
// |--------|--------|--------|--------|--------|--------|--------|--------|
//
// - |presence| is either hasbit index or field number for oneofs.
uint64_t data = offset.size64 << 48 | expected_tag;
if (field->is_repeated()) {
// No hasbit/oneof-related fields.
} if (field->real_containing_oneof()) {
MessageLayout::Size case_offset =
layout.GetOneofCaseOffset(field->real_containing_oneof());
if (case_offset.size64 > 0xffff) return false;
assert(field->number() < 256);
data |= field->number() << 24;
data |= case_offset.size64 << 32;
} else {
uint64_t hasbit_index = 63; // No hasbit (set a high, unused bit).
if (layout.HasHasbit(field)) {
hasbit_index = layout.GetHasbitIndex(field);
if (hasbit_index > 31) return;
// thas hasbits mask in the parser occupies bits 16-48
// in the 64 bit register.
hasbit_index += 16; // account for the shifted hasbits
if (hasbit_index > 31) return false;
}
data |= hasbit_index << 24;
}
MessageLayout::Size data;
data.size32 = ((uint64_t)offset.size32 << 48) | expected_tag;
data.size64 = ((uint64_t)offset.size64 << 48) | expected_tag;
if (field->type() == protobuf::FieldDescriptor::TYPE_MESSAGE) {
if (field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_MESSAGE) {
SubmsgArray submsg_array(message);
uint64_t idx = submsg_array.GetIndex(field);
data.size32 |= idx << 16 | hasbit_index << 32;
data.size64 |= idx << 16 | hasbit_index << 32;
} else {
uint64_t hasbit_mask = (1ull << hasbit_index) & -0x10000;
data.size32 |= (uint64_t)hasbit_mask;
data.size64 |= (uint64_t)hasbit_mask;
}
if (idx > 255) return false;
data |= idx << 16;
if (field->type() == protobuf::FieldDescriptor::TYPE_MESSAGE) {
std::string size_ceil = "max";
size_t size = SIZE_MAX;
if (field->message_type()->file() == field->file()) {
// We can only be guaranteed the size of the sub-message if it is in the
// same file as us. We could relax this to increase the speed of
// cross-file sub-message parsing if we are comfortable requiring that
// users compile all messages at the same time.
MessageLayout sub_layout(field->message_type());
size = sub_layout.message_size().size64 + 8;
}
@ -853,32 +885,40 @@ void TryFillTableEntry(const protobuf::Descriptor* message,
}
}
ent.first = absl::Substitute("upb_p$0$1_$2bt_max$3b", cardinality, type,
(num > 15) ? "2" : "1", size_ceil);
expected_tag > 0xff ? "2" : "1", size_ceil);
} else {
ent.first = absl::Substitute("upb_p$0$1_$2bt", cardinality, type,
(num > 15) ? "2" : "1");
expected_tag > 0xff ? "2" : "1");
}
ent.second = data;
return true;
}
std::vector<TableEntry> FastDecodeTable(const protobuf::Descriptor* message,
const MessageLayout& layout) {
int table_size = 1;
for (int i = 0; i < message->field_count(); i++) {
int num = message->field(i)->number();
while (num >= table_size && num < 32) {
table_size *= 2;
std::vector<TableEntry> table;
for (const auto field : FieldHotnessOrder(message)) {
TableEntry ent;
int slot = GetTableSlot(field);
// std::cerr << "table slot: " << field->number() << ": " << slot << "\n";
if (slot < 0) {
// Tag can't fit in the table.
continue;
}
if (!TryFillTableEntry(message, layout, field, ent)) {
// Unsupported field type or offset, hasbit index, etc. doesn't fit.
continue;
}
while ((size_t)slot >= table.size()) {
size_t size = std::max(static_cast<size_t>(1), table.size() * 2);
table.resize(size, TableEntry{"fastdecode_generic", 0});
}
std::vector<TableEntry> table;
MessageLayout::Size empty_size;
empty_size.size32 = 0;
empty_size.size64 = 0;
for (int i = 0; i < table_size; i++) {
table.emplace_back(TableEntry{"fastdecode_generic", empty_size});
TryFillTableEntry(message, layout, i, table.back());
if (table[slot].first != "fastdecode_generic") {
// A hotter field already filled this slot.
continue;
}
table[slot] = ent;
}
return table;
}
@ -981,6 +1021,10 @@ void WriteSource(const protobuf::FileDescriptor* file, Output& output,
if (fasttable_enabled) {
table = FastDecodeTable(message, layout);
}
if (table.size() > 1) {
assert((table.size() & (table.size() - 1)) == 0);
table_mask = (table.size() - 1) << 3;
}
@ -994,7 +1038,8 @@ void WriteSource(const protobuf::FileDescriptor* file, Output& output,
);
output(" {\n");
for (const auto& ent : table) {
output(" {&$0, $1},\n", ent.first, GetSizeInit(ent.second));
output(" {0x$1, &$0},\n", ent.first,
absl::StrCat(absl::Hex(ent.second, absl::kZeroPad16)));
}
output(" },\n");

@ -143,7 +143,7 @@ void MessageLayout::PlaceNonOneofFields(
// Place/count hasbits.
int hasbit_count = 0;
for (auto field : field_order) {
for (auto field : FieldHotnessOrder(descriptor)) {
if (HasHasbit(field)) {
// We don't use hasbit 0, so that 0 can indicate "no presence" in the
// table. This wastes one hasbit, but we don't worry about it for now.

@ -102,6 +102,23 @@ class MessageLayout {
Size size_;
};
// Returns fields in order of "hotness", eg. how frequently they appear in
// serialized payloads. Ideally this will use a profile. When we don't have
// that, we assume that fields with smaller numbers are used more frequently.
inline std::vector<const google::protobuf::FieldDescriptor*> FieldHotnessOrder(
const google::protobuf::Descriptor* message) {
std::vector<const google::protobuf::FieldDescriptor*> fields;
for (int i = 0; i < message->field_count(); i++) {
fields.push_back(message->field(i));
}
std::sort(fields.begin(), fields.end(),
[](const google::protobuf::FieldDescriptor* a,
const google::protobuf::FieldDescriptor* b) {
return a->number() < b->number();
});
return fields;
}
} // namespace upbc
#endif // UPBC_MESSAGE_LAYOUT_H

Loading…
Cancel
Save