Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | Public Attributes | Private Types | Static Private Member Functions | List of all members
ScriptRuntime Class Reference

Abstraction around a SpiderMonkey JSRuntime. More...

Classes

struct  ScriptLocation
 
struct  ScriptLocationName
 

Public Member Functions

 ScriptRuntime (int runtimeSize)
 
 ~ScriptRuntime ()
 

Public Attributes

JSRuntime * m_rt
 
AutoGCRooterm_rooter
 
JSObject * m_compartmentGlobal
 

Private Types

typedef boost::flyweight
< std::string,
boost::flyweights::no_tracking,
boost::flyweights::no_locking > 
StringFlyweight
 
typedef boost::flyweight
< boost::flyweights::key_value
< ScriptLocation,
ScriptLocationName >
, boost::flyweights::no_tracking,
boost::flyweights::no_locking > 
LocFlyweight
 

Static Private Member Functions

static void * jshook_script (JSContext *cx, JSStackFrame *fp, JSBool before, JSBool *ok, void *closure)
 
static void * jshook_function (JSContext *cx, JSStackFrame *fp, JSBool before, JSBool *ok, void *closure)
 
static void jshook_trace (JSTracer *trc, void *data)
 

Detailed Description

Abstraction around a SpiderMonkey JSRuntime.

Each ScriptRuntime can be used to initialize several ScriptInterface contexts which can then share data, but a single ScriptRuntime should only be used on a single thread.

(One means to share data between threads and runtimes is to create a ScriptInterface::StructuredClone.)

Definition at line 68 of file ScriptInterface.cpp.

Member Typedef Documentation

typedef boost::flyweight< boost::flyweights::key_value<ScriptLocation, ScriptLocationName>, boost::flyweights::no_tracking, boost::flyweights::no_locking > ScriptRuntime::LocFlyweight
private

Definition at line 181 of file ScriptInterface.cpp.

typedef boost::flyweight< std::string, boost::flyweights::no_tracking, boost::flyweights::no_locking > ScriptRuntime::StringFlyweight
private

Definition at line 176 of file ScriptInterface.cpp.

Constructor & Destructor Documentation

ScriptRuntime::ScriptRuntime ( int  runtimeSize)
inline

Definition at line 71 of file ScriptInterface.cpp.

ScriptRuntime::~ScriptRuntime ( )
inline

Definition at line 93 of file ScriptInterface.cpp.

Member Function Documentation

static void* ScriptRuntime::jshook_function ( JSContext *  cx,
JSStackFrame *  fp,
JSBool  before,
JSBool *  ok,
void *  closure 
)
inlinestaticprivate

Definition at line 183 of file ScriptInterface.cpp.

static void* ScriptRuntime::jshook_script ( JSContext *  cx,
JSStackFrame *  fp,
JSBool  before,
JSBool *  ok,
void *  closure 
)
inlinestaticprivate

Definition at line 106 of file ScriptInterface.cpp.

static void ScriptRuntime::jshook_trace ( JSTracer *  trc,
void *  data 
)
inlinestaticprivate

Definition at line 218 of file ScriptInterface.cpp.

Member Data Documentation

JSObject* ScriptRuntime::m_compartmentGlobal

Definition at line 101 of file ScriptInterface.cpp.

AutoGCRooter* ScriptRuntime::m_rooter

Definition at line 99 of file ScriptInterface.cpp.

JSRuntime* ScriptRuntime::m_rt

Definition at line 98 of file ScriptInterface.cpp.


The documentation for this class was generated from the following file: