• Seth Brenith's avatar
    [torque] Get rid of @generatePrint annotation · 267b067b
    Seth Brenith authored
    I'm trying to remove annotations and make behavior more consistent. For
    @generatePrint, there are two options: either generate printers for
    every extern class, or never generate printers for extern classes. This
    change implements the option of always generating printers. Classes that
    require custom printing can easily hide the generated printer by using
    DECL_PRINTER. This causes the generated file
    gen/torque-generated/objects-printer.cc to grow to 1600 lines, including
    many functions that are never used, but I think the consistency benefit
    outweighs a little more compilation time on one file. This change also
    removes custom printers in cases where the generated printer includes
    all of the same content.
    
    If folks would prefer the option to never generate printers, I'm open to
    doing that instead. I like the notion that generating more code could
    reduce the friction of adding new classes and thereby encourage people
    to define precise types rather than using FixedArrays, but the current
    implementation of generated printers is limited, and many printers have
    been customized to show the data that matters the most. Unlike verifiers
    and body descriptors, there are no correctness or safety concerns with
    hand-written printers.
    
    Some bugs showed up once we start generating printers for everything,
    and this change fixes them:
    - Printers incorrectly included ungettable fields like padding
    - Printers called getters which might be hidden by hand-written classes
    - The generated getter for Map::instance_type used
      ReadField<InstanceType>, which is not an arithmetic type since it's an
      enum
    
    One more tiny drive-by fix: added a missing newline in the printers for
    JSMap and JSSet.
    
    Bug: v8:7793
    Change-Id: Ib9e9575fbcb57879935ff18bf4db49fe276d2966
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3172190Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
    Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
    Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
    Cr-Commit-Position: refs/heads/main@{#77152}
    267b067b
Name
Last commit
Last update
.github Loading commit data...
bazel Loading commit data...
build_overrides Loading commit data...
custom_deps Loading commit data...
docs Loading commit data...
gni Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party Loading commit data...
tools Loading commit data...
.bazelrc Loading commit data...
.clang-format Loading commit data...
.clang-tidy Loading commit data...
.editorconfig Loading commit data...
.flake8 Loading commit data...
.git-blame-ignore-revs Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.mailmap Loading commit data...
.vpython Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.bazel Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
COMMON_OWNERS Loading commit data...
DEPS Loading commit data...
DIR_METADATA Loading commit data...
ENG_REVIEW_OWNERS Loading commit data...
INFRA_OWNERS Loading commit data...
INTL_OWNERS Loading commit data...
LICENSE Loading commit data...
LICENSE.fdlibm Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LOONG_OWNERS Loading commit data...
MIPS_OWNERS Loading commit data...
OWNERS Loading commit data...
PPC_OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
RISCV_OWNERS Loading commit data...
S390_OWNERS Loading commit data...
WATCHLISTS Loading commit data...
WORKSPACE Loading commit data...
codereview.settings Loading commit data...