1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: protos/perfetto/config/chrome/v8_config.proto
3 
4 #include "protos/perfetto/config/chrome/v8_config.pb.h"
5 
6 #include <algorithm>
7 #include <cstdint>
8 
9 #include <google/protobuf/io/coded_stream.h>
10 #include <google/protobuf/extension_set.h>
11 #include <google/protobuf/wire_format_lite.h>
12 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
13 // @@protoc_insertion_point(includes)
14 #include <google/protobuf/port_def.inc>
15 
16 PROTOBUF_PRAGMA_INIT_SEG
17 
18 namespace _pb = ::PROTOBUF_NAMESPACE_ID;
19 namespace _pbi = _pb::internal;
20 
21 namespace perfetto {
22 namespace protos {
V8Config(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR V8Config::V8Config(
24     ::_pbi::ConstantInitialized): _impl_{
25     /*decltype(_impl_._has_bits_)*/{}
26   , /*decltype(_impl_._cached_size_)*/{}
27   , /*decltype(_impl_.log_script_sources_)*/false
28   , /*decltype(_impl_.log_instructions_)*/false} {}
29 struct V8ConfigDefaultTypeInternal {
V8ConfigDefaultTypeInternalperfetto::protos::V8ConfigDefaultTypeInternal30   PROTOBUF_CONSTEXPR V8ConfigDefaultTypeInternal()
31       : _instance(::_pbi::ConstantInitialized{}) {}
~V8ConfigDefaultTypeInternalperfetto::protos::V8ConfigDefaultTypeInternal32   ~V8ConfigDefaultTypeInternal() {}
33   union {  // NOLINT(misc-non-private-member-variables-in-classes)
34     V8Config _instance;
35   };
36 };
37 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 V8ConfigDefaultTypeInternal _V8Config_default_instance_;
38 }  // namespace protos
39 }  // namespace perfetto
40 namespace perfetto {
41 namespace protos {
42 
43 // ===================================================================
44 
45 class V8Config::_Internal {
46  public:
47   using HasBits = decltype(std::declval<V8Config>()._impl_._has_bits_);
set_has_log_script_sources(HasBits * has_bits)48   static void set_has_log_script_sources(HasBits* has_bits) {
49     (*has_bits)[0] |= 1u;
50   }
set_has_log_instructions(HasBits * has_bits)51   static void set_has_log_instructions(HasBits* has_bits) {
52     (*has_bits)[0] |= 2u;
53   }
54 };
55 
V8Config(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)56 V8Config::V8Config(::PROTOBUF_NAMESPACE_ID::Arena* arena,
57                          bool is_message_owned)
58   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
59   SharedCtor(arena, is_message_owned);
60   // @@protoc_insertion_point(arena_constructor:perfetto.protos.V8Config)
61 }
V8Config(const V8Config & from)62 V8Config::V8Config(const V8Config& from)
63   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
64   V8Config* const _this = this; (void)_this;
65   new (&_impl_) Impl_{
66       decltype(_impl_._has_bits_){from._impl_._has_bits_}
67     , /*decltype(_impl_._cached_size_)*/{}
68     , decltype(_impl_.log_script_sources_){}
69     , decltype(_impl_.log_instructions_){}};
70 
71   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
72   ::memcpy(&_impl_.log_script_sources_, &from._impl_.log_script_sources_,
73     static_cast<size_t>(reinterpret_cast<char*>(&_impl_.log_instructions_) -
74     reinterpret_cast<char*>(&_impl_.log_script_sources_)) + sizeof(_impl_.log_instructions_));
75   // @@protoc_insertion_point(copy_constructor:perfetto.protos.V8Config)
76 }
77 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)78 inline void V8Config::SharedCtor(
79     ::_pb::Arena* arena, bool is_message_owned) {
80   (void)arena;
81   (void)is_message_owned;
82   new (&_impl_) Impl_{
83       decltype(_impl_._has_bits_){}
84     , /*decltype(_impl_._cached_size_)*/{}
85     , decltype(_impl_.log_script_sources_){false}
86     , decltype(_impl_.log_instructions_){false}
87   };
88 }
89 
~V8Config()90 V8Config::~V8Config() {
91   // @@protoc_insertion_point(destructor:perfetto.protos.V8Config)
92   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
93   (void)arena;
94     return;
95   }
96   SharedDtor();
97 }
98 
SharedDtor()99 inline void V8Config::SharedDtor() {
100   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
101 }
102 
SetCachedSize(int size) const103 void V8Config::SetCachedSize(int size) const {
104   _impl_._cached_size_.Set(size);
105 }
106 
Clear()107 void V8Config::Clear() {
108 // @@protoc_insertion_point(message_clear_start:perfetto.protos.V8Config)
109   ::uint32_t cached_has_bits = 0;
110   // Prevent compiler warnings about cached_has_bits being unused
111   (void) cached_has_bits;
112 
113   ::memset(&_impl_.log_script_sources_, 0, static_cast<size_t>(
114       reinterpret_cast<char*>(&_impl_.log_instructions_) -
115       reinterpret_cast<char*>(&_impl_.log_script_sources_)) + sizeof(_impl_.log_instructions_));
116   _impl_._has_bits_.Clear();
117   _internal_metadata_.Clear<std::string>();
118 }
119 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)120 const char* V8Config::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
121 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
122   _Internal::HasBits has_bits{};
123   while (!ctx->Done(&ptr)) {
124     ::uint32_t tag;
125     ptr = ::_pbi::ReadTag(ptr, &tag);
126     switch (tag >> 3) {
127       // optional bool log_script_sources = 1;
128       case 1:
129         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
130           _Internal::set_has_log_script_sources(&has_bits);
131           _impl_.log_script_sources_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
132           CHK_(ptr);
133         } else {
134           goto handle_unusual;
135         }
136         continue;
137       // optional bool log_instructions = 2;
138       case 2:
139         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
140           _Internal::set_has_log_instructions(&has_bits);
141           _impl_.log_instructions_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
142           CHK_(ptr);
143         } else {
144           goto handle_unusual;
145         }
146         continue;
147       default:
148         goto handle_unusual;
149     }  // switch
150   handle_unusual:
151     if ((tag == 0) || ((tag & 7) == 4)) {
152       CHK_(ptr);
153       ctx->SetLastTag(tag);
154       goto message_done;
155     }
156     ptr = UnknownFieldParse(
157         tag,
158         _internal_metadata_.mutable_unknown_fields<std::string>(),
159         ptr, ctx);
160     CHK_(ptr != nullptr);
161   }  // while
162 message_done:
163   _impl_._has_bits_.Or(has_bits);
164   return ptr;
165 failure:
166   ptr = nullptr;
167   goto message_done;
168 #undef CHK_
169 }
170 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const171 ::uint8_t* V8Config::_InternalSerialize(
172     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
173   // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.V8Config)
174   ::uint32_t cached_has_bits = 0;
175   (void) cached_has_bits;
176 
177   cached_has_bits = _impl_._has_bits_[0];
178   // optional bool log_script_sources = 1;
179   if (cached_has_bits & 0x00000001u) {
180     target = stream->EnsureSpace(target);
181     target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_log_script_sources(), target);
182   }
183 
184   // optional bool log_instructions = 2;
185   if (cached_has_bits & 0x00000002u) {
186     target = stream->EnsureSpace(target);
187     target = ::_pbi::WireFormatLite::WriteBoolToArray(2, this->_internal_log_instructions(), target);
188   }
189 
190   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
191     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
192         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
193   }
194   // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.V8Config)
195   return target;
196 }
197 
ByteSizeLong() const198 size_t V8Config::ByteSizeLong() const {
199 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.V8Config)
200   size_t total_size = 0;
201 
202   ::uint32_t cached_has_bits = 0;
203   // Prevent compiler warnings about cached_has_bits being unused
204   (void) cached_has_bits;
205 
206   cached_has_bits = _impl_._has_bits_[0];
207   if (cached_has_bits & 0x00000003u) {
208     // optional bool log_script_sources = 1;
209     if (cached_has_bits & 0x00000001u) {
210       total_size += 1 + 1;
211     }
212 
213     // optional bool log_instructions = 2;
214     if (cached_has_bits & 0x00000002u) {
215       total_size += 1 + 1;
216     }
217 
218   }
219   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
220     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
221   }
222   int cached_size = ::_pbi::ToCachedSize(total_size);
223   SetCachedSize(cached_size);
224   return total_size;
225 }
226 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)227 void V8Config::CheckTypeAndMergeFrom(
228     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
229   MergeFrom(*::_pbi::DownCast<const V8Config*>(
230       &from));
231 }
232 
MergeFrom(const V8Config & from)233 void V8Config::MergeFrom(const V8Config& from) {
234   V8Config* const _this = this;
235   // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.V8Config)
236   GOOGLE_DCHECK_NE(&from, _this);
237   ::uint32_t cached_has_bits = 0;
238   (void) cached_has_bits;
239 
240   cached_has_bits = from._impl_._has_bits_[0];
241   if (cached_has_bits & 0x00000003u) {
242     if (cached_has_bits & 0x00000001u) {
243       _this->_impl_.log_script_sources_ = from._impl_.log_script_sources_;
244     }
245     if (cached_has_bits & 0x00000002u) {
246       _this->_impl_.log_instructions_ = from._impl_.log_instructions_;
247     }
248     _this->_impl_._has_bits_[0] |= cached_has_bits;
249   }
250   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
251 }
252 
CopyFrom(const V8Config & from)253 void V8Config::CopyFrom(const V8Config& from) {
254 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.V8Config)
255   if (&from == this) return;
256   Clear();
257   MergeFrom(from);
258 }
259 
IsInitialized() const260 bool V8Config::IsInitialized() const {
261   return true;
262 }
263 
InternalSwap(V8Config * other)264 void V8Config::InternalSwap(V8Config* other) {
265   using std::swap;
266   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
267   swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
268   ::PROTOBUF_NAMESPACE_ID::internal::memswap<
269       PROTOBUF_FIELD_OFFSET(V8Config, _impl_.log_instructions_)
270       + sizeof(V8Config::_impl_.log_instructions_)  // NOLINT
271       - PROTOBUF_FIELD_OFFSET(V8Config, _impl_.log_script_sources_)>(
272           reinterpret_cast<char*>(&_impl_.log_script_sources_),
273           reinterpret_cast<char*>(&other->_impl_.log_script_sources_));
274 }
275 
GetTypeName() const276 std::string V8Config::GetTypeName() const {
277   return "perfetto.protos.V8Config";
278 }
279 
280 
281 // @@protoc_insertion_point(namespace_scope)
282 }  // namespace protos
283 }  // namespace perfetto
284 PROTOBUF_NAMESPACE_OPEN
285 template<> PROTOBUF_NOINLINE ::perfetto::protos::V8Config*
CreateMaybeMessage(Arena * arena)286 Arena::CreateMaybeMessage< ::perfetto::protos::V8Config >(Arena* arena) {
287   return Arena::CreateMessageInternal< ::perfetto::protos::V8Config >(arena);
288 }
289 PROTOBUF_NAMESPACE_CLOSE
290 
291 // @@protoc_insertion_point(global_scope)
292 #include <google/protobuf/port_undef.inc>
293