Joshua Haberman
80441e4eb4
Optimized binary encoder.
4 years ago
Joshua Haberman
b717575cef
Added -Wextra and -Wshorten-64-to-32 and fixed resulting errors. ( #289 )
...
* Added -Wextra and -Wshorten-64-to-32 and fixed resulting errors.
* Disable -Wshorten-32-to-64 since Kokoro is missing Clang.
* Fixed -Wextra warnings for gcc.
* Reordered UPB_UNUSED() to come after declarations.
* Added another -pedantic fix and log CC version.
* Fix compile error and conditionally run use_bazel.sh.
* Moved set -e after use_bazel.sh.
* Fixed typo in conditional.
5 years ago
Joshua Haberman
6b808a4072
Fixed all UBSan issues and added UBSan CI checks.
5 years ago
Joshua Haberman
a0ae30bd16
Remove bytes allocated measurement functions. ( #276 )
5 years ago
Joshua Haberman
aacdcf8b91
The compile is now clean of -Wshorten-64-to-32 warnings.
5 years ago
Joshua Haberman
a6c54729df
Added UPB_ASSUME(), to work around warnings when optimization is enabled:
...
upb/json/parser.rl: In function 'end_member.isra.150':
bazel-out/k8-opt/bin/upb.c:5536:13: error: 'sel' may be used uninitialized in this function [-Werror=maybe-uninitialized]
upb_func *ret = (upb_func *)h->table[s].func;
5 years ago
Joshua Haberman
7f5fe52dfa
Fixes for non-C89 code.
5 years ago
Joshua Haberman
715718d5a5
Changed endsubmsg handler to return the closure of the submessage.
...
This is a behavior change to help out PHP for the lazy wrappers
optimization.
5 years ago
Joshua Haberman
29c30e9cb3
Fixed cache to properly insert by msgdef key.
5 years ago
Joshua Haberman
ca4605b3af
Properly cache decoder methods, instead of regenerating every time.
...
This doesn't fully share bytecode. If you generate for message A
which has B as a sub-message, then generate B, B's code will be
generated twice. This could be optimized later if desired. But
this addresses the leak in PHP.
Also removed some obsolete JIT-only code.
5 years ago
Esun Kim
bc8b1a8f90
Fixed UBSAN issues
5 years ago
Esun Kim
2c3a28e411
Add -Wstrict-prototypes option
5 years ago
Joshua Haberman
cf35baa1ad
Moved macros from upb.h to port_def.inc to avoid leaking them to users. ( #160 )
...
* Use port_def.inc to prevent macros from leaking to users.
* Added helpful comments to port_def.inc/port_undef.inc.
6 years ago
Shahid
17db372267
Removing the 'byteswap.h' header which is not portable
...
Incorporating code review changes:
https://github.com/google/upb/pull/151#discussion_r257529497
6 years ago
Shahid
33cd3cfa1d
Update varint.int.h
6 years ago
Josh Haberman
b07fcde013
Fix for C++ inclusion of decoder.int.h.
6 years ago
Josh Haberman
22ad7121c2
Fixes for google3.
6 years ago
Josh Haberman
c4327e55ac
A few more fixes.
6 years ago
Josh Haberman
8980f6db5c
text_printer.h now successfully compiles.
6 years ago
Josh Haberman
c358bb42fd
A few more Google fixes.
6 years ago
Josh Haberman
76033b3a65
Correct TextPrinterPtr.
6 years ago
Joshua Haberman
315c167bed
Some more fixes for PHP.
6 years ago
Joshua Haberman
04923fc26e
Some fixes for PHP.
6 years ago
Paul Yang
c7870e0f77
Supprot FieldMask json encoding/decoding. ( #147 )
6 years ago
Joshua Haberman
84fb01ad0f
Removed the JIT. Nobody was actually using it, and table-driven should achieve 80-90% of the perf.
6 years ago
Joshua Haberman
2c26f60dbb
Added some comments and reversed upb_arena_cleanup() args.
6 years ago
Joshua Haberman
f30c7f4acb
Take sinks by value.
6 years ago
Joshua Haberman
1508648f30
Build & fix the JIT.
6 years ago
Joshua Haberman
754b9f1cfd
All tests pass again!
6 years ago
Joshua Haberman
cb26d883d1
WIP.
6 years ago
Joshua Haberman
48863ea0be
A lot more tests are working now.
6 years ago
Joshua Haberman
d2f9bec5c6
Removed old-style C++ handlers that relied on UB in favor of more normal ones.
6 years ago
Joshua Haberman
0553eff64a
upb_refcounted is gone! Some tests still to fix.
6 years ago
Joshua Haberman
336402b4d7
WIP, core library compiles now.
6 years ago
Josh Haberman
b79fd65a83
WIP.
6 years ago
Bo Yang
0a9681874e
Modify TODO
7 years ago
Bo Yang
1e1c54f772
Change parameter type from enum opcode to int.
...
If the compiler elects to represent enum E as a char rather than an int
(per 6.7.2.2p4), the call to va_start() will have undefined behavior.
7 years ago
Joshua Haberman
0776f64830
Fixed JIT for unknown fields. ( #1 )
7 years ago
Bo Yang
dd77460c65
Do not expose encode_unknown
7 years ago
Bo Yang
69dee545ec
Remove upb_pb_encoder_encode_unknown
7 years ago
Bo Yang
6a6e192375
Remove unused declaration.
7 years ago
Bo Yang
5aa27d91c6
Use upb_sink_putunknown for reserve unknown
7 years ago
Bo Yang
dc9d15084f
Remove upb_addunknown_handlerfunc and upb_handlers_setaddunknown
7 years ago
Bo Yang
0b7904e18c
Reserve unknown fields in upb
...
1. For decoding, an unknownfields will be lazily created on message,
which contains bytes of unknown fields.
2. For encoding, if the unknownfields is present on message, all bytes
contained in it will be serialized.
7 years ago
Joshua Haberman
be9094d91a
New encode/decode: most (171 / 192) conformance tests pass.
8 years ago
Josh Haberman
c909a7aa6e
Deleted some dead code related to varint decoding.
8 years ago
Bo Yang
0168f28daf
Bug fix: When encoding, negative int32 values should be padded to int64 in order to be wire compatible
8 years ago
Josh Haberman
c850bc0a4e
Moved upb_symtab to def.h/def.c.
...
This is in anticipation of removing refcounting and
making upb_symtab (soon to be upb_defpool) the unique
owner of all defs inside.
8 years ago
Josh Haberman
ff99b3f46b
Fixed some bugs surfaced by Travis.
8 years ago
Joshua Haberman
fa338b70a6
Added UPB_ASSERT() that helps avoid unused var warnings.
...
* Added UPB_ASSERT() that helps avoid unused var warnings.
* Addressed PR comments.
* Fixed assert in the JIT.
9 years ago