Bug 1608183 - Move js::ScopeCreationData to js::frontend namespace r=mgaudet

Differential Revision: https://phabricator.services.mozilla.com/D59827

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Rob Rico 2020-01-14 17:42:36 +00:00
parent 7110e845e3
commit 6a91705585
4 changed files with 15 additions and 11 deletions

View File

@ -21,11 +21,11 @@ class Scope;
class GlobalScope; class GlobalScope;
class EvalScope; class EvalScope;
class GCMarker; class GCMarker;
class ScopeCreationData;
namespace frontend { namespace frontend {
struct ParseInfo; struct ParseInfo;
class FunctionBox; class FunctionBox;
class ScopeCreationData;
} // namespace frontend } // namespace frontend
using ScopeIndex = frontend::TypedIndex<Scope>; using ScopeIndex = frontend::TypedIndex<Scope>;
@ -89,7 +89,7 @@ class AbstractScope {
bool isScopeCreationData() const { return scope_.is<Deferred>(); } bool isScopeCreationData() const { return scope_.is<Deferred>(); }
// Note: this handle is rooted in the ParseInfo. // Note: this handle is rooted in the ParseInfo.
MutableHandle<ScopeCreationData> scopeCreationData() const; MutableHandle<frontend::ScopeCreationData> scopeCreationData() const;
Scope* scope() const { return scope_.as<HeapPtrScope>(); } Scope* scope() const { return scope_.as<HeapPtrScope>(); }

View File

@ -184,8 +184,6 @@ class BigIntCreationData {
using BigIntIndex = TypedIndex<BigIntCreationData>; using BigIntIndex = TypedIndex<BigIntCreationData>;
} /* namespace frontend */
class ScopeCreationData { class ScopeCreationData {
friend class AbstractScope; friend class AbstractScope;
friend class GCMarker; friend class GCMarker;
@ -321,12 +319,13 @@ class ScopeCreationData {
} }
}; };
} /* namespace frontend */
} /* namespace js */ } /* namespace js */
namespace JS { namespace JS {
template <> template <>
struct GCPolicy<js::ScopeCreationData*> { struct GCPolicy<js::frontend::ScopeCreationData*> {
static void trace(JSTracer* trc, js::ScopeCreationData** data, static void trace(JSTracer* trc, js::frontend::ScopeCreationData** data,
const char* name) { const char* name) {
(*data)->trace(trc); (*data)->trace(trc);
} }

View File

@ -26,6 +26,7 @@
#include "vm/Shape-inl.h" #include "vm/Shape-inl.h"
using namespace js; using namespace js;
using namespace js::frontend;
using mozilla::Maybe; using mozilla::Maybe;

View File

@ -25,6 +25,10 @@
namespace js { namespace js {
namespace frontend {
class ScopeCreationData;
};
class BaseScopeData; class BaseScopeData;
class ModuleObject; class ModuleObject;
class AbstractScope; class AbstractScope;
@ -239,7 +243,7 @@ class WrappedPtrOperations<Scope*, Wrapper> {
// //
class Scope : public js::gc::TenuredCell { class Scope : public js::gc::TenuredCell {
friend class GCMarker; friend class GCMarker;
friend class ScopeCreationData; friend class frontend::ScopeCreationData;
// The enclosing scope or nullptr. // The enclosing scope or nullptr.
const GCPtrScope enclosing_; const GCPtrScope enclosing_;
@ -393,7 +397,7 @@ class LexicalScope : public Scope {
friend class Scope; friend class Scope;
friend class BindingIter; friend class BindingIter;
friend class GCMarker; friend class GCMarker;
friend class ScopeCreationData; friend class frontend::ScopeCreationData;
public: public:
// Data is public because it is created by the frontend. See // Data is public because it is created by the frontend. See
@ -621,7 +625,7 @@ class VarScope : public Scope {
friend class GCMarker; friend class GCMarker;
friend class BindingIter; friend class BindingIter;
friend class Scope; friend class Scope;
friend class ScopeCreationData; friend class frontend::ScopeCreationData;
public: public:
// Data is public because it is created by the // Data is public because it is created by the
@ -796,7 +800,7 @@ class EvalScope : public Scope {
friend class Scope; friend class Scope;
friend class BindingIter; friend class BindingIter;
friend class GCMarker; friend class GCMarker;
friend class ScopeCreationData; friend class frontend::ScopeCreationData;
public: public:
// Data is public because it is created by the frontend. See // Data is public because it is created by the frontend. See
@ -883,7 +887,7 @@ class ModuleScope : public Scope {
friend class BindingIter; friend class BindingIter;
friend class Scope; friend class Scope;
friend class AbstractScope; friend class AbstractScope;
friend class ScopeCreationData; friend class frontend::ScopeCreationData;
static const ScopeKind classScopeKind_ = ScopeKind::Module; static const ScopeKind classScopeKind_ = ScopeKind::Module;
public: public: