mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 14:52:16 +00:00
Bug 1642154 : Add JSLinearString to MapTypeToTraceKind. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D78063
This commit is contained in:
parent
9a5ae1ba85
commit
d9df44ffe5
@ -28,10 +28,11 @@ class JS_PUBLIC_API Value;
|
||||
|
||||
// Expand the given macro D for each public GC pointer.
|
||||
#define JS_FOR_EACH_PUBLIC_GC_POINTER_TYPE(D) \
|
||||
D(JS::Symbol*) \
|
||||
D(JS::BigInt*) \
|
||||
D(JS::Symbol*) \
|
||||
D(JSAtom*) \
|
||||
D(JSFunction*) \
|
||||
D(JSLinearString*) \
|
||||
D(JSObject*) \
|
||||
D(JSScript*) \
|
||||
D(JSString*)
|
||||
|
@ -12,6 +12,8 @@
|
||||
#include "js/TypeDecls.h"
|
||||
|
||||
// Forward declarations of all the types a TraceKind can denote.
|
||||
class JSLinearString;
|
||||
|
||||
namespace js {
|
||||
class BaseScript;
|
||||
class BaseShape;
|
||||
@ -144,6 +146,19 @@ inline constexpr bool IsBaseTraceType_v = IsBaseTraceType<T>::value;
|
||||
JS_FOR_EACH_TRACEKIND(JS_EXPAND_DEF);
|
||||
#undef JS_EXPAND_DEF
|
||||
|
||||
template <>
|
||||
struct MapTypeToTraceKind<JSLinearString> {
|
||||
static const JS::TraceKind kind = JS::TraceKind::String;
|
||||
};
|
||||
template <>
|
||||
struct MapTypeToTraceKind<JSFunction> {
|
||||
static const JS::TraceKind kind = JS::TraceKind::Object;
|
||||
};
|
||||
template <>
|
||||
struct MapTypeToTraceKind<JSScript> {
|
||||
static const JS::TraceKind kind = JS::TraceKind::Script;
|
||||
};
|
||||
|
||||
// RootKind is closely related to TraceKind. Whereas TraceKind's indices are
|
||||
// laid out for convenient embedding as a pointer tag, the indicies of RootKind
|
||||
// are designed for use as array keys via EnumeratedArray.
|
||||
@ -203,11 +218,6 @@ template <>
|
||||
struct MapTypeToRootKind<jsid> {
|
||||
static const JS::RootKind kind = JS::RootKind::Id;
|
||||
};
|
||||
template <>
|
||||
struct MapTypeToRootKind<JSFunction*> : public MapTypeToRootKind<JSObject*> {};
|
||||
template <>
|
||||
struct MapTypeToRootKind<JSScript*>
|
||||
: public MapTypeToRootKind<js::BaseScript*> {};
|
||||
|
||||
// Fortunately, few places in the system need to deal with fully abstract
|
||||
// cells. In those places that do, we generally want to move to a layout
|
||||
|
Loading…
Reference in New Issue
Block a user