From ae1367626fac64b7b6682b4ec68ba3a8d7153b51 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 25 Jul 2013 23:40:57 -0700 Subject: [PATCH] Bug 898263 (part 8) - Move the Handle* and Rooted* types out of jsprvtd.h. r=jorendorff. --HG-- extra : rebase_source : 599e2408848fc7973e83e6661f24292e1191e3b8 --- js/src/frontend/ParseMaps.h | 2 ++ js/src/gc/Barrier.h | 2 ++ js/src/gc/Rooting.h | 38 +++++++++++++++++++++++++++++++++++++ js/src/jsatom.h | 1 + js/src/jsprvtd.h | 21 -------------------- 5 files changed, 43 insertions(+), 21 deletions(-) create mode 100644 js/src/gc/Rooting.h diff --git a/js/src/frontend/ParseMaps.h b/js/src/frontend/ParseMaps.h index e0b1409e57a..c8aadcb2f95 100644 --- a/js/src/frontend/ParseMaps.h +++ b/js/src/frontend/ParseMaps.h @@ -17,6 +17,8 @@ #include "js/HashTable.h" #include "js/Vector.h" +class JSAtom; + namespace js { class LifoAlloc; diff --git a/js/src/gc/Barrier.h b/js/src/gc/Barrier.h index 62e9df6ed65..98a64d2a411 100644 --- a/js/src/gc/Barrier.h +++ b/js/src/gc/Barrier.h @@ -116,6 +116,8 @@ namespace js { +class PropertyName; + template class EncapsulatedPtr { diff --git a/js/src/gc/Rooting.h b/js/src/gc/Rooting.h new file mode 100644 index 00000000000..6c45e82b9a4 --- /dev/null +++ b/js/src/gc/Rooting.h @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ + +#ifndef gc_Rooting_h +#define gc_Rooting_h + +#include "js/RootingAPI.h" + +class JSAtom; + +namespace js { + +class PropertyName; +class Shape; + +namespace types { struct TypeObject; } + +// These are internal counterparts to the public types such as HandleObject. + +typedef JS::Handle HandleShape; +typedef JS::Handle HandleTypeObject; +typedef JS::Handle HandleAtom; +typedef JS::Handle HandlePropertyName; + +typedef JS::MutableHandle MutableHandleShape; +typedef JS::MutableHandle MutableHandleAtom; + +typedef JS::Rooted RootedShape; +typedef JS::Rooted RootedTypeObject; +typedef JS::Rooted RootedAtom; +typedef JS::Rooted RootedPropertyName; + +} /* namespace js */ + +#endif /* gc_Rooting_h */ diff --git a/js/src/jsatom.h b/js/src/jsatom.h index 3793448ef3e..d152c9ba2da 100644 --- a/js/src/jsatom.h +++ b/js/src/jsatom.h @@ -17,6 +17,7 @@ #include "jspubtd.h" #include "gc/Barrier.h" +#include "gc/Rooting.h" #include "js/HashTable.h" #include "vm/CommonPropertyNames.h" diff --git a/js/src/jsprvtd.h b/js/src/jsprvtd.h index 383ecd171f7..d590de8434c 100644 --- a/js/src/jsprvtd.h +++ b/js/src/jsprvtd.h @@ -15,14 +15,8 @@ typedef uintptr_t jsatomid; -/* String typedefs. */ -class JSAtom; - namespace js { -class PropertyName; -class Shape; - typedef JSNative Native; typedef JSParallelNative ParallelNative; typedef JSThreadSafeNative ThreadSafeNative; @@ -30,21 +24,6 @@ typedef JSPropertyOp PropertyOp; typedef JSStrictPropertyOp StrictPropertyOp; typedef JSPropertyDescriptor PropertyDescriptor; -namespace types { struct TypeObject; } - -typedef JS::Handle HandleShape; -typedef JS::Handle HandleTypeObject; -typedef JS::Handle HandleAtom; -typedef JS::Handle HandlePropertyName; - -typedef JS::MutableHandle MutableHandleShape; -typedef JS::MutableHandle MutableHandleAtom; - -typedef JS::Rooted RootedShape; -typedef JS::Rooted RootedTypeObject; -typedef JS::Rooted RootedAtom; -typedef JS::Rooted RootedPropertyName; - enum XDRMode { XDR_ENCODE, XDR_DECODE