Bug 898263 (part 1) - Slim down jsprvtd.h. r=jorendorff.

--HG--
extra : rebase_source : 7a926428c59e388fc08148bf60f6dbc7bfe71271
This commit is contained in:
Nicholas Nethercote 2013-07-25 21:23:14 -07:00
parent ad1141baba
commit 066d47a07a
30 changed files with 72 additions and 160 deletions

View File

@ -15,7 +15,6 @@
// JavaScript includes
#include "jsapi.h"
#include "jsfriendapi.h"
#include "jsprvtd.h" // we are using private JS typedefs...
#include "jsdbgapi.h"
#include "WrapperFactory.h"
#include "AccessCheck.h"

View File

@ -7,8 +7,6 @@
#ifndef builtin_RegExp_h
#define builtin_RegExp_h
#include "jsprvtd.h"
#include "vm/MatchPairs.h"
#include "vm/RegExpObject.h"

View File

@ -24,6 +24,9 @@
namespace js {
namespace frontend {
template <typename ParseHandler>
class Parser;
struct CGTryNoteList {
Vector<JSTryNote> list;
CGTryNoteList(ExclusiveContext *cx) : list(cx) {}

View File

@ -7,8 +7,6 @@
#ifndef frontend_FoldConstants_h
#define frontend_FoldConstants_h
#include "jsprvtd.h"
#include "frontend/SyntaxParseHandler.h"
namespace js {

View File

@ -18,6 +18,9 @@
#include "js/Vector.h"
namespace js {
class LifoAlloc;
namespace frontend {
class DefinitionSingle;

View File

@ -21,6 +21,8 @@ template <typename ParseHandler>
struct ParseContext;
class FullParseHandler;
class FunctionBox;
class ObjectBox;
/*
* Indicates a location in the stack that an upvar value can be retrieved from

View File

@ -13,6 +13,9 @@
namespace js {
namespace frontend {
template <typename ParseHandler>
class Parser;
// Parse handler used when processing the syntax in a block of code, to generate
// the minimal information which is required to detect syntax errors and allow
// bytecode to be emitted for outer functions.

View File

@ -22,6 +22,11 @@ class JSScript;
namespace js {
namespace analyze {
class LoopAnalysis;
class SlotValue;
class SSAValue;
class SSAUseChain;
/*
* There are three analyses we can perform on a JSScript, outlined below.
* The results of all three are stored in ScriptAnalysis, but the analyses

View File

@ -218,6 +218,9 @@ template <AllowGC allowGC>
extern JSAtom *
ToAtom(ExclusiveContext *cx, typename MaybeRooted<Value, allowGC>::HandleType v);
template <XDRMode mode>
class XDRState;
template<XDRMode mode>
bool
XDRAtom(XDRState<mode> *xdr, js::MutableHandleAtom atomp);

View File

@ -18,9 +18,11 @@
namespace js {
class Class;
class FreeOp;
class PropertyId;
class PropertyName;
class SpecialId;
class PropertyId;
// This is equal to JSFunction::class_. Use it in places where you don't want
// to #include jsfun.h.

View File

@ -107,10 +107,11 @@ extern void
TraceCycleDetectionSet(JSTracer *trc, ObjectSet &set);
struct AutoResolving;
class DtoaCache;
class ForkJoinSlice;
class RegExpCompartment;
class DtoaCache;
class RegExpStatics;
class ForkJoinSlice;
/*
* Execution Context Overview:

View File

@ -18,7 +18,6 @@
#include "jsgc.h"
#include "jsobj.h"
#include "jsopcode.h"
#include "jsprvtd.h"
#include "jsscript.h"
#include "jsstr.h"
#include "jstypes.h"

View File

@ -12,6 +12,8 @@
#include "jsprvtd.h"
namespace js { class StackFrame; }
namespace JS {
struct FrameDescription

View File

@ -30,6 +30,8 @@
#define JS_CHECK_STACK_SIZE(limit, lval) JS_CHECK_STACK_SIZE_WITH_TOLERANCE(limit, lval, 0)
class JSLinearString;
namespace JS {
template <class T>
class Heap;

View File

@ -105,8 +105,16 @@ namespace ion {
struct IonScript;
}
namespace analyze {
class ScriptAnalysis;
}
namespace types {
class TypeCallsite;
class TypeCompartment;
class TypeSet;
/* Type set entry for either a JSObject with singleton type or a non-singleton TypeObject. */
struct TypeObjectKey {
static intptr_t keyBits(TypeObjectKey *obj) { return (intptr_t) obj; }

View File

@ -36,7 +36,6 @@ struct ObjectsExtraSizes;
namespace js {
class AutoPropDescArrayRooter;
class BaseProxyHandler;
struct GCMarker;
struct NativeIterator;
class Nursery;

View File

@ -12,6 +12,7 @@
namespace js {
class RegExpGuard;
class JS_FRIEND_API(Wrapper);
/*

View File

@ -6,79 +6,24 @@
#ifndef jsprvtd_h
#define jsprvtd_h
/*
* JS private typename definitions.
*
* This header is included only in other .h files, for convenience and for
* simplicity of type naming. The alternative for structures is to use tags,
* which are named the same as their typedef names (legal in C/C++, and less
* noisy than suffixing the typedef name with "Struct" or "Str"). Instead,
* all .h files that include this file may use the same typedef name, whether
* declaring a pointer to struct type, or defining a member of struct type.
*
* A few fundamental scalar types are defined here too. Neither the scalar
* nor the struct typedefs should change much, therefore the nearly-global
* make dependency induced by this file should not prove painful.
*/
#include "jsapi.h"
#include "jsutil.h"
#include "js/HashTable.h"
#include "js/Vector.h"
/*
* Convenience constants.
*/
#define JS_BITS_PER_UINT32_LOG2 5
#define JS_BITS_PER_UINT32 32
/* The alignment required of objects stored in GC arenas. */
static const unsigned JS_GCTHING_ALIGN = 8;
static const unsigned JS_GCTHING_ZEROBITS = 3;
/* Scalar typedefs. */
typedef uint8_t jsbytecode;
typedef uint8_t jssrcnote;
typedef uintptr_t jsatomid;
/* Struct typedefs. */
typedef struct JSGCThing JSGCThing;
typedef struct JSGenerator JSGenerator;
typedef struct JSNativeEnumerator JSNativeEnumerator;
typedef struct JSTryNote JSTryNote;
/* Friend "Advanced API" typedefs. */
typedef struct JSAtomState JSAtomState;
typedef struct JSCodeSpec JSCodeSpec;
typedef struct JSPrinter JSPrinter;
typedef struct JSStackHeader JSStackHeader;
typedef struct JSSubString JSSubString;
typedef struct JSSpecializedNative JSSpecializedNative;
/* String typedefs. */
class JSDependentString;
class JSExtensibleString;
class JSExternalString;
class JSLinearString;
class JSRope;
class JSAtom;
class JSWrapper;
namespace js {
struct ArgumentsData;
struct Class;
class AutoNameVector;
class RegExpGuard;
class RegExpObject;
class RegExpObjectBuilder;
class RegExpShared;
class RegExpStatics;
class MatchPairs;
class PropertyName;
class LazyScript;
enum RegExpFlag
{
@ -91,37 +36,8 @@ enum RegExpFlag
AllFlags = 0x0f
};
class StringBuffer;
class FrameRegs;
class StackFrame;
class ScriptFrameIter;
class Proxy;
class JS_FRIEND_API(AutoEnterPolicy);
class JS_FRIEND_API(BaseProxyHandler);
class JS_FRIEND_API(Wrapper);
class JS_FRIEND_API(CrossCompartmentWrapper);
class TempAllocPolicy;
class RuntimeAllocPolicy;
class GlobalObject;
template <typename K,
typename V,
size_t InlineElems>
class InlineMap;
class LifoAlloc;
class Shape;
class Breakpoint;
class BreakpointSite;
class Debugger;
class WatchpointMap;
/*
* Env is the type of what ES5 calls "lexical environments" (runtime
* activations of lexical scopes). This is currently just JSObject, and is
@ -137,45 +53,7 @@ typedef JSPropertyOp PropertyOp;
typedef JSStrictPropertyOp StrictPropertyOp;
typedef JSPropertyDescriptor PropertyDescriptor;
struct SourceCompressionToken;
namespace frontend {
struct BytecodeEmitter;
struct Definition;
class FullParseHandler;
class FunctionBox;
class ObjectBox;
struct Token;
struct TokenPos;
class TokenStream;
class ParseMapPool;
class ParseNode;
template <typename ParseHandler>
class Parser;
} /* namespace frontend */
namespace analyze {
struct LifetimeVariable;
class LoopAnalysis;
class ScriptAnalysis;
class SlotValue;
class SSAValue;
class SSAUseChain;
} /* namespace analyze */
namespace types {
class TypeSet;
struct TypeCallsite;
struct TypeObject;
struct TypeCompartment;
} /* namespace types */
namespace types { struct TypeObject; }
typedef JS::Handle<Shape*> HandleShape;
typedef JS::Handle<types::TypeObject*> HandleTypeObject;
@ -195,11 +73,6 @@ enum XDRMode {
XDR_DECODE
};
template <XDRMode mode>
class XDRState;
class FreeOp;
struct IdValuePair
{
jsid id;
@ -213,18 +86,6 @@ struct IdValuePair
} /* namespace js */
namespace JSC {
class ExecutableAllocator;
} /* namespace JSC */
namespace WTF {
class BumpPointerAllocator;
} /* namespace WTF */
/* "Friend" types used by jscntxt.h and jsdbgapi.h. */
typedef enum JSTrapStatus {
JSTRAP_ERROR,

View File

@ -34,14 +34,21 @@ namespace ion {
# define BASELINE_DISABLED_SCRIPT ((js::ion::BaselineScript *)0x1)
class Shape;
class BreakpointSite;
class BindingIter;
class RegExpObject;
struct SourceCompressionToken;
class Shape;
class WatchpointMap;
namespace analyze {
class ScriptAnalysis;
}
namespace frontend {
class BytecodeEmitter;
}
}
/*

View File

@ -20,11 +20,11 @@
#include "vm/Unicode.h"
class JSFlatString;
class JSLinearString;
class JSStableString;
namespace js {
/* Implemented in jsstrinlines.h */
class StringBuffer;
/*

View File

@ -14,6 +14,7 @@
namespace js {
class AbstractFramePtr;
class ScriptFrameIter;
namespace ion {
class IonJSFrameLayout;

View File

@ -21,6 +21,8 @@
namespace js {
class Breakpoint;
/*
* A weakmap that supports the keys being in different compartments to the
* values, although all values must be in the same compartment.

View File

@ -7,7 +7,10 @@
#ifndef vm_MatchPairs_h
#define vm_MatchPairs_h
#include "jsalloc.h"
#include "ds/LifoAlloc.h"
#include "js/Vector.h"
/*
* RegExp match results are succinctly represented by pairs of integer

View File

@ -47,6 +47,9 @@
*/
namespace js {
class RegExpShared;
namespace frontend { class TokenStream; }
enum RegExpRunStatus
{
RegExpRunStatus_Error,

View File

@ -23,6 +23,7 @@
#include "jsfriendapi.h"
#include "jsgc.h"
#include "jsprvtd.h"
#include "jsproxy.h"
#include "ds/FixedSizeHash.h"
#include "ds/LifoAlloc.h"
@ -63,21 +64,24 @@ js_ReportAllocationOverflow(js::ThreadSafeContext *cx);
extern void
js_ReportOverRecursed(js::ThreadSafeContext *cx);
namespace JSC { class ExecutableAllocator; }
namespace WTF { class BumpPointerAllocator; }
namespace js {
typedef Rooted<JSLinearString*> RootedLinearString;
class AsmJSActivation;
class InterpreterFrames;
class MathCache;
class WorkerThreadState;
namespace ion {
class IonRuntime;
struct PcScriptCache;
}
class AsmJSActivation;
class InterpreterFrames;
class WorkerThreadState;
/*
* GetSrcNote cache to avoid O(n^2) growth in finding a source note for a
* given pc in a script. We use the script->code pointer to tag the cache,

View File

@ -16,6 +16,8 @@
namespace js {
namespace frontend { struct Definition; }
/*****************************************************************************/
/*

View File

@ -17,6 +17,7 @@
struct JSContext;
struct JSCompartment;
struct JSGenerator;
namespace js {

View File

@ -11,6 +11,7 @@
#define xpcinlines_h___
#include "jsfriendapi.h"
#include "jsutil.h"
/***************************************************************************/

View File

@ -59,7 +59,6 @@
#include "mozilla/MemoryReporting.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/DOMJSClass.h"
#include "jsfriendapi.h"
#include "jsprf.h"
#include "nsCycleCollectionNoteRootCallback.h"
#include "nsCycleCollectionParticipant.h"

View File

@ -8,8 +8,8 @@
#define mozilla_CycleCollectedJSRuntime_h__
#include "mozilla/MemoryReporting.h"
#include "jsprvtd.h"
#include "jsapi.h"
#include "jsfriendapi.h"
#include "nsCycleCollector.h"
#include "nsCycleCollectionParticipant.h"