michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /** michael@0: * This file defines various reserved slot indices used by JavaScript michael@0: * reflections of DOM objects. michael@0: */ michael@0: #ifndef mozilla_dom_DOMSlots_h michael@0: #define mozilla_dom_DOMSlots_h michael@0: michael@0: // We use slot 0 for holding the raw object. This is safe for both michael@0: // globals and non-globals. michael@0: #define DOM_OBJECT_SLOT 0 michael@0: michael@0: // The total number of slots non-proxy DOM objects use by default. michael@0: // Specific objects may have more for storing cached values. michael@0: #define DOM_INSTANCE_RESERVED_SLOTS 1 michael@0: michael@0: // NOTE: This is baked into the Ion JIT as 0 in codegen for LGetDOMProperty and michael@0: // LSetDOMProperty. Those constants need to be changed accordingly if this value michael@0: // changes. michael@0: #define DOM_PROTO_INSTANCE_CLASS_SLOT 0 michael@0: michael@0: // Interface objects store a number of reserved slots equal to michael@0: // DOM_INTERFACE_SLOTS_BASE + number of named constructors. michael@0: #define DOM_INTERFACE_SLOTS_BASE 0 michael@0: michael@0: // Interface prototype objects store a number of reserved slots equal to michael@0: // DOM_INTERFACE_PROTO_SLOTS_BASE or DOM_INTERFACE_PROTO_SLOTS_BASE + 1 if a michael@0: // slot for the unforgeable holder is needed. michael@0: #define DOM_INTERFACE_PROTO_SLOTS_BASE (DOM_PROTO_INSTANCE_CLASS_SLOT + 1) michael@0: michael@0: #endif /* mozilla_dom_DOMSlots_h */