diff --git a/src/google/protobuf/compiler/cpp/message.cc b/src/google/protobuf/compiler/cpp/message.cc index 8a202cb5c4..739c619649 100644 --- a/src/google/protobuf/compiler/cpp/message.cc +++ b/src/google/protobuf/compiler/cpp/message.cc @@ -1732,11 +1732,6 @@ void MessageGenerator::GenerateClassDefinition(io::Printer* p) { bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - )cc"); - - parse_function_generator_->GenerateMethodDecls(p); - - p->Emit(R"cc( $uint8$* _InternalSerialize( $uint8$* target, ::$proto_ns$::io::EpsCopyOutputStream* stream) const final; @@ -2188,11 +2183,6 @@ void MessageGenerator::GenerateClassMethods(io::Printer* p) { GenerateClear(p); format("\n"); - if (!HasSimpleBaseClass(descriptor_, options_)) { - parse_function_generator_->GenerateMethodImpls(p); - format("\n"); - } - GenerateSerializeWithCachedSizesToArray(p); format("\n"); @@ -3595,6 +3585,8 @@ void MessageGenerator::GenerateClassData(io::Printer* p) { &$desc_table$, $tracker_on_get_metadata$, }; + $pbi$::PrefetchToLocalCache(&_data_); + $pbi$::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } )cc"); diff --git a/src/google/protobuf/compiler/cpp/parse_function_generator.cc b/src/google/protobuf/compiler/cpp/parse_function_generator.cc index 14d0491396..91e72ec472 100644 --- a/src/google/protobuf/compiler/cpp/parse_function_generator.cc +++ b/src/google/protobuf/compiler/cpp/parse_function_generator.cc @@ -107,30 +107,6 @@ ParseFunctionGenerator::ParseFunctionGenerator( variables_["classname"] = ClassName(descriptor, false); } -static bool ShouldGenerateInternalParse(const Descriptor* descriptor, - const Options& options) { - return HasGeneratedMethods(descriptor->file(), options) && - HasDescriptorMethods(descriptor->file(), options); -} - -void ParseFunctionGenerator::GenerateMethodDecls(io::Printer* printer) { - if (!ShouldGenerateInternalParse(descriptor_, options_)) return; - Formatter format(printer, variables_); - format( - "const char* _InternalParse(const char* ptr, " - "::$proto_ns$::internal::ParseContext* ctx) final;\n"); -} - -void ParseFunctionGenerator::GenerateMethodImpls(io::Printer* printer) { - if (!ShouldGenerateInternalParse(descriptor_, options_)) return; - printer->Emit(R"cc( - const char* $classname$::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - } - )cc"); -} - struct SkipEntry16 { uint16_t skipmap; uint16_t field_entry_offset; diff --git a/src/google/protobuf/compiler/cpp/parse_function_generator.h b/src/google/protobuf/compiler/cpp/parse_function_generator.h index ab9eb36588..d6b9dd7b48 100644 --- a/src/google/protobuf/compiler/cpp/parse_function_generator.h +++ b/src/google/protobuf/compiler/cpp/parse_function_generator.h @@ -36,12 +36,6 @@ class ParseFunctionGenerator { const absl::flat_hash_map& vars, int index_in_file_messages); - // Emits class-level method declarations to `printer`: - void GenerateMethodDecls(io::Printer* printer); - - // Emits out-of-class method implementation definitions to `printer`: - void GenerateMethodImpls(io::Printer* printer); - // Emits class-level data member declarations to `printer`: void GenerateDataDecls(io::Printer* printer); diff --git a/src/google/protobuf/compiler/java/java_features.pb.cc b/src/google/protobuf/compiler/java/java_features.pb.cc index 78d404c90c..0659158da1 100644 --- a/src/google/protobuf/compiler/java/java_features.pb.cc +++ b/src/google/protobuf/compiler/java/java_features.pb.cc @@ -187,6 +187,8 @@ JavaFeatures::GetClassData() const { &descriptor_table_google_2fprotobuf_2fcompiler_2fjava_2fjava_5ffeatures_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 @@ -246,11 +248,6 @@ PROTOBUF_NOINLINE void JavaFeatures::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* JavaFeatures::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* JavaFeatures::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { diff --git a/src/google/protobuf/compiler/java/java_features.pb.h b/src/google/protobuf/compiler/java/java_features.pb.h index 28d2f9ec37..2aaf7ab79a 100644 --- a/src/google/protobuf/compiler/java/java_features.pb.h +++ b/src/google/protobuf/compiler/java/java_features.pb.h @@ -193,7 +193,6 @@ class PROTOC_EXPORT JavaFeatures final : public ::google::protobuf::Message bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; diff --git a/src/google/protobuf/compiler/plugin.pb.cc b/src/google/protobuf/compiler/plugin.pb.cc index 7ab44b6615..31c2d05dbe 100644 --- a/src/google/protobuf/compiler/plugin.pb.cc +++ b/src/google/protobuf/compiler/plugin.pb.cc @@ -373,6 +373,8 @@ Version::GetClassData() const { &descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 @@ -450,11 +452,6 @@ PROTOBUF_NOINLINE void Version::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* Version::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* Version::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -685,6 +682,8 @@ CodeGeneratorRequest::GetClassData() const { &descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 @@ -776,11 +775,6 @@ PROTOBUF_NOINLINE void CodeGeneratorRequest::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* CodeGeneratorRequest::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* CodeGeneratorRequest::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -1033,6 +1027,8 @@ CodeGeneratorResponse_File::GetClassData() const { &descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 @@ -1119,11 +1115,6 @@ PROTOBUF_NOINLINE void CodeGeneratorResponse_File::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* CodeGeneratorResponse_File::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* CodeGeneratorResponse_File::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -1354,6 +1345,8 @@ CodeGeneratorResponse::GetClassData() const { &descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 @@ -1441,11 +1434,6 @@ PROTOBUF_NOINLINE void CodeGeneratorResponse::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* CodeGeneratorResponse::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* CodeGeneratorResponse::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { diff --git a/src/google/protobuf/compiler/plugin.pb.h b/src/google/protobuf/compiler/plugin.pb.h index 43f0af1209..684e7abb7b 100644 --- a/src/google/protobuf/compiler/plugin.pb.h +++ b/src/google/protobuf/compiler/plugin.pb.h @@ -210,7 +210,6 @@ class PROTOC_EXPORT Version final : public ::google::protobuf::Message bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -428,7 +427,6 @@ class PROTOC_EXPORT CodeGeneratorResponse_File final : public ::google::protobuf bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -662,7 +660,6 @@ class PROTOC_EXPORT CodeGeneratorResponse final : public ::google::protobuf::Mes bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -920,7 +917,6 @@ class PROTOC_EXPORT CodeGeneratorRequest final : public ::google::protobuf::Mess bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; diff --git a/src/google/protobuf/cpp_features.pb.cc b/src/google/protobuf/cpp_features.pb.cc index a5822da2aa..50bf3ed6ae 100644 --- a/src/google/protobuf/cpp_features.pb.cc +++ b/src/google/protobuf/cpp_features.pb.cc @@ -187,6 +187,8 @@ CppFeatures::GetClassData() const { &descriptor_table_google_2fprotobuf_2fcpp_5ffeatures_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 @@ -246,11 +248,6 @@ PROTOBUF_NOINLINE void CppFeatures::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* CppFeatures::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* CppFeatures::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { diff --git a/src/google/protobuf/cpp_features.pb.h b/src/google/protobuf/cpp_features.pb.h index 01b2446212..ccb8a1b7fe 100644 --- a/src/google/protobuf/cpp_features.pb.h +++ b/src/google/protobuf/cpp_features.pb.h @@ -194,7 +194,6 @@ class PROTOBUF_EXPORT CppFeatures final : public ::google::protobuf::Message bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; diff --git a/src/google/protobuf/descriptor.pb.cc b/src/google/protobuf/descriptor.pb.cc index 48d14d35f3..f9a47c0979 100644 --- a/src/google/protobuf/descriptor.pb.cc +++ b/src/google/protobuf/descriptor.pb.cc @@ -2461,6 +2461,8 @@ FileDescriptorSet::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<0, 1, 1, 0, 2> FileDescriptorSet::_table_ = { @@ -2507,11 +2509,6 @@ PROTOBUF_NOINLINE void FileDescriptorSet::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* FileDescriptorSet::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* FileDescriptorSet::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -2695,6 +2692,8 @@ FileDescriptorProto::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<4, 13, 7, 79, 2> FileDescriptorProto::_table_ = { @@ -2856,11 +2855,6 @@ PROTOBUF_NOINLINE void FileDescriptorProto::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* FileDescriptorProto::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* FileDescriptorProto::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -3270,6 +3264,8 @@ DescriptorProto_ExtensionRange::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<2, 3, 1, 0, 2> DescriptorProto_ExtensionRange::_table_ = { @@ -3339,11 +3335,6 @@ PROTOBUF_NOINLINE void DescriptorProto_ExtensionRange::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* DescriptorProto_ExtensionRange::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* DescriptorProto_ExtensionRange::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -3533,6 +3524,8 @@ DescriptorProto_ReservedRange::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<1, 2, 0, 0, 2> DescriptorProto_ReservedRange::_table_ = { @@ -3591,11 +3584,6 @@ PROTOBUF_NOINLINE void DescriptorProto_ReservedRange::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* DescriptorProto_ReservedRange::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* DescriptorProto_ReservedRange::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -3792,6 +3780,8 @@ DescriptorProto::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<4, 10, 8, 65, 2> DescriptorProto::_table_ = { @@ -3927,11 +3917,6 @@ PROTOBUF_NOINLINE void DescriptorProto::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* DescriptorProto::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* DescriptorProto::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -4285,6 +4270,8 @@ ExtensionRangeOptions_Declaration::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<3, 5, 0, 71, 2> ExtensionRangeOptions_Declaration::_table_ = { @@ -4376,11 +4363,6 @@ PROTOBUF_NOINLINE void ExtensionRangeOptions_Declaration::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* ExtensionRangeOptions_Declaration::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* ExtensionRangeOptions_Declaration::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -4619,6 +4601,8 @@ ExtensionRangeOptions::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<3, 4, 4, 0, 12> ExtensionRangeOptions::_table_ = { @@ -4702,11 +4686,6 @@ PROTOBUF_NOINLINE void ExtensionRangeOptions::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* ExtensionRangeOptions::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* ExtensionRangeOptions::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -4971,6 +4950,8 @@ FieldDescriptorProto::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<4, 11, 3, 96, 2> FieldDescriptorProto::_table_ = { @@ -5121,11 +5102,6 @@ PROTOBUF_NOINLINE void FieldDescriptorProto::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* FieldDescriptorProto::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* FieldDescriptorProto::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -5474,6 +5450,8 @@ OneofDescriptorProto::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<1, 2, 1, 49, 2> OneofDescriptorProto::_table_ = { @@ -5539,11 +5517,6 @@ PROTOBUF_NOINLINE void OneofDescriptorProto::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* OneofDescriptorProto::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* OneofDescriptorProto::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -5716,6 +5689,8 @@ EnumDescriptorProto_EnumReservedRange::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<1, 2, 0, 0, 2> EnumDescriptorProto_EnumReservedRange::_table_ = { @@ -5774,11 +5749,6 @@ PROTOBUF_NOINLINE void EnumDescriptorProto_EnumReservedRange::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* EnumDescriptorProto_EnumReservedRange::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* EnumDescriptorProto_EnumReservedRange::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -5965,6 +5935,8 @@ EnumDescriptorProto::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<3, 5, 3, 61, 2> EnumDescriptorProto::_table_ = { @@ -6057,11 +6029,6 @@ PROTOBUF_NOINLINE void EnumDescriptorProto::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* EnumDescriptorProto::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* EnumDescriptorProto::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -6311,6 +6278,8 @@ EnumValueDescriptorProto::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<2, 3, 1, 53, 2> EnumValueDescriptorProto::_table_ = { @@ -6384,11 +6353,6 @@ PROTOBUF_NOINLINE void EnumValueDescriptorProto::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* EnumValueDescriptorProto::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* EnumValueDescriptorProto::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -6600,6 +6564,8 @@ ServiceDescriptorProto::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<2, 3, 2, 51, 2> ServiceDescriptorProto::_table_ = { @@ -6674,11 +6640,6 @@ PROTOBUF_NOINLINE void ServiceDescriptorProto::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* ServiceDescriptorProto::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* ServiceDescriptorProto::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -6905,6 +6866,8 @@ MethodDescriptorProto::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<3, 6, 1, 71, 2> MethodDescriptorProto::_table_ = { @@ -7007,11 +6970,6 @@ PROTOBUF_NOINLINE void MethodDescriptorProto::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* MethodDescriptorProto::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* MethodDescriptorProto::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -7317,6 +7275,8 @@ FileOptions::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<5, 21, 3, 202, 12> FileOptions::_table_ = { @@ -7556,11 +7516,6 @@ PROTOBUF_NOINLINE void FileOptions::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* FileOptions::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* FileOptions::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -8104,6 +8059,8 @@ MessageOptions::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<3, 7, 2, 0, 7> MessageOptions::_table_ = { @@ -8198,11 +8155,6 @@ PROTOBUF_NOINLINE void MessageOptions::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* MessageOptions::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* MessageOptions::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -8477,6 +8429,8 @@ FieldOptions_EditionDefault::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<1, 2, 1, 57, 2> FieldOptions_EditionDefault::_table_ = { @@ -8537,11 +8491,6 @@ PROTOBUF_NOINLINE void FieldOptions_EditionDefault::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* FieldOptions_EditionDefault::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* FieldOptions_EditionDefault::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -8728,6 +8677,8 @@ FieldOptions_FeatureSupport::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<2, 4, 3, 71, 2> FieldOptions_FeatureSupport::_table_ = { @@ -8806,11 +8757,6 @@ PROTOBUF_NOINLINE void FieldOptions_FeatureSupport::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* FieldOptions_FeatureSupport::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* FieldOptions_FeatureSupport::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -9049,6 +8995,8 @@ FieldOptions::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<4, 14, 8, 0, 7> FieldOptions::_table_ = { @@ -9201,11 +9149,6 @@ PROTOBUF_NOINLINE void FieldOptions::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* FieldOptions::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* FieldOptions::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -9615,6 +9558,8 @@ OneofOptions::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<2, 2, 2, 0, 7> OneofOptions::_table_ = { @@ -9679,11 +9624,6 @@ PROTOBUF_NOINLINE void OneofOptions::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* OneofOptions::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* OneofOptions::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -9892,6 +9832,8 @@ EnumOptions::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<3, 5, 2, 0, 7> EnumOptions::_table_ = { @@ -9976,11 +9918,6 @@ PROTOBUF_NOINLINE void EnumOptions::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* EnumOptions::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* EnumOptions::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -10243,6 +10180,8 @@ EnumValueOptions::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<3, 4, 2, 0, 7> EnumValueOptions::_table_ = { @@ -10324,11 +10263,6 @@ PROTOBUF_NOINLINE void EnumValueOptions::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* EnumValueOptions::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* EnumValueOptions::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -10570,6 +10504,8 @@ ServiceOptions::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<2, 3, 2, 0, 12> ServiceOptions::_table_ = { @@ -10641,11 +10577,6 @@ PROTOBUF_NOINLINE void ServiceOptions::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* ServiceOptions::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* ServiceOptions::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -10878,6 +10809,8 @@ MethodOptions::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<3, 4, 3, 0, 12> MethodOptions::_table_ = { @@ -10963,11 +10896,6 @@ PROTOBUF_NOINLINE void MethodOptions::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* MethodOptions::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* MethodOptions::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -11201,6 +11129,8 @@ UninterpretedOption_NamePart::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<1, 2, 0, 62, 2> UninterpretedOption_NamePart::_table_ = { @@ -11261,11 +11191,6 @@ PROTOBUF_NOINLINE void UninterpretedOption_NamePart::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* UninterpretedOption_NamePart::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* UninterpretedOption_NamePart::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -11462,6 +11387,8 @@ UninterpretedOption::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<3, 7, 1, 75, 2> UninterpretedOption::_table_ = { @@ -11567,11 +11494,6 @@ PROTOBUF_NOINLINE void UninterpretedOption::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* UninterpretedOption::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* UninterpretedOption::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -11848,6 +11770,8 @@ FeatureSet::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<3, 6, 6, 0, 2> FeatureSet::_table_ = { @@ -11938,11 +11862,6 @@ PROTOBUF_NOINLINE void FeatureSet::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* FeatureSet::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* FeatureSet::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -12208,6 +12127,8 @@ FeatureSetDefaults_FeatureSetEditionDefault::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<2, 4, 4, 0, 2> FeatureSetDefaults_FeatureSetEditionDefault::_table_ = { @@ -12291,11 +12212,6 @@ PROTOBUF_NOINLINE void FeatureSetDefaults_FeatureSetEditionDefault::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* FeatureSetDefaults_FeatureSetEditionDefault::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* FeatureSetDefaults_FeatureSetEditionDefault::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -12539,6 +12455,8 @@ FeatureSetDefaults::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<1, 3, 3, 0, 2> FeatureSetDefaults::_table_ = { @@ -12603,11 +12521,6 @@ PROTOBUF_NOINLINE void FeatureSetDefaults::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* FeatureSetDefaults::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* FeatureSetDefaults::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -12815,6 +12728,8 @@ SourceCodeInfo_Location::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<3, 5, 0, 106, 2> SourceCodeInfo_Location::_table_ = { @@ -12905,11 +12820,6 @@ PROTOBUF_NOINLINE void SourceCodeInfo_Location::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* SourceCodeInfo_Location::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* SourceCodeInfo_Location::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -13143,6 +13053,8 @@ SourceCodeInfo::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<0, 1, 1, 0, 2> SourceCodeInfo::_table_ = { @@ -13189,11 +13101,6 @@ PROTOBUF_NOINLINE void SourceCodeInfo::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* SourceCodeInfo::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* SourceCodeInfo::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -13357,6 +13264,8 @@ GeneratedCodeInfo_Annotation::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<3, 5, 1, 64, 2> GeneratedCodeInfo_Annotation::_table_ = { @@ -13443,11 +13352,6 @@ PROTOBUF_NOINLINE void GeneratedCodeInfo_Annotation::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* GeneratedCodeInfo_Annotation::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* GeneratedCodeInfo_Annotation::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { @@ -13677,6 +13581,8 @@ GeneratedCodeInfo::GetClassData() const { &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, nullptr, // tracker }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); return _data_.base(); } constexpr ::_pbi::TcParseTable<0, 1, 1, 0, 2> GeneratedCodeInfo::_table_ = { @@ -13723,11 +13629,6 @@ PROTOBUF_NOINLINE void GeneratedCodeInfo::Clear() { _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } -const char* GeneratedCodeInfo::_InternalParse(const char* ptr, - ::_pbi::ParseContext* ctx) { - return ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); -} - ::uint8_t* GeneratedCodeInfo::_InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const { diff --git a/src/google/protobuf/descriptor.pb.h b/src/google/protobuf/descriptor.pb.h index fa269e01ba..7a377634a1 100644 --- a/src/google/protobuf/descriptor.pb.h +++ b/src/google/protobuf/descriptor.pb.h @@ -795,7 +795,6 @@ class PROTOBUF_EXPORT UninterpretedOption_NamePart final : public ::google::prot bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -987,7 +986,6 @@ class PROTOBUF_EXPORT SourceCodeInfo_Location final : public ::google::protobuf: bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -1257,7 +1255,6 @@ class PROTOBUF_EXPORT GeneratedCodeInfo_Annotation final : public ::google::prot bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -1516,7 +1513,6 @@ class PROTOBUF_EXPORT FieldOptions_FeatureSupport final : public ::google::proto bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -1734,7 +1730,6 @@ class PROTOBUF_EXPORT FieldOptions_EditionDefault final : public ::google::proto bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -1926,7 +1921,6 @@ class PROTOBUF_EXPORT FeatureSet final : public ::google::protobuf::Message bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -2465,7 +2459,6 @@ class PROTOBUF_EXPORT ExtensionRangeOptions_Declaration final : public ::google: bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -2702,7 +2695,6 @@ class PROTOBUF_EXPORT EnumDescriptorProto_EnumReservedRange final : public ::goo bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -2888,7 +2880,6 @@ class PROTOBUF_EXPORT DescriptorProto_ReservedRange final : public ::google::pro bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -3074,7 +3065,6 @@ class PROTOBUF_EXPORT UninterpretedOption final : public ::google::protobuf::Mes bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -3350,7 +3340,6 @@ class PROTOBUF_EXPORT SourceCodeInfo final : public ::google::protobuf::Message bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -3529,7 +3518,6 @@ class PROTOBUF_EXPORT GeneratedCodeInfo final : public ::google::protobuf::Messa bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -3708,7 +3696,6 @@ class PROTOBUF_EXPORT FeatureSetDefaults_FeatureSetEditionDefault final : public bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -3932,7 +3919,6 @@ class PROTOBUF_EXPORT ServiceOptions final : public ::google::protobuf::Message bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -4321,7 +4307,6 @@ class PROTOBUF_EXPORT OneofOptions final : public ::google::protobuf::Message bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -4697,7 +4682,6 @@ class PROTOBUF_EXPORT MethodOptions final : public ::google::protobuf::Message bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -5119,7 +5103,6 @@ class PROTOBUF_EXPORT MessageOptions final : public ::google::protobuf::Message bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -5560,7 +5543,6 @@ class PROTOBUF_EXPORT FileOptions final : public ::google::protobuf::Message bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -6263,7 +6245,6 @@ class PROTOBUF_EXPORT FieldOptions final : public ::google::protobuf::Message bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -6902,7 +6883,6 @@ class PROTOBUF_EXPORT FeatureSetDefaults final : public ::google::protobuf::Mess bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -7108,7 +7088,6 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final : public ::google::protobuf::M bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -7536,7 +7515,6 @@ class PROTOBUF_EXPORT EnumValueOptions final : public ::google::protobuf::Messag bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -7938,7 +7916,6 @@ class PROTOBUF_EXPORT EnumOptions final : public ::google::protobuf::Message bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -8353,7 +8330,6 @@ class PROTOBUF_EXPORT OneofDescriptorProto final : public ::google::protobuf::Me bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -8549,7 +8525,6 @@ class PROTOBUF_EXPORT MethodDescriptorProto final : public ::google::protobuf::M bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -8809,7 +8784,6 @@ class PROTOBUF_EXPORT FieldDescriptorProto final : public ::google::protobuf::Me bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -9201,7 +9175,6 @@ class PROTOBUF_EXPORT EnumValueDescriptorProto final : public ::google::protobuf bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -9410,7 +9383,6 @@ class PROTOBUF_EXPORT DescriptorProto_ExtensionRange final : public ::google::pr bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -9613,7 +9585,6 @@ class PROTOBUF_EXPORT ServiceDescriptorProto final : public ::google::protobuf:: bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -9828,7 +9799,6 @@ class PROTOBUF_EXPORT EnumDescriptorProto final : public ::google::protobuf::Mes bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -10093,7 +10063,6 @@ class PROTOBUF_EXPORT DescriptorProto final : public ::google::protobuf::Message bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -10454,7 +10423,6 @@ class PROTOBUF_EXPORT FileDescriptorProto final : public ::google::protobuf::Mes bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; @@ -10864,7 +10832,6 @@ class PROTOBUF_EXPORT FileDescriptorSet final : public ::google::protobuf::Messa bool IsInitialized() const final; ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize( ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; diff --git a/src/google/protobuf/dynamic_message.cc b/src/google/protobuf/dynamic_message.cc index 3856082889..f54815f2af 100644 --- a/src/google/protobuf/dynamic_message.cc +++ b/src/google/protobuf/dynamic_message.cc @@ -268,6 +268,7 @@ struct DynamicMessageFactory::TypeInfo { DynamicMessage::ClassDataFull class_data = { { + nullptr, // tc_table nullptr, // on_demand_register_arena_dtor PROTOBUF_FIELD_OFFSET(DynamicMessage, cached_byte_size_), false, diff --git a/src/google/protobuf/generated_message_bases.cc b/src/google/protobuf/generated_message_bases.cc index 3e453c53e9..79ff3feae1 100644 --- a/src/google/protobuf/generated_message_bases.cc +++ b/src/google/protobuf/generated_message_bases.cc @@ -38,34 +38,6 @@ size_t ZeroFieldsBase::ByteSizeLong() const { return MaybeComputeUnknownFieldsSize(0, &_impl_._cached_size_); } -const char* ZeroFieldsBase::_InternalParse(const char* ptr, - internal::ParseContext* ctx) { -#define CHK_(x) \ - if (PROTOBUF_PREDICT_FALSE(!(x))) { \ - goto failure; \ - } - - while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = internal::ReadTag(ptr, &tag); - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, _internal_metadata_.mutable_unknown_fields(), ptr, - ctx); - CHK_(ptr); - } // while -message_done: - return ptr; -failure: - ptr = nullptr; - goto message_done; -#undef CHK_ -} - ::uint8_t* ZeroFieldsBase::_InternalSerialize( ::uint8_t* target, io::EpsCopyOutputStream* stream) const { if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { diff --git a/src/google/protobuf/generated_message_bases.h b/src/google/protobuf/generated_message_bases.h index 030caab529..c4ba558b53 100644 --- a/src/google/protobuf/generated_message_bases.h +++ b/src/google/protobuf/generated_message_bases.h @@ -33,8 +33,6 @@ class PROTOBUF_EXPORT ZeroFieldsBase : public Message { bool IsInitialized() const final { return true; } size_t ByteSizeLong() const final; int GetCachedSize() const { return _impl_._cached_size_.Get(); } - const char* _InternalParse(const char* ptr, - internal::ParseContext* ctx) final; ::uint8_t* _InternalSerialize(::uint8_t* target, io::EpsCopyOutputStream* stream) const final; diff --git a/src/google/protobuf/generated_message_tctable_impl.h b/src/google/protobuf/generated_message_tctable_impl.h index 838e748501..4cd6e9582b 100644 --- a/src/google/protobuf/generated_message_tctable_impl.h +++ b/src/google/protobuf/generated_message_tctable_impl.h @@ -382,7 +382,7 @@ class PROTOBUF_EXPORT TcParser final { MessageLite* msg, const char* ptr, ParseContext* ctx, const TcParseTableBase* tc_table) { return ctx->ParseLengthDelimitedInlined(ptr, [&](const char* ptr) { - return ParseLoopInlined(msg, ptr, ctx, tc_table); + return ParseLoop(msg, ptr, ctx, tc_table); }); } @@ -390,7 +390,7 @@ class PROTOBUF_EXPORT TcParser final { MessageLite* msg, const char* ptr, ParseContext* ctx, const TcParseTableBase* tc_table, uint32_t start_tag) { return ctx->ParseGroupInlined(ptr, start_tag, [&](const char* ptr) { - return ParseLoopInlined(msg, ptr, ctx, tc_table); + return ParseLoop(msg, ptr, ctx, tc_table); }); } @@ -428,13 +428,9 @@ class PROTOBUF_EXPORT TcParser final { static const char* MessageSetWireFormatParseLoopLite( PROTOBUF_TC_PARAM_NO_DATA_DECL); - PROTOBUF_NOINLINE static const char* ParseLoop(MessageLite* msg, const char* ptr, ParseContext* ctx, const TcParseTableBase* table); - static const char* ParseLoopInlined(MessageLite* msg, const char* ptr, - ParseContext* ctx, - const TcParseTableBase* table); // Functions referenced by generated fast tables (numeric types): // F: fixed V: varint Z: zigzag @@ -993,7 +989,7 @@ inline PROTOBUF_ALWAYS_INLINE const char* TcParser::ToParseLoop( return ptr; } -inline PROTOBUF_ALWAYS_INLINE const char* TcParser::ParseLoopInlined( +inline PROTOBUF_ALWAYS_INLINE const char* TcParser::ParseLoop( MessageLite* msg, const char* ptr, ParseContext* ctx, const TcParseTableBase* table) { // Note: TagDispatch uses a dispatch table at "&table->fast_entries". diff --git a/src/google/protobuf/generated_message_tctable_lite.cc b/src/google/protobuf/generated_message_tctable_lite.cc index f8b0d87942..9db970e23f 100644 --- a/src/google/protobuf/generated_message_tctable_lite.cc +++ b/src/google/protobuf/generated_message_tctable_lite.cc @@ -73,12 +73,6 @@ const char* TcParser::GenericFallbackLite(PROTOBUF_TC_PARAM_DECL) { // Core fast parsing implementation: ////////////////////////////////////////////////////////////////////////////// -PROTOBUF_NOINLINE const char* TcParser::ParseLoop( - MessageLite* msg, const char* ptr, ParseContext* ctx, - const TcParseTableBase* table) { - return ParseLoopInlined(msg, ptr, ctx, table); -} - // On the fast path, a (matching) 1-byte tag already has the decoded value. static uint32_t FastDecodeTag(uint8_t coded_tag) { return coded_tag; @@ -369,7 +363,7 @@ inline PROTOBUF_ALWAYS_INLINE const char* TcParser::SingularParseMessageAuxImpl( field = inner_table->default_instance->New(msg->GetArena()); } const auto inner_loop = [&](const char* ptr) { - return ParseLoopInlined(field, ptr, ctx, inner_table); + return ParseLoop(field, ptr, ctx, inner_table); }; return group_coding ? ctx->ParseGroupInlined(ptr, FastDecodeTag(saved_tag), inner_loop) @@ -457,7 +451,7 @@ inline PROTOBUF_ALWAYS_INLINE const char* TcParser::RepeatedParseMessageAuxImpl( MessageLite* submsg = field.AddMessage(default_instance); if (aux_is_table) { const auto inner_loop = [&](const char* ptr) { - return ParseLoopInlined(submsg, ptr, ctx, aux.table); + return ParseLoop(submsg, ptr, ctx, aux.table); }; ptr = group_coding ? ctx->ParseGroupInlined( ptr, FastDecodeTag(expected_tag), inner_loop) diff --git a/src/google/protobuf/message_lite.cc b/src/google/protobuf/message_lite.cc index f32e929e8e..98d8a14e5f 100644 --- a/src/google/protobuf/message_lite.cc +++ b/src/google/protobuf/message_lite.cc @@ -46,22 +46,9 @@ namespace google { namespace protobuf { -const internal::TcParseTableBase* MessageLite::GetTcParseTable() const { - auto* data = GetClassData(); - ABSL_DCHECK(data != nullptr); - - auto* tc_table = data->tc_table; - if (ABSL_PREDICT_FALSE(tc_table == nullptr)) { - ABSL_DCHECK(!data->is_lite); - return data->full().descriptor_methods->get_tc_table(*this); - } - return tc_table; -} - const char* MessageLite::_InternalParse(const char* ptr, internal::ParseContext* ctx) { - return internal::TcParser::ParseLoopInlined(this, ptr, ctx, - GetTcParseTable()); + return internal::TcParser::ParseLoop(this, ptr, ctx, GetTcParseTable()); } std::string MessageLite::GetTypeName() const { @@ -169,11 +156,12 @@ namespace internal { template bool MergeFromImpl(absl::string_view input, MessageLite* msg, + const internal::TcParseTableBase* tc_table, MessageLite::ParseFlags parse_flags) { const char* ptr; internal::ParseContext ctx(io::CodedInputStream::GetDefaultRecursionLimit(), aliasing, &ptr, input); - ptr = msg->_InternalParse(ptr, &ctx); + ptr = internal::TcParser::ParseLoop(msg, ptr, &ctx, tc_table); // ctx has an explicit limit set (length of string_view). if (PROTOBUF_PREDICT_TRUE(ptr && ctx.EndedAtLimit())) { return CheckFieldPresence(ctx, *msg, parse_flags); @@ -183,11 +171,12 @@ bool MergeFromImpl(absl::string_view input, MessageLite* msg, template bool MergeFromImpl(io::ZeroCopyInputStream* input, MessageLite* msg, + const internal::TcParseTableBase* tc_table, MessageLite::ParseFlags parse_flags) { const char* ptr; internal::ParseContext ctx(io::CodedInputStream::GetDefaultRecursionLimit(), aliasing, &ptr, input); - ptr = msg->_InternalParse(ptr, &ctx); + ptr = internal::TcParser::ParseLoop(msg, ptr, &ctx, tc_table); // ctx has no explicit limit (hence we end on end of stream) if (PROTOBUF_PREDICT_TRUE(ptr && ctx.EndedAtEndOfStream())) { return CheckFieldPresence(ctx, *msg, parse_flags); @@ -197,11 +186,12 @@ bool MergeFromImpl(io::ZeroCopyInputStream* input, MessageLite* msg, template bool MergeFromImpl(BoundedZCIS input, MessageLite* msg, + const internal::TcParseTableBase* tc_table, MessageLite::ParseFlags parse_flags) { const char* ptr; internal::ParseContext ctx(io::CodedInputStream::GetDefaultRecursionLimit(), aliasing, &ptr, input.zcis, input.limit); - ptr = msg->_InternalParse(ptr, &ctx); + ptr = internal::TcParser::ParseLoop(msg, ptr, &ctx, tc_table); if (PROTOBUF_PREDICT_FALSE(!ptr)) return false; ctx.BackUp(ptr); if (PROTOBUF_PREDICT_TRUE(ctx.EndedAtLimit())) { @@ -211,18 +201,24 @@ bool MergeFromImpl(BoundedZCIS input, MessageLite* msg, } template bool MergeFromImpl(absl::string_view input, MessageLite* msg, + const internal::TcParseTableBase* tc_table, MessageLite::ParseFlags parse_flags); template bool MergeFromImpl(absl::string_view input, MessageLite* msg, + const internal::TcParseTableBase* tc_table, MessageLite::ParseFlags parse_flags); template bool MergeFromImpl(io::ZeroCopyInputStream* input, MessageLite* msg, + const internal::TcParseTableBase* tc_table, MessageLite::ParseFlags parse_flags); template bool MergeFromImpl(io::ZeroCopyInputStream* input, MessageLite* msg, + const internal::TcParseTableBase* tc_table, MessageLite::ParseFlags parse_flags); template bool MergeFromImpl(BoundedZCIS input, MessageLite* msg, + const internal::TcParseTableBase* tc_table, MessageLite::ParseFlags parse_flags); template bool MergeFromImpl(BoundedZCIS input, MessageLite* msg, + const internal::TcParseTableBase* tc_table, MessageLite::ParseFlags parse_flags); } // namespace internal @@ -267,7 +263,7 @@ bool MessageLite::MergeFromImpl(io::CodedInputStream* input, ctx.TrackCorrectEnding(); ctx.data().pool = input->GetExtensionPool(); ctx.data().factory = input->GetExtensionFactory(); - ptr = _InternalParse(ptr, &ctx); + ptr = internal::TcParser::ParseLoop(this, ptr, &ctx, GetTcParseTable()); if (PROTOBUF_PREDICT_FALSE(!ptr)) return false; ctx.BackUp(ptr); if (!ctx.EndedAtEndOfStream()) { @@ -374,13 +370,14 @@ template <> struct SourceWrapper { explicit SourceWrapper(const absl::Cord* c) : cord(c) {} template - bool MergeInto(MessageLite* msg, MessageLite::ParseFlags parse_flags) const { + bool MergeInto(MessageLite* msg, const internal::TcParseTableBase* tc_table, + MessageLite::ParseFlags parse_flags) const { absl::optional flat = cord->TryFlat(); if (flat && flat->size() <= ParseContext::kMaxCordBytesToCopy) { - return MergeFromImpl(*flat, msg, parse_flags); + return MergeFromImpl(*flat, msg, tc_table, parse_flags); } else { io::CordInputStream input(cord); - return MergeFromImpl(&input, msg, parse_flags); + return MergeFromImpl(&input, msg, tc_table, parse_flags); } } diff --git a/src/google/protobuf/message_lite.h b/src/google/protobuf/message_lite.h index 722bdf990e..fc14e810c5 100644 --- a/src/google/protobuf/message_lite.h +++ b/src/google/protobuf/message_lite.h @@ -496,8 +496,7 @@ class PROTOBUF_EXPORT MessageLite { // method.) int GetCachedSize() const; - virtual const char* _InternalParse(const char* ptr, - internal::ParseContext* ctx); + const char* _InternalParse(const char* ptr, internal::ParseContext* ctx); void OnDemandRegisterArenaDtor(Arena* arena); @@ -517,7 +516,17 @@ class PROTOBUF_EXPORT MessageLite { return static_cast(Arena::CopyConstruct(arena, &from)); } - const internal::TcParseTableBase* GetTcParseTable() const; + const internal::TcParseTableBase* GetTcParseTable() const { + auto* data = GetClassData(); + ABSL_DCHECK(data != nullptr); + + auto* tc_table = data->tc_table; + if (ABSL_PREDICT_FALSE(tc_table == nullptr)) { + ABSL_DCHECK(!data->is_lite); + return data->full().descriptor_methods->get_tc_table(*this); + } + return tc_table; + } inline explicit MessageLite(Arena* arena) : _internal_metadata_(arena) {} @@ -705,22 +714,28 @@ namespace internal { template bool MergeFromImpl(absl::string_view input, MessageLite* msg, + const internal::TcParseTableBase* tc_table, MessageLite::ParseFlags parse_flags); extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl( absl::string_view input, MessageLite* msg, + const internal::TcParseTableBase* tc_table, MessageLite::ParseFlags parse_flags); extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl( absl::string_view input, MessageLite* msg, + const internal::TcParseTableBase* tc_table, MessageLite::ParseFlags parse_flags); template bool MergeFromImpl(io::ZeroCopyInputStream* input, MessageLite* msg, + const internal::TcParseTableBase* tc_table, MessageLite::ParseFlags parse_flags); extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl( io::ZeroCopyInputStream* input, MessageLite* msg, + const internal::TcParseTableBase* tc_table, MessageLite::ParseFlags parse_flags); extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl( io::ZeroCopyInputStream* input, MessageLite* msg, + const internal::TcParseTableBase* tc_table, MessageLite::ParseFlags parse_flags); struct BoundedZCIS { @@ -730,19 +745,25 @@ struct BoundedZCIS { template bool MergeFromImpl(BoundedZCIS input, MessageLite* msg, + const internal::TcParseTableBase* tc_table, MessageLite::ParseFlags parse_flags); extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl( - BoundedZCIS input, MessageLite* msg, MessageLite::ParseFlags parse_flags); + BoundedZCIS input, MessageLite* msg, + const internal::TcParseTableBase* tc_table, + MessageLite::ParseFlags parse_flags); extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl( - BoundedZCIS input, MessageLite* msg, MessageLite::ParseFlags parse_flags); + BoundedZCIS input, MessageLite* msg, + const internal::TcParseTableBase* tc_table, + MessageLite::ParseFlags parse_flags); template struct SourceWrapper; template bool MergeFromImpl(const SourceWrapper& input, MessageLite* msg, + const internal::TcParseTableBase* tc_table, MessageLite::ParseFlags parse_flags) { - return input.template MergeInto(msg, parse_flags); + return input.template MergeInto(msg, tc_table, parse_flags); } } // namespace internal @@ -751,7 +772,9 @@ template bool MessageLite::ParseFrom(const T& input) { if (flags & kParse) Clear(); constexpr bool alias = (flags & kMergeWithAliasing) != 0; - return internal::MergeFromImpl(input, this, flags); + const internal::TcParseTableBase* tc_table; + PROTOBUF_ALWAYS_INLINE_CALL tc_table = GetTcParseTable(); + return internal::MergeFromImpl(input, this, tc_table, flags); } // =================================================================== diff --git a/src/google/protobuf/parse_context.h b/src/google/protobuf/parse_context.h index 843f5b337f..11e0b23bf7 100644 --- a/src/google/protobuf/parse_context.h +++ b/src/google/protobuf/parse_context.h @@ -24,7 +24,6 @@ #include "google/protobuf/arena.h" #include "google/protobuf/arenastring.h" #include "google/protobuf/endian.h" -#include "google/protobuf/implicit_weak_message.h" #include "google/protobuf/inlined_string_field.h" #include "google/protobuf/io/coded_stream.h" #include "google/protobuf/io/zero_copy_stream.h" @@ -507,6 +506,24 @@ class PROTOBUF_EXPORT ParseContext : public EpsCopyInputStream { uint32_t start_tag, const Func& func); + // Use a template to avoid the strong dep into TcParser. All callers will have + // the dep. + template + PROTOBUF_ALWAYS_INLINE const char* ParseMessage( + MessageLite* msg, const TcParseTableBase* tc_table, const char* ptr) { + return ParseLengthDelimitedInlined(ptr, [&](const char* ptr) { + return Parser::ParseLoop(msg, ptr, this, tc_table); + }); + } + template + PROTOBUF_ALWAYS_INLINE const char* ParseGroup( + MessageLite* msg, const TcParseTableBase* tc_table, const char* ptr, + uint32_t start_tag) { + return ParseGroupInlined(ptr, start_tag, [&](const char* ptr) { + return Parser::ParseLoop(msg, ptr, this, tc_table); + }); + } + PROTOBUF_NODISCARD PROTOBUF_NDEBUG_INLINE const char* ParseGroup( MessageLite* msg, const char* ptr, uint32_t tag) { if (--depth_ < 0) return nullptr; diff --git a/src/google/protobuf/port.h b/src/google/protobuf/port.h index 73e08a21af..803ca59984 100644 --- a/src/google/protobuf/port.h +++ b/src/google/protobuf/port.h @@ -23,6 +23,7 @@ #include "absl/base/config.h" +#include "absl/base/prefetch.h" #include "absl/meta/type_traits.h" #include "absl/strings/string_view.h" #include "absl/types/optional.h" @@ -302,6 +303,12 @@ inline PROTOBUF_ALWAYS_INLINE void TSanRead(const void*) {} inline PROTOBUF_ALWAYS_INLINE void TSanWrite(const void*) {} #endif +// This trampoline allows calling from codegen without needing a #include to +// absl. It simplifies IWYU and deps. +inline void PrefetchToLocalCache(const void* ptr) { + absl::PrefetchToLocalCache(ptr); +} + } // namespace internal } // namespace protobuf } // namespace google