prototype-info.tq 1.16 KB
Newer Older
Tobias Tebbi's avatar
Tobias Tebbi committed
1 2 3 4
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5 6 7 8
bitfield struct PrototypeInfoFlags extends uint31 {
  should_be_fast: bool: 1 bit;
}

Tobias Tebbi's avatar
Tobias Tebbi committed
9
extern class PrototypeInfo extends Struct {
10 11 12 13 14 15 16 17
  // [module_namespace]: A backpointer to JSModuleNamespace from its
  // PrototypeInfo (or undefined). This field is only used for JSModuleNamespace
  // maps.  TODO(jkummerow): Figure out if there's a way to store the namespace
  // pointer elsewhere to save memory.
  module_namespace: JSModuleNamespace|Undefined;

  // [prototype_users]: WeakArrayList containing weak references to maps using
  // this prototype, or Smi(0) if uninitialized.
Tobias Tebbi's avatar
Tobias Tebbi committed
18
  prototype_users: WeakArrayList|Zero;
19 20 21 22 23

  prototype_chain_enum_cache: FixedArray|Zero|Undefined;

  // [registry_slot]: Slot in prototype's user registry where this user
  // is stored. Returns UNREGISTERED if this prototype has not been registered.
Tobias Tebbi's avatar
Tobias Tebbi committed
24
  registry_slot: Smi;
25

26 27
  bit_field: SmiTagged<PrototypeInfoFlags>;

28
  // [object_create_map]: A field caching the map for Object.create(prototype).
Tobias Tebbi's avatar
Tobias Tebbi committed
29 30
  object_create_map: Weak<Map>|Undefined;
}