Bug 898263 (part 8) - Move the Handle* and Rooted* types out of jsprvtd.h. r=jorendorff.

--HG--
extra : rebase_source : 599e2408848fc7973e83e6661f24292e1191e3b8
This commit is contained in:
Nicholas Nethercote 2013-07-25 23:40:57 -07:00
parent 24779f3511
commit ae1367626f
5 changed files with 43 additions and 21 deletions

View File

@ -17,6 +17,8 @@
#include "js/HashTable.h"
#include "js/Vector.h"
class JSAtom;
namespace js {
class LifoAlloc;

View File

@ -116,6 +116,8 @@
namespace js {
class PropertyName;
template<class T, typename Unioned = uintptr_t>
class EncapsulatedPtr
{

38
js/src/gc/Rooting.h Normal file
View File

@ -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<Shape*> HandleShape;
typedef JS::Handle<types::TypeObject*> HandleTypeObject;
typedef JS::Handle<JSAtom*> HandleAtom;
typedef JS::Handle<PropertyName*> HandlePropertyName;
typedef JS::MutableHandle<Shape*> MutableHandleShape;
typedef JS::MutableHandle<JSAtom*> MutableHandleAtom;
typedef JS::Rooted<Shape*> RootedShape;
typedef JS::Rooted<types::TypeObject*> RootedTypeObject;
typedef JS::Rooted<JSAtom*> RootedAtom;
typedef JS::Rooted<PropertyName*> RootedPropertyName;
} /* namespace js */
#endif /* gc_Rooting_h */

View File

@ -17,6 +17,7 @@
#include "jspubtd.h"
#include "gc/Barrier.h"
#include "gc/Rooting.h"
#include "js/HashTable.h"
#include "vm/CommonPropertyNames.h"

View File

@ -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<Shape*> HandleShape;
typedef JS::Handle<types::TypeObject*> HandleTypeObject;
typedef JS::Handle<JSAtom*> HandleAtom;
typedef JS::Handle<PropertyName*> HandlePropertyName;
typedef JS::MutableHandle<Shape*> MutableHandleShape;
typedef JS::MutableHandle<JSAtom*> MutableHandleAtom;
typedef JS::Rooted<Shape*> RootedShape;
typedef JS::Rooted<types::TypeObject*> RootedTypeObject;
typedef JS::Rooted<JSAtom*> RootedAtom;
typedef JS::Rooted<PropertyName*> RootedPropertyName;
enum XDRMode {
XDR_ENCODE,
XDR_DECODE