• 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
..
benchmarks Loading commit data...
cctest Loading commit data...
common Loading commit data...
debugger Loading commit data...
debugging Loading commit data...
fuzzer Loading commit data...
inspector Loading commit data...
intl Loading commit data...
js-perf-test Loading commit data...
memory Loading commit data...
message Loading commit data...
mjsunit Loading commit data...
mkgrokdump Loading commit data...
mozilla Loading commit data...
test262 Loading commit data...
torque Loading commit data...
unittests Loading commit data...
wasm-api-tests Loading commit data...
wasm-js Loading commit data...
wasm-spec-tests Loading commit data...
webkit Loading commit data...
BUILD.gn Loading commit data...
OWNERS Loading commit data...