pull/13171/head
Joshua Haberman 3 years ago
parent f2aab6ed3c
commit 76a81e2177
  1. 284
      cmake/google/protobuf/descriptor.upb.c
  2. 74
      upb/mini_table.c
  3. 20
      upb/mini_table.h
  4. 4
      upb/msg_internal.h
  5. 109
      upbc/protoc-gen-upb.cc

@ -29,25 +29,25 @@ const upb_MiniTable google_protobuf_FileDescriptorSet_msginit = {
static const upb_MiniTable_Sub google_protobuf_FileDescriptorProto_submsgs[6] = {
{.submsg = &google_protobuf_DescriptorProto_msginit},
{.submsg = &google_protobuf_EnumDescriptorProto_msginit},
{.submsg = &google_protobuf_ServiceDescriptorProto_msginit},
{.submsg = &google_protobuf_FieldDescriptorProto_msginit},
{.submsg = &google_protobuf_FileOptions_msginit},
{.submsg = &google_protobuf_ServiceDescriptorProto_msginit},
{.submsg = &google_protobuf_SourceCodeInfo_msginit},
};
static const upb_MiniTable_Field google_protobuf_FileDescriptorProto__fields[12] = {
{1, UPB_SIZE(4, 8), 1, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(12, 24), 2, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(36, 72), 0, 0, 12, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{4, UPB_SIZE(40, 80), 0, 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{5, UPB_SIZE(44, 88), 0, 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{6, UPB_SIZE(48, 96), 0, 4, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{7, UPB_SIZE(52, 104), 0, 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{8, UPB_SIZE(28, 56), 3, 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{9, UPB_SIZE(32, 64), 4, 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{10, UPB_SIZE(56, 112), 0, 0, 5, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{11, UPB_SIZE(60, 120), 0, 0, 5, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{12, UPB_SIZE(20, 40), 5, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(12, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(20, 40), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{4, UPB_SIZE(24, 48), 0, 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{5, UPB_SIZE(28, 56), 0, 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{6, UPB_SIZE(32, 64), 0, 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{7, UPB_SIZE(36, 72), 0, 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{8, UPB_SIZE(40, 80), 3, 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{9, UPB_SIZE(44, 88), 4, 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{10, UPB_SIZE(48, 96), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{11, UPB_SIZE(52, 104), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{12, UPB_SIZE(56, 112), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
const upb_MiniTable google_protobuf_FileDescriptorProto_msginit = {
@ -56,27 +56,28 @@ const upb_MiniTable google_protobuf_FileDescriptorProto_msginit = {
UPB_SIZE(64, 128), 12, kUpb_ExtMode_NonExtendable, 12, 255, 0,
};
static const upb_MiniTable_Sub google_protobuf_DescriptorProto_submsgs[7] = {
static const upb_MiniTable_Sub google_protobuf_DescriptorProto_submsgs[8] = {
{.submsg = &google_protobuf_FieldDescriptorProto_msginit},
{.submsg = &google_protobuf_DescriptorProto_msginit},
{.submsg = &google_protobuf_DescriptorProto_ExtensionRange_msginit},
{.submsg = &google_protobuf_DescriptorProto_ReservedRange_msginit},
{.submsg = &google_protobuf_EnumDescriptorProto_msginit},
{.submsg = &google_protobuf_DescriptorProto_ExtensionRange_msginit},
{.submsg = &google_protobuf_FieldDescriptorProto_msginit},
{.submsg = &google_protobuf_MessageOptions_msginit},
{.submsg = &google_protobuf_OneofDescriptorProto_msginit},
{.submsg = &google_protobuf_DescriptorProto_ReservedRange_msginit},
};
static const upb_MiniTable_Field google_protobuf_DescriptorProto__fields[10] = {
{1, UPB_SIZE(4, 8), 1, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(16, 32), 0, 4, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(20, 40), 0, 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{4, UPB_SIZE(24, 48), 0, 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{5, UPB_SIZE(28, 56), 0, 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{6, UPB_SIZE(32, 64), 0, 4, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{7, UPB_SIZE(12, 24), 2, 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(12, 24), 0, 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(16, 32), 0, 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{4, UPB_SIZE(20, 40), 0, 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{5, UPB_SIZE(24, 48), 0, 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{6, UPB_SIZE(28, 56), 0, 4, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{7, UPB_SIZE(32, 64), 2, 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{8, UPB_SIZE(36, 72), 0, 6, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{9, UPB_SIZE(40, 80), 0, 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{10, UPB_SIZE(44, 88), 0, 0, 12, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{9, UPB_SIZE(40, 80), 0, 7, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{10, UPB_SIZE(44, 88), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
const upb_MiniTable google_protobuf_DescriptorProto_msginit = {
@ -90,8 +91,8 @@ static const upb_MiniTable_Sub google_protobuf_DescriptorProto_ExtensionRange_su
};
static const upb_MiniTable_Field google_protobuf_DescriptorProto_ExtensionRange__fields[3] = {
{1, UPB_SIZE(4, 4), 1, 0, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(8, 8), 2, 0, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{1, UPB_SIZE(4, 4), 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(8, 8), 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(12, 16), 3, 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
@ -102,8 +103,8 @@ const upb_MiniTable google_protobuf_DescriptorProto_ExtensionRange_msginit = {
};
static const upb_MiniTable_Field google_protobuf_DescriptorProto_ReservedRange__fields[2] = {
{1, UPB_SIZE(4, 4), 1, 0, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(8, 8), 2, 0, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{1, UPB_SIZE(4, 4), 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(8, 8), 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
const upb_MiniTable google_protobuf_DescriptorProto_ReservedRange_msginit = {
@ -127,23 +128,23 @@ const upb_MiniTable google_protobuf_ExtensionRangeOptions_msginit = {
};
static const upb_MiniTable_Sub google_protobuf_FieldDescriptorProto_submsgs[3] = {
{.submsg = &google_protobuf_FieldOptions_msginit},
{.subenum = &google_protobuf_FieldDescriptorProto_Label_enuminit},
{.subenum = &google_protobuf_FieldDescriptorProto_Type_enuminit},
{.submsg = &google_protobuf_FieldOptions_msginit},
};
static const upb_MiniTable_Field google_protobuf_FieldDescriptorProto__fields[11] = {
{1, UPB_SIZE(24, 24), 1, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(32, 40), 2, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(12, 12), 3, 0, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{4, UPB_SIZE(4, 4), 4, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{5, UPB_SIZE(8, 8), 5, 2, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{6, UPB_SIZE(40, 56), 6, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{7, UPB_SIZE(48, 72), 7, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{8, UPB_SIZE(64, 104), 8, 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{9, UPB_SIZE(16, 16), 9, 0, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{10, UPB_SIZE(56, 88), 10, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{17, UPB_SIZE(20, 20), 11, 0, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{1, UPB_SIZE(24, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(32, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(4, 4), 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{4, UPB_SIZE(8, 8), 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{5, UPB_SIZE(12, 12), 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{6, UPB_SIZE(40, 56), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{7, UPB_SIZE(48, 72), 7, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{8, UPB_SIZE(56, 88), 8, 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{9, UPB_SIZE(16, 16), 9, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{10, UPB_SIZE(60, 96), 10, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{17, UPB_SIZE(20, 20), 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
const upb_MiniTable google_protobuf_FieldDescriptorProto_msginit = {
@ -157,7 +158,7 @@ static const upb_MiniTable_Sub google_protobuf_OneofDescriptorProto_submsgs[1] =
};
static const upb_MiniTable_Field google_protobuf_OneofDescriptorProto__fields[2] = {
{1, UPB_SIZE(4, 8), 1, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(12, 24), 2, 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
@ -168,32 +169,28 @@ const upb_MiniTable google_protobuf_OneofDescriptorProto_msginit = {
};
static const upb_MiniTable_Sub google_protobuf_EnumDescriptorProto_submsgs[3] = {
{.submsg = &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit},
{.submsg = &google_protobuf_EnumOptions_msginit},
{.submsg = &google_protobuf_EnumValueDescriptorProto_msginit},
{.submsg = &google_protobuf_EnumOptions_msginit},
{.submsg = &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit},
};
static const upb_MiniTable_Field google_protobuf_EnumDescriptorProto__fields[5] = {
{1, UPB_SIZE(4, 8), 1, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(16, 32), 0, 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(12, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{4, UPB_SIZE(20, 40), 0, 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{5, UPB_SIZE(24, 48), 0, 0, 12, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(12, 24), 0, 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(16, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{4, UPB_SIZE(20, 40), 0, 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{5, UPB_SIZE(24, 48), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
const upb_MiniTable google_protobuf_EnumDescriptorProto_msginit = {
&google_protobuf_EnumDescriptorProto_submsgs[0],
&google_protobuf_EnumDescriptorProto__fields[0],
<<<<<<< HEAD
UPB_SIZE(32, 56), 5, upb_ExtMode_NonExtendable, 5, 255, 0,
=======
UPB_SIZE(32, 64), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0,
>>>>>>> mini-table-1
UPB_SIZE(32, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0,
};
static const upb_MiniTable_Field google_protobuf_EnumDescriptorProto_EnumReservedRange__fields[2] = {
{1, UPB_SIZE(4, 4), 1, 0, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(8, 8), 2, 0, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{1, UPB_SIZE(4, 4), 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(8, 8), 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
const upb_MiniTable google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit = {
@ -207,8 +204,8 @@ static const upb_MiniTable_Sub google_protobuf_EnumValueDescriptorProto_submsgs[
};
static const upb_MiniTable_Field google_protobuf_EnumValueDescriptorProto__fields[3] = {
{1, UPB_SIZE(8, 8), 1, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(4, 4), 2, 0, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{1, UPB_SIZE(8, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(4, 4), 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(16, 24), 3, 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
@ -224,19 +221,15 @@ static const upb_MiniTable_Sub google_protobuf_ServiceDescriptorProto_submsgs[2]
};
static const upb_MiniTable_Field google_protobuf_ServiceDescriptorProto__fields[3] = {
{1, UPB_SIZE(4, 8), 1, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(16, 32), 0, 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(12, 24), 2, 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(12, 24), 0, 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(16, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
const upb_MiniTable google_protobuf_ServiceDescriptorProto_msginit = {
&google_protobuf_ServiceDescriptorProto_submsgs[0],
&google_protobuf_ServiceDescriptorProto__fields[0],
<<<<<<< HEAD
UPB_SIZE(24, 40), 3, upb_ExtMode_NonExtendable, 3, 255, 0,
=======
UPB_SIZE(24, 48), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
>>>>>>> mini-table-1
UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
static const upb_MiniTable_Sub google_protobuf_MethodDescriptorProto_submsgs[1] = {
@ -244,12 +237,12 @@ static const upb_MiniTable_Sub google_protobuf_MethodDescriptorProto_submsgs[1]
};
static const upb_MiniTable_Field google_protobuf_MethodDescriptorProto__fields[6] = {
{1, UPB_SIZE(4, 8), 1, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(12, 24), 2, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(20, 40), 3, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(12, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(20, 40), 3, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{4, UPB_SIZE(28, 56), 4, 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{5, UPB_SIZE(1, 1), 5, 0, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{6, UPB_SIZE(2, 2), 6, 0, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{5, UPB_SIZE(1, 1), 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{6, UPB_SIZE(2, 2), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
const upb_MiniTable google_protobuf_MethodDescriptorProto_msginit = {
@ -259,32 +252,32 @@ const upb_MiniTable google_protobuf_MethodDescriptorProto_msginit = {
};
static const upb_MiniTable_Sub google_protobuf_FileOptions_submsgs[2] = {
{.submsg = &google_protobuf_UninterpretedOption_msginit},
{.subenum = &google_protobuf_FileOptions_OptimizeMode_enuminit},
{.submsg = &google_protobuf_UninterpretedOption_msginit},
};
static const upb_MiniTable_Field google_protobuf_FileOptions__fields[21] = {
{1, UPB_SIZE(20, 24), 1, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{8, UPB_SIZE(28, 40), 2, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{9, UPB_SIZE(4, 4), 3, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{10, UPB_SIZE(8, 8), 4, 0, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{11, UPB_SIZE(36, 56), 5, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{16, UPB_SIZE(9, 9), 6, 0, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{17, UPB_SIZE(10, 10), 7, 0, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{18, UPB_SIZE(11, 11), 8, 0, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{20, UPB_SIZE(12, 12), 9, 0, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{23, UPB_SIZE(13, 13), 10, 0, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{27, UPB_SIZE(14, 14), 11, 0, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{31, UPB_SIZE(15, 15), 12, 0, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{36, UPB_SIZE(44, 72), 13, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{37, UPB_SIZE(52, 88), 14, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{39, UPB_SIZE(60, 104), 15, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{40, UPB_SIZE(68, 120), 16, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{41, UPB_SIZE(76, 136), 17, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{42, UPB_SIZE(16, 16), 18, 0, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{44, UPB_SIZE(84, 152), 19, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{45, UPB_SIZE(92, 168), 20, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{999, UPB_SIZE(100, 184), 0, 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{1, UPB_SIZE(20, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{8, UPB_SIZE(28, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{9, UPB_SIZE(4, 4), 3, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{10, UPB_SIZE(8, 8), 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{11, UPB_SIZE(36, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{16, UPB_SIZE(9, 9), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{17, UPB_SIZE(10, 10), 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{18, UPB_SIZE(11, 11), 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{20, UPB_SIZE(12, 12), 9, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{23, UPB_SIZE(13, 13), 10, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{27, UPB_SIZE(14, 14), 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{31, UPB_SIZE(15, 15), 12, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{36, UPB_SIZE(44, 72), 13, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{37, UPB_SIZE(52, 88), 14, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{39, UPB_SIZE(60, 104), 15, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{40, UPB_SIZE(68, 120), 16, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{41, UPB_SIZE(76, 136), 17, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{42, UPB_SIZE(16, 16), 18, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{44, UPB_SIZE(84, 152), 19, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{45, UPB_SIZE(92, 168), 20, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{999, UPB_SIZE(100, 184), 0, 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
const upb_MiniTable google_protobuf_FileOptions_msginit = {
@ -298,10 +291,10 @@ static const upb_MiniTable_Sub google_protobuf_MessageOptions_submsgs[1] = {
};
static const upb_MiniTable_Field google_protobuf_MessageOptions__fields[5] = {
{1, UPB_SIZE(1, 1), 1, 0, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(2, 2), 2, 0, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(3, 3), 3, 0, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{7, UPB_SIZE(4, 4), 4, 0, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{1, UPB_SIZE(1, 1), 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(2, 2), 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(3, 3), 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{7, UPB_SIZE(4, 4), 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{999, UPB_SIZE(8, 8), 0, 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
@ -312,20 +305,20 @@ const upb_MiniTable google_protobuf_MessageOptions_msginit = {
};
static const upb_MiniTable_Sub google_protobuf_FieldOptions_submsgs[3] = {
{.submsg = &google_protobuf_UninterpretedOption_msginit},
{.subenum = &google_protobuf_FieldOptions_CType_enuminit},
{.subenum = &google_protobuf_FieldOptions_JSType_enuminit},
{.submsg = &google_protobuf_UninterpretedOption_msginit},
};
static const upb_MiniTable_Field google_protobuf_FieldOptions__fields[8] = {
{1, UPB_SIZE(4, 4), 1, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(12, 12), 2, 0, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(13, 13), 3, 0, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{5, UPB_SIZE(14, 14), 4, 0, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{6, UPB_SIZE(8, 8), 5, 2, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{10, UPB_SIZE(15, 15), 6, 0, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{15, UPB_SIZE(16, 16), 7, 0, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{999, UPB_SIZE(20, 24), 0, 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{1, UPB_SIZE(4, 4), 1, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(8, 8), 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(9, 9), 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{5, UPB_SIZE(10, 10), 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{6, UPB_SIZE(12, 12), 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{10, UPB_SIZE(16, 16), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{15, UPB_SIZE(17, 17), 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{999, UPB_SIZE(20, 24), 0, 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
const upb_MiniTable google_protobuf_FieldOptions_msginit = {
@ -353,8 +346,8 @@ static const upb_MiniTable_Sub google_protobuf_EnumOptions_submsgs[1] = {
};
static const upb_MiniTable_Field google_protobuf_EnumOptions__fields[3] = {
{2, UPB_SIZE(1, 1), 1, 0, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(2, 2), 2, 0, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(1, 1), 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(2, 2), 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
@ -369,7 +362,7 @@ static const upb_MiniTable_Sub google_protobuf_EnumValueOptions_submsgs[1] = {
};
static const upb_MiniTable_Field google_protobuf_EnumValueOptions__fields[2] = {
{1, UPB_SIZE(1, 1), 1, 0, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{1, UPB_SIZE(1, 1), 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
@ -384,7 +377,7 @@ static const upb_MiniTable_Sub google_protobuf_ServiceOptions_submsgs[1] = {
};
static const upb_MiniTable_Field google_protobuf_ServiceOptions__fields[2] = {
{33, UPB_SIZE(1, 1), 1, 0, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{33, UPB_SIZE(1, 1), 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
@ -395,14 +388,14 @@ const upb_MiniTable google_protobuf_ServiceOptions_msginit = {
};
static const upb_MiniTable_Sub google_protobuf_MethodOptions_submsgs[2] = {
{.submsg = &google_protobuf_UninterpretedOption_msginit},
{.subenum = &google_protobuf_MethodOptions_IdempotencyLevel_enuminit},
{.submsg = &google_protobuf_UninterpretedOption_msginit},
};
static const upb_MiniTable_Field google_protobuf_MethodOptions__fields[3] = {
{33, UPB_SIZE(8, 8), 1, 0, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{34, UPB_SIZE(4, 4), 2, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{999, UPB_SIZE(12, 16), 0, 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{33, UPB_SIZE(1, 1), 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{34, UPB_SIZE(4, 4), 2, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{999, UPB_SIZE(8, 8), 0, 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
const upb_MiniTable google_protobuf_MethodOptions_msginit = {
@ -416,38 +409,30 @@ static const upb_MiniTable_Sub google_protobuf_UninterpretedOption_submsgs[1] =
};
static const upb_MiniTable_Field google_protobuf_UninterpretedOption__fields[7] = {
{2, UPB_SIZE(56, 80), 0, 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(32, 32), 1, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{4, UPB_SIZE(8, 8), 2, 0, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
{5, UPB_SIZE(16, 16), 3, 0, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
{6, UPB_SIZE(24, 24), 4, 0, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
{7, UPB_SIZE(40, 48), 5, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{8, UPB_SIZE(48, 64), 6, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(8, 16), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{4, UPB_SIZE(32, 64), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
{5, UPB_SIZE(40, 72), 3, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
{6, UPB_SIZE(48, 80), 4, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
{7, UPB_SIZE(16, 32), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{8, UPB_SIZE(24, 48), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
const upb_MiniTable google_protobuf_UninterpretedOption_msginit = {
&google_protobuf_UninterpretedOption_submsgs[0],
&google_protobuf_UninterpretedOption__fields[0],
<<<<<<< HEAD
UPB_SIZE(64, 88), 7, upb_ExtMode_NonExtendable, 0, 255, 0,
=======
UPB_SIZE(64, 96), 7, kUpb_ExtMode_NonExtendable, 0, 255, 0,
>>>>>>> mini-table-1
UPB_SIZE(64, 88), 7, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
static const upb_MiniTable_Field google_protobuf_UninterpretedOption_NamePart__fields[2] = {
{1, UPB_SIZE(4, 8), 1, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(1, 1), 2, 0, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(1, 1), 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
const upb_MiniTable google_protobuf_UninterpretedOption_NamePart_msginit = {
NULL,
&google_protobuf_UninterpretedOption_NamePart__fields[0],
<<<<<<< HEAD
UPB_SIZE(16, 24), 2, upb_ExtMode_NonExtendable, 2, 255, 2,
=======
UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 2,
>>>>>>> mini-table-1
UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 2,
};
static const upb_MiniTable_Sub google_protobuf_SourceCodeInfo_submsgs[1] = {
@ -465,16 +450,11 @@ const upb_MiniTable google_protobuf_SourceCodeInfo_msginit = {
};
static const upb_MiniTable_Field google_protobuf_SourceCodeInfo_Location__fields[5] = {
<<<<<<< HEAD
{1, UPB_SIZE(20, 40), 0, 0, 5, kUpb_FieldMode_Array | upb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(24, 48), 0, 0, 5, kUpb_FieldMode_Array | upb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
=======
{1, UPB_SIZE(20, 40), 0, 0, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(24, 48), 0, 0, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
>>>>>>> mini-table-1
{3, UPB_SIZE(4, 8), 1, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{4, UPB_SIZE(12, 24), 2, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{6, UPB_SIZE(28, 56), 0, 0, 12, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{1, UPB_SIZE(4, 8), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(12, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{4, UPB_SIZE(20, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{6, UPB_SIZE(28, 56), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
const upb_MiniTable google_protobuf_SourceCodeInfo_Location_msginit = {
@ -498,24 +478,16 @@ const upb_MiniTable google_protobuf_GeneratedCodeInfo_msginit = {
};
static const upb_MiniTable_Field google_protobuf_GeneratedCodeInfo_Annotation__fields[4] = {
<<<<<<< HEAD
{1, UPB_SIZE(20, 32), 0, 0, 5, kUpb_FieldMode_Array | upb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
=======
{1, UPB_SIZE(20, 32), 0, 0, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
>>>>>>> mini-table-1
{2, UPB_SIZE(12, 16), 1, 0, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(4, 4), 2, 0, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{4, UPB_SIZE(8, 8), 3, 0, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{1, UPB_SIZE(12, 16), 0, kUpb_NoSub, 5, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(16, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(4, 4), 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{4, UPB_SIZE(8, 8), 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
const upb_MiniTable google_protobuf_GeneratedCodeInfo_Annotation_msginit = {
NULL,
&google_protobuf_GeneratedCodeInfo_Annotation__fields[0],
<<<<<<< HEAD
UPB_SIZE(24, 40), 4, upb_ExtMode_NonExtendable, 4, 255, 0,
=======
UPB_SIZE(24, 48), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
>>>>>>> mini-table-1
UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
};
static const upb_MiniTable *messages_layout[27] = {

@ -357,10 +357,36 @@ static const char* upb_MiniTable_DecodeBase92Varint(upb_MtDecoder* d,
}
}
static bool upb_MiniTable_HasSub(char type, uint64_t msg_modifiers) {
return type == kUpb_EncodedType_Message || type == kUpb_EncodedType_Group ||
(type == kUpb_EncodedType_Enum &&
(msg_modifiers & kUpb_MessageModifier_HasClosedEnums));
static bool upb_MiniTable_HasSub(upb_MiniTable_Field* field,
uint64_t msg_modifiers) {
if (field->descriptortype == kUpb_FieldType_Message ||
field->descriptortype == kUpb_FieldType_Group) {
return true;
} else if (field->descriptortype == kUpb_FieldType_Enum) {
if (msg_modifiers & kUpb_MessageModifier_HasClosedEnums) {
return true;
} else {
field->descriptortype = kUpb_FieldType_Int32;
return false;
}
} else if (field->descriptortype == kUpb_FieldType_String) {
if (!(msg_modifiers & kUpb_MessageModifier_ValidateUtf8)) {
field->descriptortype = kUpb_FieldType_Bytes;
return false;
}
}
return false;
}
static void upb_MiniTable_SetTypeAndSub(upb_MiniTable_Field* field,
upb_FieldType type, uint32_t* sub_count,
uint64_t msg_modifiers) {
field->descriptortype = type;
if (upb_MiniTable_HasSub(field, msg_modifiers)) {
field->submsg_index = sub_count ? (*sub_count)++ : 0;
} else {
field->submsg_index = kUpb_NoSub;
}
}
static void upb_MiniTable_SetField(upb_MtDecoder* d, uint8_t ch,
@ -424,12 +450,8 @@ static void upb_MiniTable_SetField(upb_MtDecoder* d, uint8_t ch,
upb_MtDecoder_ErrorFormat(d, "Invalid field type: %d", (int)type);
UPB_UNREACHABLE();
}
field->descriptortype = kUpb_EncodedToType[type];
if (upb_MiniTable_HasSub(type, msg_modifiers)) {
field->submsg_index = sub_count ? (*sub_count)++ : 0;
} else {
field->submsg_index = 0;
}
upb_MiniTable_SetTypeAndSub(field, kUpb_EncodedToType[type], sub_count,
msg_modifiers);
}
static void upb_MtDecoder_ModifyField(upb_MtDecoder* d, uint32_t mod,
@ -877,11 +899,11 @@ upb_MiniTable* upb_MiniTable_BuildMapEntry(upb_FieldType key_type,
fields[1].mode = kUpb_FieldMode_Scalar;
fields[0].presence = 0;
fields[1].presence = 0;
fields[0].descriptortype = key_type;
fields[1].descriptortype = value_type;
fields[0].offset = 0;
fields[1].offset = field_size;
fields[1].submsg_index = 0;
upb_MiniTable_SetTypeAndSub(&fields[0], key_type, NULL, 0);
upb_MiniTable_SetTypeAndSub(&fields[1], value_type, NULL, 0);
ret->size = UPB_ALIGN_UP(2 * field_size, 8);
ret->field_count = 2;
@ -894,35 +916,23 @@ upb_MiniTable* upb_MiniTable_BuildMapEntry(upb_FieldType key_type,
return ret;
}
upb_MiniTable_Extension* upb_MiniTable_BuildExtensions(const char* data,
size_t len,
size_t* ext_count,
upb_Arena* arena,
upb_Status* status) {
bool upb_MiniTable_BuildExtension(const char* data, size_t len,
upb_MiniTable_Extension* ext,
upb_MiniTable_Sub sub, upb_Status* status) {
upb_MtDecoder decoder = {
.arena = arena,
.arena = NULL,
.status = status,
.table = NULL,
};
upb_MiniTable_Extension* exts;
if (UPB_SETJMP(decoder.err)) {
exts = NULL;
*ext_count = 0;
goto done;
return false;
}
uint16_t count = 0;
exts = upb_Arena_Malloc(arena, sizeof(*exts) * len);
upb_MtDecoder_CheckOutOfMemory(&decoder, exts);
fprintf(stderr, "ABOUT TO PARSE!\n");
upb_MtDecoder_Parse(&decoder, data, len, exts, sizeof(*exts), &count, NULL);
upb_Arena_ShrinkLast(arena, exts, sizeof(*exts) * len, sizeof(*exts) * count);
done:
*ext_count = count;
return exts;
upb_MtDecoder_Parse(&decoder, data, len, ext, sizeof(*ext), &count, NULL);
return true;
}
upb_MiniTable* upb_MiniTable_Build(const char* data, size_t len,

@ -41,10 +41,11 @@ const upb_MiniTable_Field* upb_MiniTable_FindFieldByNumber(
const upb_MiniTable* table, uint32_t number);
typedef enum {
kUpb_MessageModifier_DefaultIsPacked = 1,
kUpb_MessageModifier_HasClosedEnums = 2,
kUpb_MessageModifier_IsExtendable = 4,
kUpb_MessageModifier_IsMapEntry = 8,
kUpb_MessageModifier_ValidateUtf8 = 1,
kUpb_MessageModifier_DefaultIsPacked = 2,
kUpb_MessageModifier_HasClosedEnums = 4,
kUpb_MessageModifier_IsExtendable = 8,
kUpb_MessageModifier_IsMapEntry = 16,
} kUpb_MessageModifier;
typedef enum {
@ -123,14 +124,9 @@ void upb_MiniTable_SetSubMessage(upb_MiniTable* table,
void upb_MiniTable_SetSubEnum(upb_MiniTable* table, upb_MiniTable_Field* field,
const upb_MiniTable_Enum* sub);
upb_MiniTable_Extension* upb_MiniTable_BuildExtensions(const char* data,
size_t len,
size_t* ext_count,
upb_Arena* arena,
upb_Status* status);
void upb_MiniTable_ResolveExtension(upb_MiniTable_Extension* ext,
const upb_MiniTable* extendee,
upb_MiniTable_Sub sub);
bool upb_MiniTable_BuildExtension(const char* data, size_t len,
upb_MiniTable_Extension* ext,
upb_MiniTable_Sub sub, upb_Status* status);
// Special-case functions for MessageSet layout and map entries.
upb_MiniTable* upb_MiniTable_BuildMessageSet(upb_MiniTablePlatform platform,

@ -72,12 +72,14 @@ typedef struct {
uint32_t number;
uint16_t offset;
int16_t presence; // If >0, hasbit_index. If <0, ~oneof_index
uint16_t submsg_index; // undefined if descriptortype != MESSAGE/GROUP/ENUM
uint16_t submsg_index; // kUpb_NoSub if descriptortype != MESSAGE/GROUP/ENUM
uint8_t descriptortype;
uint8_t mode; /* upb_FieldMode | upb_LabelFlags |
(upb_FieldRep << kUpb_FieldRep_Shift) */
} upb_MiniTable_Field;
#define kUpb_NoSub ((uint16_t)-1)
typedef enum {
kUpb_FieldMode_Map = 0,
kUpb_FieldMode_Array = 1,

@ -93,20 +93,18 @@ bool IsNull(upb_MiniTable_Sub sub) {
return reinterpret_cast<uintptr_t>(sub.subenum) == 0;
}
void WriteSub(upb_MiniTable_Sub sub, Output& output) {
std::string GetSub(upb_MiniTable_Sub sub) {
uintptr_t as_int = reinterpret_cast<uintptr_t>(sub.submsg);
const char* str = reinterpret_cast<const char*>(as_int & ~SubTag::kMask);
switch (as_int & SubTag::kMask) {
case SubTag::kMessage:
output(" {.submsg = &$0},\n", str);
break;
return absl::Substitute("{.submsg = &$0}", str);
case SubTag::kEnum:
output(" {.subenum = &$0},\n", str);
break;
return absl::Substitute("{.subenum = &$0}", str);
default:
output(" {.submsg = NULL},\n", str);
break;
return std::string("{.submsg = NULL}");
}
return std::string("ERROR in WriteSub");
}
void AddEnums(const protobuf::Descriptor* message,
@ -413,7 +411,7 @@ class FilePlatformLayout {
const protobuf::FieldDescriptor* fd) const {
auto it = extension_map_.find(fd);
assert(it != extension_map_.end());
return it->second;
return &it->second;
}
private:
@ -448,22 +446,24 @@ class FilePlatformLayout {
for (const auto& f : FieldNumberOrder(pair.first)) {
upb_MiniTable_Field* mt_f = FindField(mt, f->number());
assert(mt_f);
upb_MiniTable_Sub sub = PackSubForField(f);
upb_MiniTable_Sub sub = PackSubForField(f, mt_f);
if (IsNull(sub)) continue;
fprintf(stderr, "YO: %s\n", f->full_name().c_str());
*const_cast<upb_MiniTable_Sub*>(&mt->subs[mt_f->submsg_index]) = sub;
}
}
}
upb_MiniTable_Sub PackSubForField(const protobuf::FieldDescriptor* f) {
if (f->message_type()) {
upb_MiniTable_Sub PackSubForField(const protobuf::FieldDescriptor* f,
const upb_MiniTable_Field* mt_f) {
if (mt_f->submsg_index == kUpb_NoSub) {
return PackSub(nullptr, SubTag::kNull);
} else if (f->message_type()) {
return PackSub(AllocStr(MessageInit(f->message_type())),
SubTag::kMessage);
} else if (f->enum_type() && f->enum_type()->file()->syntax() ==
protobuf::FileDescriptor::SYNTAX_PROTO2) {
return PackSub(AllocStr(EnumInit(f->enum_type())), SubTag::kEnum);
} else {
return PackSub(nullptr, SubTag::kNull);
ABSL_ASSERT(f->enum_type());
return PackSub(AllocStr(EnumInit(f->enum_type())), SubTag::kEnum);
}
}
@ -477,33 +477,27 @@ class FilePlatformLayout {
void BuildExtensions(const protobuf::FileDescriptor* fd) {
auto sorted = SortedExtensions(fd);
upb::MtDataEncoder e;
e.StartMessage(0);
upb::Status status;
for (const auto& f : sorted) {
upb::MtDataEncoder e;
e.StartMessage(0);
e.PutField(static_cast<upb_FieldType>(f->type()), f->number(),
GetFieldModifiers(f));
}
upb::Status status;
size_t ext_count;
upb_MiniTable_Extension* exts =
upb_MiniTable_BuildExtensions(e.data().data(), e.data().size(),
&ext_count, arena_.ptr(), status.ptr());
if (!exts) {
fprintf(stderr, "Error building mini-table: %s\n", status.error_message());
}
ABSL_ASSERT(exts);
if (ext_count != sorted.size()) {
fprintf(stderr, "ext_count: %zu, sorted.size(): %zu, data(): %s\n", ext_count,
sorted.size(), e.data().c_str());
}
ABSL_ASSERT(ext_count == sorted.size());
for (size_t i = 0; i < ext_count; i++) {
extension_map_[sorted[i]] = &exts[i];
upb_MiniTable_Extension& ext = extension_map_[f];
upb_MiniTable_Sub sub;
bool ok = upb_MiniTable_BuildExtension(e.data().data(), e.data().size(),
&ext, sub, status.ptr());
if (!ok) {
fprintf(stderr, "Error building mini-table: %s\n",
status.error_message());
}
ext.extendee = reinterpret_cast<const upb_MiniTable*>(
AllocStr(MessageInit(f->containing_type())));
ext.sub = PackSubForField(f, &ext.field);
ABSL_ASSERT(ok);
}
}
upb_MiniTable* MakeMiniTable(const protobuf::Descriptor* m) {
if (m->options().message_set_wire_format()) {
return upb_MiniTable_BuildMessageSet(platform_, arena_.ptr());
@ -576,7 +570,7 @@ class FilePlatformLayout {
private:
typedef absl::flat_hash_map<const protobuf::Descriptor*, upb_MiniTable*>
TableMap;
typedef absl::flat_hash_map<const protobuf::FieldDescriptor*, upb_MiniTable_Extension*>
typedef absl::flat_hash_map<const protobuf::FieldDescriptor*, upb_MiniTable_Extension>
ExtensionMap;
upb::Arena arena_;
TableMap table_map_;
@ -1367,10 +1361,12 @@ std::vector<TableEntry> FastDecodeTable(const protobuf::Descriptor* message,
return table;
}
// Returns the field mode as a string initializer.
//
// We could just emit this as a number (and we may yet go in that direction) but
// for now emitting symbolic constants gives this better readability and
// debuggability.
std::string GetModeInit(uint8_t mode) {
// We could just emit this as a number (and we may yet go in that direction)
// but for now emitting symbolic constants gives this better readability and
// debuggability.
std::string ret;
switch (mode & kUpb_FieldMode_Mask) {
case kUpb_FieldMode_Map:
@ -1420,9 +1416,11 @@ std::string GetModeInit(uint8_t mode) {
void WriteField(const upb_MiniTable_Field* field64,
const upb_MiniTable_Field* field32, Output& output) {
output("{$0, UPB_SIZE($1, $2), $3, $4, $5, $6}", field64->number,
field64->offset, field32->offset, field32->presence,
field64->submsg_index, field64->descriptortype,
GetModeInit(field64->mode));
field32->offset, field64->offset, field32->presence,
field64->submsg_index == kUpb_NoSub
? "kUpb_NoSub"
: absl::StrCat(field64->submsg_index).c_str(),
field64->descriptortype, GetModeInit(field64->mode));
}
// Writes a single field into a .upb.c source file.
@ -1444,21 +1442,23 @@ void WriteMessage(const protobuf::Descriptor* message, const FileLayout& layout,
const upb_MiniTable* mt_32 = layout.GetMiniTable32(message);
const upb_MiniTable* mt_64 = layout.GetMiniTable64(message);
MessageLayout msg_layout(message);
SubLayoutArray sublayout_array(message);
std::vector<std::string> subs;
if (sublayout_array.total_count()) {
// TODO(haberman): could save a little bit of space by only generating a
// "submsgs" array for every strongly-connected component.
for (int i = 0; i < mt_64->field_count; i++) {
const upb_MiniTable_Field* f = &mt_64->fields[i];
if (f->submsg_index != kUpb_NoSub) {
subs.push_back(GetSub(mt_64->subs[f->submsg_index]));
}
}
if (!subs.empty()) {
std::string submsgs_array_name = msg_name + "_submsgs";
submsgs_array_ref = "&" + submsgs_array_name + "[0]";
output("static const upb_MiniTable_Sub $0[$1] = {\n", submsgs_array_name,
sublayout_array.total_count());
subs.size());
for (const auto* submsg : sublayout_array.submsgs()) {
output(" {.submsg = &$0},\n", MessageInit(submsg));
}
for (const auto* subenum : sublayout_array.subenums()) {
output(" {.subenum = &$0},\n", EnumInit(subenum));
for (const auto& sub : subs) {
output(" $0,\n", sub);
}
output("};\n\n");
@ -1589,7 +1589,8 @@ int WriteMessages(const FileLayout& layout, Output& output,
void WriteExtension(const upb_MiniTable_Extension* ext, Output& output) {
WriteField(&ext->field, &ext->field, output);
output(",\n");
WriteSub(ext->sub, output);
output(" &$0,\n", reinterpret_cast<const char*>(ext->extendee));
output(" $0,\n", GetSub(ext->sub));
}
int WriteExtensions(const FileLayout& layout, Output& output) {

Loading…
Cancel
Save