The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#) https://grpc.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1727 lines
58 KiB

Upb upgrade to the lastest (#26869) * Squashed 'third_party/upb/' changes from 60607da72e..2de300726a 2de300726a Merge pull request #401 from philwo/patch-1 0010bd88ff Merge pull request #403 from haberman/google-wyhash 3f7ecfe315 A few fixes in the 32-bit fallback. 2c14e2788d Added #include for Windows instrinsic. 9e618009ec Removed some extraneous whitespace. c4744c0b21 Updated generated files. 039975556d Merge branch 'master' into google-wyhash ff9d011f12 Merge pull request #402 from haberman/update-ads-benchmark c2f2e93990 Fix Bazel at 4.1.0 41bfbca375 Updated ads benchmark to v7 as v5 no longer exists upstream. 91d506ac32 Ported ABSL's wyhash to C. 3328f06117 Remove ubuntu1604 from presubmit.yml f925acf5f0 Merge pull request #400 from haberman/extreg 897bd2500a Fixed compile error. 6e53de4a03 Addressed PR comments. cdd6434a31 Introduced upb_extreg and plumbed it into decoder. 69f186bd75 Merge pull request #399 from haberman/msg-extrep 3f8aa6ef20 Define the extension representation in messages and mini-tables. 4ccfab154b Merge pull request #398 from haberman/field-mode 58e158c6fa Changed mini-table to use a custom "mode" instead of descriptor's "label." 7596fa740f Merge pull request #397 from haberman/codegen-refactor fa4dfc2baa Addressed PR comments. 0fb61eaeb5 Refactored the codegen into smaller functions, in anticipation of extensions. 52be845c39 Merge pull request #396 from haberman/pre-ext-opt 807e7fe9e2 Fixed dense_below logic to be order-independent and consistent between def.c and codegen. 2e8a122fc0 Changed dense_below calculation to use UINT8_MAX as the constant. 6394894b6e Addressed PR comments. 65d7b8ab0c Optimized decoder and paved the way for parsing extensions. 3e035cb553 Merge pull request #395 from haberman/locale e8ba2a1899 Added a fix for locales that output ',' as decimal separator. 7010a73828 Merge pull request #394 from haberman/file-uniqueness 9482957425 Enforce that filenames are unique when loaded into symtab. aaad7801bf Merge pull request #393 from haberman/has-attribute 7887dc0c76 Fixed the __has_attribute() check for old versions of Clang. 01e7436ed3 Merge pull request #390 from haberman/musttail 4132034634 Addressed PR comment. ed708fcd5d Addressed PR comments. 876abae2db Removed some debug printing and simplified checktag slightly. 286441afa7 Fixed a size regression due to inlining UTF-8 verification. 75df4cdaa3 Loosened the check for fasttable to match what we did before. e84793dd73 Cleaned up debugging artifacts. a4b35aa388 Everything passes except 4 conformance tests. 6e10b5789d Removed redundant license from port_def in amalgmation. 4f1e48ecc6 Updated amalgamator to avoid duplicating license blocks. 0723bfa700 Merge pull request #387 from haberman/json-null dda5416569 Update bazel-skylib main branch name. 2fa52e6951 Merge branch 'master' into json-null a3126b7c7e Merge pull request #388 from haberman/fix-macos b344a6c582 Fixed the macOS build for XCode 11.3. a778f2639a Only perform multiple oneof check for non-null fields. 42bdfcb849 Fix BUILD file. 75d6dab37a Merge pull request #384 from haberman/internal 3881393907 Renamed .int.h to _internal.h, for greater clarity. 5084cbe646 Merge pull request #383 from fowles/master da4b75b979 Fix build rules for more restrive deps checks a8f9cf54cf Merge pull request #382 from haberman/license-headers 1ba446ccfe Updated Google, Inc. to Google LLC. 823eb09694 Update all 2011 dates to 2021. ff89277ef0 Merge pull request #380 from fowles/master 5f74d43cf9 Re-add some comment text that was accidentally removed. 0f27b0450a Merge branch 'master' into license-headers e59d2c8fa7 Added license headers to all files. be4f64b926 Merge pull request #381 from haberman/mv-msg-public 1674f28dd7 Put public message interface into msg.h and moved internal functions to msg.int.h. 6481f6319e Spell out deps explicitly f104225a1e Merge pull request #376 from haberman/fix-quadratic-mem 3c3799498d Merge pull request #379 from fowles/master 2e83d5c98f Remove unused file test_util.h b053fa6991 Merge pull request #378 from fowles/master 7876639e50 remove unused macro 5b97df91dd Restrict fuse to matching block_alloc e74d6c23de Small renames and use uintptr_t instead of void* d9a0c58108 Allow arena fuse to fail 53f5d9f69b Merge pull request #377 from haberman/json-parse-null 8370818143 Switch to a macro to avoid signed/const mismatches. 63ad3db980 Fixed "NULL + 0" UB in JSON encoder and decoder. add9b12f18 Fixed quadratic memory usage in upb_array_append(). 97e2aeb7ee Merge pull request #375 from haberman/cleanups 83c0edbd2a A few minor cleanups. baa7fe7473 Merge pull request #374 from haberman/update-deps 900bd5c426 Merge pull request #355 from haberman/aarch64 89df647460 Updated versions of ABSL and protobuf deps. e4343f0fa3 Update comment for ARM64. 103d51f102 Merge branch 'master' into aarch64 1b9cc09f0e Removed extraneous copybara directive. bbd817fdb6 Merge pull request #373 from haberman/table-cleanup c358829c76 Now that handlers are gone, cleaned up table to use arenas exclusively. ed5b4108e0 Merge pull request #363 from haberman/delete-handlers bfa528f0ae Merge pull request #372 from haberman/errmsg-fix ec9ba3f893 Fixed error message buffer overflow. eb0fdda14b Merge pull request #371 from haberman/json-any e58f7a0284 Fix for Any messages with no fields. 7541ba0f38 Merge pull request #364 from catenacyber/cifuzz 81829bacc3 Removed quote chars from error message. 88ed8f5d3b Changed JSON decoding error message to be more clear. f41c0ec261 Added an internal API to get arena from symtab, for Ruby's use. b080659eee Merge pull request #367 from haberman/timestamp-minute-offset f7ed1f27a3 Support non-zero minutes in the timestamp offset for JSON. 451dcbbb9a Adds CIFuzz f5d2d55007 Deleted the legacy "Handlers" APIs. upb can finally be deserving of its name. 0f40d59258 Merge pull request #362 from haberman/rb-warnings c7787cbaa1 Fixed a bunch of Clang warnings. 5e53b5bb3d Merge pull request #360 from haberman/default-msgval 7a6e647be1 Merge branch 'master' into default-msgval edb0a9a2d9 Merge pull request #361 from haberman/arena-bugfix 9175989431 Bugfix for arena cleanup list when passing to upb_decode(). 5e550e88f8 Added API for getting fielddef default as a upb_msgval. de76b31f9c Merge pull request #359 from veblush/fix-upbdefs 3cab8a38fc Fixed upbdefs error 48bb3e5662 Merge pull request #357 from veblush/string-opt 4c67b2086b Merge pull request #358 from veblush/clang-tidy-fix 38b4beed6b Fix clang-tidy function 'upb_encode_ex' has a definition with different parameter names 9b020d8f65 Optimize calls to std::string::find() and friends for a single char. 3c9ae7837a The fasttable parser works on ARM64! git-subtree-dir: third_party/upb git-subtree-split: 2de300726a1ba2de9a468468dc5ff9ed17a3215f * Updated upb for bazel * Regen upb files * Updated src/upb/gen_build_yaml.py
3 years ago
// Copyright (c) 2009-2021, Google LLC
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of Google LLC nor the
// names of its contributors may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
Upb upgrade to the lastest (#26869) * Squashed 'third_party/upb/' changes from 60607da72e..2de300726a 2de300726a Merge pull request #401 from philwo/patch-1 0010bd88ff Merge pull request #403 from haberman/google-wyhash 3f7ecfe315 A few fixes in the 32-bit fallback. 2c14e2788d Added #include for Windows instrinsic. 9e618009ec Removed some extraneous whitespace. c4744c0b21 Updated generated files. 039975556d Merge branch 'master' into google-wyhash ff9d011f12 Merge pull request #402 from haberman/update-ads-benchmark c2f2e93990 Fix Bazel at 4.1.0 41bfbca375 Updated ads benchmark to v7 as v5 no longer exists upstream. 91d506ac32 Ported ABSL's wyhash to C. 3328f06117 Remove ubuntu1604 from presubmit.yml f925acf5f0 Merge pull request #400 from haberman/extreg 897bd2500a Fixed compile error. 6e53de4a03 Addressed PR comments. cdd6434a31 Introduced upb_extreg and plumbed it into decoder. 69f186bd75 Merge pull request #399 from haberman/msg-extrep 3f8aa6ef20 Define the extension representation in messages and mini-tables. 4ccfab154b Merge pull request #398 from haberman/field-mode 58e158c6fa Changed mini-table to use a custom "mode" instead of descriptor's "label." 7596fa740f Merge pull request #397 from haberman/codegen-refactor fa4dfc2baa Addressed PR comments. 0fb61eaeb5 Refactored the codegen into smaller functions, in anticipation of extensions. 52be845c39 Merge pull request #396 from haberman/pre-ext-opt 807e7fe9e2 Fixed dense_below logic to be order-independent and consistent between def.c and codegen. 2e8a122fc0 Changed dense_below calculation to use UINT8_MAX as the constant. 6394894b6e Addressed PR comments. 65d7b8ab0c Optimized decoder and paved the way for parsing extensions. 3e035cb553 Merge pull request #395 from haberman/locale e8ba2a1899 Added a fix for locales that output ',' as decimal separator. 7010a73828 Merge pull request #394 from haberman/file-uniqueness 9482957425 Enforce that filenames are unique when loaded into symtab. aaad7801bf Merge pull request #393 from haberman/has-attribute 7887dc0c76 Fixed the __has_attribute() check for old versions of Clang. 01e7436ed3 Merge pull request #390 from haberman/musttail 4132034634 Addressed PR comment. ed708fcd5d Addressed PR comments. 876abae2db Removed some debug printing and simplified checktag slightly. 286441afa7 Fixed a size regression due to inlining UTF-8 verification. 75df4cdaa3 Loosened the check for fasttable to match what we did before. e84793dd73 Cleaned up debugging artifacts. a4b35aa388 Everything passes except 4 conformance tests. 6e10b5789d Removed redundant license from port_def in amalgmation. 4f1e48ecc6 Updated amalgamator to avoid duplicating license blocks. 0723bfa700 Merge pull request #387 from haberman/json-null dda5416569 Update bazel-skylib main branch name. 2fa52e6951 Merge branch 'master' into json-null a3126b7c7e Merge pull request #388 from haberman/fix-macos b344a6c582 Fixed the macOS build for XCode 11.3. a778f2639a Only perform multiple oneof check for non-null fields. 42bdfcb849 Fix BUILD file. 75d6dab37a Merge pull request #384 from haberman/internal 3881393907 Renamed .int.h to _internal.h, for greater clarity. 5084cbe646 Merge pull request #383 from fowles/master da4b75b979 Fix build rules for more restrive deps checks a8f9cf54cf Merge pull request #382 from haberman/license-headers 1ba446ccfe Updated Google, Inc. to Google LLC. 823eb09694 Update all 2011 dates to 2021. ff89277ef0 Merge pull request #380 from fowles/master 5f74d43cf9 Re-add some comment text that was accidentally removed. 0f27b0450a Merge branch 'master' into license-headers e59d2c8fa7 Added license headers to all files. be4f64b926 Merge pull request #381 from haberman/mv-msg-public 1674f28dd7 Put public message interface into msg.h and moved internal functions to msg.int.h. 6481f6319e Spell out deps explicitly f104225a1e Merge pull request #376 from haberman/fix-quadratic-mem 3c3799498d Merge pull request #379 from fowles/master 2e83d5c98f Remove unused file test_util.h b053fa6991 Merge pull request #378 from fowles/master 7876639e50 remove unused macro 5b97df91dd Restrict fuse to matching block_alloc e74d6c23de Small renames and use uintptr_t instead of void* d9a0c58108 Allow arena fuse to fail 53f5d9f69b Merge pull request #377 from haberman/json-parse-null 8370818143 Switch to a macro to avoid signed/const mismatches. 63ad3db980 Fixed "NULL + 0" UB in JSON encoder and decoder. add9b12f18 Fixed quadratic memory usage in upb_array_append(). 97e2aeb7ee Merge pull request #375 from haberman/cleanups 83c0edbd2a A few minor cleanups. baa7fe7473 Merge pull request #374 from haberman/update-deps 900bd5c426 Merge pull request #355 from haberman/aarch64 89df647460 Updated versions of ABSL and protobuf deps. e4343f0fa3 Update comment for ARM64. 103d51f102 Merge branch 'master' into aarch64 1b9cc09f0e Removed extraneous copybara directive. bbd817fdb6 Merge pull request #373 from haberman/table-cleanup c358829c76 Now that handlers are gone, cleaned up table to use arenas exclusively. ed5b4108e0 Merge pull request #363 from haberman/delete-handlers bfa528f0ae Merge pull request #372 from haberman/errmsg-fix ec9ba3f893 Fixed error message buffer overflow. eb0fdda14b Merge pull request #371 from haberman/json-any e58f7a0284 Fix for Any messages with no fields. 7541ba0f38 Merge pull request #364 from catenacyber/cifuzz 81829bacc3 Removed quote chars from error message. 88ed8f5d3b Changed JSON decoding error message to be more clear. f41c0ec261 Added an internal API to get arena from symtab, for Ruby's use. b080659eee Merge pull request #367 from haberman/timestamp-minute-offset f7ed1f27a3 Support non-zero minutes in the timestamp offset for JSON. 451dcbbb9a Adds CIFuzz f5d2d55007 Deleted the legacy "Handlers" APIs. upb can finally be deserving of its name. 0f40d59258 Merge pull request #362 from haberman/rb-warnings c7787cbaa1 Fixed a bunch of Clang warnings. 5e53b5bb3d Merge pull request #360 from haberman/default-msgval 7a6e647be1 Merge branch 'master' into default-msgval edb0a9a2d9 Merge pull request #361 from haberman/arena-bugfix 9175989431 Bugfix for arena cleanup list when passing to upb_decode(). 5e550e88f8 Added API for getting fielddef default as a upb_msgval. de76b31f9c Merge pull request #359 from veblush/fix-upbdefs 3cab8a38fc Fixed upbdefs error 48bb3e5662 Merge pull request #357 from veblush/string-opt 4c67b2086b Merge pull request #358 from veblush/clang-tidy-fix 38b4beed6b Fix clang-tidy function 'upb_encode_ex' has a definition with different parameter names 9b020d8f65 Optimize calls to std::string::find() and friends for a single char. 3c9ae7837a The fasttable parser works on ARM64! git-subtree-dir: third_party/upb git-subtree-split: 2de300726a1ba2de9a468468dc5ff9ed17a3215f * Updated upb for bazel * Regen upb files * Updated src/upb/gen_build_yaml.py
3 years ago
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <algorithm>
#include <cmath>
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
#include <cstddef>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <limits>
#include <map>
#include <memory>
#include <string>
#include <utility>
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
#include <vector>
#include "absl/container/flat_hash_map.h"
#include "absl/container/flat_hash_set.h"
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
#include "absl/log/absl_check.h"
#include "absl/log/absl_log.h"
#include "absl/strings/escaping.h"
#include "absl/strings/string_view.h"
#include "absl/strings/substitute.h"
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
#include "upb/base/descriptor_constants.h"
#include "upb/base/string_view.h"
#include "upb/reflection/def.hpp"
#include "upb/wire/types.h"
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
#include "upbc/common.h"
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
#include "upbc/file_layout.h"
#include "upbc/names.h"
#include "upbc/plugin.h"
// Must be last.
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
#include "upb/port/def.inc"
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
namespace upbc {
namespace {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
struct Options {
bool bootstrap = false;
};
// Returns fields in order of "hotness", eg. how frequently they appear in
// serialized payloads. Ideally this will use a profile. When we don't have
// that, we assume that fields with smaller numbers are used more frequently.
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
inline std::vector<upb::FieldDefPtr> FieldHotnessOrder(
upb::MessageDefPtr message) {
std::vector<upb::FieldDefPtr> fields;
size_t field_count = message.field_count();
fields.reserve(field_count);
for (size_t i = 0; i < field_count; i++) {
fields.push_back(message.field(i));
}
std::sort(fields.begin(), fields.end(),
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
[](upb::FieldDefPtr a, upb::FieldDefPtr b) {
return std::make_pair(!a.is_required(), a.number()) <
std::make_pair(!b.is_required(), b.number());
});
return fields;
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::string SourceFilename(upb::FileDefPtr file) {
return StripExtension(file.name()) + ".upb.c";
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::string MessageInitName(upb::MessageDefPtr descriptor) {
return absl::StrCat(MessageName(descriptor), "_msg_init");
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::string MessageMiniTableRef(upb::MessageDefPtr descriptor,
const Options& options) {
if (options.bootstrap) {
return absl::StrCat(MessageInitName(descriptor), "()");
} else {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
return absl::StrCat("&", MessageInitName(descriptor));
}
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::string EnumInitName(upb::EnumDefPtr descriptor) {
return ToCIdent(descriptor.full_name()) + "_enum_init";
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::string EnumMiniTableRef(upb::EnumDefPtr descriptor,
const Options& options) {
if (options.bootstrap) {
return absl::StrCat(EnumInitName(descriptor), "()");
} else {
return absl::StrCat("&", EnumInitName(descriptor));
}
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::string ExtensionIdentBase(upb::FieldDefPtr ext) {
assert(ext.is_extension());
std::string ext_scope;
if (ext.extension_scope()) {
return MessageName(ext.extension_scope());
} else {
return ToCIdent(ext.file().package());
}
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::string ExtensionLayout(upb::FieldDefPtr ext) {
return absl::StrCat(ExtensionIdentBase(ext), "_", ext.name(), "_ext");
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
const char* kEnumsInit = "enums_layout";
const char* kExtensionsInit = "extensions_layout";
const char* kMessagesInit = "messages_layout";
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::string EnumValueSymbol(upb::EnumValDefPtr value) {
return ToCIdent(value.full_name());
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::string CTypeInternal(upb::FieldDefPtr field, bool is_const) {
std::string maybe_const = is_const ? "const " : "";
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
switch (field.ctype()) {
case kUpb_CType_Message: {
std::string maybe_struct =
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
field.file() != field.message_type().file() ? "struct " : "";
return maybe_const + maybe_struct + MessageName(field.message_type()) +
"*";
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
case kUpb_CType_Bool:
return "bool";
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
case kUpb_CType_Float:
return "float";
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
case kUpb_CType_Int32:
case kUpb_CType_Enum:
return "int32_t";
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
case kUpb_CType_UInt32:
return "uint32_t";
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
case kUpb_CType_Double:
return "double";
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
case kUpb_CType_Int64:
return "int64_t";
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
case kUpb_CType_UInt64:
return "uint64_t";
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
case kUpb_CType_String:
case kUpb_CType_Bytes:
return "upb_StringView";
default:
abort();
}
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::string FloatToCLiteral(float value) {
if (value == std::numeric_limits<float>::infinity()) {
return "kUpb_FltInfinity";
} else if (value == -std::numeric_limits<float>::infinity()) {
return "-kUpb_FltInfinity";
} else if (std::isnan(value)) {
return "kUpb_NaN";
} else {
return absl::StrCat(value);
}
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::string DoubleToCLiteral(double value) {
if (value == std::numeric_limits<double>::infinity()) {
return "kUpb_Infinity";
} else if (value == -std::numeric_limits<double>::infinity()) {
return "-kUpb_Infinity";
} else if (std::isnan(value)) {
return "kUpb_NaN";
} else {
return absl::StrCat(value);
}
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::string FieldDefault(upb::FieldDefPtr field) {
switch (field.ctype()) {
case kUpb_CType_Message:
return "NULL";
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
case kUpb_CType_Bytes:
case kUpb_CType_String: {
upb_StringView str = field.default_value().str_val;
return absl::Substitute(
"upb_StringView_FromString(\"$0\")",
absl::CEscape(absl::string_view(str.data, str.size)));
}
case kUpb_CType_Int32:
return absl::Substitute("(int32_t)$0", field.default_value().int32_val);
case kUpb_CType_Int64:
if (field.default_value().int64_val == INT64_MIN) {
// Special-case to avoid:
// integer literal is too large to be represented in a signed integer
// type, interpreting as unsigned
// [-Werror,-Wimplicitly-unsigned-literal]
// int64_t default_val = (int64_t)-9223372036854775808ll;
//
// More info here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52661
return "INT64_MIN";
} else {
return absl::Substitute("(int64_t)$0ll",
field.default_value().int64_val);
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
case kUpb_CType_UInt32:
return absl::Substitute("(uint32_t)$0u",
field.default_value().uint32_val);
case kUpb_CType_UInt64:
return absl::Substitute("(uint64_t)$0ull",
field.default_value().uint64_val);
case kUpb_CType_Float:
return FloatToCLiteral(field.default_value().float_val);
case kUpb_CType_Double:
return DoubleToCLiteral(field.default_value().double_val);
case kUpb_CType_Bool:
return field.default_value().bool_val ? "true" : "false";
case kUpb_CType_Enum:
Squashed 'third_party/upb/' changes from 92e63da733..382d5afc60 382d5afc60 Merge pull request #306 from haberman/bigendian efefbffc80 Fixed binary encoding and decoding for big-endian machines. 5d3083013c Merge pull request #304 from haberman/upb-assume 55dd9d3e41 Fixed UPB_ASSUME() for non-GCC, non-MSVC platforms. e4c8afd0d4 Merge pull request #303 from haberman/packed-def 8284321780 Fixed upb_fielddef_packed() to have the correct default. ed86d98f53 Merge pull request #302 from haberman/verify-utf8 8e26a33bcb Added a test for UTF-8 parse checking and added missing error reporting. 2c666bc8f6 Use C-style comment instead of C++. a77ea639d5 Verify UTF-8 when parsing proto3 string fields. 7f19072206 Merge pull request #301 from haberman/rm-pop bfdfe5a914 Removed unused push/pop functions. 1479f2d7ca Merge pull request #299 from haberman/google3-fixes 8f11ec57d2 Applied changes from google3. 7172b981dd Merge pull request #297 from haberman/bugfixes ffe40c9f94 Only run Valgrind if it is present. 922c126b8b Fixed unit test errors that were causing Valgrind failures. 086a68d191 Fixed memory leak that could occur after upb_arena_fuse(). 35abcc248b Added test that should trigger a memory leak. 7d726c8da6 JSON parser: Bugfix for float/double in quotes. 74c60c757b Merge pull request #296 from haberman/php-fixes efe11c6c50 Removed excess logging statement. 81c2aa753e Fixes for the PHP C Extension. git-subtree-dir: third_party/upb git-subtree-split: 382d5afc60e05470c23e8de19b19fc5ad231e732
4 years ago
// Use a number instead of a symbolic name so that we don't require
// this enum's header to be included.
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
return absl::StrCat(field.default_value().int32_val);
}
ABSL_ASSERT(false);
return "XXX";
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::string CType(upb::FieldDefPtr field) {
return CTypeInternal(field, false);
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::string CTypeConst(upb::FieldDefPtr field) {
return CTypeInternal(field, true);
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::string MapKeyCType(upb::FieldDefPtr map_field) {
return CType(map_field.message_type().map_key());
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::string MapValueCType(upb::FieldDefPtr map_field) {
return CType(map_field.message_type().map_value());
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::string MapKeySize(upb::FieldDefPtr map_field, absl::string_view expr) {
return map_field.message_type().map_key().ctype() == kUpb_CType_String
? "0"
: absl::StrCat("sizeof(", expr, ")");
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::string MapValueSize(upb::FieldDefPtr map_field, absl::string_view expr) {
return map_field.message_type().map_value().ctype() == kUpb_CType_String
? "0"
: absl::StrCat("sizeof(", expr, ")");
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::string FieldInitializer(const DefPoolPair& pools, upb::FieldDefPtr field,
const Options& options);
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
void DumpEnumValues(upb::EnumDefPtr desc, Output& output) {
std::vector<upb::EnumValDefPtr> values;
values.reserve(desc.value_count());
for (int i = 0; i < desc.value_count(); i++) {
values.push_back(desc.value(i));
}
std::sort(values.begin(), values.end(),
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
[](upb::EnumValDefPtr a, upb::EnumValDefPtr b) {
return a.number() < b.number();
});
for (size_t i = 0; i < values.size(); i++) {
auto value = values[i];
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
output(" $0 = $1", EnumValueSymbol(value), value.number());
if (i != values.size() - 1) {
output(",");
}
output("\n");
}
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::string GetFieldRep(const DefPoolPair& pools, upb::FieldDefPtr field);
void GenerateExtensionInHeader(const DefPoolPair& pools, upb::FieldDefPtr ext,
Output& output) {
output(
R"cc(
UPB_INLINE bool $0_has_$1(const struct $2* msg) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
return _upb_Message_HasExtensionField(msg, &$3);
}
)cc",
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
ExtensionIdentBase(ext), ext.name(), MessageName(ext.containing_type()),
ExtensionLayout(ext));
output(
R"cc(
UPB_INLINE void $0_clear_$1(struct $2* msg) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
_upb_Message_ClearExtensionField(msg, &$3);
}
)cc",
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
ExtensionIdentBase(ext), ext.name(), MessageName(ext.containing_type()),
ExtensionLayout(ext));
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
if (ext.IsSequence()) {
// TODO(b/259861668): We need generated accessors for repeated extensions.
} else {
output(
R"cc(
UPB_INLINE $0 $1_$2(const struct $3* msg) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
const upb_MiniTableExtension* ext = &$4;
UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field));
UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == $5);
$0 default_val = $6;
$0 ret;
_upb_Message_GetExtensionField(msg, ext, &default_val, &ret);
return ret;
}
)cc",
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
CTypeConst(ext), ExtensionIdentBase(ext), ext.name(),
MessageName(ext.containing_type()), ExtensionLayout(ext),
GetFieldRep(pools, ext), FieldDefault(ext));
output(
R"cc(
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
UPB_INLINE void $1_set_$2(struct $3* msg, $0 val, upb_Arena* arena) {
const upb_MiniTableExtension* ext = &$4;
UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field));
UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == $5);
bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena);
UPB_ASSERT(ok);
}
)cc",
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
CTypeConst(ext), ExtensionIdentBase(ext), ext.name(),
MessageName(ext.containing_type()), ExtensionLayout(ext),
GetFieldRep(pools, ext));
}
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
void GenerateMessageFunctionsInHeader(upb::MessageDefPtr message,
const Options& options, Output& output) {
// TODO(b/235839510): The generated code here does not check the return values
// from upb_Encode(). How can we even fix this without breaking other things?
output(
R"cc(
UPB_INLINE $0* $0_new(upb_Arena* arena) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
return ($0*)_upb_Message_New($1, arena);
}
UPB_INLINE $0* $0_parse(const char* buf, size_t size, upb_Arena* arena) {
$0* ret = $0_new(arena);
if (!ret) return NULL;
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
if (upb_Decode(buf, size, ret, $1, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
return NULL;
}
return ret;
}
UPB_INLINE $0* $0_parse_ex(const char* buf, size_t size,
const upb_ExtensionRegistry* extreg,
int options, upb_Arena* arena) {
$0* ret = $0_new(arena);
if (!ret) return NULL;
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
if (upb_Decode(buf, size, ret, $1, extreg, options, arena) !=
kUpb_DecodeStatus_Ok) {
return NULL;
}
return ret;
}
UPB_INLINE char* $0_serialize(const $0* msg, upb_Arena* arena, size_t* len) {
char* ptr;
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
(void)upb_Encode(msg, $1, 0, arena, &ptr, len);
return ptr;
}
UPB_INLINE char* $0_serialize_ex(const $0* msg, int options,
upb_Arena* arena, size_t* len) {
char* ptr;
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
(void)upb_Encode(msg, $1, options, arena, &ptr, len);
return ptr;
}
)cc",
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
MessageName(message), MessageMiniTableRef(message, options));
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
void GenerateOneofInHeader(upb::OneofDefPtr oneof, const DefPoolPair& pools,
absl::string_view msg_name, const Options& options,
Output& output) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::string fullname = ToCIdent(oneof.full_name());
output("typedef enum {\n");
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
for (int j = 0; j < oneof.field_count(); j++) {
upb::FieldDefPtr field = oneof.field(j);
output(" $0_$1 = $2,\n", fullname, field.name(), field.number());
}
output(
" $0_NOT_SET = 0\n"
"} $0_oneofcases;\n",
fullname);
output(
R"cc(
UPB_INLINE $0_oneofcases $1_$2_case(const $1* msg) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
const upb_MiniTableField field = $3;
return ($0_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field);
}
)cc",
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
fullname, msg_name, oneof.name(),
FieldInitializer(pools, oneof.field(0), options));
}
Squashed 'third_party/upb/' changes from d8f3d6f9d4..ce1a399a19 ce1a399a19 Text format serializer for upb_msg (#242) 888f35cae6 Merge pull request #241 from haberman/conformance-fixes 46b93f8cea A bit more cleanup in the decoder. ad2eb65a4b Refactored conformance_upb to use reflection, and fixed a decoder bug. a202c5f84d Merge pull request #234 from haberman/parser 4c974cf72d Fixed generated files. 9a870d957f Removed upb_decframe and made ptr an explicit parameter and return. a6c54729df Added UPB_ASSUME(), to work around warnings when optimization is enabled: 9e1f89ef2c Merge pull request #224 from haberman/maps ce0496eb86 Merge branch 'master' into maps e911aae5f6 Factored upb_map_entry into a shared place. 4c1a97ae9c Merge branch 'master' into maps 59fe620fa0 Merge branch 'maps' of github.com:haberman/upb into maps 744f8588da Cleanup to remove END_GROUP from descriptortype -> type tables. f9efbcd5d6 Added missing append fallback. c4b64e6a20 Slight simplification: NULL arena will avoid creating a new sub-object. d541566a7b Moved upb_array_new() to upb/reflection.h where it belongs. 059f226d41 Unit tests for maps generated code. 520ddc1f11 c89 fixes. 806c8c9c6e Removed obsolete testing files. 2a85bef825 Generated code interface for maps is complete, though not yet tested. 7f5fe52dfa Fixes for non-C89 code. 6c2d732082 Fixed upb's map parsing to overwrite existing elements. 090a0c33a4 Fixed VLA error and rewrote the map parsing code to be clearer. 0fbae939d2 Removed stray fprintf(). 572ba75d1c Removed comma after final enumerator. c9135e5276 Fixed the build. d040aa1302 Merge branch 'master' into maps e18541a9dd Added some missing files. 92509cc3b2 Rename lua_test. 382f92a87f Maps encode and decode successfully! 4c57b1fefd More progress on Lua extension. d6c3152c0b Added more Lua tests that are passing. ae66e571d4 Fixed some bugs and added a few more tests. bfc86d3577 Fixed many bugs, basic Lua test passes! b518b06d75 Lua test program is loaded successfully. 6ae4a2694c Merge branch 'maps' of github.com:haberman/upb into maps cc6db9fb0b Fixed crash bug. 88d996132e Added Lua main.c test driver program. 626ec4bfcf Everything builds, test pass except test_decoder. 5239655b99 WIP. 23825332e1 WIP. 27b95c969a WIP. 9a360ad43d Moved legacy_msg_reflection.{c,h} -> reflection.{c.h}. dc58b657ee New reflection API doesn't need types as parameters for map/array. c486da3970 WIP. b76040cfcc Merge branch 'maps' of github.com:haberman/upb into maps cc8e894b63 Merge branch 'master' into maps 946880c105 Merge branch 'master' into maps 1461da5056 WIP. 0a07f2714b Merge branch 'master' into maps 18de110b00 Merge branch 'master' into maps 283857f308 WIP. 5dea3f8486 Merge branch 'master' into maps 07ac6f0e8e Merge branch 'master' into maps 0c64c4b594 WIP. git-subtree-dir: third_party/upb git-subtree-split: ce1a399a19f11683d58ba4c2569ec3fdd5a67621
5 years ago
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
void GenerateHazzer(upb::FieldDefPtr field, const DefPoolPair& pools,
absl::string_view msg_name,
const NameToFieldDefMap& field_names,
const Options& options, Output& output) {
std::string resolved_name = ResolveFieldName(field, field_names);
if (field.has_presence()) {
Squashed 'third_party/upb/' changes from d8f3d6f9d4..ce1a399a19 ce1a399a19 Text format serializer for upb_msg (#242) 888f35cae6 Merge pull request #241 from haberman/conformance-fixes 46b93f8cea A bit more cleanup in the decoder. ad2eb65a4b Refactored conformance_upb to use reflection, and fixed a decoder bug. a202c5f84d Merge pull request #234 from haberman/parser 4c974cf72d Fixed generated files. 9a870d957f Removed upb_decframe and made ptr an explicit parameter and return. a6c54729df Added UPB_ASSUME(), to work around warnings when optimization is enabled: 9e1f89ef2c Merge pull request #224 from haberman/maps ce0496eb86 Merge branch 'master' into maps e911aae5f6 Factored upb_map_entry into a shared place. 4c1a97ae9c Merge branch 'master' into maps 59fe620fa0 Merge branch 'maps' of github.com:haberman/upb into maps 744f8588da Cleanup to remove END_GROUP from descriptortype -> type tables. f9efbcd5d6 Added missing append fallback. c4b64e6a20 Slight simplification: NULL arena will avoid creating a new sub-object. d541566a7b Moved upb_array_new() to upb/reflection.h where it belongs. 059f226d41 Unit tests for maps generated code. 520ddc1f11 c89 fixes. 806c8c9c6e Removed obsolete testing files. 2a85bef825 Generated code interface for maps is complete, though not yet tested. 7f5fe52dfa Fixes for non-C89 code. 6c2d732082 Fixed upb's map parsing to overwrite existing elements. 090a0c33a4 Fixed VLA error and rewrote the map parsing code to be clearer. 0fbae939d2 Removed stray fprintf(). 572ba75d1c Removed comma after final enumerator. c9135e5276 Fixed the build. d040aa1302 Merge branch 'master' into maps e18541a9dd Added some missing files. 92509cc3b2 Rename lua_test. 382f92a87f Maps encode and decode successfully! 4c57b1fefd More progress on Lua extension. d6c3152c0b Added more Lua tests that are passing. ae66e571d4 Fixed some bugs and added a few more tests. bfc86d3577 Fixed many bugs, basic Lua test passes! b518b06d75 Lua test program is loaded successfully. 6ae4a2694c Merge branch 'maps' of github.com:haberman/upb into maps cc6db9fb0b Fixed crash bug. 88d996132e Added Lua main.c test driver program. 626ec4bfcf Everything builds, test pass except test_decoder. 5239655b99 WIP. 23825332e1 WIP. 27b95c969a WIP. 9a360ad43d Moved legacy_msg_reflection.{c,h} -> reflection.{c.h}. dc58b657ee New reflection API doesn't need types as parameters for map/array. c486da3970 WIP. b76040cfcc Merge branch 'maps' of github.com:haberman/upb into maps cc8e894b63 Merge branch 'master' into maps 946880c105 Merge branch 'master' into maps 1461da5056 WIP. 0a07f2714b Merge branch 'master' into maps 18de110b00 Merge branch 'master' into maps 283857f308 WIP. 5dea3f8486 Merge branch 'master' into maps 07ac6f0e8e Merge branch 'master' into maps 0c64c4b594 WIP. git-subtree-dir: third_party/upb git-subtree-split: ce1a399a19f11683d58ba4c2569ec3fdd5a67621
5 years ago
output(
R"cc(
UPB_INLINE bool $0_has_$1(const $0* msg) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
const upb_MiniTableField field = $2;
return _upb_Message_HasNonExtensionField(msg, &field);
}
)cc",
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
msg_name, resolved_name, FieldInitializer(pools, field, options));
} else if (field.IsMap()) {
// Do nothing.
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
} else if (field.IsSequence()) {
// TODO(b/259616267): remove.
output(
R"cc(
UPB_INLINE bool $0_has_$1(const $0* msg) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
size_t size;
$0_$1(msg, &size);
return size != 0;
}
)cc",
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
msg_name, resolved_name);
Squashed 'third_party/upb/' changes from d8f3d6f9d4..ce1a399a19 ce1a399a19 Text format serializer for upb_msg (#242) 888f35cae6 Merge pull request #241 from haberman/conformance-fixes 46b93f8cea A bit more cleanup in the decoder. ad2eb65a4b Refactored conformance_upb to use reflection, and fixed a decoder bug. a202c5f84d Merge pull request #234 from haberman/parser 4c974cf72d Fixed generated files. 9a870d957f Removed upb_decframe and made ptr an explicit parameter and return. a6c54729df Added UPB_ASSUME(), to work around warnings when optimization is enabled: 9e1f89ef2c Merge pull request #224 from haberman/maps ce0496eb86 Merge branch 'master' into maps e911aae5f6 Factored upb_map_entry into a shared place. 4c1a97ae9c Merge branch 'master' into maps 59fe620fa0 Merge branch 'maps' of github.com:haberman/upb into maps 744f8588da Cleanup to remove END_GROUP from descriptortype -> type tables. f9efbcd5d6 Added missing append fallback. c4b64e6a20 Slight simplification: NULL arena will avoid creating a new sub-object. d541566a7b Moved upb_array_new() to upb/reflection.h where it belongs. 059f226d41 Unit tests for maps generated code. 520ddc1f11 c89 fixes. 806c8c9c6e Removed obsolete testing files. 2a85bef825 Generated code interface for maps is complete, though not yet tested. 7f5fe52dfa Fixes for non-C89 code. 6c2d732082 Fixed upb's map parsing to overwrite existing elements. 090a0c33a4 Fixed VLA error and rewrote the map parsing code to be clearer. 0fbae939d2 Removed stray fprintf(). 572ba75d1c Removed comma after final enumerator. c9135e5276 Fixed the build. d040aa1302 Merge branch 'master' into maps e18541a9dd Added some missing files. 92509cc3b2 Rename lua_test. 382f92a87f Maps encode and decode successfully! 4c57b1fefd More progress on Lua extension. d6c3152c0b Added more Lua tests that are passing. ae66e571d4 Fixed some bugs and added a few more tests. bfc86d3577 Fixed many bugs, basic Lua test passes! b518b06d75 Lua test program is loaded successfully. 6ae4a2694c Merge branch 'maps' of github.com:haberman/upb into maps cc6db9fb0b Fixed crash bug. 88d996132e Added Lua main.c test driver program. 626ec4bfcf Everything builds, test pass except test_decoder. 5239655b99 WIP. 23825332e1 WIP. 27b95c969a WIP. 9a360ad43d Moved legacy_msg_reflection.{c,h} -> reflection.{c.h}. dc58b657ee New reflection API doesn't need types as parameters for map/array. c486da3970 WIP. b76040cfcc Merge branch 'maps' of github.com:haberman/upb into maps cc8e894b63 Merge branch 'master' into maps 946880c105 Merge branch 'master' into maps 1461da5056 WIP. 0a07f2714b Merge branch 'master' into maps 18de110b00 Merge branch 'master' into maps 283857f308 WIP. 5dea3f8486 Merge branch 'master' into maps 07ac6f0e8e Merge branch 'master' into maps 0c64c4b594 WIP. git-subtree-dir: third_party/upb git-subtree-split: ce1a399a19f11683d58ba4c2569ec3fdd5a67621
5 years ago
}
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
void GenerateClear(upb::FieldDefPtr field, const DefPoolPair& pools,
absl::string_view msg_name,
const NameToFieldDefMap& field_names, const Options& options,
Output& output) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
if (field == field.containing_type().map_key() ||
field == field.containing_type().map_value()) {
// Cannot be cleared.
return;
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::string resolved_name = ResolveFieldName(field, field_names);
output(
R"cc(
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
UPB_INLINE void $0_clear_$1($0* msg) {
const upb_MiniTableField field = $2;
_upb_Message_ClearNonExtensionField(msg, &field);
}
)cc",
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
msg_name, resolved_name, FieldInitializer(pools, field, options));
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
void GenerateMapGetters(upb::FieldDefPtr field, const DefPoolPair& pools,
absl::string_view msg_name,
const NameToFieldDefMap& field_names,
const Options& options, Output& output) {
std::string resolved_name = ResolveFieldName(field, field_names);
output(
R"cc(
UPB_INLINE size_t $0_$1_size(const $0* msg) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
const upb_MiniTableField field = $2;
const upb_Map* map = upb_Message_GetMap(msg, &field);
return map ? _upb_Map_Size(map) : 0;
}
)cc",
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
msg_name, resolved_name, FieldInitializer(pools, field, options));
output(
R"cc(
UPB_INLINE bool $0_$1_get(const $0* msg, $2 key, $3* val) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
const upb_MiniTableField field = $4;
const upb_Map* map = upb_Message_GetMap(msg, &field);
if (!map) return false;
return _upb_Map_Get(map, &key, $5, val, $6);
}
)cc",
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
msg_name, resolved_name, MapKeyCType(field), MapValueCType(field),
FieldInitializer(pools, field, options), MapKeySize(field, "key"),
MapValueSize(field, "*val"));
output(
R"cc(
UPB_INLINE $0 $1_$2_next(const $1* msg, size_t* iter) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
const upb_MiniTableField field = $3;
const upb_Map* map = upb_Message_GetMap(msg, &field);
if (!map) return NULL;
return ($0)_upb_map_next(map, iter);
}
)cc",
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
CTypeConst(field), msg_name, resolved_name,
FieldInitializer(pools, field, options));
}
Squashed 'third_party/upb/' changes from d8f3d6f9d4..ce1a399a19 ce1a399a19 Text format serializer for upb_msg (#242) 888f35cae6 Merge pull request #241 from haberman/conformance-fixes 46b93f8cea A bit more cleanup in the decoder. ad2eb65a4b Refactored conformance_upb to use reflection, and fixed a decoder bug. a202c5f84d Merge pull request #234 from haberman/parser 4c974cf72d Fixed generated files. 9a870d957f Removed upb_decframe and made ptr an explicit parameter and return. a6c54729df Added UPB_ASSUME(), to work around warnings when optimization is enabled: 9e1f89ef2c Merge pull request #224 from haberman/maps ce0496eb86 Merge branch 'master' into maps e911aae5f6 Factored upb_map_entry into a shared place. 4c1a97ae9c Merge branch 'master' into maps 59fe620fa0 Merge branch 'maps' of github.com:haberman/upb into maps 744f8588da Cleanup to remove END_GROUP from descriptortype -> type tables. f9efbcd5d6 Added missing append fallback. c4b64e6a20 Slight simplification: NULL arena will avoid creating a new sub-object. d541566a7b Moved upb_array_new() to upb/reflection.h where it belongs. 059f226d41 Unit tests for maps generated code. 520ddc1f11 c89 fixes. 806c8c9c6e Removed obsolete testing files. 2a85bef825 Generated code interface for maps is complete, though not yet tested. 7f5fe52dfa Fixes for non-C89 code. 6c2d732082 Fixed upb's map parsing to overwrite existing elements. 090a0c33a4 Fixed VLA error and rewrote the map parsing code to be clearer. 0fbae939d2 Removed stray fprintf(). 572ba75d1c Removed comma after final enumerator. c9135e5276 Fixed the build. d040aa1302 Merge branch 'master' into maps e18541a9dd Added some missing files. 92509cc3b2 Rename lua_test. 382f92a87f Maps encode and decode successfully! 4c57b1fefd More progress on Lua extension. d6c3152c0b Added more Lua tests that are passing. ae66e571d4 Fixed some bugs and added a few more tests. bfc86d3577 Fixed many bugs, basic Lua test passes! b518b06d75 Lua test program is loaded successfully. 6ae4a2694c Merge branch 'maps' of github.com:haberman/upb into maps cc6db9fb0b Fixed crash bug. 88d996132e Added Lua main.c test driver program. 626ec4bfcf Everything builds, test pass except test_decoder. 5239655b99 WIP. 23825332e1 WIP. 27b95c969a WIP. 9a360ad43d Moved legacy_msg_reflection.{c,h} -> reflection.{c.h}. dc58b657ee New reflection API doesn't need types as parameters for map/array. c486da3970 WIP. b76040cfcc Merge branch 'maps' of github.com:haberman/upb into maps cc8e894b63 Merge branch 'master' into maps 946880c105 Merge branch 'master' into maps 1461da5056 WIP. 0a07f2714b Merge branch 'master' into maps 18de110b00 Merge branch 'master' into maps 283857f308 WIP. 5dea3f8486 Merge branch 'master' into maps 07ac6f0e8e Merge branch 'master' into maps 0c64c4b594 WIP. git-subtree-dir: third_party/upb git-subtree-split: ce1a399a19f11683d58ba4c2569ec3fdd5a67621
5 years ago
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
void GenerateMapEntryGetters(upb::FieldDefPtr field, absl::string_view msg_name,
Output& output) {
output(
R"cc(
UPB_INLINE $0 $1_$2(const $1* msg) {
$3 ret;
_upb_msg_map_$2(msg, &ret, $4);
return ret;
}
)cc",
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
CTypeConst(field), msg_name, field.name(), CType(field),
field.ctype() == kUpb_CType_String ? "0" : "sizeof(ret)");
}
Squashed 'third_party/upb/' changes from d8f3d6f9d4..ce1a399a19 ce1a399a19 Text format serializer for upb_msg (#242) 888f35cae6 Merge pull request #241 from haberman/conformance-fixes 46b93f8cea A bit more cleanup in the decoder. ad2eb65a4b Refactored conformance_upb to use reflection, and fixed a decoder bug. a202c5f84d Merge pull request #234 from haberman/parser 4c974cf72d Fixed generated files. 9a870d957f Removed upb_decframe and made ptr an explicit parameter and return. a6c54729df Added UPB_ASSUME(), to work around warnings when optimization is enabled: 9e1f89ef2c Merge pull request #224 from haberman/maps ce0496eb86 Merge branch 'master' into maps e911aae5f6 Factored upb_map_entry into a shared place. 4c1a97ae9c Merge branch 'master' into maps 59fe620fa0 Merge branch 'maps' of github.com:haberman/upb into maps 744f8588da Cleanup to remove END_GROUP from descriptortype -> type tables. f9efbcd5d6 Added missing append fallback. c4b64e6a20 Slight simplification: NULL arena will avoid creating a new sub-object. d541566a7b Moved upb_array_new() to upb/reflection.h where it belongs. 059f226d41 Unit tests for maps generated code. 520ddc1f11 c89 fixes. 806c8c9c6e Removed obsolete testing files. 2a85bef825 Generated code interface for maps is complete, though not yet tested. 7f5fe52dfa Fixes for non-C89 code. 6c2d732082 Fixed upb's map parsing to overwrite existing elements. 090a0c33a4 Fixed VLA error and rewrote the map parsing code to be clearer. 0fbae939d2 Removed stray fprintf(). 572ba75d1c Removed comma after final enumerator. c9135e5276 Fixed the build. d040aa1302 Merge branch 'master' into maps e18541a9dd Added some missing files. 92509cc3b2 Rename lua_test. 382f92a87f Maps encode and decode successfully! 4c57b1fefd More progress on Lua extension. d6c3152c0b Added more Lua tests that are passing. ae66e571d4 Fixed some bugs and added a few more tests. bfc86d3577 Fixed many bugs, basic Lua test passes! b518b06d75 Lua test program is loaded successfully. 6ae4a2694c Merge branch 'maps' of github.com:haberman/upb into maps cc6db9fb0b Fixed crash bug. 88d996132e Added Lua main.c test driver program. 626ec4bfcf Everything builds, test pass except test_decoder. 5239655b99 WIP. 23825332e1 WIP. 27b95c969a WIP. 9a360ad43d Moved legacy_msg_reflection.{c,h} -> reflection.{c.h}. dc58b657ee New reflection API doesn't need types as parameters for map/array. c486da3970 WIP. b76040cfcc Merge branch 'maps' of github.com:haberman/upb into maps cc8e894b63 Merge branch 'master' into maps 946880c105 Merge branch 'master' into maps 1461da5056 WIP. 0a07f2714b Merge branch 'master' into maps 18de110b00 Merge branch 'master' into maps 283857f308 WIP. 5dea3f8486 Merge branch 'master' into maps 07ac6f0e8e Merge branch 'master' into maps 0c64c4b594 WIP. git-subtree-dir: third_party/upb git-subtree-split: ce1a399a19f11683d58ba4c2569ec3fdd5a67621
5 years ago
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
void GenerateRepeatedGetters(upb::FieldDefPtr field, const DefPoolPair& pools,
absl::string_view msg_name,
const NameToFieldDefMap& field_names,
const Options& options, Output& output) {
// Generate getter returning first item and size.
//
// Example:
// UPB_INLINE const struct Bar* const* name(const Foo* msg, size_t* size)
output(
R"cc(
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
UPB_INLINE $0 const* $1_$2(const $1* msg, size_t* size) {
const upb_MiniTableField field = $3;
const upb_Array* arr = upb_Message_GetArray(msg, &field);
if (arr) {
if (size) *size = arr->size;
return ($0 const*)_upb_array_constptr(arr);
} else {
if (size) *size = 0;
return NULL;
}
}
)cc",
CTypeConst(field), // $0
msg_name, // $1
ResolveFieldName(field, field_names), // $2
FieldInitializer(pools, field, options) // #3
);
// Generate private getter returning array or NULL for immutable and upb_Array
// for mutable.
//
// Example:
// UPB_INLINE const upb_Array* _name_upbarray(size_t* size)
// UPB_INLINE upb_Array* _name_mutable_upbarray(size_t* size)
output(
R"cc(
UPB_INLINE const upb_Array* _$1_$2_$4(const $1* msg, size_t* size) {
const upb_MiniTableField field = $3;
const upb_Array* arr = upb_Message_GetArray(msg, &field);
if (size) {
*size = arr ? arr->size : 0;
}
return arr;
}
UPB_INLINE upb_Array* _$1_$2_$5(const $1* msg, size_t* size, upb_Arena* arena) {
const upb_MiniTableField field = $3;
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
(upb_Message*)msg, &field, arena);
if (size) {
*size = arr ? arr->size : 0;
}
return arr;
}
)cc",
CTypeConst(field), // $0
msg_name, // $1
ResolveFieldName(field, field_names), // $2
FieldInitializer(pools, field, options), // $3
kRepeatedFieldArrayGetterPostfix, // $4
kRepeatedFieldMutableArrayGetterPostfix // $5
);
}
Squashed 'third_party/upb/' changes from d8f3d6f9d4..ce1a399a19 ce1a399a19 Text format serializer for upb_msg (#242) 888f35cae6 Merge pull request #241 from haberman/conformance-fixes 46b93f8cea A bit more cleanup in the decoder. ad2eb65a4b Refactored conformance_upb to use reflection, and fixed a decoder bug. a202c5f84d Merge pull request #234 from haberman/parser 4c974cf72d Fixed generated files. 9a870d957f Removed upb_decframe and made ptr an explicit parameter and return. a6c54729df Added UPB_ASSUME(), to work around warnings when optimization is enabled: 9e1f89ef2c Merge pull request #224 from haberman/maps ce0496eb86 Merge branch 'master' into maps e911aae5f6 Factored upb_map_entry into a shared place. 4c1a97ae9c Merge branch 'master' into maps 59fe620fa0 Merge branch 'maps' of github.com:haberman/upb into maps 744f8588da Cleanup to remove END_GROUP from descriptortype -> type tables. f9efbcd5d6 Added missing append fallback. c4b64e6a20 Slight simplification: NULL arena will avoid creating a new sub-object. d541566a7b Moved upb_array_new() to upb/reflection.h where it belongs. 059f226d41 Unit tests for maps generated code. 520ddc1f11 c89 fixes. 806c8c9c6e Removed obsolete testing files. 2a85bef825 Generated code interface for maps is complete, though not yet tested. 7f5fe52dfa Fixes for non-C89 code. 6c2d732082 Fixed upb's map parsing to overwrite existing elements. 090a0c33a4 Fixed VLA error and rewrote the map parsing code to be clearer. 0fbae939d2 Removed stray fprintf(). 572ba75d1c Removed comma after final enumerator. c9135e5276 Fixed the build. d040aa1302 Merge branch 'master' into maps e18541a9dd Added some missing files. 92509cc3b2 Rename lua_test. 382f92a87f Maps encode and decode successfully! 4c57b1fefd More progress on Lua extension. d6c3152c0b Added more Lua tests that are passing. ae66e571d4 Fixed some bugs and added a few more tests. bfc86d3577 Fixed many bugs, basic Lua test passes! b518b06d75 Lua test program is loaded successfully. 6ae4a2694c Merge branch 'maps' of github.com:haberman/upb into maps cc6db9fb0b Fixed crash bug. 88d996132e Added Lua main.c test driver program. 626ec4bfcf Everything builds, test pass except test_decoder. 5239655b99 WIP. 23825332e1 WIP. 27b95c969a WIP. 9a360ad43d Moved legacy_msg_reflection.{c,h} -> reflection.{c.h}. dc58b657ee New reflection API doesn't need types as parameters for map/array. c486da3970 WIP. b76040cfcc Merge branch 'maps' of github.com:haberman/upb into maps cc8e894b63 Merge branch 'master' into maps 946880c105 Merge branch 'master' into maps 1461da5056 WIP. 0a07f2714b Merge branch 'master' into maps 18de110b00 Merge branch 'master' into maps 283857f308 WIP. 5dea3f8486 Merge branch 'master' into maps 07ac6f0e8e Merge branch 'master' into maps 0c64c4b594 WIP. git-subtree-dir: third_party/upb git-subtree-split: ce1a399a19f11683d58ba4c2569ec3fdd5a67621
5 years ago
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
void GenerateScalarGetters(upb::FieldDefPtr field, const DefPoolPair& pools,
absl::string_view msg_name,
const NameToFieldDefMap& field_names,
const Options& Options, Output& output) {
std::string field_name = ResolveFieldName(field, field_names);
output(
R"cc(
UPB_INLINE $0 $1_$2(const $1* msg) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
$0 default_val = $3;
$0 ret;
const upb_MiniTableField field = $4;
_upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
return ret;
}
)cc",
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
CTypeConst(field), msg_name, field_name, FieldDefault(field),
FieldInitializer(pools, field, Options));
}
void GenerateGetters(upb::FieldDefPtr field, const DefPoolPair& pools,
absl::string_view msg_name,
const NameToFieldDefMap& field_names,
const Options& options, Output& output) {
if (field.IsMap()) {
GenerateMapGetters(field, pools, msg_name, field_names, options, output);
} else if (UPB_DESC(MessageOptions_map_entry)(
field.containing_type().options())) {
GenerateMapEntryGetters(field, msg_name, output);
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
} else if (field.IsSequence()) {
GenerateRepeatedGetters(field, pools, msg_name, field_names, options,
output);
} else {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
GenerateScalarGetters(field, pools, msg_name, field_names, options, output);
}
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
void GenerateMapSetters(upb::FieldDefPtr field, const DefPoolPair& pools,
absl::string_view msg_name,
const NameToFieldDefMap& field_names,
const Options& options, Output& output) {
std::string resolved_name = ResolveFieldName(field, field_names);
output(
R"cc(
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
UPB_INLINE void $0_$1_clear($0* msg) {
const upb_MiniTableField field = $2;
upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field);
if (!map) return;
_upb_Map_Clear(map);
}
)cc",
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
msg_name, resolved_name, FieldInitializer(pools, field, options));
output(
R"cc(
UPB_INLINE bool $0_$1_set($0* msg, $2 key, $3 val, upb_Arena* a) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
const upb_MiniTableField field = $4;
upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, $5, $6, a);
return _upb_Map_Insert(map, &key, $5, &val, $6, a) !=
kUpb_MapInsertStatus_OutOfMemory;
}
)cc",
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
msg_name, resolved_name, MapKeyCType(field), MapValueCType(field),
FieldInitializer(pools, field, options), MapKeySize(field, "key"),
MapValueSize(field, "val"));
output(
R"cc(
UPB_INLINE bool $0_$1_delete($0* msg, $2 key) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
const upb_MiniTableField field = $3;
upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field);
if (!map) return false;
return _upb_Map_Delete(map, &key, $4, NULL);
}
)cc",
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
msg_name, resolved_name, MapKeyCType(field),
FieldInitializer(pools, field, options), MapKeySize(field, "key"));
output(
R"cc(
UPB_INLINE $0 $1_$2_nextmutable($1* msg, size_t* iter) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
const upb_MiniTableField field = $3;
upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field);
if (!map) return NULL;
return ($0)_upb_map_next(map, iter);
}
)cc",
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
CType(field), msg_name, resolved_name,
FieldInitializer(pools, field, options));
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
void GenerateRepeatedSetters(upb::FieldDefPtr field, const DefPoolPair& pools,
absl::string_view msg_name,
const NameToFieldDefMap& field_names,
const Options& options, Output& output) {
std::string resolved_name = ResolveFieldName(field, field_names);
output(
R"cc(
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
UPB_INLINE $0* $1_mutable_$2($1* msg, size_t* size) {
upb_MiniTableField field = $3;
upb_Array* arr = upb_Message_GetMutableArray(msg, &field);
if (arr) {
if (size) *size = arr->size;
return ($0*)_upb_array_ptr(arr);
} else {
if (size) *size = 0;
return NULL;
}
}
)cc",
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
CType(field), msg_name, resolved_name,
FieldInitializer(pools, field, options));
output(
R"cc(
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
UPB_INLINE $0* $1_resize_$2($1* msg, size_t size, upb_Arena* arena) {
upb_MiniTableField field = $3;
return ($0*)upb_Message_ResizeArray(msg, &field, size, arena);
}
)cc",
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
CType(field), msg_name, resolved_name,
FieldInitializer(pools, field, options));
if (field.ctype() == kUpb_CType_Message) {
output(
R"cc(
UPB_INLINE struct $0* $1_add_$2($1* msg, upb_Arena* arena) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
upb_MiniTableField field = $4;
upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return NULL;
}
struct $0* sub = (struct $0*)_upb_Message_New($3, arena);
if (!arr || !sub) return NULL;
_upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
return sub;
}
)cc",
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
MessageName(field.message_type()), msg_name, resolved_name,
MessageMiniTableRef(field.message_type(), options),
FieldInitializer(pools, field, options));
} else {
output(
R"cc(
UPB_INLINE bool $1_add_$2($1* msg, $0 val, upb_Arena* arena) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
upb_MiniTableField field = $3;
upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
return false;
}
_upb_Array_Set(arr, arr->size - 1, &val, sizeof(val));
return true;
}
)cc",
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
CType(field), msg_name, resolved_name,
FieldInitializer(pools, field, options));
}
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
void GenerateNonRepeatedSetters(upb::FieldDefPtr field,
const DefPoolPair& pools,
absl::string_view msg_name,
const NameToFieldDefMap& field_names,
const Options& options, Output& output) {
if (field == field.containing_type().map_key()) {
// Key cannot be mutated.
return;
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::string field_name = ResolveFieldName(field, field_names);
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
if (field == field.containing_type().map_value()) {
output(R"cc(
UPB_INLINE void $0_set_$1($0 *msg, $2 value) {
_upb_msg_map_set_value(msg, &value, $3);
}
)cc",
msg_name, field_name, CType(field),
field.ctype() == kUpb_CType_String ? "0"
: "sizeof(" + CType(field) + ")");
} else {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
output(R"cc(
UPB_INLINE void $0_set_$1($0 *msg, $2 value) {
const upb_MiniTableField field = $3;
_upb_Message_SetNonExtensionField(msg, &field, &value);
}
)cc",
msg_name, field_name, CType(field),
FieldInitializer(pools, field, options));
}
// Message fields also have a Msg_mutable_foo() accessor that will create
// the sub-message if it doesn't already exist.
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
if (field.ctype() == kUpb_CType_Message &&
!UPB_DESC(MessageOptions_map_entry)(field.containing_type().options())) {
output(
R"cc(
UPB_INLINE struct $0* $1_mutable_$2($1* msg, upb_Arena* arena) {
struct $0* sub = (struct $0*)$1_$2(msg);
if (sub == NULL) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
sub = (struct $0*)_upb_Message_New($3, arena);
if (sub) $1_set_$2(msg, sub);
}
return sub;
}
)cc",
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
MessageName(field.message_type()), msg_name, field_name,
MessageMiniTableRef(field.message_type(), options));
}
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
void GenerateSetters(upb::FieldDefPtr field, const DefPoolPair& pools,
absl::string_view msg_name,
const NameToFieldDefMap& field_names,
const Options& options, Output& output) {
if (field.IsMap()) {
GenerateMapSetters(field, pools, msg_name, field_names, options, output);
} else if (field.IsSequence()) {
GenerateRepeatedSetters(field, pools, msg_name, field_names, options,
output);
} else {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
GenerateNonRepeatedSetters(field, pools, msg_name, field_names, options,
output);
}
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
void GenerateMessageInHeader(upb::MessageDefPtr message,
const DefPoolPair& pools, const Options& options,
Output& output) {
output("/* $0 */\n\n", message.full_name());
std::string msg_name = ToCIdent(message.full_name());
if (!UPB_DESC(MessageOptions_map_entry)(message.options())) {
GenerateMessageFunctionsInHeader(message, options, output);
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
for (int i = 0; i < message.real_oneof_count(); i++) {
GenerateOneofInHeader(message.oneof(i), pools, msg_name, options, output);
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
auto field_names = CreateFieldNameMap(message);
for (auto field : FieldNumberOrder(message)) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
GenerateClear(field, pools, msg_name, field_names, options, output);
GenerateGetters(field, pools, msg_name, field_names, options, output);
GenerateHazzer(field, pools, msg_name, field_names, options, output);
}
output("\n");
for (auto field : FieldNumberOrder(message)) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
GenerateSetters(field, pools, msg_name, field_names, options, output);
}
output("\n");
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
void ForwardDeclareMiniTableInit(upb::MessageDefPtr message,
const Options& options, Output& output) {
if (options.bootstrap) {
output("extern const upb_MiniTable* $0();\n", MessageInitName(message));
} else {
output("extern const upb_MiniTable $0;\n", MessageInitName(message));
}
}
void WriteHeader(const DefPoolPair& pools, upb::FileDefPtr file,
const Options& options, Output& output) {
EmitFileWarning(file.name(), output);
output(
"#ifndef $0_UPB_H_\n"
"#define $0_UPB_H_\n\n"
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
"#include \"upb/collections/array_internal.h\"\n"
"#include \"upb/collections/map_gencode_util.h\"\n"
"#include \"upb/message/accessors.h\"\n"
"#include \"upb/message/internal.h\"\n"
"#include \"upb/mini_table/enum_internal.h\"\n"
"#include \"upb/wire/decode.h\"\n"
"#include \"upb/wire/decode_fast.h\"\n"
"#include \"upb/wire/encode.h\"\n\n",
ToPreproc(file.name()));
for (int i = 0; i < file.public_dependency_count(); i++) {
if (i == 0) {
output("/* Public Imports. */\n");
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
output("#include \"$0\"\n", HeaderFilename(file.public_dependency(i)));
if (i == file.public_dependency_count() - 1) {
output("\n");
}
}
output(
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
"// Must be last. \n"
"#include \"upb/port/def.inc\"\n"
"\n"
"#ifdef __cplusplus\n"
"extern \"C\" {\n"
"#endif\n"
"\n");
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
const std::vector<upb::MessageDefPtr> this_file_messages =
SortedMessages(file);
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
const std::vector<upb::FieldDefPtr> this_file_exts = SortedExtensions(file);
// Forward-declare types defined in this file.
for (auto message : this_file_messages) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
output("typedef struct $0 $0;\n", ToCIdent(message.full_name()));
}
for (auto message : this_file_messages) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
ForwardDeclareMiniTableInit(message, options, output);
}
for (auto ext : this_file_exts) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
output("extern const upb_MiniTableExtension $0;\n", ExtensionLayout(ext));
}
// Forward-declare types not in this file, but used as submessages.
// Order by full name for consistent ordering.
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::map<std::string, upb::MessageDefPtr> forward_messages;
for (auto message : this_file_messages) {
for (int i = 0; i < message.field_count(); i++) {
upb::FieldDefPtr field = message.field(i);
if (field.ctype() == kUpb_CType_Message &&
field.file() != field.message_type().file()) {
forward_messages[field.message_type().full_name()] =
field.message_type();
}
}
}
for (auto ext : this_file_exts) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
if (ext.file() != ext.containing_type().file()) {
forward_messages[ext.containing_type().full_name()] =
ext.containing_type();
}
}
for (const auto& pair : forward_messages) {
output("struct $0;\n", MessageName(pair.second));
}
for (const auto& pair : forward_messages) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
ForwardDeclareMiniTableInit(pair.second, options, output);
}
if (!this_file_messages.empty()) {
output("\n");
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::vector<upb::EnumDefPtr> this_file_enums = SortedEnums(file);
for (auto enumdesc : this_file_enums) {
output("typedef enum {\n");
DumpEnumValues(enumdesc, output);
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
output("} $0;\n\n", ToCIdent(enumdesc.full_name()));
}
output("\n");
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
if (file.syntax() == kUpb_Syntax_Proto2) {
for (const auto enumdesc : this_file_enums) {
if (options.bootstrap) {
output("extern const upb_MiniTableEnum* $0();\n", EnumInit(enumdesc));
} else {
output("extern const upb_MiniTableEnum $0;\n", EnumInit(enumdesc));
}
}
}
output("\n");
for (auto message : this_file_messages) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
GenerateMessageInHeader(message, pools, options, output);
}
for (auto ext : this_file_exts) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
GenerateExtensionInHeader(pools, ext, output);
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
output("extern const upb_MiniTableFile $0;\n\n", FileLayoutName(file));
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
if (absl::string_view(file.name()) == "google/protobuf/descriptor.proto" ||
absl::string_view(file.name()) == "net/proto2/proto/descriptor.proto") {
// This is gratuitously inefficient with how many times it rebuilds
// MessageLayout objects for the same message. But we only do this for one
// proto (descriptor.proto) so we don't worry about it.
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
upb::MessageDefPtr max32_message;
upb::MessageDefPtr max64_message;
size_t max32 = 0;
size_t max64 = 0;
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
for (const auto message : this_file_messages) {
if (absl::EndsWith(message.name(), "Options")) {
size_t size32 = pools.GetMiniTable32(message)->size;
size_t size64 = pools.GetMiniTable64(message)->size;
if (size32 > max32) {
max32 = size32;
max32_message = message;
}
if (size64 > max64) {
max64 = size64;
max64_message = message;
}
}
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
output("/* Max size 32 is $0 */\n", max32_message.full_name());
output("/* Max size 64 is $0 */\n", max64_message.full_name());
output("#define _UPB_MAXOPT_SIZE UPB_SIZE($0, $1)\n\n", max32, max64);
}
output(
"#ifdef __cplusplus\n"
"} /* extern \"C\" */\n"
"#endif\n"
"\n"
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
"#include \"upb/port/undef.inc\"\n"
"\n"
"#endif /* $0_UPB_H_ */\n",
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
ToPreproc(file.name()));
}
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
typedef std::pair<std::string, uint64_t> TableEntry;
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
uint32_t GetWireTypeForField(upb::FieldDefPtr field) {
if (field.packed()) return kUpb_WireType_Delimited;
switch (field.type()) {
case kUpb_FieldType_Double:
case kUpb_FieldType_Fixed64:
case kUpb_FieldType_SFixed64:
return kUpb_WireType_64Bit;
case kUpb_FieldType_Float:
case kUpb_FieldType_Fixed32:
case kUpb_FieldType_SFixed32:
return kUpb_WireType_32Bit;
case kUpb_FieldType_Int64:
case kUpb_FieldType_UInt64:
case kUpb_FieldType_Int32:
case kUpb_FieldType_Bool:
case kUpb_FieldType_UInt32:
case kUpb_FieldType_Enum:
case kUpb_FieldType_SInt32:
case kUpb_FieldType_SInt64:
return kUpb_WireType_Varint;
case kUpb_FieldType_Group:
return kUpb_WireType_StartGroup;
case kUpb_FieldType_Message:
case kUpb_FieldType_String:
case kUpb_FieldType_Bytes:
return kUpb_WireType_Delimited;
}
UPB_UNREACHABLE();
}
uint32_t MakeTag(uint32_t field_number, uint32_t wire_type) {
return field_number << 3 | wire_type;
}
size_t WriteVarint32ToArray(uint64_t val, char* buf) {
size_t i = 0;
do {
uint8_t byte = val & 0x7fU;
val >>= 7;
if (val) byte |= 0x80U;
buf[i++] = byte;
} while (val);
return i;
}
uint64_t GetEncodedTag(upb::FieldDefPtr field) {
uint32_t wire_type = GetWireTypeForField(field);
uint32_t unencoded_tag = MakeTag(field.number(), wire_type);
char tag_bytes[10] = {0};
WriteVarint32ToArray(unencoded_tag, tag_bytes);
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
uint64_t encoded_tag = 0;
memcpy(&encoded_tag, tag_bytes, sizeof(encoded_tag));
// TODO: byte-swap for big endian.
return encoded_tag;
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
int GetTableSlot(upb::FieldDefPtr field) {
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
uint64_t tag = GetEncodedTag(field);
if (tag > 0x7fff) {
// Tag must fit within a two-byte varint.
return -1;
}
return (tag & 0xf8) >> 3;
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
bool TryFillTableEntry(const DefPoolPair& pools, upb::FieldDefPtr field,
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
TableEntry& ent) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
const upb_MiniTable* mt = pools.GetMiniTable64(field.containing_type());
const upb_MiniTableField* mt_f =
upb_MiniTable_FindFieldByNumber(mt, field.number());
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
std::string type = "";
std::string cardinality = "";
switch (upb_MiniTableField_Type(mt_f)) {
case kUpb_FieldType_Bool:
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
type = "b1";
break;
case kUpb_FieldType_Enum:
if (upb_MiniTableField_IsClosedEnum(mt_f)) {
// We don't have the means to test proto2 enum fields for valid values.
return false;
}
[[fallthrough]];
case kUpb_FieldType_Int32:
case kUpb_FieldType_UInt32:
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
type = "v4";
break;
case kUpb_FieldType_Int64:
case kUpb_FieldType_UInt64:
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
type = "v8";
break;
case kUpb_FieldType_Fixed32:
case kUpb_FieldType_SFixed32:
case kUpb_FieldType_Float:
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
type = "f4";
break;
case kUpb_FieldType_Fixed64:
case kUpb_FieldType_SFixed64:
case kUpb_FieldType_Double:
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
type = "f8";
break;
case kUpb_FieldType_SInt32:
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
type = "z4";
break;
case kUpb_FieldType_SInt64:
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
type = "z8";
break;
case kUpb_FieldType_String:
type = "s";
break;
case kUpb_FieldType_Bytes:
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
type = "b";
break;
case kUpb_FieldType_Message:
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
type = "m";
break;
default:
return false; // Not supported yet.
}
switch (upb_FieldMode_Get(mt_f)) {
case kUpb_FieldMode_Map:
return false; // Not supported yet (ever?).
case kUpb_FieldMode_Array:
if (mt_f->mode & kUpb_LabelFlags_IsPacked) {
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
cardinality = "p";
} else {
cardinality = "r";
}
break;
case kUpb_FieldMode_Scalar:
if (mt_f->presence < 0) {
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
cardinality = "o";
} else {
cardinality = "s";
}
break;
}
uint64_t expected_tag = GetEncodedTag(field);
// Data is:
//
// 48 32 16 0
// |--------|--------|--------|--------|--------|--------|--------|--------|
// | offset (16) |case offset (16) |presence| submsg | exp. tag (16) |
// |--------|--------|--------|--------|--------|--------|--------|--------|
//
// - |presence| is either hasbit index or field number for oneofs.
uint64_t data = static_cast<uint64_t>(mt_f->offset) << 48 | expected_tag;
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
if (field.IsSequence()) {
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
// No hasbit/oneof-related fields.
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
if (field.real_containing_oneof()) {
uint64_t case_offset = ~mt_f->presence;
if (case_offset > 0xffff || field.number() > 0xff) return false;
data |= field.number() << 24;
data |= case_offset << 32;
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
} else {
uint64_t hasbit_index = 63; // No hasbit (set a high, unused bit).
if (mt_f->presence) {
hasbit_index = mt_f->presence;
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
if (hasbit_index > 31) return false;
}
data |= hasbit_index << 24;
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
if (field.ctype() == kUpb_CType_Message) {
uint64_t idx = mt_f->UPB_PRIVATE(submsg_index);
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
if (idx > 255) return false;
data |= idx << 16;
std::string size_ceil = "max";
size_t size = SIZE_MAX;
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
if (field.message_type().file() == field.file()) {
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
// We can only be guaranteed the size of the sub-message if it is in the
// same file as us. We could relax this to increase the speed of
// cross-file sub-message parsing if we are comfortable requiring that
// users compile all messages at the same time.
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
const upb_MiniTable* sub_mt = pools.GetMiniTable64(field.message_type());
size = sub_mt->size + 8;
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
}
std::vector<size_t> breaks = {64, 128, 192, 256};
for (auto brk : breaks) {
if (size <= brk) {
size_ceil = std::to_string(brk);
break;
}
}
ent.first = absl::Substitute("upb_p$0$1_$2bt_max$3b", cardinality, type,
expected_tag > 0xff ? "2" : "1", size_ceil);
} else {
ent.first = absl::Substitute("upb_p$0$1_$2bt", cardinality, type,
expected_tag > 0xff ? "2" : "1");
}
ent.second = data;
return true;
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::vector<TableEntry> FastDecodeTable(upb::MessageDefPtr message,
const DefPoolPair& pools) {
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
std::vector<TableEntry> table;
for (const auto field : FieldHotnessOrder(message)) {
TableEntry ent;
int slot = GetTableSlot(field);
// std::cerr << "table slot: " << field->number() << ": " << slot << "\n";
if (slot < 0) {
// Tag can't fit in the table.
continue;
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
if (!TryFillTableEntry(pools, field, ent)) {
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
// Unsupported field type or offset, hasbit index, etc. doesn't fit.
continue;
}
while ((size_t)slot >= table.size()) {
size_t size = std::max(static_cast<size_t>(1), table.size() * 2);
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
table.resize(size, TableEntry{"_upb_FastDecoder_DecodeGeneric", 0});
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
if (table[slot].first != "_upb_FastDecoder_DecodeGeneric") {
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
// A hotter field already filled this slot.
continue;
}
table[slot] = ent;
}
return table;
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::string ArchDependentSize(int64_t size32, int64_t size64) {
if (size32 == size64) return absl::StrCat(size32);
return absl::Substitute("UPB_SIZE($0, $1)", size32, size64);
}
std::string GetFieldRep(const upb_MiniTableField* field32,
const upb_MiniTableField* field64) {
switch (_upb_MiniTableField_GetRep(field32)) {
case kUpb_FieldRep_1Byte:
return "kUpb_FieldRep_1Byte";
break;
case kUpb_FieldRep_4Byte: {
if (_upb_MiniTableField_GetRep(field64) == kUpb_FieldRep_4Byte) {
return "kUpb_FieldRep_4Byte";
} else {
assert(_upb_MiniTableField_GetRep(field64) == kUpb_FieldRep_8Byte);
return "UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte)";
}
break;
}
case kUpb_FieldRep_StringView:
return "kUpb_FieldRep_StringView";
break;
case kUpb_FieldRep_8Byte:
return "kUpb_FieldRep_8Byte";
break;
}
UPB_UNREACHABLE();
}
std::string GetFieldRep(const DefPoolPair& pools, upb::FieldDefPtr field) {
return GetFieldRep(pools.GetField32(field), pools.GetField64(field));
}
// Returns the field mode as a string initializer.
//
// We could just emit this as a number (and we may yet go in that direction) but
// for now emitting symbolic constants gives this better readability and
// debuggability.
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::string GetModeInit(const upb_MiniTableField* field32,
const upb_MiniTableField* field64) {
std::string ret;
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
uint8_t mode32 = field32->mode;
switch (mode32 & kUpb_FieldMode_Mask) {
case kUpb_FieldMode_Map:
ret = "kUpb_FieldMode_Map";
break;
case kUpb_FieldMode_Array:
ret = "kUpb_FieldMode_Array";
break;
case kUpb_FieldMode_Scalar:
ret = "kUpb_FieldMode_Scalar";
break;
default:
break;
Upb upgrade to the lastest (#26869) * Squashed 'third_party/upb/' changes from 60607da72e..2de300726a 2de300726a Merge pull request #401 from philwo/patch-1 0010bd88ff Merge pull request #403 from haberman/google-wyhash 3f7ecfe315 A few fixes in the 32-bit fallback. 2c14e2788d Added #include for Windows instrinsic. 9e618009ec Removed some extraneous whitespace. c4744c0b21 Updated generated files. 039975556d Merge branch 'master' into google-wyhash ff9d011f12 Merge pull request #402 from haberman/update-ads-benchmark c2f2e93990 Fix Bazel at 4.1.0 41bfbca375 Updated ads benchmark to v7 as v5 no longer exists upstream. 91d506ac32 Ported ABSL's wyhash to C. 3328f06117 Remove ubuntu1604 from presubmit.yml f925acf5f0 Merge pull request #400 from haberman/extreg 897bd2500a Fixed compile error. 6e53de4a03 Addressed PR comments. cdd6434a31 Introduced upb_extreg and plumbed it into decoder. 69f186bd75 Merge pull request #399 from haberman/msg-extrep 3f8aa6ef20 Define the extension representation in messages and mini-tables. 4ccfab154b Merge pull request #398 from haberman/field-mode 58e158c6fa Changed mini-table to use a custom "mode" instead of descriptor's "label." 7596fa740f Merge pull request #397 from haberman/codegen-refactor fa4dfc2baa Addressed PR comments. 0fb61eaeb5 Refactored the codegen into smaller functions, in anticipation of extensions. 52be845c39 Merge pull request #396 from haberman/pre-ext-opt 807e7fe9e2 Fixed dense_below logic to be order-independent and consistent between def.c and codegen. 2e8a122fc0 Changed dense_below calculation to use UINT8_MAX as the constant. 6394894b6e Addressed PR comments. 65d7b8ab0c Optimized decoder and paved the way for parsing extensions. 3e035cb553 Merge pull request #395 from haberman/locale e8ba2a1899 Added a fix for locales that output ',' as decimal separator. 7010a73828 Merge pull request #394 from haberman/file-uniqueness 9482957425 Enforce that filenames are unique when loaded into symtab. aaad7801bf Merge pull request #393 from haberman/has-attribute 7887dc0c76 Fixed the __has_attribute() check for old versions of Clang. 01e7436ed3 Merge pull request #390 from haberman/musttail 4132034634 Addressed PR comment. ed708fcd5d Addressed PR comments. 876abae2db Removed some debug printing and simplified checktag slightly. 286441afa7 Fixed a size regression due to inlining UTF-8 verification. 75df4cdaa3 Loosened the check for fasttable to match what we did before. e84793dd73 Cleaned up debugging artifacts. a4b35aa388 Everything passes except 4 conformance tests. 6e10b5789d Removed redundant license from port_def in amalgmation. 4f1e48ecc6 Updated amalgamator to avoid duplicating license blocks. 0723bfa700 Merge pull request #387 from haberman/json-null dda5416569 Update bazel-skylib main branch name. 2fa52e6951 Merge branch 'master' into json-null a3126b7c7e Merge pull request #388 from haberman/fix-macos b344a6c582 Fixed the macOS build for XCode 11.3. a778f2639a Only perform multiple oneof check for non-null fields. 42bdfcb849 Fix BUILD file. 75d6dab37a Merge pull request #384 from haberman/internal 3881393907 Renamed .int.h to _internal.h, for greater clarity. 5084cbe646 Merge pull request #383 from fowles/master da4b75b979 Fix build rules for more restrive deps checks a8f9cf54cf Merge pull request #382 from haberman/license-headers 1ba446ccfe Updated Google, Inc. to Google LLC. 823eb09694 Update all 2011 dates to 2021. ff89277ef0 Merge pull request #380 from fowles/master 5f74d43cf9 Re-add some comment text that was accidentally removed. 0f27b0450a Merge branch 'master' into license-headers e59d2c8fa7 Added license headers to all files. be4f64b926 Merge pull request #381 from haberman/mv-msg-public 1674f28dd7 Put public message interface into msg.h and moved internal functions to msg.int.h. 6481f6319e Spell out deps explicitly f104225a1e Merge pull request #376 from haberman/fix-quadratic-mem 3c3799498d Merge pull request #379 from fowles/master 2e83d5c98f Remove unused file test_util.h b053fa6991 Merge pull request #378 from fowles/master 7876639e50 remove unused macro 5b97df91dd Restrict fuse to matching block_alloc e74d6c23de Small renames and use uintptr_t instead of void* d9a0c58108 Allow arena fuse to fail 53f5d9f69b Merge pull request #377 from haberman/json-parse-null 8370818143 Switch to a macro to avoid signed/const mismatches. 63ad3db980 Fixed "NULL + 0" UB in JSON encoder and decoder. add9b12f18 Fixed quadratic memory usage in upb_array_append(). 97e2aeb7ee Merge pull request #375 from haberman/cleanups 83c0edbd2a A few minor cleanups. baa7fe7473 Merge pull request #374 from haberman/update-deps 900bd5c426 Merge pull request #355 from haberman/aarch64 89df647460 Updated versions of ABSL and protobuf deps. e4343f0fa3 Update comment for ARM64. 103d51f102 Merge branch 'master' into aarch64 1b9cc09f0e Removed extraneous copybara directive. bbd817fdb6 Merge pull request #373 from haberman/table-cleanup c358829c76 Now that handlers are gone, cleaned up table to use arenas exclusively. ed5b4108e0 Merge pull request #363 from haberman/delete-handlers bfa528f0ae Merge pull request #372 from haberman/errmsg-fix ec9ba3f893 Fixed error message buffer overflow. eb0fdda14b Merge pull request #371 from haberman/json-any e58f7a0284 Fix for Any messages with no fields. 7541ba0f38 Merge pull request #364 from catenacyber/cifuzz 81829bacc3 Removed quote chars from error message. 88ed8f5d3b Changed JSON decoding error message to be more clear. f41c0ec261 Added an internal API to get arena from symtab, for Ruby's use. b080659eee Merge pull request #367 from haberman/timestamp-minute-offset f7ed1f27a3 Support non-zero minutes in the timestamp offset for JSON. 451dcbbb9a Adds CIFuzz f5d2d55007 Deleted the legacy "Handlers" APIs. upb can finally be deserving of its name. 0f40d59258 Merge pull request #362 from haberman/rb-warnings c7787cbaa1 Fixed a bunch of Clang warnings. 5e53b5bb3d Merge pull request #360 from haberman/default-msgval 7a6e647be1 Merge branch 'master' into default-msgval edb0a9a2d9 Merge pull request #361 from haberman/arena-bugfix 9175989431 Bugfix for arena cleanup list when passing to upb_decode(). 5e550e88f8 Added API for getting fielddef default as a upb_msgval. de76b31f9c Merge pull request #359 from veblush/fix-upbdefs 3cab8a38fc Fixed upbdefs error 48bb3e5662 Merge pull request #357 from veblush/string-opt 4c67b2086b Merge pull request #358 from veblush/clang-tidy-fix 38b4beed6b Fix clang-tidy function 'upb_encode_ex' has a definition with different parameter names 9b020d8f65 Optimize calls to std::string::find() and friends for a single char. 3c9ae7837a The fasttable parser works on ARM64! git-subtree-dir: third_party/upb git-subtree-split: 2de300726a1ba2de9a468468dc5ff9ed17a3215f * Updated upb for bazel * Regen upb files * Updated src/upb/gen_build_yaml.py
3 years ago
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
if (mode32 & kUpb_LabelFlags_IsPacked) {
absl::StrAppend(&ret, " | kUpb_LabelFlags_IsPacked");
Upb upgrade to the lastest (#26869) * Squashed 'third_party/upb/' changes from 60607da72e..2de300726a 2de300726a Merge pull request #401 from philwo/patch-1 0010bd88ff Merge pull request #403 from haberman/google-wyhash 3f7ecfe315 A few fixes in the 32-bit fallback. 2c14e2788d Added #include for Windows instrinsic. 9e618009ec Removed some extraneous whitespace. c4744c0b21 Updated generated files. 039975556d Merge branch 'master' into google-wyhash ff9d011f12 Merge pull request #402 from haberman/update-ads-benchmark c2f2e93990 Fix Bazel at 4.1.0 41bfbca375 Updated ads benchmark to v7 as v5 no longer exists upstream. 91d506ac32 Ported ABSL's wyhash to C. 3328f06117 Remove ubuntu1604 from presubmit.yml f925acf5f0 Merge pull request #400 from haberman/extreg 897bd2500a Fixed compile error. 6e53de4a03 Addressed PR comments. cdd6434a31 Introduced upb_extreg and plumbed it into decoder. 69f186bd75 Merge pull request #399 from haberman/msg-extrep 3f8aa6ef20 Define the extension representation in messages and mini-tables. 4ccfab154b Merge pull request #398 from haberman/field-mode 58e158c6fa Changed mini-table to use a custom "mode" instead of descriptor's "label." 7596fa740f Merge pull request #397 from haberman/codegen-refactor fa4dfc2baa Addressed PR comments. 0fb61eaeb5 Refactored the codegen into smaller functions, in anticipation of extensions. 52be845c39 Merge pull request #396 from haberman/pre-ext-opt 807e7fe9e2 Fixed dense_below logic to be order-independent and consistent between def.c and codegen. 2e8a122fc0 Changed dense_below calculation to use UINT8_MAX as the constant. 6394894b6e Addressed PR comments. 65d7b8ab0c Optimized decoder and paved the way for parsing extensions. 3e035cb553 Merge pull request #395 from haberman/locale e8ba2a1899 Added a fix for locales that output ',' as decimal separator. 7010a73828 Merge pull request #394 from haberman/file-uniqueness 9482957425 Enforce that filenames are unique when loaded into symtab. aaad7801bf Merge pull request #393 from haberman/has-attribute 7887dc0c76 Fixed the __has_attribute() check for old versions of Clang. 01e7436ed3 Merge pull request #390 from haberman/musttail 4132034634 Addressed PR comment. ed708fcd5d Addressed PR comments. 876abae2db Removed some debug printing and simplified checktag slightly. 286441afa7 Fixed a size regression due to inlining UTF-8 verification. 75df4cdaa3 Loosened the check for fasttable to match what we did before. e84793dd73 Cleaned up debugging artifacts. a4b35aa388 Everything passes except 4 conformance tests. 6e10b5789d Removed redundant license from port_def in amalgmation. 4f1e48ecc6 Updated amalgamator to avoid duplicating license blocks. 0723bfa700 Merge pull request #387 from haberman/json-null dda5416569 Update bazel-skylib main branch name. 2fa52e6951 Merge branch 'master' into json-null a3126b7c7e Merge pull request #388 from haberman/fix-macos b344a6c582 Fixed the macOS build for XCode 11.3. a778f2639a Only perform multiple oneof check for non-null fields. 42bdfcb849 Fix BUILD file. 75d6dab37a Merge pull request #384 from haberman/internal 3881393907 Renamed .int.h to _internal.h, for greater clarity. 5084cbe646 Merge pull request #383 from fowles/master da4b75b979 Fix build rules for more restrive deps checks a8f9cf54cf Merge pull request #382 from haberman/license-headers 1ba446ccfe Updated Google, Inc. to Google LLC. 823eb09694 Update all 2011 dates to 2021. ff89277ef0 Merge pull request #380 from fowles/master 5f74d43cf9 Re-add some comment text that was accidentally removed. 0f27b0450a Merge branch 'master' into license-headers e59d2c8fa7 Added license headers to all files. be4f64b926 Merge pull request #381 from haberman/mv-msg-public 1674f28dd7 Put public message interface into msg.h and moved internal functions to msg.int.h. 6481f6319e Spell out deps explicitly f104225a1e Merge pull request #376 from haberman/fix-quadratic-mem 3c3799498d Merge pull request #379 from fowles/master 2e83d5c98f Remove unused file test_util.h b053fa6991 Merge pull request #378 from fowles/master 7876639e50 remove unused macro 5b97df91dd Restrict fuse to matching block_alloc e74d6c23de Small renames and use uintptr_t instead of void* d9a0c58108 Allow arena fuse to fail 53f5d9f69b Merge pull request #377 from haberman/json-parse-null 8370818143 Switch to a macro to avoid signed/const mismatches. 63ad3db980 Fixed "NULL + 0" UB in JSON encoder and decoder. add9b12f18 Fixed quadratic memory usage in upb_array_append(). 97e2aeb7ee Merge pull request #375 from haberman/cleanups 83c0edbd2a A few minor cleanups. baa7fe7473 Merge pull request #374 from haberman/update-deps 900bd5c426 Merge pull request #355 from haberman/aarch64 89df647460 Updated versions of ABSL and protobuf deps. e4343f0fa3 Update comment for ARM64. 103d51f102 Merge branch 'master' into aarch64 1b9cc09f0e Removed extraneous copybara directive. bbd817fdb6 Merge pull request #373 from haberman/table-cleanup c358829c76 Now that handlers are gone, cleaned up table to use arenas exclusively. ed5b4108e0 Merge pull request #363 from haberman/delete-handlers bfa528f0ae Merge pull request #372 from haberman/errmsg-fix ec9ba3f893 Fixed error message buffer overflow. eb0fdda14b Merge pull request #371 from haberman/json-any e58f7a0284 Fix for Any messages with no fields. 7541ba0f38 Merge pull request #364 from catenacyber/cifuzz 81829bacc3 Removed quote chars from error message. 88ed8f5d3b Changed JSON decoding error message to be more clear. f41c0ec261 Added an internal API to get arena from symtab, for Ruby's use. b080659eee Merge pull request #367 from haberman/timestamp-minute-offset f7ed1f27a3 Support non-zero minutes in the timestamp offset for JSON. 451dcbbb9a Adds CIFuzz f5d2d55007 Deleted the legacy "Handlers" APIs. upb can finally be deserving of its name. 0f40d59258 Merge pull request #362 from haberman/rb-warnings c7787cbaa1 Fixed a bunch of Clang warnings. 5e53b5bb3d Merge pull request #360 from haberman/default-msgval 7a6e647be1 Merge branch 'master' into default-msgval edb0a9a2d9 Merge pull request #361 from haberman/arena-bugfix 9175989431 Bugfix for arena cleanup list when passing to upb_decode(). 5e550e88f8 Added API for getting fielddef default as a upb_msgval. de76b31f9c Merge pull request #359 from veblush/fix-upbdefs 3cab8a38fc Fixed upbdefs error 48bb3e5662 Merge pull request #357 from veblush/string-opt 4c67b2086b Merge pull request #358 from veblush/clang-tidy-fix 38b4beed6b Fix clang-tidy function 'upb_encode_ex' has a definition with different parameter names 9b020d8f65 Optimize calls to std::string::find() and friends for a single char. 3c9ae7837a The fasttable parser works on ARM64! git-subtree-dir: third_party/upb git-subtree-split: 2de300726a1ba2de9a468468dc5ff9ed17a3215f * Updated upb for bazel * Regen upb files * Updated src/upb/gen_build_yaml.py
3 years ago
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
if (mode32 & kUpb_LabelFlags_IsExtension) {
absl::StrAppend(&ret, " | kUpb_LabelFlags_IsExtension");
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
if (mode32 & kUpb_LabelFlags_IsAlternate) {
absl::StrAppend(&ret, " | kUpb_LabelFlags_IsAlternate");
}
Upb upgrade to the lastest (#26869) * Squashed 'third_party/upb/' changes from 60607da72e..2de300726a 2de300726a Merge pull request #401 from philwo/patch-1 0010bd88ff Merge pull request #403 from haberman/google-wyhash 3f7ecfe315 A few fixes in the 32-bit fallback. 2c14e2788d Added #include for Windows instrinsic. 9e618009ec Removed some extraneous whitespace. c4744c0b21 Updated generated files. 039975556d Merge branch 'master' into google-wyhash ff9d011f12 Merge pull request #402 from haberman/update-ads-benchmark c2f2e93990 Fix Bazel at 4.1.0 41bfbca375 Updated ads benchmark to v7 as v5 no longer exists upstream. 91d506ac32 Ported ABSL's wyhash to C. 3328f06117 Remove ubuntu1604 from presubmit.yml f925acf5f0 Merge pull request #400 from haberman/extreg 897bd2500a Fixed compile error. 6e53de4a03 Addressed PR comments. cdd6434a31 Introduced upb_extreg and plumbed it into decoder. 69f186bd75 Merge pull request #399 from haberman/msg-extrep 3f8aa6ef20 Define the extension representation in messages and mini-tables. 4ccfab154b Merge pull request #398 from haberman/field-mode 58e158c6fa Changed mini-table to use a custom "mode" instead of descriptor's "label." 7596fa740f Merge pull request #397 from haberman/codegen-refactor fa4dfc2baa Addressed PR comments. 0fb61eaeb5 Refactored the codegen into smaller functions, in anticipation of extensions. 52be845c39 Merge pull request #396 from haberman/pre-ext-opt 807e7fe9e2 Fixed dense_below logic to be order-independent and consistent between def.c and codegen. 2e8a122fc0 Changed dense_below calculation to use UINT8_MAX as the constant. 6394894b6e Addressed PR comments. 65d7b8ab0c Optimized decoder and paved the way for parsing extensions. 3e035cb553 Merge pull request #395 from haberman/locale e8ba2a1899 Added a fix for locales that output ',' as decimal separator. 7010a73828 Merge pull request #394 from haberman/file-uniqueness 9482957425 Enforce that filenames are unique when loaded into symtab. aaad7801bf Merge pull request #393 from haberman/has-attribute 7887dc0c76 Fixed the __has_attribute() check for old versions of Clang. 01e7436ed3 Merge pull request #390 from haberman/musttail 4132034634 Addressed PR comment. ed708fcd5d Addressed PR comments. 876abae2db Removed some debug printing and simplified checktag slightly. 286441afa7 Fixed a size regression due to inlining UTF-8 verification. 75df4cdaa3 Loosened the check for fasttable to match what we did before. e84793dd73 Cleaned up debugging artifacts. a4b35aa388 Everything passes except 4 conformance tests. 6e10b5789d Removed redundant license from port_def in amalgmation. 4f1e48ecc6 Updated amalgamator to avoid duplicating license blocks. 0723bfa700 Merge pull request #387 from haberman/json-null dda5416569 Update bazel-skylib main branch name. 2fa52e6951 Merge branch 'master' into json-null a3126b7c7e Merge pull request #388 from haberman/fix-macos b344a6c582 Fixed the macOS build for XCode 11.3. a778f2639a Only perform multiple oneof check for non-null fields. 42bdfcb849 Fix BUILD file. 75d6dab37a Merge pull request #384 from haberman/internal 3881393907 Renamed .int.h to _internal.h, for greater clarity. 5084cbe646 Merge pull request #383 from fowles/master da4b75b979 Fix build rules for more restrive deps checks a8f9cf54cf Merge pull request #382 from haberman/license-headers 1ba446ccfe Updated Google, Inc. to Google LLC. 823eb09694 Update all 2011 dates to 2021. ff89277ef0 Merge pull request #380 from fowles/master 5f74d43cf9 Re-add some comment text that was accidentally removed. 0f27b0450a Merge branch 'master' into license-headers e59d2c8fa7 Added license headers to all files. be4f64b926 Merge pull request #381 from haberman/mv-msg-public 1674f28dd7 Put public message interface into msg.h and moved internal functions to msg.int.h. 6481f6319e Spell out deps explicitly f104225a1e Merge pull request #376 from haberman/fix-quadratic-mem 3c3799498d Merge pull request #379 from fowles/master 2e83d5c98f Remove unused file test_util.h b053fa6991 Merge pull request #378 from fowles/master 7876639e50 remove unused macro 5b97df91dd Restrict fuse to matching block_alloc e74d6c23de Small renames and use uintptr_t instead of void* d9a0c58108 Allow arena fuse to fail 53f5d9f69b Merge pull request #377 from haberman/json-parse-null 8370818143 Switch to a macro to avoid signed/const mismatches. 63ad3db980 Fixed "NULL + 0" UB in JSON encoder and decoder. add9b12f18 Fixed quadratic memory usage in upb_array_append(). 97e2aeb7ee Merge pull request #375 from haberman/cleanups 83c0edbd2a A few minor cleanups. baa7fe7473 Merge pull request #374 from haberman/update-deps 900bd5c426 Merge pull request #355 from haberman/aarch64 89df647460 Updated versions of ABSL and protobuf deps. e4343f0fa3 Update comment for ARM64. 103d51f102 Merge branch 'master' into aarch64 1b9cc09f0e Removed extraneous copybara directive. bbd817fdb6 Merge pull request #373 from haberman/table-cleanup c358829c76 Now that handlers are gone, cleaned up table to use arenas exclusively. ed5b4108e0 Merge pull request #363 from haberman/delete-handlers bfa528f0ae Merge pull request #372 from haberman/errmsg-fix ec9ba3f893 Fixed error message buffer overflow. eb0fdda14b Merge pull request #371 from haberman/json-any e58f7a0284 Fix for Any messages with no fields. 7541ba0f38 Merge pull request #364 from catenacyber/cifuzz 81829bacc3 Removed quote chars from error message. 88ed8f5d3b Changed JSON decoding error message to be more clear. f41c0ec261 Added an internal API to get arena from symtab, for Ruby's use. b080659eee Merge pull request #367 from haberman/timestamp-minute-offset f7ed1f27a3 Support non-zero minutes in the timestamp offset for JSON. 451dcbbb9a Adds CIFuzz f5d2d55007 Deleted the legacy "Handlers" APIs. upb can finally be deserving of its name. 0f40d59258 Merge pull request #362 from haberman/rb-warnings c7787cbaa1 Fixed a bunch of Clang warnings. 5e53b5bb3d Merge pull request #360 from haberman/default-msgval 7a6e647be1 Merge branch 'master' into default-msgval edb0a9a2d9 Merge pull request #361 from haberman/arena-bugfix 9175989431 Bugfix for arena cleanup list when passing to upb_decode(). 5e550e88f8 Added API for getting fielddef default as a upb_msgval. de76b31f9c Merge pull request #359 from veblush/fix-upbdefs 3cab8a38fc Fixed upbdefs error 48bb3e5662 Merge pull request #357 from veblush/string-opt 4c67b2086b Merge pull request #358 from veblush/clang-tidy-fix 38b4beed6b Fix clang-tidy function 'upb_encode_ex' has a definition with different parameter names 9b020d8f65 Optimize calls to std::string::find() and friends for a single char. 3c9ae7837a The fasttable parser works on ARM64! git-subtree-dir: third_party/upb git-subtree-split: 2de300726a1ba2de9a468468dc5ff9ed17a3215f * Updated upb for bazel * Regen upb files * Updated src/upb/gen_build_yaml.py
3 years ago
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
absl::StrAppend(&ret, " | (", GetFieldRep(field32, field64),
" << kUpb_FieldRep_Shift)");
return ret;
}
Upb upgrade to the lastest (#26869) * Squashed 'third_party/upb/' changes from 60607da72e..2de300726a 2de300726a Merge pull request #401 from philwo/patch-1 0010bd88ff Merge pull request #403 from haberman/google-wyhash 3f7ecfe315 A few fixes in the 32-bit fallback. 2c14e2788d Added #include for Windows instrinsic. 9e618009ec Removed some extraneous whitespace. c4744c0b21 Updated generated files. 039975556d Merge branch 'master' into google-wyhash ff9d011f12 Merge pull request #402 from haberman/update-ads-benchmark c2f2e93990 Fix Bazel at 4.1.0 41bfbca375 Updated ads benchmark to v7 as v5 no longer exists upstream. 91d506ac32 Ported ABSL's wyhash to C. 3328f06117 Remove ubuntu1604 from presubmit.yml f925acf5f0 Merge pull request #400 from haberman/extreg 897bd2500a Fixed compile error. 6e53de4a03 Addressed PR comments. cdd6434a31 Introduced upb_extreg and plumbed it into decoder. 69f186bd75 Merge pull request #399 from haberman/msg-extrep 3f8aa6ef20 Define the extension representation in messages and mini-tables. 4ccfab154b Merge pull request #398 from haberman/field-mode 58e158c6fa Changed mini-table to use a custom "mode" instead of descriptor's "label." 7596fa740f Merge pull request #397 from haberman/codegen-refactor fa4dfc2baa Addressed PR comments. 0fb61eaeb5 Refactored the codegen into smaller functions, in anticipation of extensions. 52be845c39 Merge pull request #396 from haberman/pre-ext-opt 807e7fe9e2 Fixed dense_below logic to be order-independent and consistent between def.c and codegen. 2e8a122fc0 Changed dense_below calculation to use UINT8_MAX as the constant. 6394894b6e Addressed PR comments. 65d7b8ab0c Optimized decoder and paved the way for parsing extensions. 3e035cb553 Merge pull request #395 from haberman/locale e8ba2a1899 Added a fix for locales that output ',' as decimal separator. 7010a73828 Merge pull request #394 from haberman/file-uniqueness 9482957425 Enforce that filenames are unique when loaded into symtab. aaad7801bf Merge pull request #393 from haberman/has-attribute 7887dc0c76 Fixed the __has_attribute() check for old versions of Clang. 01e7436ed3 Merge pull request #390 from haberman/musttail 4132034634 Addressed PR comment. ed708fcd5d Addressed PR comments. 876abae2db Removed some debug printing and simplified checktag slightly. 286441afa7 Fixed a size regression due to inlining UTF-8 verification. 75df4cdaa3 Loosened the check for fasttable to match what we did before. e84793dd73 Cleaned up debugging artifacts. a4b35aa388 Everything passes except 4 conformance tests. 6e10b5789d Removed redundant license from port_def in amalgmation. 4f1e48ecc6 Updated amalgamator to avoid duplicating license blocks. 0723bfa700 Merge pull request #387 from haberman/json-null dda5416569 Update bazel-skylib main branch name. 2fa52e6951 Merge branch 'master' into json-null a3126b7c7e Merge pull request #388 from haberman/fix-macos b344a6c582 Fixed the macOS build for XCode 11.3. a778f2639a Only perform multiple oneof check for non-null fields. 42bdfcb849 Fix BUILD file. 75d6dab37a Merge pull request #384 from haberman/internal 3881393907 Renamed .int.h to _internal.h, for greater clarity. 5084cbe646 Merge pull request #383 from fowles/master da4b75b979 Fix build rules for more restrive deps checks a8f9cf54cf Merge pull request #382 from haberman/license-headers 1ba446ccfe Updated Google, Inc. to Google LLC. 823eb09694 Update all 2011 dates to 2021. ff89277ef0 Merge pull request #380 from fowles/master 5f74d43cf9 Re-add some comment text that was accidentally removed. 0f27b0450a Merge branch 'master' into license-headers e59d2c8fa7 Added license headers to all files. be4f64b926 Merge pull request #381 from haberman/mv-msg-public 1674f28dd7 Put public message interface into msg.h and moved internal functions to msg.int.h. 6481f6319e Spell out deps explicitly f104225a1e Merge pull request #376 from haberman/fix-quadratic-mem 3c3799498d Merge pull request #379 from fowles/master 2e83d5c98f Remove unused file test_util.h b053fa6991 Merge pull request #378 from fowles/master 7876639e50 remove unused macro 5b97df91dd Restrict fuse to matching block_alloc e74d6c23de Small renames and use uintptr_t instead of void* d9a0c58108 Allow arena fuse to fail 53f5d9f69b Merge pull request #377 from haberman/json-parse-null 8370818143 Switch to a macro to avoid signed/const mismatches. 63ad3db980 Fixed "NULL + 0" UB in JSON encoder and decoder. add9b12f18 Fixed quadratic memory usage in upb_array_append(). 97e2aeb7ee Merge pull request #375 from haberman/cleanups 83c0edbd2a A few minor cleanups. baa7fe7473 Merge pull request #374 from haberman/update-deps 900bd5c426 Merge pull request #355 from haberman/aarch64 89df647460 Updated versions of ABSL and protobuf deps. e4343f0fa3 Update comment for ARM64. 103d51f102 Merge branch 'master' into aarch64 1b9cc09f0e Removed extraneous copybara directive. bbd817fdb6 Merge pull request #373 from haberman/table-cleanup c358829c76 Now that handlers are gone, cleaned up table to use arenas exclusively. ed5b4108e0 Merge pull request #363 from haberman/delete-handlers bfa528f0ae Merge pull request #372 from haberman/errmsg-fix ec9ba3f893 Fixed error message buffer overflow. eb0fdda14b Merge pull request #371 from haberman/json-any e58f7a0284 Fix for Any messages with no fields. 7541ba0f38 Merge pull request #364 from catenacyber/cifuzz 81829bacc3 Removed quote chars from error message. 88ed8f5d3b Changed JSON decoding error message to be more clear. f41c0ec261 Added an internal API to get arena from symtab, for Ruby's use. b080659eee Merge pull request #367 from haberman/timestamp-minute-offset f7ed1f27a3 Support non-zero minutes in the timestamp offset for JSON. 451dcbbb9a Adds CIFuzz f5d2d55007 Deleted the legacy "Handlers" APIs. upb can finally be deserving of its name. 0f40d59258 Merge pull request #362 from haberman/rb-warnings c7787cbaa1 Fixed a bunch of Clang warnings. 5e53b5bb3d Merge pull request #360 from haberman/default-msgval 7a6e647be1 Merge branch 'master' into default-msgval edb0a9a2d9 Merge pull request #361 from haberman/arena-bugfix 9175989431 Bugfix for arena cleanup list when passing to upb_decode(). 5e550e88f8 Added API for getting fielddef default as a upb_msgval. de76b31f9c Merge pull request #359 from veblush/fix-upbdefs 3cab8a38fc Fixed upbdefs error 48bb3e5662 Merge pull request #357 from veblush/string-opt 4c67b2086b Merge pull request #358 from veblush/clang-tidy-fix 38b4beed6b Fix clang-tidy function 'upb_encode_ex' has a definition with different parameter names 9b020d8f65 Optimize calls to std::string::find() and friends for a single char. 3c9ae7837a The fasttable parser works on ARM64! git-subtree-dir: third_party/upb git-subtree-split: 2de300726a1ba2de9a468468dc5ff9ed17a3215f * Updated upb for bazel * Regen upb files * Updated src/upb/gen_build_yaml.py
3 years ago
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::string FieldInitializer(upb::FieldDefPtr field,
const upb_MiniTableField* field64,
const upb_MiniTableField* field32,
const Options& options) {
if (options.bootstrap) {
ABSL_CHECK(!field.is_extension());
return absl::Substitute(
"*upb_MiniTable_FindFieldByNumber($0, $1)",
MessageMiniTableRef(field.containing_type(), options), field.number());
} else {
return absl::Substitute(
"{$0, $1, $2, $3, $4, $5}", field64->number,
ArchDependentSize(field32->offset, field64->offset),
ArchDependentSize(field32->presence, field64->presence),
field64->UPB_PRIVATE(submsg_index) == kUpb_NoSub
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
? "kUpb_NoSub"
: absl::StrCat(field64->UPB_PRIVATE(submsg_index)).c_str(),
field64->UPB_PRIVATE(descriptortype), GetModeInit(field32, field64));
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
}
}
std::string FieldInitializer(const DefPoolPair& pools, upb::FieldDefPtr field,
const Options& options) {
return FieldInitializer(field, pools.GetField64(field),
pools.GetField32(field), options);
}
// Writes a single field into a .upb.c source file.
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
void WriteMessageField(upb::FieldDefPtr field,
const upb_MiniTableField* field64,
const upb_MiniTableField* field32,
const Options& options, Output& output) {
output(" $0,\n", FieldInitializer(field, field64, field32, options));
}
std::string GetSub(upb::FieldDefPtr field) {
if (auto message_def = field.message_type()) {
return absl::Substitute("{.submsg = &$0}", MessageInitName(message_def));
}
if (auto enum_def = field.enum_subdef()) {
if (enum_def.is_closed()) {
return absl::Substitute("{.subenum = &$0}", EnumInit(enum_def));
}
}
return std::string("{.submsg = NULL}");
Upb upgrade to the lastest (#26869) * Squashed 'third_party/upb/' changes from 60607da72e..2de300726a 2de300726a Merge pull request #401 from philwo/patch-1 0010bd88ff Merge pull request #403 from haberman/google-wyhash 3f7ecfe315 A few fixes in the 32-bit fallback. 2c14e2788d Added #include for Windows instrinsic. 9e618009ec Removed some extraneous whitespace. c4744c0b21 Updated generated files. 039975556d Merge branch 'master' into google-wyhash ff9d011f12 Merge pull request #402 from haberman/update-ads-benchmark c2f2e93990 Fix Bazel at 4.1.0 41bfbca375 Updated ads benchmark to v7 as v5 no longer exists upstream. 91d506ac32 Ported ABSL's wyhash to C. 3328f06117 Remove ubuntu1604 from presubmit.yml f925acf5f0 Merge pull request #400 from haberman/extreg 897bd2500a Fixed compile error. 6e53de4a03 Addressed PR comments. cdd6434a31 Introduced upb_extreg and plumbed it into decoder. 69f186bd75 Merge pull request #399 from haberman/msg-extrep 3f8aa6ef20 Define the extension representation in messages and mini-tables. 4ccfab154b Merge pull request #398 from haberman/field-mode 58e158c6fa Changed mini-table to use a custom "mode" instead of descriptor's "label." 7596fa740f Merge pull request #397 from haberman/codegen-refactor fa4dfc2baa Addressed PR comments. 0fb61eaeb5 Refactored the codegen into smaller functions, in anticipation of extensions. 52be845c39 Merge pull request #396 from haberman/pre-ext-opt 807e7fe9e2 Fixed dense_below logic to be order-independent and consistent between def.c and codegen. 2e8a122fc0 Changed dense_below calculation to use UINT8_MAX as the constant. 6394894b6e Addressed PR comments. 65d7b8ab0c Optimized decoder and paved the way for parsing extensions. 3e035cb553 Merge pull request #395 from haberman/locale e8ba2a1899 Added a fix for locales that output ',' as decimal separator. 7010a73828 Merge pull request #394 from haberman/file-uniqueness 9482957425 Enforce that filenames are unique when loaded into symtab. aaad7801bf Merge pull request #393 from haberman/has-attribute 7887dc0c76 Fixed the __has_attribute() check for old versions of Clang. 01e7436ed3 Merge pull request #390 from haberman/musttail 4132034634 Addressed PR comment. ed708fcd5d Addressed PR comments. 876abae2db Removed some debug printing and simplified checktag slightly. 286441afa7 Fixed a size regression due to inlining UTF-8 verification. 75df4cdaa3 Loosened the check for fasttable to match what we did before. e84793dd73 Cleaned up debugging artifacts. a4b35aa388 Everything passes except 4 conformance tests. 6e10b5789d Removed redundant license from port_def in amalgmation. 4f1e48ecc6 Updated amalgamator to avoid duplicating license blocks. 0723bfa700 Merge pull request #387 from haberman/json-null dda5416569 Update bazel-skylib main branch name. 2fa52e6951 Merge branch 'master' into json-null a3126b7c7e Merge pull request #388 from haberman/fix-macos b344a6c582 Fixed the macOS build for XCode 11.3. a778f2639a Only perform multiple oneof check for non-null fields. 42bdfcb849 Fix BUILD file. 75d6dab37a Merge pull request #384 from haberman/internal 3881393907 Renamed .int.h to _internal.h, for greater clarity. 5084cbe646 Merge pull request #383 from fowles/master da4b75b979 Fix build rules for more restrive deps checks a8f9cf54cf Merge pull request #382 from haberman/license-headers 1ba446ccfe Updated Google, Inc. to Google LLC. 823eb09694 Update all 2011 dates to 2021. ff89277ef0 Merge pull request #380 from fowles/master 5f74d43cf9 Re-add some comment text that was accidentally removed. 0f27b0450a Merge branch 'master' into license-headers e59d2c8fa7 Added license headers to all files. be4f64b926 Merge pull request #381 from haberman/mv-msg-public 1674f28dd7 Put public message interface into msg.h and moved internal functions to msg.int.h. 6481f6319e Spell out deps explicitly f104225a1e Merge pull request #376 from haberman/fix-quadratic-mem 3c3799498d Merge pull request #379 from fowles/master 2e83d5c98f Remove unused file test_util.h b053fa6991 Merge pull request #378 from fowles/master 7876639e50 remove unused macro 5b97df91dd Restrict fuse to matching block_alloc e74d6c23de Small renames and use uintptr_t instead of void* d9a0c58108 Allow arena fuse to fail 53f5d9f69b Merge pull request #377 from haberman/json-parse-null 8370818143 Switch to a macro to avoid signed/const mismatches. 63ad3db980 Fixed "NULL + 0" UB in JSON encoder and decoder. add9b12f18 Fixed quadratic memory usage in upb_array_append(). 97e2aeb7ee Merge pull request #375 from haberman/cleanups 83c0edbd2a A few minor cleanups. baa7fe7473 Merge pull request #374 from haberman/update-deps 900bd5c426 Merge pull request #355 from haberman/aarch64 89df647460 Updated versions of ABSL and protobuf deps. e4343f0fa3 Update comment for ARM64. 103d51f102 Merge branch 'master' into aarch64 1b9cc09f0e Removed extraneous copybara directive. bbd817fdb6 Merge pull request #373 from haberman/table-cleanup c358829c76 Now that handlers are gone, cleaned up table to use arenas exclusively. ed5b4108e0 Merge pull request #363 from haberman/delete-handlers bfa528f0ae Merge pull request #372 from haberman/errmsg-fix ec9ba3f893 Fixed error message buffer overflow. eb0fdda14b Merge pull request #371 from haberman/json-any e58f7a0284 Fix for Any messages with no fields. 7541ba0f38 Merge pull request #364 from catenacyber/cifuzz 81829bacc3 Removed quote chars from error message. 88ed8f5d3b Changed JSON decoding error message to be more clear. f41c0ec261 Added an internal API to get arena from symtab, for Ruby's use. b080659eee Merge pull request #367 from haberman/timestamp-minute-offset f7ed1f27a3 Support non-zero minutes in the timestamp offset for JSON. 451dcbbb9a Adds CIFuzz f5d2d55007 Deleted the legacy "Handlers" APIs. upb can finally be deserving of its name. 0f40d59258 Merge pull request #362 from haberman/rb-warnings c7787cbaa1 Fixed a bunch of Clang warnings. 5e53b5bb3d Merge pull request #360 from haberman/default-msgval 7a6e647be1 Merge branch 'master' into default-msgval edb0a9a2d9 Merge pull request #361 from haberman/arena-bugfix 9175989431 Bugfix for arena cleanup list when passing to upb_decode(). 5e550e88f8 Added API for getting fielddef default as a upb_msgval. de76b31f9c Merge pull request #359 from veblush/fix-upbdefs 3cab8a38fc Fixed upbdefs error 48bb3e5662 Merge pull request #357 from veblush/string-opt 4c67b2086b Merge pull request #358 from veblush/clang-tidy-fix 38b4beed6b Fix clang-tidy function 'upb_encode_ex' has a definition with different parameter names 9b020d8f65 Optimize calls to std::string::find() and friends for a single char. 3c9ae7837a The fasttable parser works on ARM64! git-subtree-dir: third_party/upb git-subtree-split: 2de300726a1ba2de9a468468dc5ff9ed17a3215f * Updated upb for bazel * Regen upb files * Updated src/upb/gen_build_yaml.py
3 years ago
}
Upb upgrade to the lastest (#26869) * Squashed 'third_party/upb/' changes from 60607da72e..2de300726a 2de300726a Merge pull request #401 from philwo/patch-1 0010bd88ff Merge pull request #403 from haberman/google-wyhash 3f7ecfe315 A few fixes in the 32-bit fallback. 2c14e2788d Added #include for Windows instrinsic. 9e618009ec Removed some extraneous whitespace. c4744c0b21 Updated generated files. 039975556d Merge branch 'master' into google-wyhash ff9d011f12 Merge pull request #402 from haberman/update-ads-benchmark c2f2e93990 Fix Bazel at 4.1.0 41bfbca375 Updated ads benchmark to v7 as v5 no longer exists upstream. 91d506ac32 Ported ABSL's wyhash to C. 3328f06117 Remove ubuntu1604 from presubmit.yml f925acf5f0 Merge pull request #400 from haberman/extreg 897bd2500a Fixed compile error. 6e53de4a03 Addressed PR comments. cdd6434a31 Introduced upb_extreg and plumbed it into decoder. 69f186bd75 Merge pull request #399 from haberman/msg-extrep 3f8aa6ef20 Define the extension representation in messages and mini-tables. 4ccfab154b Merge pull request #398 from haberman/field-mode 58e158c6fa Changed mini-table to use a custom "mode" instead of descriptor's "label." 7596fa740f Merge pull request #397 from haberman/codegen-refactor fa4dfc2baa Addressed PR comments. 0fb61eaeb5 Refactored the codegen into smaller functions, in anticipation of extensions. 52be845c39 Merge pull request #396 from haberman/pre-ext-opt 807e7fe9e2 Fixed dense_below logic to be order-independent and consistent between def.c and codegen. 2e8a122fc0 Changed dense_below calculation to use UINT8_MAX as the constant. 6394894b6e Addressed PR comments. 65d7b8ab0c Optimized decoder and paved the way for parsing extensions. 3e035cb553 Merge pull request #395 from haberman/locale e8ba2a1899 Added a fix for locales that output ',' as decimal separator. 7010a73828 Merge pull request #394 from haberman/file-uniqueness 9482957425 Enforce that filenames are unique when loaded into symtab. aaad7801bf Merge pull request #393 from haberman/has-attribute 7887dc0c76 Fixed the __has_attribute() check for old versions of Clang. 01e7436ed3 Merge pull request #390 from haberman/musttail 4132034634 Addressed PR comment. ed708fcd5d Addressed PR comments. 876abae2db Removed some debug printing and simplified checktag slightly. 286441afa7 Fixed a size regression due to inlining UTF-8 verification. 75df4cdaa3 Loosened the check for fasttable to match what we did before. e84793dd73 Cleaned up debugging artifacts. a4b35aa388 Everything passes except 4 conformance tests. 6e10b5789d Removed redundant license from port_def in amalgmation. 4f1e48ecc6 Updated amalgamator to avoid duplicating license blocks. 0723bfa700 Merge pull request #387 from haberman/json-null dda5416569 Update bazel-skylib main branch name. 2fa52e6951 Merge branch 'master' into json-null a3126b7c7e Merge pull request #388 from haberman/fix-macos b344a6c582 Fixed the macOS build for XCode 11.3. a778f2639a Only perform multiple oneof check for non-null fields. 42bdfcb849 Fix BUILD file. 75d6dab37a Merge pull request #384 from haberman/internal 3881393907 Renamed .int.h to _internal.h, for greater clarity. 5084cbe646 Merge pull request #383 from fowles/master da4b75b979 Fix build rules for more restrive deps checks a8f9cf54cf Merge pull request #382 from haberman/license-headers 1ba446ccfe Updated Google, Inc. to Google LLC. 823eb09694 Update all 2011 dates to 2021. ff89277ef0 Merge pull request #380 from fowles/master 5f74d43cf9 Re-add some comment text that was accidentally removed. 0f27b0450a Merge branch 'master' into license-headers e59d2c8fa7 Added license headers to all files. be4f64b926 Merge pull request #381 from haberman/mv-msg-public 1674f28dd7 Put public message interface into msg.h and moved internal functions to msg.int.h. 6481f6319e Spell out deps explicitly f104225a1e Merge pull request #376 from haberman/fix-quadratic-mem 3c3799498d Merge pull request #379 from fowles/master 2e83d5c98f Remove unused file test_util.h b053fa6991 Merge pull request #378 from fowles/master 7876639e50 remove unused macro 5b97df91dd Restrict fuse to matching block_alloc e74d6c23de Small renames and use uintptr_t instead of void* d9a0c58108 Allow arena fuse to fail 53f5d9f69b Merge pull request #377 from haberman/json-parse-null 8370818143 Switch to a macro to avoid signed/const mismatches. 63ad3db980 Fixed "NULL + 0" UB in JSON encoder and decoder. add9b12f18 Fixed quadratic memory usage in upb_array_append(). 97e2aeb7ee Merge pull request #375 from haberman/cleanups 83c0edbd2a A few minor cleanups. baa7fe7473 Merge pull request #374 from haberman/update-deps 900bd5c426 Merge pull request #355 from haberman/aarch64 89df647460 Updated versions of ABSL and protobuf deps. e4343f0fa3 Update comment for ARM64. 103d51f102 Merge branch 'master' into aarch64 1b9cc09f0e Removed extraneous copybara directive. bbd817fdb6 Merge pull request #373 from haberman/table-cleanup c358829c76 Now that handlers are gone, cleaned up table to use arenas exclusively. ed5b4108e0 Merge pull request #363 from haberman/delete-handlers bfa528f0ae Merge pull request #372 from haberman/errmsg-fix ec9ba3f893 Fixed error message buffer overflow. eb0fdda14b Merge pull request #371 from haberman/json-any e58f7a0284 Fix for Any messages with no fields. 7541ba0f38 Merge pull request #364 from catenacyber/cifuzz 81829bacc3 Removed quote chars from error message. 88ed8f5d3b Changed JSON decoding error message to be more clear. f41c0ec261 Added an internal API to get arena from symtab, for Ruby's use. b080659eee Merge pull request #367 from haberman/timestamp-minute-offset f7ed1f27a3 Support non-zero minutes in the timestamp offset for JSON. 451dcbbb9a Adds CIFuzz f5d2d55007 Deleted the legacy "Handlers" APIs. upb can finally be deserving of its name. 0f40d59258 Merge pull request #362 from haberman/rb-warnings c7787cbaa1 Fixed a bunch of Clang warnings. 5e53b5bb3d Merge pull request #360 from haberman/default-msgval 7a6e647be1 Merge branch 'master' into default-msgval edb0a9a2d9 Merge pull request #361 from haberman/arena-bugfix 9175989431 Bugfix for arena cleanup list when passing to upb_decode(). 5e550e88f8 Added API for getting fielddef default as a upb_msgval. de76b31f9c Merge pull request #359 from veblush/fix-upbdefs 3cab8a38fc Fixed upbdefs error 48bb3e5662 Merge pull request #357 from veblush/string-opt 4c67b2086b Merge pull request #358 from veblush/clang-tidy-fix 38b4beed6b Fix clang-tidy function 'upb_encode_ex' has a definition with different parameter names 9b020d8f65 Optimize calls to std::string::find() and friends for a single char. 3c9ae7837a The fasttable parser works on ARM64! git-subtree-dir: third_party/upb git-subtree-split: 2de300726a1ba2de9a468468dc5ff9ed17a3215f * Updated upb for bazel * Regen upb files * Updated src/upb/gen_build_yaml.py
3 years ago
// Writes a single message into a .upb.c source file.
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
void WriteMessage(upb::MessageDefPtr message, const DefPoolPair& pools,
const Options& options, Output& output) {
std::string msg_name = ToCIdent(message.full_name());
Upb upgrade to the lastest (#26869) * Squashed 'third_party/upb/' changes from 60607da72e..2de300726a 2de300726a Merge pull request #401 from philwo/patch-1 0010bd88ff Merge pull request #403 from haberman/google-wyhash 3f7ecfe315 A few fixes in the 32-bit fallback. 2c14e2788d Added #include for Windows instrinsic. 9e618009ec Removed some extraneous whitespace. c4744c0b21 Updated generated files. 039975556d Merge branch 'master' into google-wyhash ff9d011f12 Merge pull request #402 from haberman/update-ads-benchmark c2f2e93990 Fix Bazel at 4.1.0 41bfbca375 Updated ads benchmark to v7 as v5 no longer exists upstream. 91d506ac32 Ported ABSL's wyhash to C. 3328f06117 Remove ubuntu1604 from presubmit.yml f925acf5f0 Merge pull request #400 from haberman/extreg 897bd2500a Fixed compile error. 6e53de4a03 Addressed PR comments. cdd6434a31 Introduced upb_extreg and plumbed it into decoder. 69f186bd75 Merge pull request #399 from haberman/msg-extrep 3f8aa6ef20 Define the extension representation in messages and mini-tables. 4ccfab154b Merge pull request #398 from haberman/field-mode 58e158c6fa Changed mini-table to use a custom "mode" instead of descriptor's "label." 7596fa740f Merge pull request #397 from haberman/codegen-refactor fa4dfc2baa Addressed PR comments. 0fb61eaeb5 Refactored the codegen into smaller functions, in anticipation of extensions. 52be845c39 Merge pull request #396 from haberman/pre-ext-opt 807e7fe9e2 Fixed dense_below logic to be order-independent and consistent between def.c and codegen. 2e8a122fc0 Changed dense_below calculation to use UINT8_MAX as the constant. 6394894b6e Addressed PR comments. 65d7b8ab0c Optimized decoder and paved the way for parsing extensions. 3e035cb553 Merge pull request #395 from haberman/locale e8ba2a1899 Added a fix for locales that output ',' as decimal separator. 7010a73828 Merge pull request #394 from haberman/file-uniqueness 9482957425 Enforce that filenames are unique when loaded into symtab. aaad7801bf Merge pull request #393 from haberman/has-attribute 7887dc0c76 Fixed the __has_attribute() check for old versions of Clang. 01e7436ed3 Merge pull request #390 from haberman/musttail 4132034634 Addressed PR comment. ed708fcd5d Addressed PR comments. 876abae2db Removed some debug printing and simplified checktag slightly. 286441afa7 Fixed a size regression due to inlining UTF-8 verification. 75df4cdaa3 Loosened the check for fasttable to match what we did before. e84793dd73 Cleaned up debugging artifacts. a4b35aa388 Everything passes except 4 conformance tests. 6e10b5789d Removed redundant license from port_def in amalgmation. 4f1e48ecc6 Updated amalgamator to avoid duplicating license blocks. 0723bfa700 Merge pull request #387 from haberman/json-null dda5416569 Update bazel-skylib main branch name. 2fa52e6951 Merge branch 'master' into json-null a3126b7c7e Merge pull request #388 from haberman/fix-macos b344a6c582 Fixed the macOS build for XCode 11.3. a778f2639a Only perform multiple oneof check for non-null fields. 42bdfcb849 Fix BUILD file. 75d6dab37a Merge pull request #384 from haberman/internal 3881393907 Renamed .int.h to _internal.h, for greater clarity. 5084cbe646 Merge pull request #383 from fowles/master da4b75b979 Fix build rules for more restrive deps checks a8f9cf54cf Merge pull request #382 from haberman/license-headers 1ba446ccfe Updated Google, Inc. to Google LLC. 823eb09694 Update all 2011 dates to 2021. ff89277ef0 Merge pull request #380 from fowles/master 5f74d43cf9 Re-add some comment text that was accidentally removed. 0f27b0450a Merge branch 'master' into license-headers e59d2c8fa7 Added license headers to all files. be4f64b926 Merge pull request #381 from haberman/mv-msg-public 1674f28dd7 Put public message interface into msg.h and moved internal functions to msg.int.h. 6481f6319e Spell out deps explicitly f104225a1e Merge pull request #376 from haberman/fix-quadratic-mem 3c3799498d Merge pull request #379 from fowles/master 2e83d5c98f Remove unused file test_util.h b053fa6991 Merge pull request #378 from fowles/master 7876639e50 remove unused macro 5b97df91dd Restrict fuse to matching block_alloc e74d6c23de Small renames and use uintptr_t instead of void* d9a0c58108 Allow arena fuse to fail 53f5d9f69b Merge pull request #377 from haberman/json-parse-null 8370818143 Switch to a macro to avoid signed/const mismatches. 63ad3db980 Fixed "NULL + 0" UB in JSON encoder and decoder. add9b12f18 Fixed quadratic memory usage in upb_array_append(). 97e2aeb7ee Merge pull request #375 from haberman/cleanups 83c0edbd2a A few minor cleanups. baa7fe7473 Merge pull request #374 from haberman/update-deps 900bd5c426 Merge pull request #355 from haberman/aarch64 89df647460 Updated versions of ABSL and protobuf deps. e4343f0fa3 Update comment for ARM64. 103d51f102 Merge branch 'master' into aarch64 1b9cc09f0e Removed extraneous copybara directive. bbd817fdb6 Merge pull request #373 from haberman/table-cleanup c358829c76 Now that handlers are gone, cleaned up table to use arenas exclusively. ed5b4108e0 Merge pull request #363 from haberman/delete-handlers bfa528f0ae Merge pull request #372 from haberman/errmsg-fix ec9ba3f893 Fixed error message buffer overflow. eb0fdda14b Merge pull request #371 from haberman/json-any e58f7a0284 Fix for Any messages with no fields. 7541ba0f38 Merge pull request #364 from catenacyber/cifuzz 81829bacc3 Removed quote chars from error message. 88ed8f5d3b Changed JSON decoding error message to be more clear. f41c0ec261 Added an internal API to get arena from symtab, for Ruby's use. b080659eee Merge pull request #367 from haberman/timestamp-minute-offset f7ed1f27a3 Support non-zero minutes in the timestamp offset for JSON. 451dcbbb9a Adds CIFuzz f5d2d55007 Deleted the legacy "Handlers" APIs. upb can finally be deserving of its name. 0f40d59258 Merge pull request #362 from haberman/rb-warnings c7787cbaa1 Fixed a bunch of Clang warnings. 5e53b5bb3d Merge pull request #360 from haberman/default-msgval 7a6e647be1 Merge branch 'master' into default-msgval edb0a9a2d9 Merge pull request #361 from haberman/arena-bugfix 9175989431 Bugfix for arena cleanup list when passing to upb_decode(). 5e550e88f8 Added API for getting fielddef default as a upb_msgval. de76b31f9c Merge pull request #359 from veblush/fix-upbdefs 3cab8a38fc Fixed upbdefs error 48bb3e5662 Merge pull request #357 from veblush/string-opt 4c67b2086b Merge pull request #358 from veblush/clang-tidy-fix 38b4beed6b Fix clang-tidy function 'upb_encode_ex' has a definition with different parameter names 9b020d8f65 Optimize calls to std::string::find() and friends for a single char. 3c9ae7837a The fasttable parser works on ARM64! git-subtree-dir: third_party/upb git-subtree-split: 2de300726a1ba2de9a468468dc5ff9ed17a3215f * Updated upb for bazel * Regen upb files * Updated src/upb/gen_build_yaml.py
3 years ago
std::string fields_array_ref = "NULL";
std::string submsgs_array_ref = "NULL";
std::string subenums_array_ref = "NULL";
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
const upb_MiniTable* mt_32 = pools.GetMiniTable32(message);
const upb_MiniTable* mt_64 = pools.GetMiniTable64(message);
std::vector<std::string> subs;
for (int i = 0; i < mt_64->field_count; i++) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
const upb_MiniTableField* f = &mt_64->fields[i];
if (f->UPB_PRIVATE(submsg_index) != kUpb_NoSub) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
subs.push_back(GetSub(message.FindFieldByNumber(f->number)));
}
}
if (!subs.empty()) {
Upb upgrade to the lastest (#26869) * Squashed 'third_party/upb/' changes from 60607da72e..2de300726a 2de300726a Merge pull request #401 from philwo/patch-1 0010bd88ff Merge pull request #403 from haberman/google-wyhash 3f7ecfe315 A few fixes in the 32-bit fallback. 2c14e2788d Added #include for Windows instrinsic. 9e618009ec Removed some extraneous whitespace. c4744c0b21 Updated generated files. 039975556d Merge branch 'master' into google-wyhash ff9d011f12 Merge pull request #402 from haberman/update-ads-benchmark c2f2e93990 Fix Bazel at 4.1.0 41bfbca375 Updated ads benchmark to v7 as v5 no longer exists upstream. 91d506ac32 Ported ABSL's wyhash to C. 3328f06117 Remove ubuntu1604 from presubmit.yml f925acf5f0 Merge pull request #400 from haberman/extreg 897bd2500a Fixed compile error. 6e53de4a03 Addressed PR comments. cdd6434a31 Introduced upb_extreg and plumbed it into decoder. 69f186bd75 Merge pull request #399 from haberman/msg-extrep 3f8aa6ef20 Define the extension representation in messages and mini-tables. 4ccfab154b Merge pull request #398 from haberman/field-mode 58e158c6fa Changed mini-table to use a custom "mode" instead of descriptor's "label." 7596fa740f Merge pull request #397 from haberman/codegen-refactor fa4dfc2baa Addressed PR comments. 0fb61eaeb5 Refactored the codegen into smaller functions, in anticipation of extensions. 52be845c39 Merge pull request #396 from haberman/pre-ext-opt 807e7fe9e2 Fixed dense_below logic to be order-independent and consistent between def.c and codegen. 2e8a122fc0 Changed dense_below calculation to use UINT8_MAX as the constant. 6394894b6e Addressed PR comments. 65d7b8ab0c Optimized decoder and paved the way for parsing extensions. 3e035cb553 Merge pull request #395 from haberman/locale e8ba2a1899 Added a fix for locales that output ',' as decimal separator. 7010a73828 Merge pull request #394 from haberman/file-uniqueness 9482957425 Enforce that filenames are unique when loaded into symtab. aaad7801bf Merge pull request #393 from haberman/has-attribute 7887dc0c76 Fixed the __has_attribute() check for old versions of Clang. 01e7436ed3 Merge pull request #390 from haberman/musttail 4132034634 Addressed PR comment. ed708fcd5d Addressed PR comments. 876abae2db Removed some debug printing and simplified checktag slightly. 286441afa7 Fixed a size regression due to inlining UTF-8 verification. 75df4cdaa3 Loosened the check for fasttable to match what we did before. e84793dd73 Cleaned up debugging artifacts. a4b35aa388 Everything passes except 4 conformance tests. 6e10b5789d Removed redundant license from port_def in amalgmation. 4f1e48ecc6 Updated amalgamator to avoid duplicating license blocks. 0723bfa700 Merge pull request #387 from haberman/json-null dda5416569 Update bazel-skylib main branch name. 2fa52e6951 Merge branch 'master' into json-null a3126b7c7e Merge pull request #388 from haberman/fix-macos b344a6c582 Fixed the macOS build for XCode 11.3. a778f2639a Only perform multiple oneof check for non-null fields. 42bdfcb849 Fix BUILD file. 75d6dab37a Merge pull request #384 from haberman/internal 3881393907 Renamed .int.h to _internal.h, for greater clarity. 5084cbe646 Merge pull request #383 from fowles/master da4b75b979 Fix build rules for more restrive deps checks a8f9cf54cf Merge pull request #382 from haberman/license-headers 1ba446ccfe Updated Google, Inc. to Google LLC. 823eb09694 Update all 2011 dates to 2021. ff89277ef0 Merge pull request #380 from fowles/master 5f74d43cf9 Re-add some comment text that was accidentally removed. 0f27b0450a Merge branch 'master' into license-headers e59d2c8fa7 Added license headers to all files. be4f64b926 Merge pull request #381 from haberman/mv-msg-public 1674f28dd7 Put public message interface into msg.h and moved internal functions to msg.int.h. 6481f6319e Spell out deps explicitly f104225a1e Merge pull request #376 from haberman/fix-quadratic-mem 3c3799498d Merge pull request #379 from fowles/master 2e83d5c98f Remove unused file test_util.h b053fa6991 Merge pull request #378 from fowles/master 7876639e50 remove unused macro 5b97df91dd Restrict fuse to matching block_alloc e74d6c23de Small renames and use uintptr_t instead of void* d9a0c58108 Allow arena fuse to fail 53f5d9f69b Merge pull request #377 from haberman/json-parse-null 8370818143 Switch to a macro to avoid signed/const mismatches. 63ad3db980 Fixed "NULL + 0" UB in JSON encoder and decoder. add9b12f18 Fixed quadratic memory usage in upb_array_append(). 97e2aeb7ee Merge pull request #375 from haberman/cleanups 83c0edbd2a A few minor cleanups. baa7fe7473 Merge pull request #374 from haberman/update-deps 900bd5c426 Merge pull request #355 from haberman/aarch64 89df647460 Updated versions of ABSL and protobuf deps. e4343f0fa3 Update comment for ARM64. 103d51f102 Merge branch 'master' into aarch64 1b9cc09f0e Removed extraneous copybara directive. bbd817fdb6 Merge pull request #373 from haberman/table-cleanup c358829c76 Now that handlers are gone, cleaned up table to use arenas exclusively. ed5b4108e0 Merge pull request #363 from haberman/delete-handlers bfa528f0ae Merge pull request #372 from haberman/errmsg-fix ec9ba3f893 Fixed error message buffer overflow. eb0fdda14b Merge pull request #371 from haberman/json-any e58f7a0284 Fix for Any messages with no fields. 7541ba0f38 Merge pull request #364 from catenacyber/cifuzz 81829bacc3 Removed quote chars from error message. 88ed8f5d3b Changed JSON decoding error message to be more clear. f41c0ec261 Added an internal API to get arena from symtab, for Ruby's use. b080659eee Merge pull request #367 from haberman/timestamp-minute-offset f7ed1f27a3 Support non-zero minutes in the timestamp offset for JSON. 451dcbbb9a Adds CIFuzz f5d2d55007 Deleted the legacy "Handlers" APIs. upb can finally be deserving of its name. 0f40d59258 Merge pull request #362 from haberman/rb-warnings c7787cbaa1 Fixed a bunch of Clang warnings. 5e53b5bb3d Merge pull request #360 from haberman/default-msgval 7a6e647be1 Merge branch 'master' into default-msgval edb0a9a2d9 Merge pull request #361 from haberman/arena-bugfix 9175989431 Bugfix for arena cleanup list when passing to upb_decode(). 5e550e88f8 Added API for getting fielddef default as a upb_msgval. de76b31f9c Merge pull request #359 from veblush/fix-upbdefs 3cab8a38fc Fixed upbdefs error 48bb3e5662 Merge pull request #357 from veblush/string-opt 4c67b2086b Merge pull request #358 from veblush/clang-tidy-fix 38b4beed6b Fix clang-tidy function 'upb_encode_ex' has a definition with different parameter names 9b020d8f65 Optimize calls to std::string::find() and friends for a single char. 3c9ae7837a The fasttable parser works on ARM64! git-subtree-dir: third_party/upb git-subtree-split: 2de300726a1ba2de9a468468dc5ff9ed17a3215f * Updated upb for bazel * Regen upb files * Updated src/upb/gen_build_yaml.py
3 years ago
std::string submsgs_array_name = msg_name + "_submsgs";
submsgs_array_ref = "&" + submsgs_array_name + "[0]";
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
output("static const upb_MiniTableSub $0[$1] = {\n", submsgs_array_name,
subs.size());
Upb upgrade to the lastest (#26869) * Squashed 'third_party/upb/' changes from 60607da72e..2de300726a 2de300726a Merge pull request #401 from philwo/patch-1 0010bd88ff Merge pull request #403 from haberman/google-wyhash 3f7ecfe315 A few fixes in the 32-bit fallback. 2c14e2788d Added #include for Windows instrinsic. 9e618009ec Removed some extraneous whitespace. c4744c0b21 Updated generated files. 039975556d Merge branch 'master' into google-wyhash ff9d011f12 Merge pull request #402 from haberman/update-ads-benchmark c2f2e93990 Fix Bazel at 4.1.0 41bfbca375 Updated ads benchmark to v7 as v5 no longer exists upstream. 91d506ac32 Ported ABSL's wyhash to C. 3328f06117 Remove ubuntu1604 from presubmit.yml f925acf5f0 Merge pull request #400 from haberman/extreg 897bd2500a Fixed compile error. 6e53de4a03 Addressed PR comments. cdd6434a31 Introduced upb_extreg and plumbed it into decoder. 69f186bd75 Merge pull request #399 from haberman/msg-extrep 3f8aa6ef20 Define the extension representation in messages and mini-tables. 4ccfab154b Merge pull request #398 from haberman/field-mode 58e158c6fa Changed mini-table to use a custom "mode" instead of descriptor's "label." 7596fa740f Merge pull request #397 from haberman/codegen-refactor fa4dfc2baa Addressed PR comments. 0fb61eaeb5 Refactored the codegen into smaller functions, in anticipation of extensions. 52be845c39 Merge pull request #396 from haberman/pre-ext-opt 807e7fe9e2 Fixed dense_below logic to be order-independent and consistent between def.c and codegen. 2e8a122fc0 Changed dense_below calculation to use UINT8_MAX as the constant. 6394894b6e Addressed PR comments. 65d7b8ab0c Optimized decoder and paved the way for parsing extensions. 3e035cb553 Merge pull request #395 from haberman/locale e8ba2a1899 Added a fix for locales that output ',' as decimal separator. 7010a73828 Merge pull request #394 from haberman/file-uniqueness 9482957425 Enforce that filenames are unique when loaded into symtab. aaad7801bf Merge pull request #393 from haberman/has-attribute 7887dc0c76 Fixed the __has_attribute() check for old versions of Clang. 01e7436ed3 Merge pull request #390 from haberman/musttail 4132034634 Addressed PR comment. ed708fcd5d Addressed PR comments. 876abae2db Removed some debug printing and simplified checktag slightly. 286441afa7 Fixed a size regression due to inlining UTF-8 verification. 75df4cdaa3 Loosened the check for fasttable to match what we did before. e84793dd73 Cleaned up debugging artifacts. a4b35aa388 Everything passes except 4 conformance tests. 6e10b5789d Removed redundant license from port_def in amalgmation. 4f1e48ecc6 Updated amalgamator to avoid duplicating license blocks. 0723bfa700 Merge pull request #387 from haberman/json-null dda5416569 Update bazel-skylib main branch name. 2fa52e6951 Merge branch 'master' into json-null a3126b7c7e Merge pull request #388 from haberman/fix-macos b344a6c582 Fixed the macOS build for XCode 11.3. a778f2639a Only perform multiple oneof check for non-null fields. 42bdfcb849 Fix BUILD file. 75d6dab37a Merge pull request #384 from haberman/internal 3881393907 Renamed .int.h to _internal.h, for greater clarity. 5084cbe646 Merge pull request #383 from fowles/master da4b75b979 Fix build rules for more restrive deps checks a8f9cf54cf Merge pull request #382 from haberman/license-headers 1ba446ccfe Updated Google, Inc. to Google LLC. 823eb09694 Update all 2011 dates to 2021. ff89277ef0 Merge pull request #380 from fowles/master 5f74d43cf9 Re-add some comment text that was accidentally removed. 0f27b0450a Merge branch 'master' into license-headers e59d2c8fa7 Added license headers to all files. be4f64b926 Merge pull request #381 from haberman/mv-msg-public 1674f28dd7 Put public message interface into msg.h and moved internal functions to msg.int.h. 6481f6319e Spell out deps explicitly f104225a1e Merge pull request #376 from haberman/fix-quadratic-mem 3c3799498d Merge pull request #379 from fowles/master 2e83d5c98f Remove unused file test_util.h b053fa6991 Merge pull request #378 from fowles/master 7876639e50 remove unused macro 5b97df91dd Restrict fuse to matching block_alloc e74d6c23de Small renames and use uintptr_t instead of void* d9a0c58108 Allow arena fuse to fail 53f5d9f69b Merge pull request #377 from haberman/json-parse-null 8370818143 Switch to a macro to avoid signed/const mismatches. 63ad3db980 Fixed "NULL + 0" UB in JSON encoder and decoder. add9b12f18 Fixed quadratic memory usage in upb_array_append(). 97e2aeb7ee Merge pull request #375 from haberman/cleanups 83c0edbd2a A few minor cleanups. baa7fe7473 Merge pull request #374 from haberman/update-deps 900bd5c426 Merge pull request #355 from haberman/aarch64 89df647460 Updated versions of ABSL and protobuf deps. e4343f0fa3 Update comment for ARM64. 103d51f102 Merge branch 'master' into aarch64 1b9cc09f0e Removed extraneous copybara directive. bbd817fdb6 Merge pull request #373 from haberman/table-cleanup c358829c76 Now that handlers are gone, cleaned up table to use arenas exclusively. ed5b4108e0 Merge pull request #363 from haberman/delete-handlers bfa528f0ae Merge pull request #372 from haberman/errmsg-fix ec9ba3f893 Fixed error message buffer overflow. eb0fdda14b Merge pull request #371 from haberman/json-any e58f7a0284 Fix for Any messages with no fields. 7541ba0f38 Merge pull request #364 from catenacyber/cifuzz 81829bacc3 Removed quote chars from error message. 88ed8f5d3b Changed JSON decoding error message to be more clear. f41c0ec261 Added an internal API to get arena from symtab, for Ruby's use. b080659eee Merge pull request #367 from haberman/timestamp-minute-offset f7ed1f27a3 Support non-zero minutes in the timestamp offset for JSON. 451dcbbb9a Adds CIFuzz f5d2d55007 Deleted the legacy "Handlers" APIs. upb can finally be deserving of its name. 0f40d59258 Merge pull request #362 from haberman/rb-warnings c7787cbaa1 Fixed a bunch of Clang warnings. 5e53b5bb3d Merge pull request #360 from haberman/default-msgval 7a6e647be1 Merge branch 'master' into default-msgval edb0a9a2d9 Merge pull request #361 from haberman/arena-bugfix 9175989431 Bugfix for arena cleanup list when passing to upb_decode(). 5e550e88f8 Added API for getting fielddef default as a upb_msgval. de76b31f9c Merge pull request #359 from veblush/fix-upbdefs 3cab8a38fc Fixed upbdefs error 48bb3e5662 Merge pull request #357 from veblush/string-opt 4c67b2086b Merge pull request #358 from veblush/clang-tidy-fix 38b4beed6b Fix clang-tidy function 'upb_encode_ex' has a definition with different parameter names 9b020d8f65 Optimize calls to std::string::find() and friends for a single char. 3c9ae7837a The fasttable parser works on ARM64! git-subtree-dir: third_party/upb git-subtree-split: 2de300726a1ba2de9a468468dc5ff9ed17a3215f * Updated upb for bazel * Regen upb files * Updated src/upb/gen_build_yaml.py
3 years ago
for (const auto& sub : subs) {
output(" $0,\n", sub);
}
Upb upgrade to the lastest (#26869) * Squashed 'third_party/upb/' changes from 60607da72e..2de300726a 2de300726a Merge pull request #401 from philwo/patch-1 0010bd88ff Merge pull request #403 from haberman/google-wyhash 3f7ecfe315 A few fixes in the 32-bit fallback. 2c14e2788d Added #include for Windows instrinsic. 9e618009ec Removed some extraneous whitespace. c4744c0b21 Updated generated files. 039975556d Merge branch 'master' into google-wyhash ff9d011f12 Merge pull request #402 from haberman/update-ads-benchmark c2f2e93990 Fix Bazel at 4.1.0 41bfbca375 Updated ads benchmark to v7 as v5 no longer exists upstream. 91d506ac32 Ported ABSL's wyhash to C. 3328f06117 Remove ubuntu1604 from presubmit.yml f925acf5f0 Merge pull request #400 from haberman/extreg 897bd2500a Fixed compile error. 6e53de4a03 Addressed PR comments. cdd6434a31 Introduced upb_extreg and plumbed it into decoder. 69f186bd75 Merge pull request #399 from haberman/msg-extrep 3f8aa6ef20 Define the extension representation in messages and mini-tables. 4ccfab154b Merge pull request #398 from haberman/field-mode 58e158c6fa Changed mini-table to use a custom "mode" instead of descriptor's "label." 7596fa740f Merge pull request #397 from haberman/codegen-refactor fa4dfc2baa Addressed PR comments. 0fb61eaeb5 Refactored the codegen into smaller functions, in anticipation of extensions. 52be845c39 Merge pull request #396 from haberman/pre-ext-opt 807e7fe9e2 Fixed dense_below logic to be order-independent and consistent between def.c and codegen. 2e8a122fc0 Changed dense_below calculation to use UINT8_MAX as the constant. 6394894b6e Addressed PR comments. 65d7b8ab0c Optimized decoder and paved the way for parsing extensions. 3e035cb553 Merge pull request #395 from haberman/locale e8ba2a1899 Added a fix for locales that output ',' as decimal separator. 7010a73828 Merge pull request #394 from haberman/file-uniqueness 9482957425 Enforce that filenames are unique when loaded into symtab. aaad7801bf Merge pull request #393 from haberman/has-attribute 7887dc0c76 Fixed the __has_attribute() check for old versions of Clang. 01e7436ed3 Merge pull request #390 from haberman/musttail 4132034634 Addressed PR comment. ed708fcd5d Addressed PR comments. 876abae2db Removed some debug printing and simplified checktag slightly. 286441afa7 Fixed a size regression due to inlining UTF-8 verification. 75df4cdaa3 Loosened the check for fasttable to match what we did before. e84793dd73 Cleaned up debugging artifacts. a4b35aa388 Everything passes except 4 conformance tests. 6e10b5789d Removed redundant license from port_def in amalgmation. 4f1e48ecc6 Updated amalgamator to avoid duplicating license blocks. 0723bfa700 Merge pull request #387 from haberman/json-null dda5416569 Update bazel-skylib main branch name. 2fa52e6951 Merge branch 'master' into json-null a3126b7c7e Merge pull request #388 from haberman/fix-macos b344a6c582 Fixed the macOS build for XCode 11.3. a778f2639a Only perform multiple oneof check for non-null fields. 42bdfcb849 Fix BUILD file. 75d6dab37a Merge pull request #384 from haberman/internal 3881393907 Renamed .int.h to _internal.h, for greater clarity. 5084cbe646 Merge pull request #383 from fowles/master da4b75b979 Fix build rules for more restrive deps checks a8f9cf54cf Merge pull request #382 from haberman/license-headers 1ba446ccfe Updated Google, Inc. to Google LLC. 823eb09694 Update all 2011 dates to 2021. ff89277ef0 Merge pull request #380 from fowles/master 5f74d43cf9 Re-add some comment text that was accidentally removed. 0f27b0450a Merge branch 'master' into license-headers e59d2c8fa7 Added license headers to all files. be4f64b926 Merge pull request #381 from haberman/mv-msg-public 1674f28dd7 Put public message interface into msg.h and moved internal functions to msg.int.h. 6481f6319e Spell out deps explicitly f104225a1e Merge pull request #376 from haberman/fix-quadratic-mem 3c3799498d Merge pull request #379 from fowles/master 2e83d5c98f Remove unused file test_util.h b053fa6991 Merge pull request #378 from fowles/master 7876639e50 remove unused macro 5b97df91dd Restrict fuse to matching block_alloc e74d6c23de Small renames and use uintptr_t instead of void* d9a0c58108 Allow arena fuse to fail 53f5d9f69b Merge pull request #377 from haberman/json-parse-null 8370818143 Switch to a macro to avoid signed/const mismatches. 63ad3db980 Fixed "NULL + 0" UB in JSON encoder and decoder. add9b12f18 Fixed quadratic memory usage in upb_array_append(). 97e2aeb7ee Merge pull request #375 from haberman/cleanups 83c0edbd2a A few minor cleanups. baa7fe7473 Merge pull request #374 from haberman/update-deps 900bd5c426 Merge pull request #355 from haberman/aarch64 89df647460 Updated versions of ABSL and protobuf deps. e4343f0fa3 Update comment for ARM64. 103d51f102 Merge branch 'master' into aarch64 1b9cc09f0e Removed extraneous copybara directive. bbd817fdb6 Merge pull request #373 from haberman/table-cleanup c358829c76 Now that handlers are gone, cleaned up table to use arenas exclusively. ed5b4108e0 Merge pull request #363 from haberman/delete-handlers bfa528f0ae Merge pull request #372 from haberman/errmsg-fix ec9ba3f893 Fixed error message buffer overflow. eb0fdda14b Merge pull request #371 from haberman/json-any e58f7a0284 Fix for Any messages with no fields. 7541ba0f38 Merge pull request #364 from catenacyber/cifuzz 81829bacc3 Removed quote chars from error message. 88ed8f5d3b Changed JSON decoding error message to be more clear. f41c0ec261 Added an internal API to get arena from symtab, for Ruby's use. b080659eee Merge pull request #367 from haberman/timestamp-minute-offset f7ed1f27a3 Support non-zero minutes in the timestamp offset for JSON. 451dcbbb9a Adds CIFuzz f5d2d55007 Deleted the legacy "Handlers" APIs. upb can finally be deserving of its name. 0f40d59258 Merge pull request #362 from haberman/rb-warnings c7787cbaa1 Fixed a bunch of Clang warnings. 5e53b5bb3d Merge pull request #360 from haberman/default-msgval 7a6e647be1 Merge branch 'master' into default-msgval edb0a9a2d9 Merge pull request #361 from haberman/arena-bugfix 9175989431 Bugfix for arena cleanup list when passing to upb_decode(). 5e550e88f8 Added API for getting fielddef default as a upb_msgval. de76b31f9c Merge pull request #359 from veblush/fix-upbdefs 3cab8a38fc Fixed upbdefs error 48bb3e5662 Merge pull request #357 from veblush/string-opt 4c67b2086b Merge pull request #358 from veblush/clang-tidy-fix 38b4beed6b Fix clang-tidy function 'upb_encode_ex' has a definition with different parameter names 9b020d8f65 Optimize calls to std::string::find() and friends for a single char. 3c9ae7837a The fasttable parser works on ARM64! git-subtree-dir: third_party/upb git-subtree-split: 2de300726a1ba2de9a468468dc5ff9ed17a3215f * Updated upb for bazel * Regen upb files * Updated src/upb/gen_build_yaml.py
3 years ago
output("};\n\n");
}
if (mt_64->field_count > 0) {
Upb upgrade to the lastest (#26869) * Squashed 'third_party/upb/' changes from 60607da72e..2de300726a 2de300726a Merge pull request #401 from philwo/patch-1 0010bd88ff Merge pull request #403 from haberman/google-wyhash 3f7ecfe315 A few fixes in the 32-bit fallback. 2c14e2788d Added #include for Windows instrinsic. 9e618009ec Removed some extraneous whitespace. c4744c0b21 Updated generated files. 039975556d Merge branch 'master' into google-wyhash ff9d011f12 Merge pull request #402 from haberman/update-ads-benchmark c2f2e93990 Fix Bazel at 4.1.0 41bfbca375 Updated ads benchmark to v7 as v5 no longer exists upstream. 91d506ac32 Ported ABSL's wyhash to C. 3328f06117 Remove ubuntu1604 from presubmit.yml f925acf5f0 Merge pull request #400 from haberman/extreg 897bd2500a Fixed compile error. 6e53de4a03 Addressed PR comments. cdd6434a31 Introduced upb_extreg and plumbed it into decoder. 69f186bd75 Merge pull request #399 from haberman/msg-extrep 3f8aa6ef20 Define the extension representation in messages and mini-tables. 4ccfab154b Merge pull request #398 from haberman/field-mode 58e158c6fa Changed mini-table to use a custom "mode" instead of descriptor's "label." 7596fa740f Merge pull request #397 from haberman/codegen-refactor fa4dfc2baa Addressed PR comments. 0fb61eaeb5 Refactored the codegen into smaller functions, in anticipation of extensions. 52be845c39 Merge pull request #396 from haberman/pre-ext-opt 807e7fe9e2 Fixed dense_below logic to be order-independent and consistent between def.c and codegen. 2e8a122fc0 Changed dense_below calculation to use UINT8_MAX as the constant. 6394894b6e Addressed PR comments. 65d7b8ab0c Optimized decoder and paved the way for parsing extensions. 3e035cb553 Merge pull request #395 from haberman/locale e8ba2a1899 Added a fix for locales that output ',' as decimal separator. 7010a73828 Merge pull request #394 from haberman/file-uniqueness 9482957425 Enforce that filenames are unique when loaded into symtab. aaad7801bf Merge pull request #393 from haberman/has-attribute 7887dc0c76 Fixed the __has_attribute() check for old versions of Clang. 01e7436ed3 Merge pull request #390 from haberman/musttail 4132034634 Addressed PR comment. ed708fcd5d Addressed PR comments. 876abae2db Removed some debug printing and simplified checktag slightly. 286441afa7 Fixed a size regression due to inlining UTF-8 verification. 75df4cdaa3 Loosened the check for fasttable to match what we did before. e84793dd73 Cleaned up debugging artifacts. a4b35aa388 Everything passes except 4 conformance tests. 6e10b5789d Removed redundant license from port_def in amalgmation. 4f1e48ecc6 Updated amalgamator to avoid duplicating license blocks. 0723bfa700 Merge pull request #387 from haberman/json-null dda5416569 Update bazel-skylib main branch name. 2fa52e6951 Merge branch 'master' into json-null a3126b7c7e Merge pull request #388 from haberman/fix-macos b344a6c582 Fixed the macOS build for XCode 11.3. a778f2639a Only perform multiple oneof check for non-null fields. 42bdfcb849 Fix BUILD file. 75d6dab37a Merge pull request #384 from haberman/internal 3881393907 Renamed .int.h to _internal.h, for greater clarity. 5084cbe646 Merge pull request #383 from fowles/master da4b75b979 Fix build rules for more restrive deps checks a8f9cf54cf Merge pull request #382 from haberman/license-headers 1ba446ccfe Updated Google, Inc. to Google LLC. 823eb09694 Update all 2011 dates to 2021. ff89277ef0 Merge pull request #380 from fowles/master 5f74d43cf9 Re-add some comment text that was accidentally removed. 0f27b0450a Merge branch 'master' into license-headers e59d2c8fa7 Added license headers to all files. be4f64b926 Merge pull request #381 from haberman/mv-msg-public 1674f28dd7 Put public message interface into msg.h and moved internal functions to msg.int.h. 6481f6319e Spell out deps explicitly f104225a1e Merge pull request #376 from haberman/fix-quadratic-mem 3c3799498d Merge pull request #379 from fowles/master 2e83d5c98f Remove unused file test_util.h b053fa6991 Merge pull request #378 from fowles/master 7876639e50 remove unused macro 5b97df91dd Restrict fuse to matching block_alloc e74d6c23de Small renames and use uintptr_t instead of void* d9a0c58108 Allow arena fuse to fail 53f5d9f69b Merge pull request #377 from haberman/json-parse-null 8370818143 Switch to a macro to avoid signed/const mismatches. 63ad3db980 Fixed "NULL + 0" UB in JSON encoder and decoder. add9b12f18 Fixed quadratic memory usage in upb_array_append(). 97e2aeb7ee Merge pull request #375 from haberman/cleanups 83c0edbd2a A few minor cleanups. baa7fe7473 Merge pull request #374 from haberman/update-deps 900bd5c426 Merge pull request #355 from haberman/aarch64 89df647460 Updated versions of ABSL and protobuf deps. e4343f0fa3 Update comment for ARM64. 103d51f102 Merge branch 'master' into aarch64 1b9cc09f0e Removed extraneous copybara directive. bbd817fdb6 Merge pull request #373 from haberman/table-cleanup c358829c76 Now that handlers are gone, cleaned up table to use arenas exclusively. ed5b4108e0 Merge pull request #363 from haberman/delete-handlers bfa528f0ae Merge pull request #372 from haberman/errmsg-fix ec9ba3f893 Fixed error message buffer overflow. eb0fdda14b Merge pull request #371 from haberman/json-any e58f7a0284 Fix for Any messages with no fields. 7541ba0f38 Merge pull request #364 from catenacyber/cifuzz 81829bacc3 Removed quote chars from error message. 88ed8f5d3b Changed JSON decoding error message to be more clear. f41c0ec261 Added an internal API to get arena from symtab, for Ruby's use. b080659eee Merge pull request #367 from haberman/timestamp-minute-offset f7ed1f27a3 Support non-zero minutes in the timestamp offset for JSON. 451dcbbb9a Adds CIFuzz f5d2d55007 Deleted the legacy "Handlers" APIs. upb can finally be deserving of its name. 0f40d59258 Merge pull request #362 from haberman/rb-warnings c7787cbaa1 Fixed a bunch of Clang warnings. 5e53b5bb3d Merge pull request #360 from haberman/default-msgval 7a6e647be1 Merge branch 'master' into default-msgval edb0a9a2d9 Merge pull request #361 from haberman/arena-bugfix 9175989431 Bugfix for arena cleanup list when passing to upb_decode(). 5e550e88f8 Added API for getting fielddef default as a upb_msgval. de76b31f9c Merge pull request #359 from veblush/fix-upbdefs 3cab8a38fc Fixed upbdefs error 48bb3e5662 Merge pull request #357 from veblush/string-opt 4c67b2086b Merge pull request #358 from veblush/clang-tidy-fix 38b4beed6b Fix clang-tidy function 'upb_encode_ex' has a definition with different parameter names 9b020d8f65 Optimize calls to std::string::find() and friends for a single char. 3c9ae7837a The fasttable parser works on ARM64! git-subtree-dir: third_party/upb git-subtree-split: 2de300726a1ba2de9a468468dc5ff9ed17a3215f * Updated upb for bazel * Regen upb files * Updated src/upb/gen_build_yaml.py
3 years ago
std::string fields_array_name = msg_name + "__fields";
fields_array_ref = "&" + fields_array_name + "[0]";
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
output("static const upb_MiniTableField $0[$1] = {\n", fields_array_name,
mt_64->field_count);
for (int i = 0; i < mt_64->field_count; i++) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
WriteMessageField(message.FindFieldByNumber(mt_64->fields[i].number),
&mt_64->fields[i], &mt_32->fields[i], options, output);
}
Upb upgrade to the lastest (#26869) * Squashed 'third_party/upb/' changes from 60607da72e..2de300726a 2de300726a Merge pull request #401 from philwo/patch-1 0010bd88ff Merge pull request #403 from haberman/google-wyhash 3f7ecfe315 A few fixes in the 32-bit fallback. 2c14e2788d Added #include for Windows instrinsic. 9e618009ec Removed some extraneous whitespace. c4744c0b21 Updated generated files. 039975556d Merge branch 'master' into google-wyhash ff9d011f12 Merge pull request #402 from haberman/update-ads-benchmark c2f2e93990 Fix Bazel at 4.1.0 41bfbca375 Updated ads benchmark to v7 as v5 no longer exists upstream. 91d506ac32 Ported ABSL's wyhash to C. 3328f06117 Remove ubuntu1604 from presubmit.yml f925acf5f0 Merge pull request #400 from haberman/extreg 897bd2500a Fixed compile error. 6e53de4a03 Addressed PR comments. cdd6434a31 Introduced upb_extreg and plumbed it into decoder. 69f186bd75 Merge pull request #399 from haberman/msg-extrep 3f8aa6ef20 Define the extension representation in messages and mini-tables. 4ccfab154b Merge pull request #398 from haberman/field-mode 58e158c6fa Changed mini-table to use a custom "mode" instead of descriptor's "label." 7596fa740f Merge pull request #397 from haberman/codegen-refactor fa4dfc2baa Addressed PR comments. 0fb61eaeb5 Refactored the codegen into smaller functions, in anticipation of extensions. 52be845c39 Merge pull request #396 from haberman/pre-ext-opt 807e7fe9e2 Fixed dense_below logic to be order-independent and consistent between def.c and codegen. 2e8a122fc0 Changed dense_below calculation to use UINT8_MAX as the constant. 6394894b6e Addressed PR comments. 65d7b8ab0c Optimized decoder and paved the way for parsing extensions. 3e035cb553 Merge pull request #395 from haberman/locale e8ba2a1899 Added a fix for locales that output ',' as decimal separator. 7010a73828 Merge pull request #394 from haberman/file-uniqueness 9482957425 Enforce that filenames are unique when loaded into symtab. aaad7801bf Merge pull request #393 from haberman/has-attribute 7887dc0c76 Fixed the __has_attribute() check for old versions of Clang. 01e7436ed3 Merge pull request #390 from haberman/musttail 4132034634 Addressed PR comment. ed708fcd5d Addressed PR comments. 876abae2db Removed some debug printing and simplified checktag slightly. 286441afa7 Fixed a size regression due to inlining UTF-8 verification. 75df4cdaa3 Loosened the check for fasttable to match what we did before. e84793dd73 Cleaned up debugging artifacts. a4b35aa388 Everything passes except 4 conformance tests. 6e10b5789d Removed redundant license from port_def in amalgmation. 4f1e48ecc6 Updated amalgamator to avoid duplicating license blocks. 0723bfa700 Merge pull request #387 from haberman/json-null dda5416569 Update bazel-skylib main branch name. 2fa52e6951 Merge branch 'master' into json-null a3126b7c7e Merge pull request #388 from haberman/fix-macos b344a6c582 Fixed the macOS build for XCode 11.3. a778f2639a Only perform multiple oneof check for non-null fields. 42bdfcb849 Fix BUILD file. 75d6dab37a Merge pull request #384 from haberman/internal 3881393907 Renamed .int.h to _internal.h, for greater clarity. 5084cbe646 Merge pull request #383 from fowles/master da4b75b979 Fix build rules for more restrive deps checks a8f9cf54cf Merge pull request #382 from haberman/license-headers 1ba446ccfe Updated Google, Inc. to Google LLC. 823eb09694 Update all 2011 dates to 2021. ff89277ef0 Merge pull request #380 from fowles/master 5f74d43cf9 Re-add some comment text that was accidentally removed. 0f27b0450a Merge branch 'master' into license-headers e59d2c8fa7 Added license headers to all files. be4f64b926 Merge pull request #381 from haberman/mv-msg-public 1674f28dd7 Put public message interface into msg.h and moved internal functions to msg.int.h. 6481f6319e Spell out deps explicitly f104225a1e Merge pull request #376 from haberman/fix-quadratic-mem 3c3799498d Merge pull request #379 from fowles/master 2e83d5c98f Remove unused file test_util.h b053fa6991 Merge pull request #378 from fowles/master 7876639e50 remove unused macro 5b97df91dd Restrict fuse to matching block_alloc e74d6c23de Small renames and use uintptr_t instead of void* d9a0c58108 Allow arena fuse to fail 53f5d9f69b Merge pull request #377 from haberman/json-parse-null 8370818143 Switch to a macro to avoid signed/const mismatches. 63ad3db980 Fixed "NULL + 0" UB in JSON encoder and decoder. add9b12f18 Fixed quadratic memory usage in upb_array_append(). 97e2aeb7ee Merge pull request #375 from haberman/cleanups 83c0edbd2a A few minor cleanups. baa7fe7473 Merge pull request #374 from haberman/update-deps 900bd5c426 Merge pull request #355 from haberman/aarch64 89df647460 Updated versions of ABSL and protobuf deps. e4343f0fa3 Update comment for ARM64. 103d51f102 Merge branch 'master' into aarch64 1b9cc09f0e Removed extraneous copybara directive. bbd817fdb6 Merge pull request #373 from haberman/table-cleanup c358829c76 Now that handlers are gone, cleaned up table to use arenas exclusively. ed5b4108e0 Merge pull request #363 from haberman/delete-handlers bfa528f0ae Merge pull request #372 from haberman/errmsg-fix ec9ba3f893 Fixed error message buffer overflow. eb0fdda14b Merge pull request #371 from haberman/json-any e58f7a0284 Fix for Any messages with no fields. 7541ba0f38 Merge pull request #364 from catenacyber/cifuzz 81829bacc3 Removed quote chars from error message. 88ed8f5d3b Changed JSON decoding error message to be more clear. f41c0ec261 Added an internal API to get arena from symtab, for Ruby's use. b080659eee Merge pull request #367 from haberman/timestamp-minute-offset f7ed1f27a3 Support non-zero minutes in the timestamp offset for JSON. 451dcbbb9a Adds CIFuzz f5d2d55007 Deleted the legacy "Handlers" APIs. upb can finally be deserving of its name. 0f40d59258 Merge pull request #362 from haberman/rb-warnings c7787cbaa1 Fixed a bunch of Clang warnings. 5e53b5bb3d Merge pull request #360 from haberman/default-msgval 7a6e647be1 Merge branch 'master' into default-msgval edb0a9a2d9 Merge pull request #361 from haberman/arena-bugfix 9175989431 Bugfix for arena cleanup list when passing to upb_decode(). 5e550e88f8 Added API for getting fielddef default as a upb_msgval. de76b31f9c Merge pull request #359 from veblush/fix-upbdefs 3cab8a38fc Fixed upbdefs error 48bb3e5662 Merge pull request #357 from veblush/string-opt 4c67b2086b Merge pull request #358 from veblush/clang-tidy-fix 38b4beed6b Fix clang-tidy function 'upb_encode_ex' has a definition with different parameter names 9b020d8f65 Optimize calls to std::string::find() and friends for a single char. 3c9ae7837a The fasttable parser works on ARM64! git-subtree-dir: third_party/upb git-subtree-split: 2de300726a1ba2de9a468468dc5ff9ed17a3215f * Updated upb for bazel * Regen upb files * Updated src/upb/gen_build_yaml.py
3 years ago
output("};\n\n");
}
Upb upgrade to the lastest (#26869) * Squashed 'third_party/upb/' changes from 60607da72e..2de300726a 2de300726a Merge pull request #401 from philwo/patch-1 0010bd88ff Merge pull request #403 from haberman/google-wyhash 3f7ecfe315 A few fixes in the 32-bit fallback. 2c14e2788d Added #include for Windows instrinsic. 9e618009ec Removed some extraneous whitespace. c4744c0b21 Updated generated files. 039975556d Merge branch 'master' into google-wyhash ff9d011f12 Merge pull request #402 from haberman/update-ads-benchmark c2f2e93990 Fix Bazel at 4.1.0 41bfbca375 Updated ads benchmark to v7 as v5 no longer exists upstream. 91d506ac32 Ported ABSL's wyhash to C. 3328f06117 Remove ubuntu1604 from presubmit.yml f925acf5f0 Merge pull request #400 from haberman/extreg 897bd2500a Fixed compile error. 6e53de4a03 Addressed PR comments. cdd6434a31 Introduced upb_extreg and plumbed it into decoder. 69f186bd75 Merge pull request #399 from haberman/msg-extrep 3f8aa6ef20 Define the extension representation in messages and mini-tables. 4ccfab154b Merge pull request #398 from haberman/field-mode 58e158c6fa Changed mini-table to use a custom "mode" instead of descriptor's "label." 7596fa740f Merge pull request #397 from haberman/codegen-refactor fa4dfc2baa Addressed PR comments. 0fb61eaeb5 Refactored the codegen into smaller functions, in anticipation of extensions. 52be845c39 Merge pull request #396 from haberman/pre-ext-opt 807e7fe9e2 Fixed dense_below logic to be order-independent and consistent between def.c and codegen. 2e8a122fc0 Changed dense_below calculation to use UINT8_MAX as the constant. 6394894b6e Addressed PR comments. 65d7b8ab0c Optimized decoder and paved the way for parsing extensions. 3e035cb553 Merge pull request #395 from haberman/locale e8ba2a1899 Added a fix for locales that output ',' as decimal separator. 7010a73828 Merge pull request #394 from haberman/file-uniqueness 9482957425 Enforce that filenames are unique when loaded into symtab. aaad7801bf Merge pull request #393 from haberman/has-attribute 7887dc0c76 Fixed the __has_attribute() check for old versions of Clang. 01e7436ed3 Merge pull request #390 from haberman/musttail 4132034634 Addressed PR comment. ed708fcd5d Addressed PR comments. 876abae2db Removed some debug printing and simplified checktag slightly. 286441afa7 Fixed a size regression due to inlining UTF-8 verification. 75df4cdaa3 Loosened the check for fasttable to match what we did before. e84793dd73 Cleaned up debugging artifacts. a4b35aa388 Everything passes except 4 conformance tests. 6e10b5789d Removed redundant license from port_def in amalgmation. 4f1e48ecc6 Updated amalgamator to avoid duplicating license blocks. 0723bfa700 Merge pull request #387 from haberman/json-null dda5416569 Update bazel-skylib main branch name. 2fa52e6951 Merge branch 'master' into json-null a3126b7c7e Merge pull request #388 from haberman/fix-macos b344a6c582 Fixed the macOS build for XCode 11.3. a778f2639a Only perform multiple oneof check for non-null fields. 42bdfcb849 Fix BUILD file. 75d6dab37a Merge pull request #384 from haberman/internal 3881393907 Renamed .int.h to _internal.h, for greater clarity. 5084cbe646 Merge pull request #383 from fowles/master da4b75b979 Fix build rules for more restrive deps checks a8f9cf54cf Merge pull request #382 from haberman/license-headers 1ba446ccfe Updated Google, Inc. to Google LLC. 823eb09694 Update all 2011 dates to 2021. ff89277ef0 Merge pull request #380 from fowles/master 5f74d43cf9 Re-add some comment text that was accidentally removed. 0f27b0450a Merge branch 'master' into license-headers e59d2c8fa7 Added license headers to all files. be4f64b926 Merge pull request #381 from haberman/mv-msg-public 1674f28dd7 Put public message interface into msg.h and moved internal functions to msg.int.h. 6481f6319e Spell out deps explicitly f104225a1e Merge pull request #376 from haberman/fix-quadratic-mem 3c3799498d Merge pull request #379 from fowles/master 2e83d5c98f Remove unused file test_util.h b053fa6991 Merge pull request #378 from fowles/master 7876639e50 remove unused macro 5b97df91dd Restrict fuse to matching block_alloc e74d6c23de Small renames and use uintptr_t instead of void* d9a0c58108 Allow arena fuse to fail 53f5d9f69b Merge pull request #377 from haberman/json-parse-null 8370818143 Switch to a macro to avoid signed/const mismatches. 63ad3db980 Fixed "NULL + 0" UB in JSON encoder and decoder. add9b12f18 Fixed quadratic memory usage in upb_array_append(). 97e2aeb7ee Merge pull request #375 from haberman/cleanups 83c0edbd2a A few minor cleanups. baa7fe7473 Merge pull request #374 from haberman/update-deps 900bd5c426 Merge pull request #355 from haberman/aarch64 89df647460 Updated versions of ABSL and protobuf deps. e4343f0fa3 Update comment for ARM64. 103d51f102 Merge branch 'master' into aarch64 1b9cc09f0e Removed extraneous copybara directive. bbd817fdb6 Merge pull request #373 from haberman/table-cleanup c358829c76 Now that handlers are gone, cleaned up table to use arenas exclusively. ed5b4108e0 Merge pull request #363 from haberman/delete-handlers bfa528f0ae Merge pull request #372 from haberman/errmsg-fix ec9ba3f893 Fixed error message buffer overflow. eb0fdda14b Merge pull request #371 from haberman/json-any e58f7a0284 Fix for Any messages with no fields. 7541ba0f38 Merge pull request #364 from catenacyber/cifuzz 81829bacc3 Removed quote chars from error message. 88ed8f5d3b Changed JSON decoding error message to be more clear. f41c0ec261 Added an internal API to get arena from symtab, for Ruby's use. b080659eee Merge pull request #367 from haberman/timestamp-minute-offset f7ed1f27a3 Support non-zero minutes in the timestamp offset for JSON. 451dcbbb9a Adds CIFuzz f5d2d55007 Deleted the legacy "Handlers" APIs. upb can finally be deserving of its name. 0f40d59258 Merge pull request #362 from haberman/rb-warnings c7787cbaa1 Fixed a bunch of Clang warnings. 5e53b5bb3d Merge pull request #360 from haberman/default-msgval 7a6e647be1 Merge branch 'master' into default-msgval edb0a9a2d9 Merge pull request #361 from haberman/arena-bugfix 9175989431 Bugfix for arena cleanup list when passing to upb_decode(). 5e550e88f8 Added API for getting fielddef default as a upb_msgval. de76b31f9c Merge pull request #359 from veblush/fix-upbdefs 3cab8a38fc Fixed upbdefs error 48bb3e5662 Merge pull request #357 from veblush/string-opt 4c67b2086b Merge pull request #358 from veblush/clang-tidy-fix 38b4beed6b Fix clang-tidy function 'upb_encode_ex' has a definition with different parameter names 9b020d8f65 Optimize calls to std::string::find() and friends for a single char. 3c9ae7837a The fasttable parser works on ARM64! git-subtree-dir: third_party/upb git-subtree-split: 2de300726a1ba2de9a468468dc5ff9ed17a3215f * Updated upb for bazel * Regen upb files * Updated src/upb/gen_build_yaml.py
3 years ago
std::vector<TableEntry> table;
uint8_t table_mask = -1;
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
table = FastDecodeTable(message, pools);
Upb upgrade to the lastest (#26869) * Squashed 'third_party/upb/' changes from 60607da72e..2de300726a 2de300726a Merge pull request #401 from philwo/patch-1 0010bd88ff Merge pull request #403 from haberman/google-wyhash 3f7ecfe315 A few fixes in the 32-bit fallback. 2c14e2788d Added #include for Windows instrinsic. 9e618009ec Removed some extraneous whitespace. c4744c0b21 Updated generated files. 039975556d Merge branch 'master' into google-wyhash ff9d011f12 Merge pull request #402 from haberman/update-ads-benchmark c2f2e93990 Fix Bazel at 4.1.0 41bfbca375 Updated ads benchmark to v7 as v5 no longer exists upstream. 91d506ac32 Ported ABSL's wyhash to C. 3328f06117 Remove ubuntu1604 from presubmit.yml f925acf5f0 Merge pull request #400 from haberman/extreg 897bd2500a Fixed compile error. 6e53de4a03 Addressed PR comments. cdd6434a31 Introduced upb_extreg and plumbed it into decoder. 69f186bd75 Merge pull request #399 from haberman/msg-extrep 3f8aa6ef20 Define the extension representation in messages and mini-tables. 4ccfab154b Merge pull request #398 from haberman/field-mode 58e158c6fa Changed mini-table to use a custom "mode" instead of descriptor's "label." 7596fa740f Merge pull request #397 from haberman/codegen-refactor fa4dfc2baa Addressed PR comments. 0fb61eaeb5 Refactored the codegen into smaller functions, in anticipation of extensions. 52be845c39 Merge pull request #396 from haberman/pre-ext-opt 807e7fe9e2 Fixed dense_below logic to be order-independent and consistent between def.c and codegen. 2e8a122fc0 Changed dense_below calculation to use UINT8_MAX as the constant. 6394894b6e Addressed PR comments. 65d7b8ab0c Optimized decoder and paved the way for parsing extensions. 3e035cb553 Merge pull request #395 from haberman/locale e8ba2a1899 Added a fix for locales that output ',' as decimal separator. 7010a73828 Merge pull request #394 from haberman/file-uniqueness 9482957425 Enforce that filenames are unique when loaded into symtab. aaad7801bf Merge pull request #393 from haberman/has-attribute 7887dc0c76 Fixed the __has_attribute() check for old versions of Clang. 01e7436ed3 Merge pull request #390 from haberman/musttail 4132034634 Addressed PR comment. ed708fcd5d Addressed PR comments. 876abae2db Removed some debug printing and simplified checktag slightly. 286441afa7 Fixed a size regression due to inlining UTF-8 verification. 75df4cdaa3 Loosened the check for fasttable to match what we did before. e84793dd73 Cleaned up debugging artifacts. a4b35aa388 Everything passes except 4 conformance tests. 6e10b5789d Removed redundant license from port_def in amalgmation. 4f1e48ecc6 Updated amalgamator to avoid duplicating license blocks. 0723bfa700 Merge pull request #387 from haberman/json-null dda5416569 Update bazel-skylib main branch name. 2fa52e6951 Merge branch 'master' into json-null a3126b7c7e Merge pull request #388 from haberman/fix-macos b344a6c582 Fixed the macOS build for XCode 11.3. a778f2639a Only perform multiple oneof check for non-null fields. 42bdfcb849 Fix BUILD file. 75d6dab37a Merge pull request #384 from haberman/internal 3881393907 Renamed .int.h to _internal.h, for greater clarity. 5084cbe646 Merge pull request #383 from fowles/master da4b75b979 Fix build rules for more restrive deps checks a8f9cf54cf Merge pull request #382 from haberman/license-headers 1ba446ccfe Updated Google, Inc. to Google LLC. 823eb09694 Update all 2011 dates to 2021. ff89277ef0 Merge pull request #380 from fowles/master 5f74d43cf9 Re-add some comment text that was accidentally removed. 0f27b0450a Merge branch 'master' into license-headers e59d2c8fa7 Added license headers to all files. be4f64b926 Merge pull request #381 from haberman/mv-msg-public 1674f28dd7 Put public message interface into msg.h and moved internal functions to msg.int.h. 6481f6319e Spell out deps explicitly f104225a1e Merge pull request #376 from haberman/fix-quadratic-mem 3c3799498d Merge pull request #379 from fowles/master 2e83d5c98f Remove unused file test_util.h b053fa6991 Merge pull request #378 from fowles/master 7876639e50 remove unused macro 5b97df91dd Restrict fuse to matching block_alloc e74d6c23de Small renames and use uintptr_t instead of void* d9a0c58108 Allow arena fuse to fail 53f5d9f69b Merge pull request #377 from haberman/json-parse-null 8370818143 Switch to a macro to avoid signed/const mismatches. 63ad3db980 Fixed "NULL + 0" UB in JSON encoder and decoder. add9b12f18 Fixed quadratic memory usage in upb_array_append(). 97e2aeb7ee Merge pull request #375 from haberman/cleanups 83c0edbd2a A few minor cleanups. baa7fe7473 Merge pull request #374 from haberman/update-deps 900bd5c426 Merge pull request #355 from haberman/aarch64 89df647460 Updated versions of ABSL and protobuf deps. e4343f0fa3 Update comment for ARM64. 103d51f102 Merge branch 'master' into aarch64 1b9cc09f0e Removed extraneous copybara directive. bbd817fdb6 Merge pull request #373 from haberman/table-cleanup c358829c76 Now that handlers are gone, cleaned up table to use arenas exclusively. ed5b4108e0 Merge pull request #363 from haberman/delete-handlers bfa528f0ae Merge pull request #372 from haberman/errmsg-fix ec9ba3f893 Fixed error message buffer overflow. eb0fdda14b Merge pull request #371 from haberman/json-any e58f7a0284 Fix for Any messages with no fields. 7541ba0f38 Merge pull request #364 from catenacyber/cifuzz 81829bacc3 Removed quote chars from error message. 88ed8f5d3b Changed JSON decoding error message to be more clear. f41c0ec261 Added an internal API to get arena from symtab, for Ruby's use. b080659eee Merge pull request #367 from haberman/timestamp-minute-offset f7ed1f27a3 Support non-zero minutes in the timestamp offset for JSON. 451dcbbb9a Adds CIFuzz f5d2d55007 Deleted the legacy "Handlers" APIs. upb can finally be deserving of its name. 0f40d59258 Merge pull request #362 from haberman/rb-warnings c7787cbaa1 Fixed a bunch of Clang warnings. 5e53b5bb3d Merge pull request #360 from haberman/default-msgval 7a6e647be1 Merge branch 'master' into default-msgval edb0a9a2d9 Merge pull request #361 from haberman/arena-bugfix 9175989431 Bugfix for arena cleanup list when passing to upb_decode(). 5e550e88f8 Added API for getting fielddef default as a upb_msgval. de76b31f9c Merge pull request #359 from veblush/fix-upbdefs 3cab8a38fc Fixed upbdefs error 48bb3e5662 Merge pull request #357 from veblush/string-opt 4c67b2086b Merge pull request #358 from veblush/clang-tidy-fix 38b4beed6b Fix clang-tidy function 'upb_encode_ex' has a definition with different parameter names 9b020d8f65 Optimize calls to std::string::find() and friends for a single char. 3c9ae7837a The fasttable parser works on ARM64! git-subtree-dir: third_party/upb git-subtree-split: 2de300726a1ba2de9a468468dc5ff9ed17a3215f * Updated upb for bazel * Regen upb files * Updated src/upb/gen_build_yaml.py
3 years ago
if (table.size() > 1) {
assert((table.size() & (table.size() - 1)) == 0);
table_mask = (table.size() - 1) << 3;
}
std::string msgext = "kUpb_ExtMode_NonExtendable";
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
if (message.extension_range_count()) {
if (UPB_DESC(MessageOptions_message_set_wire_format)(message.options())) {
msgext = "kUpb_ExtMode_IsMessageSet";
} else {
msgext = "kUpb_ExtMode_Extendable";
}
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
output("const upb_MiniTable $0 = {\n", MessageInitName(message));
Upb upgrade to the lastest (#26869) * Squashed 'third_party/upb/' changes from 60607da72e..2de300726a 2de300726a Merge pull request #401 from philwo/patch-1 0010bd88ff Merge pull request #403 from haberman/google-wyhash 3f7ecfe315 A few fixes in the 32-bit fallback. 2c14e2788d Added #include for Windows instrinsic. 9e618009ec Removed some extraneous whitespace. c4744c0b21 Updated generated files. 039975556d Merge branch 'master' into google-wyhash ff9d011f12 Merge pull request #402 from haberman/update-ads-benchmark c2f2e93990 Fix Bazel at 4.1.0 41bfbca375 Updated ads benchmark to v7 as v5 no longer exists upstream. 91d506ac32 Ported ABSL's wyhash to C. 3328f06117 Remove ubuntu1604 from presubmit.yml f925acf5f0 Merge pull request #400 from haberman/extreg 897bd2500a Fixed compile error. 6e53de4a03 Addressed PR comments. cdd6434a31 Introduced upb_extreg and plumbed it into decoder. 69f186bd75 Merge pull request #399 from haberman/msg-extrep 3f8aa6ef20 Define the extension representation in messages and mini-tables. 4ccfab154b Merge pull request #398 from haberman/field-mode 58e158c6fa Changed mini-table to use a custom "mode" instead of descriptor's "label." 7596fa740f Merge pull request #397 from haberman/codegen-refactor fa4dfc2baa Addressed PR comments. 0fb61eaeb5 Refactored the codegen into smaller functions, in anticipation of extensions. 52be845c39 Merge pull request #396 from haberman/pre-ext-opt 807e7fe9e2 Fixed dense_below logic to be order-independent and consistent between def.c and codegen. 2e8a122fc0 Changed dense_below calculation to use UINT8_MAX as the constant. 6394894b6e Addressed PR comments. 65d7b8ab0c Optimized decoder and paved the way for parsing extensions. 3e035cb553 Merge pull request #395 from haberman/locale e8ba2a1899 Added a fix for locales that output ',' as decimal separator. 7010a73828 Merge pull request #394 from haberman/file-uniqueness 9482957425 Enforce that filenames are unique when loaded into symtab. aaad7801bf Merge pull request #393 from haberman/has-attribute 7887dc0c76 Fixed the __has_attribute() check for old versions of Clang. 01e7436ed3 Merge pull request #390 from haberman/musttail 4132034634 Addressed PR comment. ed708fcd5d Addressed PR comments. 876abae2db Removed some debug printing and simplified checktag slightly. 286441afa7 Fixed a size regression due to inlining UTF-8 verification. 75df4cdaa3 Loosened the check for fasttable to match what we did before. e84793dd73 Cleaned up debugging artifacts. a4b35aa388 Everything passes except 4 conformance tests. 6e10b5789d Removed redundant license from port_def in amalgmation. 4f1e48ecc6 Updated amalgamator to avoid duplicating license blocks. 0723bfa700 Merge pull request #387 from haberman/json-null dda5416569 Update bazel-skylib main branch name. 2fa52e6951 Merge branch 'master' into json-null a3126b7c7e Merge pull request #388 from haberman/fix-macos b344a6c582 Fixed the macOS build for XCode 11.3. a778f2639a Only perform multiple oneof check for non-null fields. 42bdfcb849 Fix BUILD file. 75d6dab37a Merge pull request #384 from haberman/internal 3881393907 Renamed .int.h to _internal.h, for greater clarity. 5084cbe646 Merge pull request #383 from fowles/master da4b75b979 Fix build rules for more restrive deps checks a8f9cf54cf Merge pull request #382 from haberman/license-headers 1ba446ccfe Updated Google, Inc. to Google LLC. 823eb09694 Update all 2011 dates to 2021. ff89277ef0 Merge pull request #380 from fowles/master 5f74d43cf9 Re-add some comment text that was accidentally removed. 0f27b0450a Merge branch 'master' into license-headers e59d2c8fa7 Added license headers to all files. be4f64b926 Merge pull request #381 from haberman/mv-msg-public 1674f28dd7 Put public message interface into msg.h and moved internal functions to msg.int.h. 6481f6319e Spell out deps explicitly f104225a1e Merge pull request #376 from haberman/fix-quadratic-mem 3c3799498d Merge pull request #379 from fowles/master 2e83d5c98f Remove unused file test_util.h b053fa6991 Merge pull request #378 from fowles/master 7876639e50 remove unused macro 5b97df91dd Restrict fuse to matching block_alloc e74d6c23de Small renames and use uintptr_t instead of void* d9a0c58108 Allow arena fuse to fail 53f5d9f69b Merge pull request #377 from haberman/json-parse-null 8370818143 Switch to a macro to avoid signed/const mismatches. 63ad3db980 Fixed "NULL + 0" UB in JSON encoder and decoder. add9b12f18 Fixed quadratic memory usage in upb_array_append(). 97e2aeb7ee Merge pull request #375 from haberman/cleanups 83c0edbd2a A few minor cleanups. baa7fe7473 Merge pull request #374 from haberman/update-deps 900bd5c426 Merge pull request #355 from haberman/aarch64 89df647460 Updated versions of ABSL and protobuf deps. e4343f0fa3 Update comment for ARM64. 103d51f102 Merge branch 'master' into aarch64 1b9cc09f0e Removed extraneous copybara directive. bbd817fdb6 Merge pull request #373 from haberman/table-cleanup c358829c76 Now that handlers are gone, cleaned up table to use arenas exclusively. ed5b4108e0 Merge pull request #363 from haberman/delete-handlers bfa528f0ae Merge pull request #372 from haberman/errmsg-fix ec9ba3f893 Fixed error message buffer overflow. eb0fdda14b Merge pull request #371 from haberman/json-any e58f7a0284 Fix for Any messages with no fields. 7541ba0f38 Merge pull request #364 from catenacyber/cifuzz 81829bacc3 Removed quote chars from error message. 88ed8f5d3b Changed JSON decoding error message to be more clear. f41c0ec261 Added an internal API to get arena from symtab, for Ruby's use. b080659eee Merge pull request #367 from haberman/timestamp-minute-offset f7ed1f27a3 Support non-zero minutes in the timestamp offset for JSON. 451dcbbb9a Adds CIFuzz f5d2d55007 Deleted the legacy "Handlers" APIs. upb can finally be deserving of its name. 0f40d59258 Merge pull request #362 from haberman/rb-warnings c7787cbaa1 Fixed a bunch of Clang warnings. 5e53b5bb3d Merge pull request #360 from haberman/default-msgval 7a6e647be1 Merge branch 'master' into default-msgval edb0a9a2d9 Merge pull request #361 from haberman/arena-bugfix 9175989431 Bugfix for arena cleanup list when passing to upb_decode(). 5e550e88f8 Added API for getting fielddef default as a upb_msgval. de76b31f9c Merge pull request #359 from veblush/fix-upbdefs 3cab8a38fc Fixed upbdefs error 48bb3e5662 Merge pull request #357 from veblush/string-opt 4c67b2086b Merge pull request #358 from veblush/clang-tidy-fix 38b4beed6b Fix clang-tidy function 'upb_encode_ex' has a definition with different parameter names 9b020d8f65 Optimize calls to std::string::find() and friends for a single char. 3c9ae7837a The fasttable parser works on ARM64! git-subtree-dir: third_party/upb git-subtree-split: 2de300726a1ba2de9a468468dc5ff9ed17a3215f * Updated upb for bazel * Regen upb files * Updated src/upb/gen_build_yaml.py
3 years ago
output(" $0,\n", submsgs_array_ref);
output(" $0,\n", fields_array_ref);
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
output(" $0, $1, $2, $3, UPB_FASTTABLE_MASK($4), $5,\n",
ArchDependentSize(mt_32->size, mt_64->size), mt_64->field_count,
msgext, mt_64->dense_below, table_mask, mt_64->required_count);
Upb upgrade to the lastest (#26869) * Squashed 'third_party/upb/' changes from 60607da72e..2de300726a 2de300726a Merge pull request #401 from philwo/patch-1 0010bd88ff Merge pull request #403 from haberman/google-wyhash 3f7ecfe315 A few fixes in the 32-bit fallback. 2c14e2788d Added #include for Windows instrinsic. 9e618009ec Removed some extraneous whitespace. c4744c0b21 Updated generated files. 039975556d Merge branch 'master' into google-wyhash ff9d011f12 Merge pull request #402 from haberman/update-ads-benchmark c2f2e93990 Fix Bazel at 4.1.0 41bfbca375 Updated ads benchmark to v7 as v5 no longer exists upstream. 91d506ac32 Ported ABSL's wyhash to C. 3328f06117 Remove ubuntu1604 from presubmit.yml f925acf5f0 Merge pull request #400 from haberman/extreg 897bd2500a Fixed compile error. 6e53de4a03 Addressed PR comments. cdd6434a31 Introduced upb_extreg and plumbed it into decoder. 69f186bd75 Merge pull request #399 from haberman/msg-extrep 3f8aa6ef20 Define the extension representation in messages and mini-tables. 4ccfab154b Merge pull request #398 from haberman/field-mode 58e158c6fa Changed mini-table to use a custom "mode" instead of descriptor's "label." 7596fa740f Merge pull request #397 from haberman/codegen-refactor fa4dfc2baa Addressed PR comments. 0fb61eaeb5 Refactored the codegen into smaller functions, in anticipation of extensions. 52be845c39 Merge pull request #396 from haberman/pre-ext-opt 807e7fe9e2 Fixed dense_below logic to be order-independent and consistent between def.c and codegen. 2e8a122fc0 Changed dense_below calculation to use UINT8_MAX as the constant. 6394894b6e Addressed PR comments. 65d7b8ab0c Optimized decoder and paved the way for parsing extensions. 3e035cb553 Merge pull request #395 from haberman/locale e8ba2a1899 Added a fix for locales that output ',' as decimal separator. 7010a73828 Merge pull request #394 from haberman/file-uniqueness 9482957425 Enforce that filenames are unique when loaded into symtab. aaad7801bf Merge pull request #393 from haberman/has-attribute 7887dc0c76 Fixed the __has_attribute() check for old versions of Clang. 01e7436ed3 Merge pull request #390 from haberman/musttail 4132034634 Addressed PR comment. ed708fcd5d Addressed PR comments. 876abae2db Removed some debug printing and simplified checktag slightly. 286441afa7 Fixed a size regression due to inlining UTF-8 verification. 75df4cdaa3 Loosened the check for fasttable to match what we did before. e84793dd73 Cleaned up debugging artifacts. a4b35aa388 Everything passes except 4 conformance tests. 6e10b5789d Removed redundant license from port_def in amalgmation. 4f1e48ecc6 Updated amalgamator to avoid duplicating license blocks. 0723bfa700 Merge pull request #387 from haberman/json-null dda5416569 Update bazel-skylib main branch name. 2fa52e6951 Merge branch 'master' into json-null a3126b7c7e Merge pull request #388 from haberman/fix-macos b344a6c582 Fixed the macOS build for XCode 11.3. a778f2639a Only perform multiple oneof check for non-null fields. 42bdfcb849 Fix BUILD file. 75d6dab37a Merge pull request #384 from haberman/internal 3881393907 Renamed .int.h to _internal.h, for greater clarity. 5084cbe646 Merge pull request #383 from fowles/master da4b75b979 Fix build rules for more restrive deps checks a8f9cf54cf Merge pull request #382 from haberman/license-headers 1ba446ccfe Updated Google, Inc. to Google LLC. 823eb09694 Update all 2011 dates to 2021. ff89277ef0 Merge pull request #380 from fowles/master 5f74d43cf9 Re-add some comment text that was accidentally removed. 0f27b0450a Merge branch 'master' into license-headers e59d2c8fa7 Added license headers to all files. be4f64b926 Merge pull request #381 from haberman/mv-msg-public 1674f28dd7 Put public message interface into msg.h and moved internal functions to msg.int.h. 6481f6319e Spell out deps explicitly f104225a1e Merge pull request #376 from haberman/fix-quadratic-mem 3c3799498d Merge pull request #379 from fowles/master 2e83d5c98f Remove unused file test_util.h b053fa6991 Merge pull request #378 from fowles/master 7876639e50 remove unused macro 5b97df91dd Restrict fuse to matching block_alloc e74d6c23de Small renames and use uintptr_t instead of void* d9a0c58108 Allow arena fuse to fail 53f5d9f69b Merge pull request #377 from haberman/json-parse-null 8370818143 Switch to a macro to avoid signed/const mismatches. 63ad3db980 Fixed "NULL + 0" UB in JSON encoder and decoder. add9b12f18 Fixed quadratic memory usage in upb_array_append(). 97e2aeb7ee Merge pull request #375 from haberman/cleanups 83c0edbd2a A few minor cleanups. baa7fe7473 Merge pull request #374 from haberman/update-deps 900bd5c426 Merge pull request #355 from haberman/aarch64 89df647460 Updated versions of ABSL and protobuf deps. e4343f0fa3 Update comment for ARM64. 103d51f102 Merge branch 'master' into aarch64 1b9cc09f0e Removed extraneous copybara directive. bbd817fdb6 Merge pull request #373 from haberman/table-cleanup c358829c76 Now that handlers are gone, cleaned up table to use arenas exclusively. ed5b4108e0 Merge pull request #363 from haberman/delete-handlers bfa528f0ae Merge pull request #372 from haberman/errmsg-fix ec9ba3f893 Fixed error message buffer overflow. eb0fdda14b Merge pull request #371 from haberman/json-any e58f7a0284 Fix for Any messages with no fields. 7541ba0f38 Merge pull request #364 from catenacyber/cifuzz 81829bacc3 Removed quote chars from error message. 88ed8f5d3b Changed JSON decoding error message to be more clear. f41c0ec261 Added an internal API to get arena from symtab, for Ruby's use. b080659eee Merge pull request #367 from haberman/timestamp-minute-offset f7ed1f27a3 Support non-zero minutes in the timestamp offset for JSON. 451dcbbb9a Adds CIFuzz f5d2d55007 Deleted the legacy "Handlers" APIs. upb can finally be deserving of its name. 0f40d59258 Merge pull request #362 from haberman/rb-warnings c7787cbaa1 Fixed a bunch of Clang warnings. 5e53b5bb3d Merge pull request #360 from haberman/default-msgval 7a6e647be1 Merge branch 'master' into default-msgval edb0a9a2d9 Merge pull request #361 from haberman/arena-bugfix 9175989431 Bugfix for arena cleanup list when passing to upb_decode(). 5e550e88f8 Added API for getting fielddef default as a upb_msgval. de76b31f9c Merge pull request #359 from veblush/fix-upbdefs 3cab8a38fc Fixed upbdefs error 48bb3e5662 Merge pull request #357 from veblush/string-opt 4c67b2086b Merge pull request #358 from veblush/clang-tidy-fix 38b4beed6b Fix clang-tidy function 'upb_encode_ex' has a definition with different parameter names 9b020d8f65 Optimize calls to std::string::find() and friends for a single char. 3c9ae7837a The fasttable parser works on ARM64! git-subtree-dir: third_party/upb git-subtree-split: 2de300726a1ba2de9a468468dc5ff9ed17a3215f * Updated upb for bazel * Regen upb files * Updated src/upb/gen_build_yaml.py
3 years ago
if (!table.empty()) {
output(" UPB_FASTTABLE_INIT({\n");
for (const auto& ent : table) {
output(" {0x$1, &$0},\n", ent.first,
absl::StrCat(absl::Hex(ent.second, absl::kZeroPad16)));
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
output(" })\n");
Upb upgrade to the lastest (#26869) * Squashed 'third_party/upb/' changes from 60607da72e..2de300726a 2de300726a Merge pull request #401 from philwo/patch-1 0010bd88ff Merge pull request #403 from haberman/google-wyhash 3f7ecfe315 A few fixes in the 32-bit fallback. 2c14e2788d Added #include for Windows instrinsic. 9e618009ec Removed some extraneous whitespace. c4744c0b21 Updated generated files. 039975556d Merge branch 'master' into google-wyhash ff9d011f12 Merge pull request #402 from haberman/update-ads-benchmark c2f2e93990 Fix Bazel at 4.1.0 41bfbca375 Updated ads benchmark to v7 as v5 no longer exists upstream. 91d506ac32 Ported ABSL's wyhash to C. 3328f06117 Remove ubuntu1604 from presubmit.yml f925acf5f0 Merge pull request #400 from haberman/extreg 897bd2500a Fixed compile error. 6e53de4a03 Addressed PR comments. cdd6434a31 Introduced upb_extreg and plumbed it into decoder. 69f186bd75 Merge pull request #399 from haberman/msg-extrep 3f8aa6ef20 Define the extension representation in messages and mini-tables. 4ccfab154b Merge pull request #398 from haberman/field-mode 58e158c6fa Changed mini-table to use a custom "mode" instead of descriptor's "label." 7596fa740f Merge pull request #397 from haberman/codegen-refactor fa4dfc2baa Addressed PR comments. 0fb61eaeb5 Refactored the codegen into smaller functions, in anticipation of extensions. 52be845c39 Merge pull request #396 from haberman/pre-ext-opt 807e7fe9e2 Fixed dense_below logic to be order-independent and consistent between def.c and codegen. 2e8a122fc0 Changed dense_below calculation to use UINT8_MAX as the constant. 6394894b6e Addressed PR comments. 65d7b8ab0c Optimized decoder and paved the way for parsing extensions. 3e035cb553 Merge pull request #395 from haberman/locale e8ba2a1899 Added a fix for locales that output ',' as decimal separator. 7010a73828 Merge pull request #394 from haberman/file-uniqueness 9482957425 Enforce that filenames are unique when loaded into symtab. aaad7801bf Merge pull request #393 from haberman/has-attribute 7887dc0c76 Fixed the __has_attribute() check for old versions of Clang. 01e7436ed3 Merge pull request #390 from haberman/musttail 4132034634 Addressed PR comment. ed708fcd5d Addressed PR comments. 876abae2db Removed some debug printing and simplified checktag slightly. 286441afa7 Fixed a size regression due to inlining UTF-8 verification. 75df4cdaa3 Loosened the check for fasttable to match what we did before. e84793dd73 Cleaned up debugging artifacts. a4b35aa388 Everything passes except 4 conformance tests. 6e10b5789d Removed redundant license from port_def in amalgmation. 4f1e48ecc6 Updated amalgamator to avoid duplicating license blocks. 0723bfa700 Merge pull request #387 from haberman/json-null dda5416569 Update bazel-skylib main branch name. 2fa52e6951 Merge branch 'master' into json-null a3126b7c7e Merge pull request #388 from haberman/fix-macos b344a6c582 Fixed the macOS build for XCode 11.3. a778f2639a Only perform multiple oneof check for non-null fields. 42bdfcb849 Fix BUILD file. 75d6dab37a Merge pull request #384 from haberman/internal 3881393907 Renamed .int.h to _internal.h, for greater clarity. 5084cbe646 Merge pull request #383 from fowles/master da4b75b979 Fix build rules for more restrive deps checks a8f9cf54cf Merge pull request #382 from haberman/license-headers 1ba446ccfe Updated Google, Inc. to Google LLC. 823eb09694 Update all 2011 dates to 2021. ff89277ef0 Merge pull request #380 from fowles/master 5f74d43cf9 Re-add some comment text that was accidentally removed. 0f27b0450a Merge branch 'master' into license-headers e59d2c8fa7 Added license headers to all files. be4f64b926 Merge pull request #381 from haberman/mv-msg-public 1674f28dd7 Put public message interface into msg.h and moved internal functions to msg.int.h. 6481f6319e Spell out deps explicitly f104225a1e Merge pull request #376 from haberman/fix-quadratic-mem 3c3799498d Merge pull request #379 from fowles/master 2e83d5c98f Remove unused file test_util.h b053fa6991 Merge pull request #378 from fowles/master 7876639e50 remove unused macro 5b97df91dd Restrict fuse to matching block_alloc e74d6c23de Small renames and use uintptr_t instead of void* d9a0c58108 Allow arena fuse to fail 53f5d9f69b Merge pull request #377 from haberman/json-parse-null 8370818143 Switch to a macro to avoid signed/const mismatches. 63ad3db980 Fixed "NULL + 0" UB in JSON encoder and decoder. add9b12f18 Fixed quadratic memory usage in upb_array_append(). 97e2aeb7ee Merge pull request #375 from haberman/cleanups 83c0edbd2a A few minor cleanups. baa7fe7473 Merge pull request #374 from haberman/update-deps 900bd5c426 Merge pull request #355 from haberman/aarch64 89df647460 Updated versions of ABSL and protobuf deps. e4343f0fa3 Update comment for ARM64. 103d51f102 Merge branch 'master' into aarch64 1b9cc09f0e Removed extraneous copybara directive. bbd817fdb6 Merge pull request #373 from haberman/table-cleanup c358829c76 Now that handlers are gone, cleaned up table to use arenas exclusively. ed5b4108e0 Merge pull request #363 from haberman/delete-handlers bfa528f0ae Merge pull request #372 from haberman/errmsg-fix ec9ba3f893 Fixed error message buffer overflow. eb0fdda14b Merge pull request #371 from haberman/json-any e58f7a0284 Fix for Any messages with no fields. 7541ba0f38 Merge pull request #364 from catenacyber/cifuzz 81829bacc3 Removed quote chars from error message. 88ed8f5d3b Changed JSON decoding error message to be more clear. f41c0ec261 Added an internal API to get arena from symtab, for Ruby's use. b080659eee Merge pull request #367 from haberman/timestamp-minute-offset f7ed1f27a3 Support non-zero minutes in the timestamp offset for JSON. 451dcbbb9a Adds CIFuzz f5d2d55007 Deleted the legacy "Handlers" APIs. upb can finally be deserving of its name. 0f40d59258 Merge pull request #362 from haberman/rb-warnings c7787cbaa1 Fixed a bunch of Clang warnings. 5e53b5bb3d Merge pull request #360 from haberman/default-msgval 7a6e647be1 Merge branch 'master' into default-msgval edb0a9a2d9 Merge pull request #361 from haberman/arena-bugfix 9175989431 Bugfix for arena cleanup list when passing to upb_decode(). 5e550e88f8 Added API for getting fielddef default as a upb_msgval. de76b31f9c Merge pull request #359 from veblush/fix-upbdefs 3cab8a38fc Fixed upbdefs error 48bb3e5662 Merge pull request #357 from veblush/string-opt 4c67b2086b Merge pull request #358 from veblush/clang-tidy-fix 38b4beed6b Fix clang-tidy function 'upb_encode_ex' has a definition with different parameter names 9b020d8f65 Optimize calls to std::string::find() and friends for a single char. 3c9ae7837a The fasttable parser works on ARM64! git-subtree-dir: third_party/upb git-subtree-split: 2de300726a1ba2de9a468468dc5ff9ed17a3215f * Updated upb for bazel * Regen upb files * Updated src/upb/gen_build_yaml.py
3 years ago
}
output("};\n\n");
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
void WriteEnum(upb::EnumDefPtr e, Output& output) {
std::string values_init = "{\n";
const upb_MiniTableEnum* mt = e.mini_table();
uint32_t value_count = (mt->mask_limit / 32) + mt->value_count;
for (uint32_t i = 0; i < value_count; i++) {
absl::StrAppend(&values_init, " 0x", absl::Hex(mt->data[i]),
",\n");
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
values_init += " }";
output(
R"cc(
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
const upb_MiniTableEnum $0 = {
$1,
$2,
$3,
};
)cc",
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
EnumInit(e), mt->mask_limit, mt->value_count, values_init);
output("\n");
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
int WriteEnums(const DefPoolPair& pools, upb::FileDefPtr file, Output& output) {
if (file.syntax() != kUpb_Syntax_Proto2) return 0;
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::vector<upb::EnumDefPtr> this_file_enums = SortedEnums(file);
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
for (const auto e : this_file_enums) {
WriteEnum(e, output);
}
if (!this_file_enums.empty()) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
output("static const upb_MiniTableEnum *$0[$1] = {\n", kEnumsInit,
this_file_enums.size());
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
for (const auto e : this_file_enums) {
output(" &$0,\n", EnumInit(e));
}
output("};\n");
output("\n");
}
return this_file_enums.size();
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
int WriteMessages(const DefPoolPair& pools, upb::FileDefPtr file,
const Options& options, Output& output) {
std::vector<upb::MessageDefPtr> file_messages = SortedMessages(file);
if (file_messages.empty()) return 0;
for (auto message : file_messages) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
WriteMessage(message, pools, options, output);
Upb upgrade to the lastest (#26869) * Squashed 'third_party/upb/' changes from 60607da72e..2de300726a 2de300726a Merge pull request #401 from philwo/patch-1 0010bd88ff Merge pull request #403 from haberman/google-wyhash 3f7ecfe315 A few fixes in the 32-bit fallback. 2c14e2788d Added #include for Windows instrinsic. 9e618009ec Removed some extraneous whitespace. c4744c0b21 Updated generated files. 039975556d Merge branch 'master' into google-wyhash ff9d011f12 Merge pull request #402 from haberman/update-ads-benchmark c2f2e93990 Fix Bazel at 4.1.0 41bfbca375 Updated ads benchmark to v7 as v5 no longer exists upstream. 91d506ac32 Ported ABSL's wyhash to C. 3328f06117 Remove ubuntu1604 from presubmit.yml f925acf5f0 Merge pull request #400 from haberman/extreg 897bd2500a Fixed compile error. 6e53de4a03 Addressed PR comments. cdd6434a31 Introduced upb_extreg and plumbed it into decoder. 69f186bd75 Merge pull request #399 from haberman/msg-extrep 3f8aa6ef20 Define the extension representation in messages and mini-tables. 4ccfab154b Merge pull request #398 from haberman/field-mode 58e158c6fa Changed mini-table to use a custom "mode" instead of descriptor's "label." 7596fa740f Merge pull request #397 from haberman/codegen-refactor fa4dfc2baa Addressed PR comments. 0fb61eaeb5 Refactored the codegen into smaller functions, in anticipation of extensions. 52be845c39 Merge pull request #396 from haberman/pre-ext-opt 807e7fe9e2 Fixed dense_below logic to be order-independent and consistent between def.c and codegen. 2e8a122fc0 Changed dense_below calculation to use UINT8_MAX as the constant. 6394894b6e Addressed PR comments. 65d7b8ab0c Optimized decoder and paved the way for parsing extensions. 3e035cb553 Merge pull request #395 from haberman/locale e8ba2a1899 Added a fix for locales that output ',' as decimal separator. 7010a73828 Merge pull request #394 from haberman/file-uniqueness 9482957425 Enforce that filenames are unique when loaded into symtab. aaad7801bf Merge pull request #393 from haberman/has-attribute 7887dc0c76 Fixed the __has_attribute() check for old versions of Clang. 01e7436ed3 Merge pull request #390 from haberman/musttail 4132034634 Addressed PR comment. ed708fcd5d Addressed PR comments. 876abae2db Removed some debug printing and simplified checktag slightly. 286441afa7 Fixed a size regression due to inlining UTF-8 verification. 75df4cdaa3 Loosened the check for fasttable to match what we did before. e84793dd73 Cleaned up debugging artifacts. a4b35aa388 Everything passes except 4 conformance tests. 6e10b5789d Removed redundant license from port_def in amalgmation. 4f1e48ecc6 Updated amalgamator to avoid duplicating license blocks. 0723bfa700 Merge pull request #387 from haberman/json-null dda5416569 Update bazel-skylib main branch name. 2fa52e6951 Merge branch 'master' into json-null a3126b7c7e Merge pull request #388 from haberman/fix-macos b344a6c582 Fixed the macOS build for XCode 11.3. a778f2639a Only perform multiple oneof check for non-null fields. 42bdfcb849 Fix BUILD file. 75d6dab37a Merge pull request #384 from haberman/internal 3881393907 Renamed .int.h to _internal.h, for greater clarity. 5084cbe646 Merge pull request #383 from fowles/master da4b75b979 Fix build rules for more restrive deps checks a8f9cf54cf Merge pull request #382 from haberman/license-headers 1ba446ccfe Updated Google, Inc. to Google LLC. 823eb09694 Update all 2011 dates to 2021. ff89277ef0 Merge pull request #380 from fowles/master 5f74d43cf9 Re-add some comment text that was accidentally removed. 0f27b0450a Merge branch 'master' into license-headers e59d2c8fa7 Added license headers to all files. be4f64b926 Merge pull request #381 from haberman/mv-msg-public 1674f28dd7 Put public message interface into msg.h and moved internal functions to msg.int.h. 6481f6319e Spell out deps explicitly f104225a1e Merge pull request #376 from haberman/fix-quadratic-mem 3c3799498d Merge pull request #379 from fowles/master 2e83d5c98f Remove unused file test_util.h b053fa6991 Merge pull request #378 from fowles/master 7876639e50 remove unused macro 5b97df91dd Restrict fuse to matching block_alloc e74d6c23de Small renames and use uintptr_t instead of void* d9a0c58108 Allow arena fuse to fail 53f5d9f69b Merge pull request #377 from haberman/json-parse-null 8370818143 Switch to a macro to avoid signed/const mismatches. 63ad3db980 Fixed "NULL + 0" UB in JSON encoder and decoder. add9b12f18 Fixed quadratic memory usage in upb_array_append(). 97e2aeb7ee Merge pull request #375 from haberman/cleanups 83c0edbd2a A few minor cleanups. baa7fe7473 Merge pull request #374 from haberman/update-deps 900bd5c426 Merge pull request #355 from haberman/aarch64 89df647460 Updated versions of ABSL and protobuf deps. e4343f0fa3 Update comment for ARM64. 103d51f102 Merge branch 'master' into aarch64 1b9cc09f0e Removed extraneous copybara directive. bbd817fdb6 Merge pull request #373 from haberman/table-cleanup c358829c76 Now that handlers are gone, cleaned up table to use arenas exclusively. ed5b4108e0 Merge pull request #363 from haberman/delete-handlers bfa528f0ae Merge pull request #372 from haberman/errmsg-fix ec9ba3f893 Fixed error message buffer overflow. eb0fdda14b Merge pull request #371 from haberman/json-any e58f7a0284 Fix for Any messages with no fields. 7541ba0f38 Merge pull request #364 from catenacyber/cifuzz 81829bacc3 Removed quote chars from error message. 88ed8f5d3b Changed JSON decoding error message to be more clear. f41c0ec261 Added an internal API to get arena from symtab, for Ruby's use. b080659eee Merge pull request #367 from haberman/timestamp-minute-offset f7ed1f27a3 Support non-zero minutes in the timestamp offset for JSON. 451dcbbb9a Adds CIFuzz f5d2d55007 Deleted the legacy "Handlers" APIs. upb can finally be deserving of its name. 0f40d59258 Merge pull request #362 from haberman/rb-warnings c7787cbaa1 Fixed a bunch of Clang warnings. 5e53b5bb3d Merge pull request #360 from haberman/default-msgval 7a6e647be1 Merge branch 'master' into default-msgval edb0a9a2d9 Merge pull request #361 from haberman/arena-bugfix 9175989431 Bugfix for arena cleanup list when passing to upb_decode(). 5e550e88f8 Added API for getting fielddef default as a upb_msgval. de76b31f9c Merge pull request #359 from veblush/fix-upbdefs 3cab8a38fc Fixed upbdefs error 48bb3e5662 Merge pull request #357 from veblush/string-opt 4c67b2086b Merge pull request #358 from veblush/clang-tidy-fix 38b4beed6b Fix clang-tidy function 'upb_encode_ex' has a definition with different parameter names 9b020d8f65 Optimize calls to std::string::find() and friends for a single char. 3c9ae7837a The fasttable parser works on ARM64! git-subtree-dir: third_party/upb git-subtree-split: 2de300726a1ba2de9a468468dc5ff9ed17a3215f * Updated upb for bazel * Regen upb files * Updated src/upb/gen_build_yaml.py
3 years ago
}
output("static const upb_MiniTable *$0[$1] = {\n", kMessagesInit,
file_messages.size());
for (auto message : file_messages) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
output(" &$0,\n", MessageInitName(message));
}
output("};\n");
output("\n");
return file_messages.size();
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
void WriteExtension(upb::FieldDefPtr ext, const DefPoolPair& pools,
const Options& options, Output& output) {
output("$0,\n", FieldInitializer(pools, ext, options));
output(" &$0,\n", MessageInitName(ext.containing_type()));
output(" $0,\n", GetSub(ext));
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
int WriteExtensions(const DefPoolPair& pools, upb::FileDefPtr file,
const Options& options, Output& output) {
auto exts = SortedExtensions(file);
if (exts.empty()) return 0;
// Order by full name for consistent ordering.
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
std::map<std::string, upb::MessageDefPtr> forward_messages;
for (auto ext : exts) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
forward_messages[ext.containing_type().full_name()] = ext.containing_type();
if (ext.message_type()) {
forward_messages[ext.message_type().full_name()] = ext.message_type();
}
}
for (const auto& decl : forward_messages) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
ForwardDeclareMiniTableInit(decl.second, options, output);
}
for (auto ext : exts) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
output("const upb_MiniTableExtension $0 = {\n ", ExtensionLayout(ext));
WriteExtension(ext, pools, options, output);
output("\n};\n");
}
output(
"\n"
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
"static const upb_MiniTableExtension *$0[$1] = {\n",
kExtensionsInit, exts.size());
for (auto ext : exts) {
output(" &$0,\n", ExtensionLayout(ext));
}
output(
"};\n"
"\n");
return exts.size();
Upb upgrade to the lastest (#26869) * Squashed 'third_party/upb/' changes from 60607da72e..2de300726a 2de300726a Merge pull request #401 from philwo/patch-1 0010bd88ff Merge pull request #403 from haberman/google-wyhash 3f7ecfe315 A few fixes in the 32-bit fallback. 2c14e2788d Added #include for Windows instrinsic. 9e618009ec Removed some extraneous whitespace. c4744c0b21 Updated generated files. 039975556d Merge branch 'master' into google-wyhash ff9d011f12 Merge pull request #402 from haberman/update-ads-benchmark c2f2e93990 Fix Bazel at 4.1.0 41bfbca375 Updated ads benchmark to v7 as v5 no longer exists upstream. 91d506ac32 Ported ABSL's wyhash to C. 3328f06117 Remove ubuntu1604 from presubmit.yml f925acf5f0 Merge pull request #400 from haberman/extreg 897bd2500a Fixed compile error. 6e53de4a03 Addressed PR comments. cdd6434a31 Introduced upb_extreg and plumbed it into decoder. 69f186bd75 Merge pull request #399 from haberman/msg-extrep 3f8aa6ef20 Define the extension representation in messages and mini-tables. 4ccfab154b Merge pull request #398 from haberman/field-mode 58e158c6fa Changed mini-table to use a custom "mode" instead of descriptor's "label." 7596fa740f Merge pull request #397 from haberman/codegen-refactor fa4dfc2baa Addressed PR comments. 0fb61eaeb5 Refactored the codegen into smaller functions, in anticipation of extensions. 52be845c39 Merge pull request #396 from haberman/pre-ext-opt 807e7fe9e2 Fixed dense_below logic to be order-independent and consistent between def.c and codegen. 2e8a122fc0 Changed dense_below calculation to use UINT8_MAX as the constant. 6394894b6e Addressed PR comments. 65d7b8ab0c Optimized decoder and paved the way for parsing extensions. 3e035cb553 Merge pull request #395 from haberman/locale e8ba2a1899 Added a fix for locales that output ',' as decimal separator. 7010a73828 Merge pull request #394 from haberman/file-uniqueness 9482957425 Enforce that filenames are unique when loaded into symtab. aaad7801bf Merge pull request #393 from haberman/has-attribute 7887dc0c76 Fixed the __has_attribute() check for old versions of Clang. 01e7436ed3 Merge pull request #390 from haberman/musttail 4132034634 Addressed PR comment. ed708fcd5d Addressed PR comments. 876abae2db Removed some debug printing and simplified checktag slightly. 286441afa7 Fixed a size regression due to inlining UTF-8 verification. 75df4cdaa3 Loosened the check for fasttable to match what we did before. e84793dd73 Cleaned up debugging artifacts. a4b35aa388 Everything passes except 4 conformance tests. 6e10b5789d Removed redundant license from port_def in amalgmation. 4f1e48ecc6 Updated amalgamator to avoid duplicating license blocks. 0723bfa700 Merge pull request #387 from haberman/json-null dda5416569 Update bazel-skylib main branch name. 2fa52e6951 Merge branch 'master' into json-null a3126b7c7e Merge pull request #388 from haberman/fix-macos b344a6c582 Fixed the macOS build for XCode 11.3. a778f2639a Only perform multiple oneof check for non-null fields. 42bdfcb849 Fix BUILD file. 75d6dab37a Merge pull request #384 from haberman/internal 3881393907 Renamed .int.h to _internal.h, for greater clarity. 5084cbe646 Merge pull request #383 from fowles/master da4b75b979 Fix build rules for more restrive deps checks a8f9cf54cf Merge pull request #382 from haberman/license-headers 1ba446ccfe Updated Google, Inc. to Google LLC. 823eb09694 Update all 2011 dates to 2021. ff89277ef0 Merge pull request #380 from fowles/master 5f74d43cf9 Re-add some comment text that was accidentally removed. 0f27b0450a Merge branch 'master' into license-headers e59d2c8fa7 Added license headers to all files. be4f64b926 Merge pull request #381 from haberman/mv-msg-public 1674f28dd7 Put public message interface into msg.h and moved internal functions to msg.int.h. 6481f6319e Spell out deps explicitly f104225a1e Merge pull request #376 from haberman/fix-quadratic-mem 3c3799498d Merge pull request #379 from fowles/master 2e83d5c98f Remove unused file test_util.h b053fa6991 Merge pull request #378 from fowles/master 7876639e50 remove unused macro 5b97df91dd Restrict fuse to matching block_alloc e74d6c23de Small renames and use uintptr_t instead of void* d9a0c58108 Allow arena fuse to fail 53f5d9f69b Merge pull request #377 from haberman/json-parse-null 8370818143 Switch to a macro to avoid signed/const mismatches. 63ad3db980 Fixed "NULL + 0" UB in JSON encoder and decoder. add9b12f18 Fixed quadratic memory usage in upb_array_append(). 97e2aeb7ee Merge pull request #375 from haberman/cleanups 83c0edbd2a A few minor cleanups. baa7fe7473 Merge pull request #374 from haberman/update-deps 900bd5c426 Merge pull request #355 from haberman/aarch64 89df647460 Updated versions of ABSL and protobuf deps. e4343f0fa3 Update comment for ARM64. 103d51f102 Merge branch 'master' into aarch64 1b9cc09f0e Removed extraneous copybara directive. bbd817fdb6 Merge pull request #373 from haberman/table-cleanup c358829c76 Now that handlers are gone, cleaned up table to use arenas exclusively. ed5b4108e0 Merge pull request #363 from haberman/delete-handlers bfa528f0ae Merge pull request #372 from haberman/errmsg-fix ec9ba3f893 Fixed error message buffer overflow. eb0fdda14b Merge pull request #371 from haberman/json-any e58f7a0284 Fix for Any messages with no fields. 7541ba0f38 Merge pull request #364 from catenacyber/cifuzz 81829bacc3 Removed quote chars from error message. 88ed8f5d3b Changed JSON decoding error message to be more clear. f41c0ec261 Added an internal API to get arena from symtab, for Ruby's use. b080659eee Merge pull request #367 from haberman/timestamp-minute-offset f7ed1f27a3 Support non-zero minutes in the timestamp offset for JSON. 451dcbbb9a Adds CIFuzz f5d2d55007 Deleted the legacy "Handlers" APIs. upb can finally be deserving of its name. 0f40d59258 Merge pull request #362 from haberman/rb-warnings c7787cbaa1 Fixed a bunch of Clang warnings. 5e53b5bb3d Merge pull request #360 from haberman/default-msgval 7a6e647be1 Merge branch 'master' into default-msgval edb0a9a2d9 Merge pull request #361 from haberman/arena-bugfix 9175989431 Bugfix for arena cleanup list when passing to upb_decode(). 5e550e88f8 Added API for getting fielddef default as a upb_msgval. de76b31f9c Merge pull request #359 from veblush/fix-upbdefs 3cab8a38fc Fixed upbdefs error 48bb3e5662 Merge pull request #357 from veblush/string-opt 4c67b2086b Merge pull request #358 from veblush/clang-tidy-fix 38b4beed6b Fix clang-tidy function 'upb_encode_ex' has a definition with different parameter names 9b020d8f65 Optimize calls to std::string::find() and friends for a single char. 3c9ae7837a The fasttable parser works on ARM64! git-subtree-dir: third_party/upb git-subtree-split: 2de300726a1ba2de9a468468dc5ff9ed17a3215f * Updated upb for bazel * Regen upb files * Updated src/upb/gen_build_yaml.py
3 years ago
}
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
void WriteMiniTableSource(const DefPoolPair& pools, upb::FileDefPtr file,
const Options& options, Output& output) {
EmitFileWarning(file.name(), output);
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
Upb upgrade to the lastest (#26869) * Squashed 'third_party/upb/' changes from 60607da72e..2de300726a 2de300726a Merge pull request #401 from philwo/patch-1 0010bd88ff Merge pull request #403 from haberman/google-wyhash 3f7ecfe315 A few fixes in the 32-bit fallback. 2c14e2788d Added #include for Windows instrinsic. 9e618009ec Removed some extraneous whitespace. c4744c0b21 Updated generated files. 039975556d Merge branch 'master' into google-wyhash ff9d011f12 Merge pull request #402 from haberman/update-ads-benchmark c2f2e93990 Fix Bazel at 4.1.0 41bfbca375 Updated ads benchmark to v7 as v5 no longer exists upstream. 91d506ac32 Ported ABSL's wyhash to C. 3328f06117 Remove ubuntu1604 from presubmit.yml f925acf5f0 Merge pull request #400 from haberman/extreg 897bd2500a Fixed compile error. 6e53de4a03 Addressed PR comments. cdd6434a31 Introduced upb_extreg and plumbed it into decoder. 69f186bd75 Merge pull request #399 from haberman/msg-extrep 3f8aa6ef20 Define the extension representation in messages and mini-tables. 4ccfab154b Merge pull request #398 from haberman/field-mode 58e158c6fa Changed mini-table to use a custom "mode" instead of descriptor's "label." 7596fa740f Merge pull request #397 from haberman/codegen-refactor fa4dfc2baa Addressed PR comments. 0fb61eaeb5 Refactored the codegen into smaller functions, in anticipation of extensions. 52be845c39 Merge pull request #396 from haberman/pre-ext-opt 807e7fe9e2 Fixed dense_below logic to be order-independent and consistent between def.c and codegen. 2e8a122fc0 Changed dense_below calculation to use UINT8_MAX as the constant. 6394894b6e Addressed PR comments. 65d7b8ab0c Optimized decoder and paved the way for parsing extensions. 3e035cb553 Merge pull request #395 from haberman/locale e8ba2a1899 Added a fix for locales that output ',' as decimal separator. 7010a73828 Merge pull request #394 from haberman/file-uniqueness 9482957425 Enforce that filenames are unique when loaded into symtab. aaad7801bf Merge pull request #393 from haberman/has-attribute 7887dc0c76 Fixed the __has_attribute() check for old versions of Clang. 01e7436ed3 Merge pull request #390 from haberman/musttail 4132034634 Addressed PR comment. ed708fcd5d Addressed PR comments. 876abae2db Removed some debug printing and simplified checktag slightly. 286441afa7 Fixed a size regression due to inlining UTF-8 verification. 75df4cdaa3 Loosened the check for fasttable to match what we did before. e84793dd73 Cleaned up debugging artifacts. a4b35aa388 Everything passes except 4 conformance tests. 6e10b5789d Removed redundant license from port_def in amalgmation. 4f1e48ecc6 Updated amalgamator to avoid duplicating license blocks. 0723bfa700 Merge pull request #387 from haberman/json-null dda5416569 Update bazel-skylib main branch name. 2fa52e6951 Merge branch 'master' into json-null a3126b7c7e Merge pull request #388 from haberman/fix-macos b344a6c582 Fixed the macOS build for XCode 11.3. a778f2639a Only perform multiple oneof check for non-null fields. 42bdfcb849 Fix BUILD file. 75d6dab37a Merge pull request #384 from haberman/internal 3881393907 Renamed .int.h to _internal.h, for greater clarity. 5084cbe646 Merge pull request #383 from fowles/master da4b75b979 Fix build rules for more restrive deps checks a8f9cf54cf Merge pull request #382 from haberman/license-headers 1ba446ccfe Updated Google, Inc. to Google LLC. 823eb09694 Update all 2011 dates to 2021. ff89277ef0 Merge pull request #380 from fowles/master 5f74d43cf9 Re-add some comment text that was accidentally removed. 0f27b0450a Merge branch 'master' into license-headers e59d2c8fa7 Added license headers to all files. be4f64b926 Merge pull request #381 from haberman/mv-msg-public 1674f28dd7 Put public message interface into msg.h and moved internal functions to msg.int.h. 6481f6319e Spell out deps explicitly f104225a1e Merge pull request #376 from haberman/fix-quadratic-mem 3c3799498d Merge pull request #379 from fowles/master 2e83d5c98f Remove unused file test_util.h b053fa6991 Merge pull request #378 from fowles/master 7876639e50 remove unused macro 5b97df91dd Restrict fuse to matching block_alloc e74d6c23de Small renames and use uintptr_t instead of void* d9a0c58108 Allow arena fuse to fail 53f5d9f69b Merge pull request #377 from haberman/json-parse-null 8370818143 Switch to a macro to avoid signed/const mismatches. 63ad3db980 Fixed "NULL + 0" UB in JSON encoder and decoder. add9b12f18 Fixed quadratic memory usage in upb_array_append(). 97e2aeb7ee Merge pull request #375 from haberman/cleanups 83c0edbd2a A few minor cleanups. baa7fe7473 Merge pull request #374 from haberman/update-deps 900bd5c426 Merge pull request #355 from haberman/aarch64 89df647460 Updated versions of ABSL and protobuf deps. e4343f0fa3 Update comment for ARM64. 103d51f102 Merge branch 'master' into aarch64 1b9cc09f0e Removed extraneous copybara directive. bbd817fdb6 Merge pull request #373 from haberman/table-cleanup c358829c76 Now that handlers are gone, cleaned up table to use arenas exclusively. ed5b4108e0 Merge pull request #363 from haberman/delete-handlers bfa528f0ae Merge pull request #372 from haberman/errmsg-fix ec9ba3f893 Fixed error message buffer overflow. eb0fdda14b Merge pull request #371 from haberman/json-any e58f7a0284 Fix for Any messages with no fields. 7541ba0f38 Merge pull request #364 from catenacyber/cifuzz 81829bacc3 Removed quote chars from error message. 88ed8f5d3b Changed JSON decoding error message to be more clear. f41c0ec261 Added an internal API to get arena from symtab, for Ruby's use. b080659eee Merge pull request #367 from haberman/timestamp-minute-offset f7ed1f27a3 Support non-zero minutes in the timestamp offset for JSON. 451dcbbb9a Adds CIFuzz f5d2d55007 Deleted the legacy "Handlers" APIs. upb can finally be deserving of its name. 0f40d59258 Merge pull request #362 from haberman/rb-warnings c7787cbaa1 Fixed a bunch of Clang warnings. 5e53b5bb3d Merge pull request #360 from haberman/default-msgval 7a6e647be1 Merge branch 'master' into default-msgval edb0a9a2d9 Merge pull request #361 from haberman/arena-bugfix 9175989431 Bugfix for arena cleanup list when passing to upb_decode(). 5e550e88f8 Added API for getting fielddef default as a upb_msgval. de76b31f9c Merge pull request #359 from veblush/fix-upbdefs 3cab8a38fc Fixed upbdefs error 48bb3e5662 Merge pull request #357 from veblush/string-opt 4c67b2086b Merge pull request #358 from veblush/clang-tidy-fix 38b4beed6b Fix clang-tidy function 'upb_encode_ex' has a definition with different parameter names 9b020d8f65 Optimize calls to std::string::find() and friends for a single char. 3c9ae7837a The fasttable parser works on ARM64! git-subtree-dir: third_party/upb git-subtree-split: 2de300726a1ba2de9a468468dc5ff9ed17a3215f * Updated upb for bazel * Regen upb files * Updated src/upb/gen_build_yaml.py
3 years ago
output(
"#include <stddef.h>\n"
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
"#include \"upb/collections/array_internal.h\"\n"
"#include \"upb/message/internal.h\"\n"
"#include \"upb/mini_table/enum_internal.h\"\n"
Upb upgrade to the lastest (#26869) * Squashed 'third_party/upb/' changes from 60607da72e..2de300726a 2de300726a Merge pull request #401 from philwo/patch-1 0010bd88ff Merge pull request #403 from haberman/google-wyhash 3f7ecfe315 A few fixes in the 32-bit fallback. 2c14e2788d Added #include for Windows instrinsic. 9e618009ec Removed some extraneous whitespace. c4744c0b21 Updated generated files. 039975556d Merge branch 'master' into google-wyhash ff9d011f12 Merge pull request #402 from haberman/update-ads-benchmark c2f2e93990 Fix Bazel at 4.1.0 41bfbca375 Updated ads benchmark to v7 as v5 no longer exists upstream. 91d506ac32 Ported ABSL's wyhash to C. 3328f06117 Remove ubuntu1604 from presubmit.yml f925acf5f0 Merge pull request #400 from haberman/extreg 897bd2500a Fixed compile error. 6e53de4a03 Addressed PR comments. cdd6434a31 Introduced upb_extreg and plumbed it into decoder. 69f186bd75 Merge pull request #399 from haberman/msg-extrep 3f8aa6ef20 Define the extension representation in messages and mini-tables. 4ccfab154b Merge pull request #398 from haberman/field-mode 58e158c6fa Changed mini-table to use a custom "mode" instead of descriptor's "label." 7596fa740f Merge pull request #397 from haberman/codegen-refactor fa4dfc2baa Addressed PR comments. 0fb61eaeb5 Refactored the codegen into smaller functions, in anticipation of extensions. 52be845c39 Merge pull request #396 from haberman/pre-ext-opt 807e7fe9e2 Fixed dense_below logic to be order-independent and consistent between def.c and codegen. 2e8a122fc0 Changed dense_below calculation to use UINT8_MAX as the constant. 6394894b6e Addressed PR comments. 65d7b8ab0c Optimized decoder and paved the way for parsing extensions. 3e035cb553 Merge pull request #395 from haberman/locale e8ba2a1899 Added a fix for locales that output ',' as decimal separator. 7010a73828 Merge pull request #394 from haberman/file-uniqueness 9482957425 Enforce that filenames are unique when loaded into symtab. aaad7801bf Merge pull request #393 from haberman/has-attribute 7887dc0c76 Fixed the __has_attribute() check for old versions of Clang. 01e7436ed3 Merge pull request #390 from haberman/musttail 4132034634 Addressed PR comment. ed708fcd5d Addressed PR comments. 876abae2db Removed some debug printing and simplified checktag slightly. 286441afa7 Fixed a size regression due to inlining UTF-8 verification. 75df4cdaa3 Loosened the check for fasttable to match what we did before. e84793dd73 Cleaned up debugging artifacts. a4b35aa388 Everything passes except 4 conformance tests. 6e10b5789d Removed redundant license from port_def in amalgmation. 4f1e48ecc6 Updated amalgamator to avoid duplicating license blocks. 0723bfa700 Merge pull request #387 from haberman/json-null dda5416569 Update bazel-skylib main branch name. 2fa52e6951 Merge branch 'master' into json-null a3126b7c7e Merge pull request #388 from haberman/fix-macos b344a6c582 Fixed the macOS build for XCode 11.3. a778f2639a Only perform multiple oneof check for non-null fields. 42bdfcb849 Fix BUILD file. 75d6dab37a Merge pull request #384 from haberman/internal 3881393907 Renamed .int.h to _internal.h, for greater clarity. 5084cbe646 Merge pull request #383 from fowles/master da4b75b979 Fix build rules for more restrive deps checks a8f9cf54cf Merge pull request #382 from haberman/license-headers 1ba446ccfe Updated Google, Inc. to Google LLC. 823eb09694 Update all 2011 dates to 2021. ff89277ef0 Merge pull request #380 from fowles/master 5f74d43cf9 Re-add some comment text that was accidentally removed. 0f27b0450a Merge branch 'master' into license-headers e59d2c8fa7 Added license headers to all files. be4f64b926 Merge pull request #381 from haberman/mv-msg-public 1674f28dd7 Put public message interface into msg.h and moved internal functions to msg.int.h. 6481f6319e Spell out deps explicitly f104225a1e Merge pull request #376 from haberman/fix-quadratic-mem 3c3799498d Merge pull request #379 from fowles/master 2e83d5c98f Remove unused file test_util.h b053fa6991 Merge pull request #378 from fowles/master 7876639e50 remove unused macro 5b97df91dd Restrict fuse to matching block_alloc e74d6c23de Small renames and use uintptr_t instead of void* d9a0c58108 Allow arena fuse to fail 53f5d9f69b Merge pull request #377 from haberman/json-parse-null 8370818143 Switch to a macro to avoid signed/const mismatches. 63ad3db980 Fixed "NULL + 0" UB in JSON encoder and decoder. add9b12f18 Fixed quadratic memory usage in upb_array_append(). 97e2aeb7ee Merge pull request #375 from haberman/cleanups 83c0edbd2a A few minor cleanups. baa7fe7473 Merge pull request #374 from haberman/update-deps 900bd5c426 Merge pull request #355 from haberman/aarch64 89df647460 Updated versions of ABSL and protobuf deps. e4343f0fa3 Update comment for ARM64. 103d51f102 Merge branch 'master' into aarch64 1b9cc09f0e Removed extraneous copybara directive. bbd817fdb6 Merge pull request #373 from haberman/table-cleanup c358829c76 Now that handlers are gone, cleaned up table to use arenas exclusively. ed5b4108e0 Merge pull request #363 from haberman/delete-handlers bfa528f0ae Merge pull request #372 from haberman/errmsg-fix ec9ba3f893 Fixed error message buffer overflow. eb0fdda14b Merge pull request #371 from haberman/json-any e58f7a0284 Fix for Any messages with no fields. 7541ba0f38 Merge pull request #364 from catenacyber/cifuzz 81829bacc3 Removed quote chars from error message. 88ed8f5d3b Changed JSON decoding error message to be more clear. f41c0ec261 Added an internal API to get arena from symtab, for Ruby's use. b080659eee Merge pull request #367 from haberman/timestamp-minute-offset f7ed1f27a3 Support non-zero minutes in the timestamp offset for JSON. 451dcbbb9a Adds CIFuzz f5d2d55007 Deleted the legacy "Handlers" APIs. upb can finally be deserving of its name. 0f40d59258 Merge pull request #362 from haberman/rb-warnings c7787cbaa1 Fixed a bunch of Clang warnings. 5e53b5bb3d Merge pull request #360 from haberman/default-msgval 7a6e647be1 Merge branch 'master' into default-msgval edb0a9a2d9 Merge pull request #361 from haberman/arena-bugfix 9175989431 Bugfix for arena cleanup list when passing to upb_decode(). 5e550e88f8 Added API for getting fielddef default as a upb_msgval. de76b31f9c Merge pull request #359 from veblush/fix-upbdefs 3cab8a38fc Fixed upbdefs error 48bb3e5662 Merge pull request #357 from veblush/string-opt 4c67b2086b Merge pull request #358 from veblush/clang-tidy-fix 38b4beed6b Fix clang-tidy function 'upb_encode_ex' has a definition with different parameter names 9b020d8f65 Optimize calls to std::string::find() and friends for a single char. 3c9ae7837a The fasttable parser works on ARM64! git-subtree-dir: third_party/upb git-subtree-split: 2de300726a1ba2de9a468468dc5ff9ed17a3215f * Updated upb for bazel * Regen upb files * Updated src/upb/gen_build_yaml.py
3 years ago
"#include \"$0\"\n",
HeaderFilename(file));
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
for (int i = 0; i < file.dependency_count(); i++) {
output("#include \"$0\"\n", HeaderFilename(file.dependency(i)));
}
Upb upgrade to the lastest (#26869) * Squashed 'third_party/upb/' changes from 60607da72e..2de300726a 2de300726a Merge pull request #401 from philwo/patch-1 0010bd88ff Merge pull request #403 from haberman/google-wyhash 3f7ecfe315 A few fixes in the 32-bit fallback. 2c14e2788d Added #include for Windows instrinsic. 9e618009ec Removed some extraneous whitespace. c4744c0b21 Updated generated files. 039975556d Merge branch 'master' into google-wyhash ff9d011f12 Merge pull request #402 from haberman/update-ads-benchmark c2f2e93990 Fix Bazel at 4.1.0 41bfbca375 Updated ads benchmark to v7 as v5 no longer exists upstream. 91d506ac32 Ported ABSL's wyhash to C. 3328f06117 Remove ubuntu1604 from presubmit.yml f925acf5f0 Merge pull request #400 from haberman/extreg 897bd2500a Fixed compile error. 6e53de4a03 Addressed PR comments. cdd6434a31 Introduced upb_extreg and plumbed it into decoder. 69f186bd75 Merge pull request #399 from haberman/msg-extrep 3f8aa6ef20 Define the extension representation in messages and mini-tables. 4ccfab154b Merge pull request #398 from haberman/field-mode 58e158c6fa Changed mini-table to use a custom "mode" instead of descriptor's "label." 7596fa740f Merge pull request #397 from haberman/codegen-refactor fa4dfc2baa Addressed PR comments. 0fb61eaeb5 Refactored the codegen into smaller functions, in anticipation of extensions. 52be845c39 Merge pull request #396 from haberman/pre-ext-opt 807e7fe9e2 Fixed dense_below logic to be order-independent and consistent between def.c and codegen. 2e8a122fc0 Changed dense_below calculation to use UINT8_MAX as the constant. 6394894b6e Addressed PR comments. 65d7b8ab0c Optimized decoder and paved the way for parsing extensions. 3e035cb553 Merge pull request #395 from haberman/locale e8ba2a1899 Added a fix for locales that output ',' as decimal separator. 7010a73828 Merge pull request #394 from haberman/file-uniqueness 9482957425 Enforce that filenames are unique when loaded into symtab. aaad7801bf Merge pull request #393 from haberman/has-attribute 7887dc0c76 Fixed the __has_attribute() check for old versions of Clang. 01e7436ed3 Merge pull request #390 from haberman/musttail 4132034634 Addressed PR comment. ed708fcd5d Addressed PR comments. 876abae2db Removed some debug printing and simplified checktag slightly. 286441afa7 Fixed a size regression due to inlining UTF-8 verification. 75df4cdaa3 Loosened the check for fasttable to match what we did before. e84793dd73 Cleaned up debugging artifacts. a4b35aa388 Everything passes except 4 conformance tests. 6e10b5789d Removed redundant license from port_def in amalgmation. 4f1e48ecc6 Updated amalgamator to avoid duplicating license blocks. 0723bfa700 Merge pull request #387 from haberman/json-null dda5416569 Update bazel-skylib main branch name. 2fa52e6951 Merge branch 'master' into json-null a3126b7c7e Merge pull request #388 from haberman/fix-macos b344a6c582 Fixed the macOS build for XCode 11.3. a778f2639a Only perform multiple oneof check for non-null fields. 42bdfcb849 Fix BUILD file. 75d6dab37a Merge pull request #384 from haberman/internal 3881393907 Renamed .int.h to _internal.h, for greater clarity. 5084cbe646 Merge pull request #383 from fowles/master da4b75b979 Fix build rules for more restrive deps checks a8f9cf54cf Merge pull request #382 from haberman/license-headers 1ba446ccfe Updated Google, Inc. to Google LLC. 823eb09694 Update all 2011 dates to 2021. ff89277ef0 Merge pull request #380 from fowles/master 5f74d43cf9 Re-add some comment text that was accidentally removed. 0f27b0450a Merge branch 'master' into license-headers e59d2c8fa7 Added license headers to all files. be4f64b926 Merge pull request #381 from haberman/mv-msg-public 1674f28dd7 Put public message interface into msg.h and moved internal functions to msg.int.h. 6481f6319e Spell out deps explicitly f104225a1e Merge pull request #376 from haberman/fix-quadratic-mem 3c3799498d Merge pull request #379 from fowles/master 2e83d5c98f Remove unused file test_util.h b053fa6991 Merge pull request #378 from fowles/master 7876639e50 remove unused macro 5b97df91dd Restrict fuse to matching block_alloc e74d6c23de Small renames and use uintptr_t instead of void* d9a0c58108 Allow arena fuse to fail 53f5d9f69b Merge pull request #377 from haberman/json-parse-null 8370818143 Switch to a macro to avoid signed/const mismatches. 63ad3db980 Fixed "NULL + 0" UB in JSON encoder and decoder. add9b12f18 Fixed quadratic memory usage in upb_array_append(). 97e2aeb7ee Merge pull request #375 from haberman/cleanups 83c0edbd2a A few minor cleanups. baa7fe7473 Merge pull request #374 from haberman/update-deps 900bd5c426 Merge pull request #355 from haberman/aarch64 89df647460 Updated versions of ABSL and protobuf deps. e4343f0fa3 Update comment for ARM64. 103d51f102 Merge branch 'master' into aarch64 1b9cc09f0e Removed extraneous copybara directive. bbd817fdb6 Merge pull request #373 from haberman/table-cleanup c358829c76 Now that handlers are gone, cleaned up table to use arenas exclusively. ed5b4108e0 Merge pull request #363 from haberman/delete-handlers bfa528f0ae Merge pull request #372 from haberman/errmsg-fix ec9ba3f893 Fixed error message buffer overflow. eb0fdda14b Merge pull request #371 from haberman/json-any e58f7a0284 Fix for Any messages with no fields. 7541ba0f38 Merge pull request #364 from catenacyber/cifuzz 81829bacc3 Removed quote chars from error message. 88ed8f5d3b Changed JSON decoding error message to be more clear. f41c0ec261 Added an internal API to get arena from symtab, for Ruby's use. b080659eee Merge pull request #367 from haberman/timestamp-minute-offset f7ed1f27a3 Support non-zero minutes in the timestamp offset for JSON. 451dcbbb9a Adds CIFuzz f5d2d55007 Deleted the legacy "Handlers" APIs. upb can finally be deserving of its name. 0f40d59258 Merge pull request #362 from haberman/rb-warnings c7787cbaa1 Fixed a bunch of Clang warnings. 5e53b5bb3d Merge pull request #360 from haberman/default-msgval 7a6e647be1 Merge branch 'master' into default-msgval edb0a9a2d9 Merge pull request #361 from haberman/arena-bugfix 9175989431 Bugfix for arena cleanup list when passing to upb_decode(). 5e550e88f8 Added API for getting fielddef default as a upb_msgval. de76b31f9c Merge pull request #359 from veblush/fix-upbdefs 3cab8a38fc Fixed upbdefs error 48bb3e5662 Merge pull request #357 from veblush/string-opt 4c67b2086b Merge pull request #358 from veblush/clang-tidy-fix 38b4beed6b Fix clang-tidy function 'upb_encode_ex' has a definition with different parameter names 9b020d8f65 Optimize calls to std::string::find() and friends for a single char. 3c9ae7837a The fasttable parser works on ARM64! git-subtree-dir: third_party/upb git-subtree-split: 2de300726a1ba2de9a468468dc5ff9ed17a3215f * Updated upb for bazel * Regen upb files * Updated src/upb/gen_build_yaml.py
3 years ago
output(
"\n"
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
"// Must be last.\n"
"#include \"upb/port/def.inc\"\n"
Upb upgrade to the lastest (#26869) * Squashed 'third_party/upb/' changes from 60607da72e..2de300726a 2de300726a Merge pull request #401 from philwo/patch-1 0010bd88ff Merge pull request #403 from haberman/google-wyhash 3f7ecfe315 A few fixes in the 32-bit fallback. 2c14e2788d Added #include for Windows instrinsic. 9e618009ec Removed some extraneous whitespace. c4744c0b21 Updated generated files. 039975556d Merge branch 'master' into google-wyhash ff9d011f12 Merge pull request #402 from haberman/update-ads-benchmark c2f2e93990 Fix Bazel at 4.1.0 41bfbca375 Updated ads benchmark to v7 as v5 no longer exists upstream. 91d506ac32 Ported ABSL's wyhash to C. 3328f06117 Remove ubuntu1604 from presubmit.yml f925acf5f0 Merge pull request #400 from haberman/extreg 897bd2500a Fixed compile error. 6e53de4a03 Addressed PR comments. cdd6434a31 Introduced upb_extreg and plumbed it into decoder. 69f186bd75 Merge pull request #399 from haberman/msg-extrep 3f8aa6ef20 Define the extension representation in messages and mini-tables. 4ccfab154b Merge pull request #398 from haberman/field-mode 58e158c6fa Changed mini-table to use a custom "mode" instead of descriptor's "label." 7596fa740f Merge pull request #397 from haberman/codegen-refactor fa4dfc2baa Addressed PR comments. 0fb61eaeb5 Refactored the codegen into smaller functions, in anticipation of extensions. 52be845c39 Merge pull request #396 from haberman/pre-ext-opt 807e7fe9e2 Fixed dense_below logic to be order-independent and consistent between def.c and codegen. 2e8a122fc0 Changed dense_below calculation to use UINT8_MAX as the constant. 6394894b6e Addressed PR comments. 65d7b8ab0c Optimized decoder and paved the way for parsing extensions. 3e035cb553 Merge pull request #395 from haberman/locale e8ba2a1899 Added a fix for locales that output ',' as decimal separator. 7010a73828 Merge pull request #394 from haberman/file-uniqueness 9482957425 Enforce that filenames are unique when loaded into symtab. aaad7801bf Merge pull request #393 from haberman/has-attribute 7887dc0c76 Fixed the __has_attribute() check for old versions of Clang. 01e7436ed3 Merge pull request #390 from haberman/musttail 4132034634 Addressed PR comment. ed708fcd5d Addressed PR comments. 876abae2db Removed some debug printing and simplified checktag slightly. 286441afa7 Fixed a size regression due to inlining UTF-8 verification. 75df4cdaa3 Loosened the check for fasttable to match what we did before. e84793dd73 Cleaned up debugging artifacts. a4b35aa388 Everything passes except 4 conformance tests. 6e10b5789d Removed redundant license from port_def in amalgmation. 4f1e48ecc6 Updated amalgamator to avoid duplicating license blocks. 0723bfa700 Merge pull request #387 from haberman/json-null dda5416569 Update bazel-skylib main branch name. 2fa52e6951 Merge branch 'master' into json-null a3126b7c7e Merge pull request #388 from haberman/fix-macos b344a6c582 Fixed the macOS build for XCode 11.3. a778f2639a Only perform multiple oneof check for non-null fields. 42bdfcb849 Fix BUILD file. 75d6dab37a Merge pull request #384 from haberman/internal 3881393907 Renamed .int.h to _internal.h, for greater clarity. 5084cbe646 Merge pull request #383 from fowles/master da4b75b979 Fix build rules for more restrive deps checks a8f9cf54cf Merge pull request #382 from haberman/license-headers 1ba446ccfe Updated Google, Inc. to Google LLC. 823eb09694 Update all 2011 dates to 2021. ff89277ef0 Merge pull request #380 from fowles/master 5f74d43cf9 Re-add some comment text that was accidentally removed. 0f27b0450a Merge branch 'master' into license-headers e59d2c8fa7 Added license headers to all files. be4f64b926 Merge pull request #381 from haberman/mv-msg-public 1674f28dd7 Put public message interface into msg.h and moved internal functions to msg.int.h. 6481f6319e Spell out deps explicitly f104225a1e Merge pull request #376 from haberman/fix-quadratic-mem 3c3799498d Merge pull request #379 from fowles/master 2e83d5c98f Remove unused file test_util.h b053fa6991 Merge pull request #378 from fowles/master 7876639e50 remove unused macro 5b97df91dd Restrict fuse to matching block_alloc e74d6c23de Small renames and use uintptr_t instead of void* d9a0c58108 Allow arena fuse to fail 53f5d9f69b Merge pull request #377 from haberman/json-parse-null 8370818143 Switch to a macro to avoid signed/const mismatches. 63ad3db980 Fixed "NULL + 0" UB in JSON encoder and decoder. add9b12f18 Fixed quadratic memory usage in upb_array_append(). 97e2aeb7ee Merge pull request #375 from haberman/cleanups 83c0edbd2a A few minor cleanups. baa7fe7473 Merge pull request #374 from haberman/update-deps 900bd5c426 Merge pull request #355 from haberman/aarch64 89df647460 Updated versions of ABSL and protobuf deps. e4343f0fa3 Update comment for ARM64. 103d51f102 Merge branch 'master' into aarch64 1b9cc09f0e Removed extraneous copybara directive. bbd817fdb6 Merge pull request #373 from haberman/table-cleanup c358829c76 Now that handlers are gone, cleaned up table to use arenas exclusively. ed5b4108e0 Merge pull request #363 from haberman/delete-handlers bfa528f0ae Merge pull request #372 from haberman/errmsg-fix ec9ba3f893 Fixed error message buffer overflow. eb0fdda14b Merge pull request #371 from haberman/json-any e58f7a0284 Fix for Any messages with no fields. 7541ba0f38 Merge pull request #364 from catenacyber/cifuzz 81829bacc3 Removed quote chars from error message. 88ed8f5d3b Changed JSON decoding error message to be more clear. f41c0ec261 Added an internal API to get arena from symtab, for Ruby's use. b080659eee Merge pull request #367 from haberman/timestamp-minute-offset f7ed1f27a3 Support non-zero minutes in the timestamp offset for JSON. 451dcbbb9a Adds CIFuzz f5d2d55007 Deleted the legacy "Handlers" APIs. upb can finally be deserving of its name. 0f40d59258 Merge pull request #362 from haberman/rb-warnings c7787cbaa1 Fixed a bunch of Clang warnings. 5e53b5bb3d Merge pull request #360 from haberman/default-msgval 7a6e647be1 Merge branch 'master' into default-msgval edb0a9a2d9 Merge pull request #361 from haberman/arena-bugfix 9175989431 Bugfix for arena cleanup list when passing to upb_decode(). 5e550e88f8 Added API for getting fielddef default as a upb_msgval. de76b31f9c Merge pull request #359 from veblush/fix-upbdefs 3cab8a38fc Fixed upbdefs error 48bb3e5662 Merge pull request #357 from veblush/string-opt 4c67b2086b Merge pull request #358 from veblush/clang-tidy-fix 38b4beed6b Fix clang-tidy function 'upb_encode_ex' has a definition with different parameter names 9b020d8f65 Optimize calls to std::string::find() and friends for a single char. 3c9ae7837a The fasttable parser works on ARM64! git-subtree-dir: third_party/upb git-subtree-split: 2de300726a1ba2de9a468468dc5ff9ed17a3215f * Updated upb for bazel * Regen upb files * Updated src/upb/gen_build_yaml.py
3 years ago
"\n");
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
int msg_count = WriteMessages(pools, file, options, output);
int ext_count = WriteExtensions(pools, file, options, output);
int enum_count = WriteEnums(pools, file, output);
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
output("const upb_MiniTableFile $0 = {\n", FileLayoutName(file));
output(" $0,\n", msg_count ? kMessagesInit : "NULL");
output(" $0,\n", enum_count ? kEnumsInit : "NULL");
output(" $0,\n", ext_count ? kExtensionsInit : "NULL");
output(" $0,\n", msg_count);
output(" $0,\n", enum_count);
output(" $0,\n", ext_count);
output("};\n\n");
Upb upgrade to the lastest (#26869) * Squashed 'third_party/upb/' changes from 60607da72e..2de300726a 2de300726a Merge pull request #401 from philwo/patch-1 0010bd88ff Merge pull request #403 from haberman/google-wyhash 3f7ecfe315 A few fixes in the 32-bit fallback. 2c14e2788d Added #include for Windows instrinsic. 9e618009ec Removed some extraneous whitespace. c4744c0b21 Updated generated files. 039975556d Merge branch 'master' into google-wyhash ff9d011f12 Merge pull request #402 from haberman/update-ads-benchmark c2f2e93990 Fix Bazel at 4.1.0 41bfbca375 Updated ads benchmark to v7 as v5 no longer exists upstream. 91d506ac32 Ported ABSL's wyhash to C. 3328f06117 Remove ubuntu1604 from presubmit.yml f925acf5f0 Merge pull request #400 from haberman/extreg 897bd2500a Fixed compile error. 6e53de4a03 Addressed PR comments. cdd6434a31 Introduced upb_extreg and plumbed it into decoder. 69f186bd75 Merge pull request #399 from haberman/msg-extrep 3f8aa6ef20 Define the extension representation in messages and mini-tables. 4ccfab154b Merge pull request #398 from haberman/field-mode 58e158c6fa Changed mini-table to use a custom "mode" instead of descriptor's "label." 7596fa740f Merge pull request #397 from haberman/codegen-refactor fa4dfc2baa Addressed PR comments. 0fb61eaeb5 Refactored the codegen into smaller functions, in anticipation of extensions. 52be845c39 Merge pull request #396 from haberman/pre-ext-opt 807e7fe9e2 Fixed dense_below logic to be order-independent and consistent between def.c and codegen. 2e8a122fc0 Changed dense_below calculation to use UINT8_MAX as the constant. 6394894b6e Addressed PR comments. 65d7b8ab0c Optimized decoder and paved the way for parsing extensions. 3e035cb553 Merge pull request #395 from haberman/locale e8ba2a1899 Added a fix for locales that output ',' as decimal separator. 7010a73828 Merge pull request #394 from haberman/file-uniqueness 9482957425 Enforce that filenames are unique when loaded into symtab. aaad7801bf Merge pull request #393 from haberman/has-attribute 7887dc0c76 Fixed the __has_attribute() check for old versions of Clang. 01e7436ed3 Merge pull request #390 from haberman/musttail 4132034634 Addressed PR comment. ed708fcd5d Addressed PR comments. 876abae2db Removed some debug printing and simplified checktag slightly. 286441afa7 Fixed a size regression due to inlining UTF-8 verification. 75df4cdaa3 Loosened the check for fasttable to match what we did before. e84793dd73 Cleaned up debugging artifacts. a4b35aa388 Everything passes except 4 conformance tests. 6e10b5789d Removed redundant license from port_def in amalgmation. 4f1e48ecc6 Updated amalgamator to avoid duplicating license blocks. 0723bfa700 Merge pull request #387 from haberman/json-null dda5416569 Update bazel-skylib main branch name. 2fa52e6951 Merge branch 'master' into json-null a3126b7c7e Merge pull request #388 from haberman/fix-macos b344a6c582 Fixed the macOS build for XCode 11.3. a778f2639a Only perform multiple oneof check for non-null fields. 42bdfcb849 Fix BUILD file. 75d6dab37a Merge pull request #384 from haberman/internal 3881393907 Renamed .int.h to _internal.h, for greater clarity. 5084cbe646 Merge pull request #383 from fowles/master da4b75b979 Fix build rules for more restrive deps checks a8f9cf54cf Merge pull request #382 from haberman/license-headers 1ba446ccfe Updated Google, Inc. to Google LLC. 823eb09694 Update all 2011 dates to 2021. ff89277ef0 Merge pull request #380 from fowles/master 5f74d43cf9 Re-add some comment text that was accidentally removed. 0f27b0450a Merge branch 'master' into license-headers e59d2c8fa7 Added license headers to all files. be4f64b926 Merge pull request #381 from haberman/mv-msg-public 1674f28dd7 Put public message interface into msg.h and moved internal functions to msg.int.h. 6481f6319e Spell out deps explicitly f104225a1e Merge pull request #376 from haberman/fix-quadratic-mem 3c3799498d Merge pull request #379 from fowles/master 2e83d5c98f Remove unused file test_util.h b053fa6991 Merge pull request #378 from fowles/master 7876639e50 remove unused macro 5b97df91dd Restrict fuse to matching block_alloc e74d6c23de Small renames and use uintptr_t instead of void* d9a0c58108 Allow arena fuse to fail 53f5d9f69b Merge pull request #377 from haberman/json-parse-null 8370818143 Switch to a macro to avoid signed/const mismatches. 63ad3db980 Fixed "NULL + 0" UB in JSON encoder and decoder. add9b12f18 Fixed quadratic memory usage in upb_array_append(). 97e2aeb7ee Merge pull request #375 from haberman/cleanups 83c0edbd2a A few minor cleanups. baa7fe7473 Merge pull request #374 from haberman/update-deps 900bd5c426 Merge pull request #355 from haberman/aarch64 89df647460 Updated versions of ABSL and protobuf deps. e4343f0fa3 Update comment for ARM64. 103d51f102 Merge branch 'master' into aarch64 1b9cc09f0e Removed extraneous copybara directive. bbd817fdb6 Merge pull request #373 from haberman/table-cleanup c358829c76 Now that handlers are gone, cleaned up table to use arenas exclusively. ed5b4108e0 Merge pull request #363 from haberman/delete-handlers bfa528f0ae Merge pull request #372 from haberman/errmsg-fix ec9ba3f893 Fixed error message buffer overflow. eb0fdda14b Merge pull request #371 from haberman/json-any e58f7a0284 Fix for Any messages with no fields. 7541ba0f38 Merge pull request #364 from catenacyber/cifuzz 81829bacc3 Removed quote chars from error message. 88ed8f5d3b Changed JSON decoding error message to be more clear. f41c0ec261 Added an internal API to get arena from symtab, for Ruby's use. b080659eee Merge pull request #367 from haberman/timestamp-minute-offset f7ed1f27a3 Support non-zero minutes in the timestamp offset for JSON. 451dcbbb9a Adds CIFuzz f5d2d55007 Deleted the legacy "Handlers" APIs. upb can finally be deserving of its name. 0f40d59258 Merge pull request #362 from haberman/rb-warnings c7787cbaa1 Fixed a bunch of Clang warnings. 5e53b5bb3d Merge pull request #360 from haberman/default-msgval 7a6e647be1 Merge branch 'master' into default-msgval edb0a9a2d9 Merge pull request #361 from haberman/arena-bugfix 9175989431 Bugfix for arena cleanup list when passing to upb_decode(). 5e550e88f8 Added API for getting fielddef default as a upb_msgval. de76b31f9c Merge pull request #359 from veblush/fix-upbdefs 3cab8a38fc Fixed upbdefs error 48bb3e5662 Merge pull request #357 from veblush/string-opt 4c67b2086b Merge pull request #358 from veblush/clang-tidy-fix 38b4beed6b Fix clang-tidy function 'upb_encode_ex' has a definition with different parameter names 9b020d8f65 Optimize calls to std::string::find() and friends for a single char. 3c9ae7837a The fasttable parser works on ARM64! git-subtree-dir: third_party/upb git-subtree-split: 2de300726a1ba2de9a468468dc5ff9ed17a3215f * Updated upb for bazel * Regen upb files * Updated src/upb/gen_build_yaml.py
3 years ago
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
output("#include \"upb/port/undef.inc\"\n");
output("\n");
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
void WriteMessageMiniDescriptorInitializer(upb::MessageDefPtr msg,
const Options& options,
Output& output) {
Output resolve_calls;
for (int i = 0; i < msg.field_count(); i++) {
upb::FieldDefPtr field = msg.field(i);
if (!field.message_type() && !field.enum_subdef()) continue;
if (field.message_type()) {
resolve_calls(
"upb_MiniTable_SetSubMessage(mini_table, "
"(upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, "
"$0), $1);\n ",
field.number(), MessageMiniTableRef(field.message_type(), options));
} else if (field.enum_subdef() && field.enum_subdef().is_closed()) {
resolve_calls(
"upb_MiniTable_SetSubEnum(mini_table, "
"(upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, "
"$0), $1);\n ",
field.number(), EnumMiniTableRef(field.enum_subdef(), options));
}
Squashed 'third_party/upb/' changes from d8f3d6f9d4..ce1a399a19 ce1a399a19 Text format serializer for upb_msg (#242) 888f35cae6 Merge pull request #241 from haberman/conformance-fixes 46b93f8cea A bit more cleanup in the decoder. ad2eb65a4b Refactored conformance_upb to use reflection, and fixed a decoder bug. a202c5f84d Merge pull request #234 from haberman/parser 4c974cf72d Fixed generated files. 9a870d957f Removed upb_decframe and made ptr an explicit parameter and return. a6c54729df Added UPB_ASSUME(), to work around warnings when optimization is enabled: 9e1f89ef2c Merge pull request #224 from haberman/maps ce0496eb86 Merge branch 'master' into maps e911aae5f6 Factored upb_map_entry into a shared place. 4c1a97ae9c Merge branch 'master' into maps 59fe620fa0 Merge branch 'maps' of github.com:haberman/upb into maps 744f8588da Cleanup to remove END_GROUP from descriptortype -> type tables. f9efbcd5d6 Added missing append fallback. c4b64e6a20 Slight simplification: NULL arena will avoid creating a new sub-object. d541566a7b Moved upb_array_new() to upb/reflection.h where it belongs. 059f226d41 Unit tests for maps generated code. 520ddc1f11 c89 fixes. 806c8c9c6e Removed obsolete testing files. 2a85bef825 Generated code interface for maps is complete, though not yet tested. 7f5fe52dfa Fixes for non-C89 code. 6c2d732082 Fixed upb's map parsing to overwrite existing elements. 090a0c33a4 Fixed VLA error and rewrote the map parsing code to be clearer. 0fbae939d2 Removed stray fprintf(). 572ba75d1c Removed comma after final enumerator. c9135e5276 Fixed the build. d040aa1302 Merge branch 'master' into maps e18541a9dd Added some missing files. 92509cc3b2 Rename lua_test. 382f92a87f Maps encode and decode successfully! 4c57b1fefd More progress on Lua extension. d6c3152c0b Added more Lua tests that are passing. ae66e571d4 Fixed some bugs and added a few more tests. bfc86d3577 Fixed many bugs, basic Lua test passes! b518b06d75 Lua test program is loaded successfully. 6ae4a2694c Merge branch 'maps' of github.com:haberman/upb into maps cc6db9fb0b Fixed crash bug. 88d996132e Added Lua main.c test driver program. 626ec4bfcf Everything builds, test pass except test_decoder. 5239655b99 WIP. 23825332e1 WIP. 27b95c969a WIP. 9a360ad43d Moved legacy_msg_reflection.{c,h} -> reflection.{c.h}. dc58b657ee New reflection API doesn't need types as parameters for map/array. c486da3970 WIP. b76040cfcc Merge branch 'maps' of github.com:haberman/upb into maps cc8e894b63 Merge branch 'master' into maps 946880c105 Merge branch 'master' into maps 1461da5056 WIP. 0a07f2714b Merge branch 'master' into maps 18de110b00 Merge branch 'master' into maps 283857f308 WIP. 5dea3f8486 Merge branch 'master' into maps 07ac6f0e8e Merge branch 'master' into maps 0c64c4b594 WIP. git-subtree-dir: third_party/upb git-subtree-split: ce1a399a19f11683d58ba4c2569ec3fdd5a67621
5 years ago
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
output(
R"cc(
const upb_MiniTable* $0() {
static upb_MiniTable* mini_table = NULL;
static const char* mini_descriptor = "$1";
if (mini_table) return mini_table;
mini_table =
upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor),
upb_BootstrapArena(), NULL);
$2return mini_table;
}
)cc",
MessageInitName(msg), msg.MiniDescriptorEncode(), resolve_calls.output());
output("\n");
}
void WriteEnumMiniDescriptorInitializer(upb::EnumDefPtr enum_def,
const Options& options,
Output& output) {
output(
R"cc(
const upb_MiniTableEnum* $0() {
static const upb_MiniTableEnum* mini_table = NULL;
static const char* mini_descriptor = "$1";
if (mini_table) return mini_table;
mini_table =
upb_MiniTableEnum_Build(mini_descriptor, strlen(mini_descriptor),
upb_BootstrapArena(), NULL);
return mini_table;
}
)cc",
EnumInitName(enum_def), enum_def.MiniDescriptorEncode());
output("\n");
}
void WriteMiniDescriptorSource(const DefPoolPair& pools, upb::FileDefPtr file,
const Options& options, Output& output) {
output(
"#include <stddef.h>\n"
"#include \"upb/collections/array_internal.h\"\n"
"#include \"upb/message/internal.h\"\n"
"#include \"upb/mini_table/decode.h\"\n"
"#include \"upb/mini_table/enum_internal.h\"\n"
"#include \"$0\"\n\n",
HeaderFilename(file));
for (int i = 0; i < file.dependency_count(); i++) {
output("#include \"$0\"\n", HeaderFilename(file.dependency(i)));
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
output(
R"cc(
static upb_Arena* upb_BootstrapArena() {
static upb_Arena* arena = NULL;
if (!arena) arena = upb_Arena_New();
return arena;
}
)cc");
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
output("\n");
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
for (const auto msg : SortedMessages(file)) {
WriteMessageMiniDescriptorInitializer(msg, options, output);
}
for (const auto msg : SortedEnums(file)) {
WriteEnumMiniDescriptorInitializer(msg, options, output);
}
}
void WriteSource(const DefPoolPair& pools, upb::FileDefPtr file,
const Options& options, Output& output) {
if (options.bootstrap) {
WriteMiniDescriptorSource(pools, file, options, output);
} else {
WriteMiniTableSource(pools, file, options, output);
}
}
void GenerateFile(const DefPoolPair& pools, upb::FileDefPtr file,
const Options& options, Plugin* plugin) {
Output h_output;
WriteHeader(pools, file, options, h_output);
plugin->AddOutputFile(HeaderFilename(file), h_output.output());
Output c_output;
WriteSource(pools, file, options, c_output);
plugin->AddOutputFile(SourceFilename(file), c_output.output());
}
bool ParseOptions(Plugin* plugin, Options* options) {
for (const auto& pair : ParseGeneratorParameter(plugin->parameter())) {
if (pair.first == "bootstrap_upb") {
options->bootstrap = true;
} else {
plugin->SetError(absl::Substitute("Unknown parameter: $0", pair.first));
return false;
}
}
return true;
}
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
absl::string_view ToStringView(upb_StringView str) {
return absl::string_view(str.data, str.size);
}
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
} // namespace
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
} // namespace upbc
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
int main(int argc, char** argv) {
[protobuf] Upgrade third_party/protobuf to 22.x (#32606) The very non-trivial upgrade of third_party/protobuf to 22.x This PR strives to be as small as possible and many changes that were compatible with protobuf 21.x and didn't have to be merged atomically with the upgrade were already merged. Due to the complexity of the upgrade, this PR wasn't created automatically by a tool, but manually. Subsequent upgraded of third_party/protobuf with our OSS release script should work again once this change is merged. This is best reviewed commit-by-commit, I tried to group changes in logical areas. Notable changes: - the upgrade of third_party/protobuf submodule, the bazel protobuf dependency itself - upgrade of UPB dependency to 22.x (in the past, we used to always upgrade upb to "main", but upb now has release branch as well). UPB needs to be upgraded atomically with protobuf since there's a de-facto circular dependency (new protobuf depends on new upb, which depends on new protobuf for codegen). - some protobuf and upb bazel rules are now aliases, so ` extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py` had to be modified to be able to follow aliases and reach the actual aliased targets. - some protobuf public headers were renamed, so especially `src/compiler` needed to be updated to use the new headers. - protobuf and upb now both depend on utf8_range project, so since we bundle upb with grpc in some languages, we now have to bundle utf8_range as well (hence changes in build for python, PHP, objC, cmake etc). - protoc now depends on absl and utf8_range (previously protobuf had absl dependency, but not for the codegen part), so python's make_grpcio_tools.py required partial rewrite to be able to handle those dependencies in the grpcio_tools build. - many updates and fixes required for C++ distribtests (currently they all pass, but we'll probably need to follow up, make protobuf's and grpc's handling of dependencies more aligned and revisit the distribtests) - bunch of other changes mostly due to overhaul of protobuf's and upb's internal build layout. TODOs: - [DONE] make sure IWYU and clang_tidy_code pass - create a list of followups (e.g. work to reenable the few tests I had to disable and to remove workaround I had to use) - [DONE in cl/523706129] figure out problem(s) with internal import --------- Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
upbc::DefPoolPair pools;
upbc::Plugin plugin;
upbc::Options options;
if (!ParseOptions(&plugin, &options)) return 0;
plugin.GenerateFilesRaw([&](const UPB_DESC(FileDescriptorProto) * file_proto,
bool generate) {
upb::Status status;
upb::FileDefPtr file = pools.AddFile(file_proto, &status);
if (!file) {
absl::string_view name =
upbc::ToStringView(UPB_DESC(FileDescriptorProto_name)(file_proto));
ABSL_LOG(FATAL) << "Couldn't add file " << name
<< " to DefPool: " << status.error_message();
}
if (generate) GenerateFile(pools, file, options, &plugin);
});
return 0;
Squashed 'third_party/upb/' changes from 382d5afc60..60607da72e 60607da72e Merge pull request #356 from haberman/codegen-uniquefiles 7a54a5f3d6 Split the code generators for .upb and .upbdefs. b10b02f66f Merge pull request #353 from haberman/small-fixes cd7c2d2701 Merge pull request #352 from haberman/large-field-number 10b355a6e0 A couple minor fixes. These are exercised by Ruby. 6c30b5fe73 Fixed upb encoder for field numbers > 2**28. 31b3528424 Merge pull request #350 from haberman/encode-depthlimit e9551022c1 Added depth limit checking to upb_encode(). f389384c5a Merge pull request #349 from lidizheng/json-public f72c26cbc4 Make :json publically visible 5797d95172 Merge pull request #348 from haberman/json-emit-defaults 7a17493269 Removed print debugging. 695b7f4617 Added code to test UPB_JSONENC_EMITDEFAULTS. 6b357607bd Fixed bugs in JSON encoding with UPB_JSONENC_EMITDEFAULTS. 1b08391979 Merge pull request #347 from haberman/filedef-symtab ee49a8d7df Added an accessor to get the symtab from a filedef. a81b47025a Merge pull request #345 from haberman/encode-skipunknown 6535cbe380 Merge pull request #346 from timgates42/bugfix_typo_position 7225108720 docs: fix simple typo, posisiton -> position 871ff96252 Test SKIPUNKNOWN on regular fields. 0569c22a1e Removed debug print. 76764643ac Added option to binary encoder to skip unknown fields. 794ce6d061 Merge pull request #344 from haberman/deterministic-serialize a04627abc8 Added map sorting to binary and text encoders. 3e071ea91a Merge pull request #343 from haberman/msvc e70e488e09 MSVC apparently doesn't support the standard C/C++ defines. 963e501aa6 Merge pull request #342 from haberman/fuzz 8d670d8aea Renamed decode_varint32() to decode_tag(). 9abf8e043f Clamp 32-bit varints to 5 bytes to fix a fuzz failure. 50a543de7f Merge pull request #341 from haberman/code-size 9c87f1168f Added size benchmark for CODE_SIZE. 6f82028236 Merge pull request #340 from haberman/darwin-setjmp 358fa14d0e Fixed headers and updated benchmark script. bc200451ce Use a macro instead of an inline function for setjmp/longjmp. ca279f8afa Merge branch 'master' into darwin-setjmp fbc0639b07 Use _setjmp on mac to avoid saving/restoring the signal mask. 10f0a38450 Merge pull request #337 from haberman/size-benchmarks 4be07a2dce Increase build timeout until we can parallelize the build. 378a27b640 Force "size" to run locally. da48e01f05 More google3 fixes. d2446fd2db Moved cc_api_version attribute to proto_library(). 4a84390c89 Added cc_proto_library() tweaks for google3. 4dd4212a34 Merge branch 'master' into size-benchmarks ffecfef161 Merge branch 'master' into size-benchmarks 86f671d5fd Fix for Darwin (output is different, but it won't error out). 165e01ec6f Fix for old Python versions. 40fdff5e43 Merge pull request #339 from haberman/benchmark-alias 5f8bb5de1d Updated generated code. 65d166a6ba Added API for copy vs. alias and added benchmarks to test both. 27b9c999a7 Merge pull request #338 from haberman/arena-initial 9df96874e9 Start arena block doubling at initial block size. 881ddac7fe Also use .format() for gen_synthetic_protos.py. 8b7dabe1a2 Use format() instead of string interpolation, for old Python versions. 8e08282c3b Removed unused small.proto. 0f79d47215 Added missing lite binaries to size_data.txt. 555fbbc0bc Size benchmarks are working pretty well. 85cbc41a89 Merge branch 'master' into size-benchmarks e5bdfba92c Removed accidentally-added .orig file. 07851fac58 Merge pull request #336 from haberman/fuzz 982b634bc5 Fixed a few minor bugs found by fuzzing. c9d2e58480 Merge pull request #310 from haberman/fast-table a01f3e23a4 Fixes for google3 build, and exclude even more tests from macOS to avoid timeout. a83d55ee4b Exclude Clang tests from MacOS to avoid Kokoro timeouts. 73fcfe9ed0 Tried to slim down the tests a bit more. baab25b7aa Removed excess/redundant tests from Kokoro script. 1eb7bd39e7 Some formatting fixes. 9d87055ce4 Updated Kokoro build script. 4bd34da105 WIP. a7993615bf Merge branch 'master' into fast-table 3a3efe69a2 Added incompatible_use_toolchain_transition = True per https://github.com/bazelbuild/bazel/issues/11584 7b4e376f79 Switch unordered_set -> absl::flat_hash_set. fe62fc83e1 Removed obsolete includes in benchmark. 5ed089dc42 Merge pull request #335 from haberman/wyhash-rule e9b79542ad Added a BUILD file for wyhash. 7b8ae7ec4e Merge branch 'master' into size-benchmarks a5b5445da6 Merge pull request #334 from haberman/rm-port-c 6c16cba83f Removed obsolete port.c file. 484d8f746a Updated comment in wyhash.h to correct spelling mistake. 6a9d0f45b8 Merge pull request #333 from haberman/32bitfixes 5b1f0d86a1 For Kokoro, only build/test -m32 on Linux. 0497f8deed Fixed a critical bug on 32-bit builds, and added much more Kokoro testing. 7543f851f1 Merge pull request #332 from haberman/php-amalgamation 64abb5eb11 Amalgamation no longer bundles wyhash, but #includes it. a2a40792b5 Merge pull request #331 from haberman/json-oneof-fix dd0994d377 Bugfix for JSON decoding: only check real oneofs for duplicates. 496f638025 Merge pull request #330 from haberman/symtab-longjmp c9f9668234 symtab: use longjmp() for errors and avoid intermediate table. 4d9a8cd67b Merge branch 'master' into symtab-longjmp 6322d1d72d Merge pull request #329 from haberman/benchmark-ads-descriptor 5ec1d39224 Avoid building .pb.cc for ads protos, as C++ takes forever to compile. 43c207ea7e Added CMake dummy rule. c3b5637646 Added benchmark for loading ads descriptor. acd72c6d3f WIP. 6ae3b66cd2 Merge pull request #328 from haberman/optdefload 8113ebd6c7 Added explanatory comment about integer constants. f2d826b9f3 Got rid of floating-point division in table init. 723cd8ffc1 Added wyhash code and LICENSE, and removed temporary benchmark. 15e20636c3 Merge branch 'master' into optdefload 154f2c25f4 Added UTF-8 validation for proto3 string fields. e8f9eac68c Added #defines UPB_ENABLE_FASTTABLE and UPB_TRY_ENABLE_FASTTABLE. 994cf07cf3 Merge pull request #327 from benjaminp/modern-linking b5bd5807a7 Migrate to modern Starlark linking api. dc64613607 Merge branch 'fastest-table' into fast-table e86541ac1d Fixed the build after the merge. 1cd0cb17d3 Merge branch 'master' into fastest-table 901744a97e Merge pull request #326 from haberman/c99 a0d16e7073 Added a few missing copts, and made some functions proper prototypes. 558315a1c3 Added COPTS to :port. 7e5bd65098 Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 8f3ee80d46 Drop C89/C90 support and MSVC prior to Visual Studio 2015. a274ad786a Plumbed copts (including the crucial -std=c99) to upb_proto_library() aspect. 2c8bb6dd9d Specify C99 explicitly until/unless we stop using bool. efd576b698 Added -std=gnu99 for fastdecode and ran Buildifier. b928696942 A few more fixes, and test fastdecode under Kokoro. 55f3569cd2 A few minor fixes and more assertions. 8b38e8f214 Merge branch 'fastest-table' into fast-table 46eb82467a Added comment to decode_fast.h. bd9f8f580d Fixed a few bugs with the fast decoder. 3eba47914b Allocate hasbits and table slots in "hotness" order. 021db6fcd5 Allow larger tags into the table if they are unique mod 31. 86d9908c55 Fastdecode support for packed fields. e3e797b680 Added fasttable support for oneofs. 7ffa9c181a Fixed some small bugs and performance problems in string copying. e2c709e047 Repeated string and primitive support. e9103eda9e Merge branch 'master' into fastest-table 0756999ab6 Merge pull request #325 from haberman/inlined-arena 25db40bc30 Fixed upb::InlinedArena, which was compeltely broken. d81ba58215 Optimized short string copying. f3a2a79349 More optimization, back up to 2.56GB/s. 199c914295 Simplify push/pop when msg fits in the current buffer. d5f5db2729 Put string-copying field parser into a separate function. 883f20d4dc Merge branch 'master' into fastest-table 1bd62e8218 Merge pull request #324 from haberman/simplemomi f4adbe0698 Optimized varint decoding from Gerben. 48689df72e Eliminated bounds checks inside parsing a field. a345af9883 Added a codegen parameter for whether fasttables are generated or not. 8a3470c543 WIP. 8e8dbb5258 Merge branch 'fastest-table' into fast-table 7d17a0e8c5 Merge branch 'master' into fastest-table a7e2e8338d Fixed benchmark script. 72de7b7002 Merge branch 'fastest-table' into fast-table cb234e652c Merge branch 'master' into fastest-table b86cf2d789 Merge pull request #323 from haberman/build-files 4ea81ab107 Fixed pedantic warning. 6399b31f4b Removed ULL constants in json_decode.c. c8ae197e64 Removed "U" suffixes, they are not necessary. bc1e0b314f Fixed some strict C89 errors. 2c1664906a Removed license comments and upb_amalgamation for google3. b7dc77415a Added licenses() to all BUILD files. de22764b33 Updated Kokoro to test ... instead of :all. e3f41de6c7 Split monolithic BUILD file into many build files. fbe2bcafbc Merge pull request #4 from gerben-s/gerbens-fast-table 9e68ec033f Add repeated varints and fixed parsers d0e4b688c6 Shorten name of kAliasString, so benchmark results don't wrap. c0c9b5a168 Regenerated generated code. eb8e6de8b7 Regenerated source files. 7f0d535826 Merge branch 'fastest-table' into fast-table bf8e08074c Added a few more comments. 6e3c22e6ee Merge branch 'fastest-table' into fast-table 3238821315 Gave fast table entry a nicer name. 2a574d3d01 Added a bunch of comments for readability. 0deca8b8fb Merge branch 'master' into fast-table bfadc99709 Merge branch 'master' into fastest-table 84e0f6127d Merge branch 'master' into fastest-table 61c51a607b Merge branch 'master' into fast-table 4f066765a9 Merge pull request #320 from haberman/string-view-benchmark bf393bf086 Cleaned up benchmark names. 9eb8414b31 Added descriptor_sv.proto. ee7da95367 Bzl formatting fix per buildifier. de1b6b0718 Refactored proto2 benchmarks and added StringView benchmark. c2901eeee1 Added missing #includes (caught by Blaze). 52721eadc7 Order LargeInitialBlock after non-initial-block test. 44a7130845 Used the correct copy of the protos in the benchmark. 3a242e7a48 Merge branch 'master' into fast-table d01b712dbb Merge branch 'master' into fastest-table d225dfc2ed Buildifier formatting fixes. b0994a6501 Added missing dep from benchmark. de80054018 Make required fields optional for benchmarking. 745661bf1f Merge branch 'master' into fastest-table 11585095b7 Merge pull request #319 from haberman/copy-descriptor fd5a35d49d Minor comment changes. bdd1a516e8 Fixed other tests. 27262adf93 Snapshot descriptor.proto into our own copy for benchmarking purposes. d6b40fd5e2 Added missing dependency on reflection. b9f1b67d07 Use quoted include. 1c8c16b9b1 Use quoted include. 4f901b6430 Passes all tests. de84e20788 Merge branch 'master' into optdefload d5c64476fd Merge pull request #318 from haberman/descriptor-load-benchmark 42d2f6cef9 Add MB/s measures in the benchmarks. 1ce98b86ec Added LoadDescriptor benchmark for proto2. 4890735ce2 Added benchmark for descriptor loading. 6f59f1256e Optimizations to descriptor loading. 6874d61704 Merge pull request #317 from haberman/gencode-compat c81113e60f Added fallback code for when no enum matches. c10b24ffb2 Simplified switch(). ded2e657a7 Added compatibility with old generated code. 5b0c5c7d4a Dispatch inline. 75edd3e59c Changed to use table pairs, seems to ever-so-slightly regress. 69d99a247e Merge pull request #3 from haberman/shifted-table bca7edac8c Cleaned up table compression a bit. b95f217996 A little speed boost, now hitting 2.51GB/s. 8ed6b2fe85 Stored mask in the table pointer. a6dc88556d Tables are compressed, but perf goes down to 2.44GB/s. 91eb09b1bc Add a few comments. 7a1835d7c3 Merge branch 'master' into fast-table 8bd5c0088e Merge pull request #316 from haberman/submsg-array a4966fd230 Added a few extra sanity checks. 99acbe0da8 Fixed bug where submsg array could have excess elements. 2a0425ecf5 Merge pull request #315 from haberman/conformance-fixes 7ccf5650c7 If we encounter "null" for a non-NullValue enum, throw an error. 0a3a94a12f Updated to a new version of protobuf and fixed a few conformance tests. ddd5f28c4f Merge branch 'is_bazel' 10fa3a0c77 Merge pull request #314 from haberman/addunknown 504e105420 undef UPB_ASAN. ab96d1ec41 Removed extraneous C++-style comment. d5096f9ee8 Fixed bug in addunknown and added ASAN poisoning. 6fe84526be Mark _is_bazel to be replace in google3. f01efe8b64 Removed another C99-ism. 1749082bbb Removed C99-ism. 147e363f56 Merge branch 'master' into fast-table f2ddc15d76 Bugfix: initialize fastlimit and fastend. 65e49b694b Merge branch 'gerben-fast-table' into fast-table 1abf7d418d Added generated files. 3f719fa6b2 Bugfix: offsetting hasbits with 16 introduced a bug in calculating hasmasks. Removing extra <<16 shift in hasmask calculating and masking out the first 16 bits. This makes messages without hasbits work as well. aec762e405 Merge branch 'master' into fast-table 4f77aaafd8 Merge pull request #2 from gerben-s/fast-table 4053805759 Bugfixes d1cd80385b Merge pull request #313 from haberman/inline-arena ad21083623 Merge pull request #313 from haberman/inline-arena 2339fc779c Updated obsolete comment. b393849bbd Updated obsolete comment. ebe53f8590 Fixed compile error. b37f82b58b Fixed compile error. 71749b7caf Implemented inline array allocation, and moved type->lg2 map to reflection. 9557b97acc Implemented inline array allocation, and moved type->lg2 map to reflection. b58d2a0ee6 Shrink overhead of message representation. 0bf063a2ca Shrink overhead of message representation. d87ceeacab Shave off one more store. ddc52ab9d6 Shave off one more store. c25d895adf Shrunk the arena state that needs to be synced. 7f67f68c1c Shrunk the arena state that needs to be synced. ff40dd6ea9 Added new internal header. 85a43e5461 Added new internal header. 36662b3735 Refactor some code. I extracted some common code from all message field parsers, to a tail recursive function. Removed the varint jmp table for a simple varint parse loop, that removes the stack frames. Also careful with not losing information in repeated message tag check. When written mindful the checks and loads that happen can be reused for tag dispatch if not the expected tag. cbcd635917 Fixed memory leak. bcbcdadbd2 Fixed memory leak. e5264bd794 Merge pull request #312 from haberman/defiter 52957fa984 Merge pull request #312 from haberman/defiter 746f64692c Moved arena inline for decoder. 7363b91ac3 Moved arena inline for decoder. b8ef1dcc57 Removed C++-style comments. 575acd85bd Re-added const for all of the pointer wrapper types. 5aa5b77b41 Added simple offset-based accessors for defs, and deprecated old iterators. 33384301e2 Merge pull request #311 from haberman/proto2-benchmark2 578e7c1f4c Merge pull request #311 from haberman/proto2-benchmark2 bc301e7da4 Use merge/partial variants to give proto2 benchmark the fairest hearing. 30f01afa83 Added LargeInitialBlock test for proto2. 5d23fd99af Used shorter protobuf:: namespace alias. 9938cf8f27 Put submsg_index directly in table data. Drop oneof support for now to focus. d87179501d Another build fix. 89bd8b87e1 Fixed a few more C89 compat issues. 64d293894a Fixed bug introduced by last optimization. ff957b996c Fixed C89 compat issues. 537b6f42c2 A few updates to the benchamrk and minor implementation changes. 0dcc5641eb Replicated dispatch and implemeted array resizing logic. Up to 2.67GB/s. 526e430794 I think this may have reached the optimization limit. 4c65b25daf Handle long varints, now 2GB/s! e39ec95ca2 Hoisted updates to limits and depth out of the loop. 52a0ed3891 Fixed a bug with tag number 15. 388b6f64eb A small optimization: don't increment array length every iteration. 9e5c5ce089 Optimized memset() with cutoff and fixed group & unknown message bugs. 8dd7b5a2ca A bunch more optimization. e46e94ec7f Added benchmarks for proto2. 405e7934b1 Handle 2-byte submessage lengths. 88b1ec7784 Table-driven supports repeated sub-messages. f173642db4 Handle non-repeated submessages. e219a2d91d Merge branch 'decode-arena' into fast-table 7ec2c52346 Donate/steal from arena to accelerate decoding. d43ccfa079 Revert test changes. fac992db83 Cleanup for showing. 3937874a85 We have a properly structured algorithm, but perf regresses by 20%. 438ecaeb5a Give all field parsers a generic table entry. 383ae5293e WIP. 26abaa2345 WIP. 34b98bc030 Avoid passing too many params to fallback. 763a3f6293 WIP. 02ff6fb996 Merge pull request #309 from haberman/decoder-forceinline a202ce9629 Add UPB_FORCEINLINE for varint32 decoding. d0f2c4c8a2 Merge pull request #308 from haberman/encoder 5741eb9ad7 Expanded benchmarking script and added one size opt to the encoder. 0135399e60 Fixed bug introduced in refactoring. df3438222b Notated impossible branch as unreachable. 9b31e8fe12 Merged common encode tag paths. 5d7dc718cc Minor formatting fix. 80441e4eb4 Optimized binary encoder. ada28896b9 Changed encoder to use longjmp() for error recovery. 6e140c267c Added benchmark for encoding. 7338facddb Merge pull request #307 from veblush/port-backport 4d2251c3e4 Add UPB_NORETURN for MSC git-subtree-dir: third_party/upb git-subtree-split: 60607da72e89ba0c84c84054d2e562d8b6b61177
4 years ago
}