• Tobias Tebbi's avatar
    [torque] add const references and disallow const class field writes · d7e02ea4
    Tobias Tebbi authored
    - Allow type expression for abstract type supertypes.
      For consistency, and ease of implementation, also allow this for enums.
    - Allow subtyping of structs. This requires changing all places where we
      checked for struct types and instead check if we have a subtype of a
      struct type.
    - This allows defining two subtypes of the Reference<T> struct for
      mutable and constant references. Mutable references are a subtype of
      constant references.
    - &T desugars to MutableReference<T>
      const &T desugars to ConstReference<T>
    - A const field of a class produces a constant reference.
      A const field of a mutable reference to a struct is const.
      A mutable field of a const reference to a struct is const.
    - It is possible to assign a new struct value to a mutable reference to
      a struct, even if the struct contains const fields. This is analogous
      to allowing assignments of let-bound structs with constant fields.
    
    Not in this CL:
    - A notion of const slices.
    - Applying const to appropriate class fields.
    
    Bug: v8:7793
    Change-Id: I6e7b09d44f54db25f8bf812be5f3b554b80414e0
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2096615Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
    Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#66759}
    d7e02ea4
Name
Last commit
Last update
..
api Loading commit data...
asmjs Loading commit data...
assembler Loading commit data...
base Loading commit data...
codegen Loading commit data...
compiler Loading commit data...
compiler-dispatcher Loading commit data...
date Loading commit data...
diagnostics Loading commit data...
execution Loading commit data...
heap Loading commit data...
interpreter Loading commit data...
libplatform Loading commit data...
logging Loading commit data...
numbers Loading commit data...
objects Loading commit data...
parser Loading commit data...
profiler Loading commit data...
regress Loading commit data...
strings Loading commit data...
tasks Loading commit data...
torque Loading commit data...
utils Loading commit data...
wasm Loading commit data...
zone Loading commit data...
BUILD.gn Loading commit data...
DEPS Loading commit data...
run-all-unittests.cc Loading commit data...
test-helpers.cc Loading commit data...
test-helpers.h Loading commit data...
test-utils.cc Loading commit data...
test-utils.h Loading commit data...
testcfg.py Loading commit data...
unittests.status Loading commit data...