current commit
261004.7 · deps: update V8 to 15.2.124.38
// 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.

@cppScope('PrototypeInfo')
bitfield struct PrototypeInfoFlags extends uint31 {
  should_be_fast: bool: 1 bit;
}

const kPrototypeInfoCachedHandlerCount: constexpr int31
    generates 'PrototypeInfo::kCachedHandlerCount';

@cppObjectLayoutDefinition
extern class PrototypeInfo extends Struct {
  // [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.
  prototype_users: WeakArrayList|Zero;

  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.
  registry_slot: Smi;

  bit_field: SmiTagged<PrototypeInfoFlags>;

  // [derived_maps]: A field caching derived maps. The first entry is the map
  // for Object.create. The following contain entries used by GetDerivedMap
  // which feeds Reflect.construct, proxies and similar.
  derived_maps: WeakArrayList|Undefined;

  // Use by SetPrototypeProperties Bytecode to store infos for lazy allocation
  // of closures.
  prototype_shared_closure_info: PrototypeSharedClosureInfo|Undefined;

  // Cached handler for loads of non-existent properties through this
  // prototype object.
  cached_handler[kPrototypeInfoCachedHandlerCount]: LoadHandler|Zero;
}