Descriptor was relying on the Root for the runtime check, but since the Root is
only startup up when needed, add the debug runtime check to the cases where the
Root isn't started up.
EnumDescriptors are normally started up by fields, but a developer could
directly call the public apis, so add the debug runtime check for safety sake.
PiperOrigin-RevId: 506062884
The root class only needs to be started up if the message scopes extensions.
This updates the startup flows so the root is only started when the message
scopes extensions and thus the runtime requires that startup.
Bump the generated source version to account for the new initializer that
doesn't take the rootClass argument.
Fix typo while at it.
PiperOrigin-RevId: 504899046
1) Move the check for invalid varint outside handling a >= 32 bit varint. This gives a modest speedup (+0.5%) on the [fleetbench protogen benchmark](https://github.com/google/fleetbench/tree/main/fleetbench/proto) by working around an LLVM issue which inserted a redundant branch.
2) Move ValueBarrier() to parse_context.h so we can delete ForceToRegister(), which does the same thing as the single value ValueBarrier() implementation.
PiperOrigin-RevId: 504883550
This deletes our old branches of internal Abseil code in favor of their newly open-sourced library. Notably, this removes the ability to turn CHECK crashes into exceptions.
PiperOrigin-RevId: 504460562
Can result in a small reduction in binary size as well as slight performance
improvement during serialization since it is less subcalls for writing out any
extensions in the ranges.
PiperOrigin-RevId: 504272482
Currently RepeatedField allocates and constructs all elements on 'Reserve'. This creates inefficiencies, but more problematically, leads to sanitizer issues once we have instances that actively poison their private contents such as Cord. This change fixes RepeatedField to only create actually 'live' elements.
PiperOrigin-RevId: 504121827
Since dead stripping is completely safe with C symbols and enums only generate C
functions, stick them all in one file to slightly reduce the potential cost of
multi file generation.
PiperOrigin-RevId: 503484196
We will continue to support the deprecated versions for the time being, but users should migrate to the string_view alternatives.
PiperOrigin-RevId: 503233401