Popcount instructions are widely available on most architectures. Conditioning
the codepath on __POPCNT__ limits the optimization to x86.
PiperOrigin-RevId: 543454555
- Add an empty() accessor to WeakRepeatedPtrField.
- Don't assume ShouldSplit is false for repeated fields.
- For repeated field tracker generated code, call field internal accessors instead of accessing fields by name.
PiperOrigin-RevId: 542936038
The motivation is that in the case of split repeated fields, we end up calling Arena::CreateMessage<RepeatedPtrFieldBase>, and RepeatedPtrFieldBase has a protected destructor.
PiperOrigin-RevId: 542905924
This handles the following proto2/3 differences in single parseMessage codepath that works for proto2, proto3, and editions
- Groups (proto2)
- Open (proto3) vs closed (proto2) enums, incl closed enums in unknown fields
- Extensions (proto2)
- No presence (proto3)
PiperOrigin-RevId: 542872685
This test was failing in opt mode, because without the debug checks we were
running into undefined behavior. This CL fixes the problem by making sure we
only exercise this error case in non-opt builds.
PiperOrigin-RevId: 542382472
Prevents the compiler from generating a malformed depfile if an inpout file did not lead to any meaningful generation. This is an edge case that is not exercised often.
PiperOrigin-RevId: 542354842
Adding to a temporary array of values on stack, then merging it to RepeatedField
minimizes dynamic growth of RepeatedField.
PiperOrigin-RevId: 542123764
Note that TSan validation is currently disabled, but this will prevent regressions of code depending on message sizes being the same with/without TSan mode.
PiperOrigin-RevId: 542048650
Follow-up from #12953 to update to `32.0.1` to fix an issue on windows:
https://github.com/google/guava/releases/tag/v32.0.1
The underlying issue likely does not affect protobuf as it does not appear to (directly) use the affected `Files.createTempDir` or `FileBackedOutputStream` code which was apparently broken on Windows in `32.0.0`.
Seems best to update anyway.
Closes#13099
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/13099 from chadlwilson:bump-guava-3201 30bd3f7563
PiperOrigin-RevId: 541960623
This unifies proto2 and proto3 (and later editions) implementations to incorporate performance optimizations directly referencing unsafe and caching presence field (and offset) originally added in cl/187404278 for proto2 only. This is similar to cl/539189318 which incorporates similar changes for writeFieldsInAscendingOrder().
This change also handles possible extensions for all syntaxes and clarifies when presenceFieldOffset may actually be storing cachedSizeOffset.
PiperOrigin-RevId: 541925703
They are currently unsupported. Up until now we've been generating gencode
assuming that map fields are standard message fields, and the gencode was
expecting thunks such as _serialize to exist, but they don't.
In some toolchains this becomes a linking problem.
PiperOrigin-RevId: 541572265
Using _impl_ makes this trigger on mutations of the first field in _impl_, which makes the triggering change arbitrarily based on field order. Also, if we do TSan validation using the address of a particular field, then there will be false positive data races detected in cases where that field is mutated concurrently with a call to an accessor for another field in the message.
Note that TSan validation is currently disabled so this should be a no-op.
PiperOrigin-RevId: 540978247