• 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...
ast Loading commit data...
base Loading commit data...
builtins Loading commit data...
codegen Loading commit data...
common Loading commit data...
compiler Loading commit data...
compiler-dispatcher Loading commit data...
d8 Loading commit data...
date Loading commit data...
debug Loading commit data...
deoptimizer Loading commit data...
diagnostics Loading commit data...
execution Loading commit data...
extensions Loading commit data...
flags Loading commit data...
handles Loading commit data...
heap Loading commit data...
ic Loading commit data...
init Loading commit data...
inspector Loading commit data...
interpreter Loading commit data...
json Loading commit data...
libplatform Loading commit data...
libsampler Loading commit data...
logging Loading commit data...
numbers Loading commit data...
objects Loading commit data...
parsing Loading commit data...
profiler Loading commit data...
protobuf Loading commit data...
regexp Loading commit data...
roots Loading commit data...
runtime Loading commit data...
sanitizer Loading commit data...
snapshot Loading commit data...
strings Loading commit data...
tasks Loading commit data...
third_party Loading commit data...
torque Loading commit data...
tracing Loading commit data...
trap-handler Loading commit data...
utils Loading commit data...
wasm Loading commit data...
zone Loading commit data...
DEPS Loading commit data...
OWNERS Loading commit data...