A couple weeks ago we moved upb into the protobuf Git repo, and this change
continues the merger of the two repos by making them into a single Bazel repo.
This was mostly a matter of deleting upb's WORKSPACE file and fixing up a bunch
of references to reflect the new structure.
Most of the changes are pretty mechanical, but one thing that needed more
invasive changes was the Python script for generating CMakeLists.txt,
make_cmakelists.py. The WORKSPACE file it relied on no longer exists with this
change, so I updated it to hardcode the information it needed from that file.
PiperOrigin-RevId: 564810016
$Msg$View is incorrect, we need to actually invoke the getter_thunks. We'll use void* to get us off to the races.
Sprinkled in TODOs as appropriate; and we'll tackle imports in another CL. For now, its important to return the actual raw message, and that's what this CL does for our base uses.
PiperOrigin-RevId: 564785201
This allows the compiler to statically detect use-after-free bugs.
This change touches a subset of field types. More changes to follow.
PiperOrigin-RevId: 564777204
virtual functions to reduce binary size and code duplication.
In this same change we replace `OnDemandRegisterArenaDtor` with an entry on the
table to keep the number of virtual functions in `MessageLite` the same to
avoid growth in space constrained systems. We will migrate other functions in
future changes.
PiperOrigin-RevId: 564706001
ThreadSafeArena::ThreadCache does not need to be aligned.
If anything, the alignment increases TLS and working set size.
Unalign it.
PiperOrigin-RevId: 564615625
The current Kotlin code generator creates code which fails to compile with imports like:
```
syntax = "proto3";
package net.example.v1;
message Sample {
string net = 1;
}
```
This results in a condition where 'net' is ambiguous in some cases (could refer to the field or the package). To avoid these issues, the code generator should enclose package paths in backticks:
```
net.example.v1.SampleKt => `net.example.v1`.SampleKt
```
Fixes#13182.
Closes#13310
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/13310 from pkwarren:pkw/issue-13182 3f72b2f1e1
PiperOrigin-RevId: 564481691
Currently the generated code contains 2 loads of ptr_ b/c it's an atomic:
one in HasSize and one in AllocateFromExisting.
Combine these to be a single load.
name old cpu/op new cpu/op delta
BM_ArenaAlloc/100 250ns ± 2% 229ns ± 1% -8.20% (p=0.000 n=54+47)
BM_ArenaAllocWithCleanup/100 865ns ± 1% 812ns ± 2% -6.15% (p=0.000 n=57+56)
PiperOrigin-RevId: 563698727
we can just hardcode that logic in `Message::CopyFrom`.
Also, move the implementation of `GetClassData` to the base class for zero field messages.
PiperOrigin-RevId: 563434532
This can be used by non-C++ runtimes and generators to seed feature resolution. The output binary proto message will contain a mapping from edition to the default feature set, including whichever generator feature extensions are passed to protoc.
PiperOrigin-RevId: 563246376
- Check that the maximum edition is always after the minimum
- Make sure that the minimum edition gets included in the default mapping when it's necessary
PiperOrigin-RevId: 563236159
The edition specification in proto files will remain unchanged, but it will be immediately converted to an enum by the parser. This gives us more control over the valid set of editions and simplifies ordering (just an integer comparison now). We plan to release exactly one edition per year.
PiperOrigin-RevId: 563215992
This changes the code to use explicit constructors instead of aggregate initialization, which allows optimizations when creating and copying messages.
PiperOrigin-RevId: 563088162