2018-11-30 22:52:05 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
2018-11-30 18:39:55 +03:00
|
|
|
* vim: set ts=8 sts=2 et sw=2 tw=80:
|
2013-08-28 06:59:14 +04:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
// This file contains public type declarations that are used *frequently*. If
|
|
|
|
// it doesn't occur at least 10 times in Gecko, it probably shouldn't be in
|
|
|
|
// here.
|
|
|
|
//
|
|
|
|
// It includes only:
|
|
|
|
// - forward declarations of structs and classes;
|
|
|
|
// - typedefs;
|
|
|
|
// - enums (maybe).
|
|
|
|
// It does *not* contain any struct or class definitions.
|
|
|
|
|
|
|
|
#ifndef js_TypeDecls_h
|
|
|
|
#define js_TypeDecls_h
|
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2013-12-07 03:03:08 +04:00
|
|
|
#include "js-config.h"
|
2019-10-28 01:34:11 +03:00
|
|
|
#include "jstypes.h"
|
2013-12-07 03:03:08 +04:00
|
|
|
|
2018-02-21 19:30:19 +03:00
|
|
|
typedef uint8_t jsbytecode;
|
|
|
|
|
2019-10-28 01:34:11 +03:00
|
|
|
class JS_PUBLIC_API JSAtom;
|
|
|
|
struct JS_PUBLIC_API JSContext;
|
|
|
|
struct JS_PUBLIC_API JSClass;
|
|
|
|
class JS_PUBLIC_API JSFunction;
|
|
|
|
class JS_PUBLIC_API JSFreeOp;
|
|
|
|
class JS_PUBLIC_API JSObject;
|
|
|
|
struct JS_PUBLIC_API JSRuntime;
|
|
|
|
class JS_PUBLIC_API JSScript;
|
|
|
|
class JS_PUBLIC_API JSString;
|
2013-08-28 06:59:14 +04:00
|
|
|
|
2019-03-25 09:39:12 +03:00
|
|
|
namespace js {
|
2019-10-28 01:34:11 +03:00
|
|
|
class JS_PUBLIC_API TempAllocPolicy;
|
2019-03-26 17:00:51 +03:00
|
|
|
}; // namespace js
|
2019-03-25 09:39:12 +03:00
|
|
|
|
2013-08-28 06:59:14 +04:00
|
|
|
namespace JS {
|
|
|
|
|
2019-10-28 01:34:11 +03:00
|
|
|
struct JS_PUBLIC_API PropertyKey;
|
2018-11-20 15:01:42 +03:00
|
|
|
|
2014-05-31 12:44:32 +04:00
|
|
|
typedef unsigned char Latin1Char;
|
|
|
|
|
2019-10-28 01:34:11 +03:00
|
|
|
class JS_PUBLIC_API Symbol;
|
|
|
|
class JS_PUBLIC_API BigInt;
|
|
|
|
class JS_PUBLIC_API Value;
|
2018-06-07 17:44:40 +03:00
|
|
|
|
2019-10-28 01:34:11 +03:00
|
|
|
class JS_PUBLIC_API Compartment;
|
|
|
|
class JS_PUBLIC_API Realm;
|
|
|
|
struct JS_PUBLIC_API Runtime;
|
|
|
|
class JS_PUBLIC_API Zone;
|
2017-12-18 23:45:06 +03:00
|
|
|
|
2013-08-28 06:59:14 +04:00
|
|
|
template <typename T>
|
|
|
|
class Handle;
|
|
|
|
template <typename T>
|
|
|
|
class MutableHandle;
|
2013-11-05 01:35:08 +04:00
|
|
|
template <typename T>
|
|
|
|
class Rooted;
|
|
|
|
template <typename T>
|
|
|
|
class PersistentRooted;
|
2019-03-25 09:39:12 +03:00
|
|
|
template <typename T>
|
|
|
|
class RootedVector;
|
2019-05-10 20:36:34 +03:00
|
|
|
template <typename T>
|
|
|
|
class PersistentRootedVector;
|
2019-03-25 09:39:12 +03:00
|
|
|
template <typename T, typename AllocPolicy = js::TempAllocPolicy>
|
|
|
|
class StackGCVector;
|
2013-08-28 06:59:14 +04:00
|
|
|
|
|
|
|
typedef Handle<JSFunction*> HandleFunction;
|
2018-11-20 15:01:42 +03:00
|
|
|
typedef Handle<PropertyKey> HandleId;
|
2013-08-28 06:59:14 +04:00
|
|
|
typedef Handle<JSObject*> HandleObject;
|
|
|
|
typedef Handle<JSScript*> HandleScript;
|
|
|
|
typedef Handle<JSString*> HandleString;
|
2014-06-23 19:55:51 +04:00
|
|
|
typedef Handle<JS::Symbol*> HandleSymbol;
|
Bug 1366287 - Part 1.0: Define a new BigInt primitive type, with a GDB prettyprinter, Rust binding support, and a new out-of-line TraceKind. (Disabled by default, implemented only incompletely, currently passing --enable-bigint will disable JITs, will be flipped on Eventually once every sub-aspect is in place, Don't Have A Cow, Man.) r=jwalden, r=Ms2ger, r=sfink
--HG--
extra : rebase_source : aa13bd94bc6157ff8134894e3ba2e7a2b53e28d9
2018-05-24 21:26:09 +03:00
|
|
|
typedef Handle<JS::BigInt*> HandleBigInt;
|
2018-11-20 15:01:42 +03:00
|
|
|
typedef Handle<Value> HandleValue;
|
2019-03-25 09:39:12 +03:00
|
|
|
typedef Handle<StackGCVector<Value>> HandleValueVector;
|
2019-03-26 17:00:51 +03:00
|
|
|
typedef Handle<StackGCVector<JSObject*>> HandleObjectVector;
|
2019-03-13 15:33:15 +03:00
|
|
|
typedef Handle<StackGCVector<JS::PropertyKey>> HandleIdVector;
|
2013-08-28 06:59:14 +04:00
|
|
|
|
|
|
|
typedef MutableHandle<JSFunction*> MutableHandleFunction;
|
2018-11-20 15:01:42 +03:00
|
|
|
typedef MutableHandle<PropertyKey> MutableHandleId;
|
2013-08-28 06:59:14 +04:00
|
|
|
typedef MutableHandle<JSObject*> MutableHandleObject;
|
|
|
|
typedef MutableHandle<JSScript*> MutableHandleScript;
|
|
|
|
typedef MutableHandle<JSString*> MutableHandleString;
|
2014-06-23 19:55:51 +04:00
|
|
|
typedef MutableHandle<JS::Symbol*> MutableHandleSymbol;
|
Bug 1366287 - Part 1.0: Define a new BigInt primitive type, with a GDB prettyprinter, Rust binding support, and a new out-of-line TraceKind. (Disabled by default, implemented only incompletely, currently passing --enable-bigint will disable JITs, will be flipped on Eventually once every sub-aspect is in place, Don't Have A Cow, Man.) r=jwalden, r=Ms2ger, r=sfink
--HG--
extra : rebase_source : aa13bd94bc6157ff8134894e3ba2e7a2b53e28d9
2018-05-24 21:26:09 +03:00
|
|
|
typedef MutableHandle<JS::BigInt*> MutableHandleBigInt;
|
2013-08-28 06:59:14 +04:00
|
|
|
typedef MutableHandle<Value> MutableHandleValue;
|
2019-03-25 09:39:12 +03:00
|
|
|
typedef MutableHandle<StackGCVector<Value>> MutableHandleValueVector;
|
2019-03-26 17:00:51 +03:00
|
|
|
typedef MutableHandle<StackGCVector<JSObject*>> MutableHandleObjectVector;
|
2019-03-13 15:33:15 +03:00
|
|
|
typedef MutableHandle<StackGCVector<JS::PropertyKey>> MutableHandleIdVector;
|
2013-08-28 06:59:14 +04:00
|
|
|
|
2013-11-05 01:35:08 +04:00
|
|
|
typedef Rooted<JSObject*> RootedObject;
|
|
|
|
typedef Rooted<JSFunction*> RootedFunction;
|
|
|
|
typedef Rooted<JSScript*> RootedScript;
|
|
|
|
typedef Rooted<JSString*> RootedString;
|
2014-06-23 19:55:51 +04:00
|
|
|
typedef Rooted<JS::Symbol*> RootedSymbol;
|
Bug 1366287 - Part 1.0: Define a new BigInt primitive type, with a GDB prettyprinter, Rust binding support, and a new out-of-line TraceKind. (Disabled by default, implemented only incompletely, currently passing --enable-bigint will disable JITs, will be flipped on Eventually once every sub-aspect is in place, Don't Have A Cow, Man.) r=jwalden, r=Ms2ger, r=sfink
--HG--
extra : rebase_source : aa13bd94bc6157ff8134894e3ba2e7a2b53e28d9
2018-05-24 21:26:09 +03:00
|
|
|
typedef Rooted<JS::BigInt*> RootedBigInt;
|
2018-11-20 15:01:42 +03:00
|
|
|
typedef Rooted<PropertyKey> RootedId;
|
2013-11-05 01:35:08 +04:00
|
|
|
typedef Rooted<JS::Value> RootedValue;
|
|
|
|
|
2019-03-25 09:39:12 +03:00
|
|
|
typedef RootedVector<JS::Value> RootedValueVector;
|
2019-03-26 17:00:51 +03:00
|
|
|
typedef RootedVector<JSObject*> RootedObjectVector;
|
2019-03-13 15:33:15 +03:00
|
|
|
typedef RootedVector<JS::PropertyKey> RootedIdVector;
|
2019-03-25 09:39:12 +03:00
|
|
|
|
2013-11-05 01:35:08 +04:00
|
|
|
typedef PersistentRooted<JSFunction*> PersistentRootedFunction;
|
2018-11-20 15:01:42 +03:00
|
|
|
typedef PersistentRooted<PropertyKey> PersistentRootedId;
|
2013-11-05 01:35:08 +04:00
|
|
|
typedef PersistentRooted<JSObject*> PersistentRootedObject;
|
|
|
|
typedef PersistentRooted<JSScript*> PersistentRootedScript;
|
|
|
|
typedef PersistentRooted<JSString*> PersistentRootedString;
|
2014-06-23 19:55:51 +04:00
|
|
|
typedef PersistentRooted<JS::Symbol*> PersistentRootedSymbol;
|
Bug 1366287 - Part 1.0: Define a new BigInt primitive type, with a GDB prettyprinter, Rust binding support, and a new out-of-line TraceKind. (Disabled by default, implemented only incompletely, currently passing --enable-bigint will disable JITs, will be flipped on Eventually once every sub-aspect is in place, Don't Have A Cow, Man.) r=jwalden, r=Ms2ger, r=sfink
--HG--
extra : rebase_source : aa13bd94bc6157ff8134894e3ba2e7a2b53e28d9
2018-05-24 21:26:09 +03:00
|
|
|
typedef PersistentRooted<JS::BigInt*> PersistentRootedBigInt;
|
2013-11-05 01:35:08 +04:00
|
|
|
typedef PersistentRooted<Value> PersistentRootedValue;
|
|
|
|
|
2019-05-10 20:36:34 +03:00
|
|
|
typedef PersistentRootedVector<PropertyKey> PersistentRootedIdVector;
|
|
|
|
typedef PersistentRootedVector<JSObject*> PersistentRootedObjectVector;
|
|
|
|
|
2019-03-26 16:58:20 +03:00
|
|
|
template <typename T>
|
|
|
|
using HandleVector = Handle<StackGCVector<T>>;
|
|
|
|
template <typename T>
|
|
|
|
using MutableHandleVector = MutableHandle<StackGCVector<T>>;
|
2013-08-28 06:59:14 +04:00
|
|
|
} // namespace JS
|
|
|
|
|
2018-11-20 15:01:42 +03:00
|
|
|
using jsid = JS::PropertyKey;
|
|
|
|
|
2013-08-28 06:59:14 +04:00
|
|
|
#endif /* js_TypeDecls_h */
|