1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/bindings/JSSlots.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,35 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.7 + * You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +/** 1.10 + * This file defines various reserved slot indices used by JavaScript 1.11 + * reflections of DOM objects. 1.12 + */ 1.13 +#ifndef mozilla_dom_DOMSlots_h 1.14 +#define mozilla_dom_DOMSlots_h 1.15 + 1.16 +// We use slot 0 for holding the raw object. This is safe for both 1.17 +// globals and non-globals. 1.18 +#define DOM_OBJECT_SLOT 0 1.19 + 1.20 +// The total number of slots non-proxy DOM objects use by default. 1.21 +// Specific objects may have more for storing cached values. 1.22 +#define DOM_INSTANCE_RESERVED_SLOTS 1 1.23 + 1.24 +// NOTE: This is baked into the Ion JIT as 0 in codegen for LGetDOMProperty and 1.25 +// LSetDOMProperty. Those constants need to be changed accordingly if this value 1.26 +// changes. 1.27 +#define DOM_PROTO_INSTANCE_CLASS_SLOT 0 1.28 + 1.29 +// Interface objects store a number of reserved slots equal to 1.30 +// DOM_INTERFACE_SLOTS_BASE + number of named constructors. 1.31 +#define DOM_INTERFACE_SLOTS_BASE 0 1.32 + 1.33 +// Interface prototype objects store a number of reserved slots equal to 1.34 +// DOM_INTERFACE_PROTO_SLOTS_BASE or DOM_INTERFACE_PROTO_SLOTS_BASE + 1 if a 1.35 +// slot for the unforgeable holder is needed. 1.36 +#define DOM_INTERFACE_PROTO_SLOTS_BASE (DOM_PROTO_INSTANCE_CLASS_SLOT + 1) 1.37 + 1.38 +#endif /* mozilla_dom_DOMSlots_h */