From c7e51fec5c42fc4c53ea812fd95bafff3498a86f Mon Sep 17 00:00:00 2001 From: Rob Rico Date: Thu, 16 Jan 2020 23:34:09 +0000 Subject: [PATCH] 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 --- js/src/frontend/AbstractScope.h | 4 ++-- js/src/frontend/Stencil.h | 11 +++++------ js/src/vm/Scope.cpp | 1 + js/src/vm/Scope.h | 14 +++++++++----- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/js/src/frontend/AbstractScope.h b/js/src/frontend/AbstractScope.h index 1ccffe3d5775..fd02ceabab34 100644 --- a/js/src/frontend/AbstractScope.h +++ b/js/src/frontend/AbstractScope.h @@ -21,11 +21,11 @@ class Scope; class GlobalScope; class EvalScope; class GCMarker; -class ScopeCreationData; namespace frontend { struct ParseInfo; class FunctionBox; +class ScopeCreationData; } // namespace frontend using ScopeIndex = frontend::TypedIndex; @@ -89,7 +89,7 @@ class AbstractScope { bool isScopeCreationData() const { return scope_.is(); } // Note: this handle is rooted in the ParseInfo. - MutableHandle scopeCreationData() const; + MutableHandle scopeCreationData() const; Scope* scope() const { return scope_.as(); } diff --git a/js/src/frontend/Stencil.h b/js/src/frontend/Stencil.h index 415dd3e6c356..560faecd81ab 100644 --- a/js/src/frontend/Stencil.h +++ b/js/src/frontend/Stencil.h @@ -200,11 +200,9 @@ class BigIntCreationData { using BigIntIndex = TypedIndex; -} /* namespace frontend */ - class ScopeCreationData { - friend class AbstractScope; - friend class GCMarker; + friend class js::AbstractScope; + friend class js::GCMarker; // The enclosing scope if it exists AbstractScope enclosing_; @@ -337,12 +335,13 @@ class ScopeCreationData { } }; +} /* namespace frontend */ } /* namespace js */ namespace JS { template <> -struct GCPolicy { - static void trace(JSTracer* trc, js::ScopeCreationData** data, +struct GCPolicy { + static void trace(JSTracer* trc, js::frontend::ScopeCreationData** data, const char* name) { (*data)->trace(trc); } diff --git a/js/src/vm/Scope.cpp b/js/src/vm/Scope.cpp index f1207b424aba..afd0a48ed596 100644 --- a/js/src/vm/Scope.cpp +++ b/js/src/vm/Scope.cpp @@ -26,6 +26,7 @@ #include "vm/Shape-inl.h" using namespace js; +using namespace js::frontend; using mozilla::Maybe; diff --git a/js/src/vm/Scope.h b/js/src/vm/Scope.h index 84dfc359caa9..9cdf4aa4bbe7 100644 --- a/js/src/vm/Scope.h +++ b/js/src/vm/Scope.h @@ -25,6 +25,10 @@ namespace js { +namespace frontend { +class ScopeCreationData; +}; + class BaseScopeData; class ModuleObject; class AbstractScope; @@ -239,7 +243,7 @@ class WrappedPtrOperations { // class Scope : public js::gc::TenuredCell { friend class GCMarker; - friend class ScopeCreationData; + friend class frontend::ScopeCreationData; // The enclosing scope or nullptr. const GCPtrScope enclosing_; @@ -393,7 +397,7 @@ class LexicalScope : public Scope { friend class Scope; friend class BindingIter; friend class GCMarker; - friend class ScopeCreationData; + friend class frontend::ScopeCreationData; public: // Data is public because it is created by the frontend. See @@ -621,7 +625,7 @@ class VarScope : public Scope { friend class GCMarker; friend class BindingIter; friend class Scope; - friend class ScopeCreationData; + friend class frontend::ScopeCreationData; public: // Data is public because it is created by the @@ -796,7 +800,7 @@ class EvalScope : public Scope { friend class Scope; friend class BindingIter; friend class GCMarker; - friend class ScopeCreationData; + friend class frontend::ScopeCreationData; public: // Data is public because it is created by the frontend. See @@ -883,7 +887,7 @@ class ModuleScope : public Scope { friend class BindingIter; friend class Scope; friend class AbstractScope; - friend class ScopeCreationData; + friend class frontend::ScopeCreationData; static const ScopeKind classScopeKind_ = ScopeKind::Module; public: