• Seth Brenith's avatar
    [torque] Generate instance types · 8c7ae314
    Seth Brenith authored
    Design doc:
    https://docs.google.com/document/d/1ZU6rCvF2YHBGMLujWqqaxlPsjFfjKDE9C3-EugfdlAE/edit
    
    Changes from the design doc:
    - Changed to use 'class' declarations rather than 'type' declarations
      for things that need instance types but whose layout is not known to
      Torque. These declarations end with a semicolon rather than having a
      full set of methods and fields surrounded by {}. If the class's name
      should not be treated as a class name in generated output (because
      it's actually a template, or doesn't exist at all), we use the
      standard 'generates' clause to declare the most appropriate C++ class.
    - Removed @instanceTypeName.
    - @highestInstanceType became @highestInstanceTypeWithinParentClassRange
      to indicate a semantic change: it no longer denotes the highest
      instance type globally, but only within the range of values for its
      immediate parent class. This lets us use it for Oddball, which is
      expected to be the highest primitive type.
    - Added new abstract classes JSCustomElementsObject and JSSpecialObject
      to help with some range checks.
    - Added @lowestInstanceTypeWithinParentClassRange so we can move the new
      classes JSCustomElementsObject and JSSpecialObject to the beginning of
      the JSObject range. This seems like the least-brittle way to establish
      ranges that also include JSProxy (and these ranges are verified with
      static assertions in instance-type.h).
    - Renamed @instanceTypeValue to @apiExposedInstanceTypeValue.
    - Renamed @instanceTypeFlags to @reserveBitsInInstanceType.
    
    This change introduces the new annotations and adds the ability for
    Torque to assign instance types that satisfy those annotations. Torque
    now emits two new macros:
    - TORQUE_ASSIGNED_INSTANCE_TYPES, which is used to define the
      InstanceType enumeration
    - TORQUE_ASSIGNED_INSTANCE_TYPE_LIST, which replaces the non-String
      parts of INSTANCE_TYPE_LIST
    
    The design document mentions a couple of other macro lists that could
    easily be replaced, but I'd like to defer those to a subsequent checkin
    because this one is already pretty large.
    
    Bug: v8:7793
    Change-Id: Ie71d93a9d5b610e62be0ffa3bb36180c3357a6e8
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1757094
    Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
    Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
    Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
    Reviewed-by: 's avatarSathya Gunasekaran  <gsathya@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#64258}
    8c7ae314
name-inl.h 3.66 KB