[SM91] Update to Spidermonkey 91.1.3 APIs
[0ad.git] / libraries / source / spidermonkey / include-win32-release / js / friend / XrayJitInfo.h
blobddeec6a44fe9397c923cd2dc1fb12f42519c2878
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: set ts=8 sts=2 et sw=2 tw=80:
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 /*
8 * JIT info so SpiderMonkey can efficiently work with Gecko XrayWrapper
9 * instances.
11 * This header is completely irrelevant to non-Gecko embedders.
14 #ifndef js_friend_XrayJitInfo_h
15 #define js_friend_XrayJitInfo_h
17 #include <stddef.h> // size_t
19 #include "jstypes.h" // JS_PUBLIC_API
21 class JS_PUBLIC_API JSObject;
23 namespace js {
25 class JS_PUBLIC_API BaseProxyHandler;
27 } // namespace js
29 namespace JS {
31 // Callbacks and other information for use by the JITs when optimizing accesses
32 // on xray wrappers.
33 struct XrayJitInfo {
34 // Test whether a proxy handler is a cross compartment xray with no
35 // security checks.
36 bool (*isCrossCompartmentXray)(const js::BaseProxyHandler* handler);
38 // Test whether xrays in |obj|'s compartment have expandos of their own,
39 // instead of sharing them with Xrays from other compartments.
40 bool (*compartmentHasExclusiveExpandos)(JSObject* obj);
42 // Proxy reserved slot used by xrays in sandboxes to store their holder
43 // object.
44 size_t xrayHolderSlot;
46 // Reserved slot used by xray holders to store the xray's expando object.
47 size_t holderExpandoSlot;
49 // Reserved slot used by xray expandos to store a custom prototype.
50 size_t expandoProtoSlot;
53 extern JS_PUBLIC_API void SetXrayJitInfo(XrayJitInfo* info);
55 } // namespace JS
57 #endif // js_friend_XrayJitInfo_h