Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Typedefs | Functions
jsd.h File Reference
#include "jstypes.h"
#include "jsprf.h"
#include "jsutil.h"
#include "jshash.h"
#include "jsclist.h"
#include "jsdebug.h"
#include "jsapi.h"
#include "jsdbgapi.h"
#include "jsd_lock.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  JSDContext
struct  JSDScript
struct  JSDProfileData
struct  JSDSourceText
struct  JSDExecHook
struct  JSDThreadState
struct  JSDStackFrameInfo
struct  JSDValue
struct  JSDProperty
struct  JSDAtom
struct  JSDObject

Defines

#define EXPORT_JSD_API   1 /* if used, must be set before include of jsdebug.h */
#define JSD_MAJOR_VERSION   1
#define JSD_MINOR_VERSION   1
#define CHECK_BIT_FLAG(f, b)   ((f)&(b))
#define SET_BIT_FLAG(f, b)   ((f)|=(b))
#define CLEAR_BIT_FLAG(f, b)   ((f)&=(~(b)))
#define JSD_IS_DEBUG_ENABLED(jsdc, jsdscript)
#define JSD_IS_PROFILE_ENABLED(jsdc, jsdscript)
#define TS_HAS_DISABLED_FRAME   0x01
#define GOT_PROTO   ((short) (1 << 0))
#define GOT_PROPS   ((short) (1 << 1))
#define GOT_PARENT   ((short) (1 << 2))
#define GOT_CTOR   ((short) (1 << 3))
#define JSD_ASSERT_VALID_CONTEXT(x)   ((void)0)
#define JSD_ASSERT_VALID_SCRIPT(x)   ((void)0)
#define JSD_ASSERT_VALID_SOURCE_TEXT(x)   ((void)0)
#define JSD_ASSERT_VALID_THREAD_STATE(x)   ((void)0)
#define JSD_ASSERT_VALID_STACK_FRAME(x)   ((void)0)
#define JSD_ASSERT_VALID_EXEC_HOOK(x)   ((void)0)
#define JSD_ASSERT_VALID_VALUE(x)   ((void)0)
#define JSD_ASSERT_VALID_PROPERTY(x)   ((void)0)
#define JSD_ASSERT_VALID_OBJECT(x)   ((void)0)
#define JSD_LOCK()   ((void)0)
#define JSD_UNLOCK()   ((void)0)
#define JSD_INIT_LOCKS(jsdc)   1
#define JSD_LOCK_SCRIPTS(jsdc)   ((void)0)
#define JSD_UNLOCK_SCRIPTS(jsdc)   ((void)0)
#define JSD_LOCK_SOURCE_TEXT(jsdc)   ((void)0)
#define JSD_UNLOCK_SOURCE_TEXT(jsdc)   ((void)0)
#define JSD_LOCK_ATOMS(jsdc)   ((void)0)
#define JSD_UNLOCK_ATOMS(jsdc)   ((void)0)
#define JSD_LOCK_OBJECTS(jsdc)   ((void)0)
#define JSD_UNLOCK_OBJECTS(jsdc)   ((void)0)
#define JSD_LOCK_THREADSTATES(jsdc)   ((void)0)
#define JSD_UNLOCK_THREADSTATES(jsdc)   ((void)0)
#define JSD_SCRIPTS_LOCKED(jsdc)   1
#define JSD_SOURCE_TEXT_LOCKED(jsdc)   1
#define JSD_ATOMS_LOCKED(jsdc)   1
#define JSD_OBJECTS_LOCKED(jsdc)   1
#define JSD_THREADSTATES_LOCKED(jsdc)   1
#define JSD_SCRIPTS_UNLOCKED(jsdc)   1
#define JSD_SOURCE_TEXT_UNLOCKED(jsdc)   1
#define JSD_ATOMS_UNLOCKED(jsdc)   1
#define JSD_OBJECTS_UNLOCKED(jsdc)   1
#define JSD_THREADSTATES_UNLOCKED(jsdc)   1
#define JSD_CURRENT_THREAD()   ((void*)0)
#define JSD_IS_DANGEROUS_THREAD(jsdc)   0
#define JSD_ATOM_TO_STRING(a)   ((const char*)((a)->str))

Typedefs

typedef struct JSDExecHook
typedef struct JSDAtom
typedef struct JSDProfileData

Functions

JSDContextjsd_DebuggerOnForUser (JSRuntime *jsrt, JSD_UserCallbacks *callbacks, void *user)
JSDContextjsd_DebuggerOn (void)
void jsd_DebuggerOff (JSDContext *jsdc)
void jsd_SetUserCallbacks (JSRuntime *jsrt, JSD_UserCallbacks *callbacks, void *user)
JSDContextjsd_JSDContextForJSContext (JSContext *context)
voidjsd_SetContextPrivate (JSDContext *jsdc, void *data)
voidjsd_GetContextPrivate (JSDContext *jsdc)
void jsd_ClearAllProfileData (JSDContext *jsdc)
JSBool jsd_SetErrorReporter (JSDContext *jsdc, JSD_ErrorReporter reporter, void *callerdata)
JSBool jsd_GetErrorReporter (JSDContext *jsdc, JSD_ErrorReporter *reporter, void **callerdata)
 jsd_DebugErrorHook (JSContext *cx, const char *message, JSErrorReport *report, void *closure)
JSBool jsd_InitScriptManager (JSDContext *jsdc)
void jsd_DestroyScriptManager (JSDContext *jsdc)
JSDScriptjsd_FindJSDScript (JSDContext *jsdc, JSScript *script)
JSDProfileDatajsd_GetScriptProfileData (JSDContext *jsdc, JSDScript *script)
uint32 jsd_GetScriptFlags (JSDContext *jsdc, JSDScript *script)
void jsd_SetScriptFlags (JSDContext *jsdc, JSDScript *script, uint32 flags)
uintN jsd_GetScriptCallCount (JSDContext *jsdc, JSDScript *script)
uintN jsd_GetScriptMaxRecurseDepth (JSDContext *jsdc, JSDScript *script)
jsdouble jsd_GetScriptMinExecutionTime (JSDContext *jsdc, JSDScript *script)
jsdouble jsd_GetScriptMaxExecutionTime (JSDContext *jsdc, JSDScript *script)
jsdouble jsd_GetScriptTotalExecutionTime (JSDContext *jsdc, JSDScript *script)
jsdouble jsd_GetScriptMinOwnExecutionTime (JSDContext *jsdc, JSDScript *script)
jsdouble jsd_GetScriptMaxOwnExecutionTime (JSDContext *jsdc, JSDScript *script)
jsdouble jsd_GetScriptTotalOwnExecutionTime (JSDContext *jsdc, JSDScript *script)
void jsd_ClearScriptProfileData (JSDContext *jsdc, JSDScript *script)
JSScriptjsd_GetJSScript (JSDContext *jsdc, JSDScript *script)
JSFunctionjsd_GetJSFunction (JSDContext *jsdc, JSDScript *script)
JSDScriptjsd_IterateScripts (JSDContext *jsdc, JSDScript **iterp)
voidjsd_SetScriptPrivate (JSDScript *jsdscript, void *data)
voidjsd_GetScriptPrivate (JSDScript *jsdscript)
JSBool jsd_IsActiveScript (JSDContext *jsdc, JSDScript *jsdscript)
const char * jsd_GetScriptFilename (JSDContext *jsdc, JSDScript *jsdscript)
const char * jsd_GetScriptFunctionName (JSDContext *jsdc, JSDScript *jsdscript)
uintN jsd_GetScriptBaseLineNumber (JSDContext *jsdc, JSDScript *jsdscript)
uintN jsd_GetScriptLineExtent (JSDContext *jsdc, JSDScript *jsdscript)
JSBool jsd_SetScriptHook (JSDContext *jsdc, JSD_ScriptHookProc hook, void *callerdata)
JSBool jsd_GetScriptHook (JSDContext *jsdc, JSD_ScriptHookProc *hook, void **callerdata)
jsuword jsd_GetClosestPC (JSDContext *jsdc, JSDScript *jsdscript, uintN line)
uintN jsd_GetClosestLine (JSDContext *jsdc, JSDScript *jsdscript, jsuword pc)
void JS_DLL_CALLBACK jsd_NewScriptHookProc (JSContext *cx, const char *filename, uintN lineno, JSScript *script, JSFunction *fun, void *callerdata)
void JS_DLL_CALLBACK jsd_DestroyScriptHookProc (JSContext *cx, JSScript *script, void *callerdata)
JSBool jsd_SetExecutionHook (JSDContext *jsdc, JSDScript *jsdscript, jsuword pc, JSD_ExecutionHookProc hook, void *callerdata)
JSBool jsd_ClearExecutionHook (JSDContext *jsdc, JSDScript *jsdscript, jsuword pc)
JSBool jsd_ClearAllExecutionHooksForScript (JSDContext *jsdc, JSDScript *jsdscript)
JSBool jsd_ClearAllExecutionHooks (JSDContext *jsdc)
void jsd_ScriptCreated (JSDContext *jsdc, JSContext *cx, const char *filename, uintN lineno, JSScript *script, JSFunction *fun)
void jsd_ScriptDestroyed (JSDContext *jsdc, JSContext *cx, JSScript *script)
JSDSourceTextjsd_IterateSources (JSDContext *jsdc, JSDSourceText **iterp)
JSDSourceTextjsd_FindSourceForURL (JSDContext *jsdc, const char *url)
const char * jsd_GetSourceURL (JSDContext *jsdc, JSDSourceText *jsdsrc)
JSBool jsd_GetSourceText (JSDContext *jsdc, JSDSourceText *jsdsrc, const char **ppBuf, intN *pLen)
void jsd_ClearSourceText (JSDContext *jsdc, JSDSourceText *jsdsrc)
JSDSourceStatus jsd_GetSourceStatus (JSDContext *jsdc, JSDSourceText *jsdsrc)
JSBool jsd_IsSourceDirty (JSDContext *jsdc, JSDSourceText *jsdsrc)
void jsd_SetSourceDirty (JSDContext *jsdc, JSDSourceText *jsdsrc, JSBool dirty)
uintN jsd_GetSourceAlterCount (JSDContext *jsdc, JSDSourceText *jsdsrc)
uintN jsd_IncrementSourceAlterCount (JSDContext *jsdc, JSDSourceText *jsdsrc)
JSDSourceTextjsd_NewSourceText (JSDContext *jsdc, const char *url)
JSDSourceTextjsd_AppendSourceText (JSDContext *jsdc, JSDSourceText *jsdsrc, const char *text, size_t length, JSDSourceStatus status)
JSDSourceTextjsd_AppendUCSourceText (JSDContext *jsdc, JSDSourceText *jsdsrc, const jschar *text, size_t length, JSDSourceStatus status)
JSBool jsd_AddFullSourceText (JSDContext *jsdc, const char *text, size_t length, const char *url)
void jsd_DestroyAllSources (JSDContext *jsdc)
const char * jsd_BuildNormalizedURL (const char *url_string)
void jsd_StartingEvalUsingFilename (JSDContext *jsdc, const char *url)
void jsd_FinishedEvalUsingFilename (JSDContext *jsdc, const char *url)
JSBool jsd_SetInterruptHook (JSDContext *jsdc, JSD_ExecutionHookProc hook, void *callerdata)
JSBool jsd_ClearInterruptHook (JSDContext *jsdc)
JSBool jsd_SetDebugBreakHook (JSDContext *jsdc, JSD_ExecutionHookProc hook, void *callerdata)
JSBool jsd_ClearDebugBreakHook (JSDContext *jsdc)
JSBool jsd_SetDebuggerHook (JSDContext *jsdc, JSD_ExecutionHookProc hook, void *callerdata)
JSBool jsd_ClearDebuggerHook (JSDContext *jsdc)
JSTrapStatus jsd_CallExecutionHook (JSDContext *jsdc, JSContext *cx, uintN type, JSD_ExecutionHookProc hook, void *hookData, jsval *rval)
JSBool jsd_CallCallHook (JSDContext *jsdc, JSContext *cx, uintN type, JSD_CallHookProc hook, void *hookData)
JSBool jsd_SetThrowHook (JSDContext *jsdc, JSD_ExecutionHookProc hook, void *callerdata)
JSBool jsd_ClearThrowHook (JSDContext *jsdc)
JSTrapStatus JS_DLL_CALLBACK jsd_DebuggerHandler (JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval, void *closure)
JSTrapStatus JS_DLL_CALLBACK jsd_ThrowHandler (JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval, void *closure)
JSBool jsd_SetFunctionHook (JSDContext *jsdc, JSD_CallHookProc hook, void *callerdata)
JSBool jsd_ClearFunctionHook (JSDContext *jsdc)
JSBool jsd_SetTopLevelHook (JSDContext *jsdc, JSD_CallHookProc hook, void *callerdata)
JSBool jsd_ClearTopLevelHook (JSDContext *jsdc)
uintN jsd_GetCountOfStackFrames (JSDContext *jsdc, JSDThreadState *jsdthreadstate)
JSDStackFrameInfojsd_GetStackFrame (JSDContext *jsdc, JSDThreadState *jsdthreadstate)
JSContextjsd_GetJSContext (JSDContext *jsdc, JSDThreadState *jsdthreadstate)
JSDStackFrameInfojsd_GetCallingStackFrame (JSDContext *jsdc, JSDThreadState *jsdthreadstate, JSDStackFrameInfo *jsdframe)
JSDScriptjsd_GetScriptForStackFrame (JSDContext *jsdc, JSDThreadState *jsdthreadstate, JSDStackFrameInfo *jsdframe)
jsuword jsd_GetPCForStackFrame (JSDContext *jsdc, JSDThreadState *jsdthreadstate, JSDStackFrameInfo *jsdframe)
JSDValuejsd_GetCallObjectForStackFrame (JSDContext *jsdc, JSDThreadState *jsdthreadstate, JSDStackFrameInfo *jsdframe)
JSDValuejsd_GetScopeChainForStackFrame (JSDContext *jsdc, JSDThreadState *jsdthreadstate, JSDStackFrameInfo *jsdframe)
JSBool jsd_IsStackFrameNative (JSDContext *jsdc, JSDThreadState *jsdthreadstate, JSDStackFrameInfo *jsdframe)
JSBool jsd_IsStackFrameDebugger (JSDContext *jsdc, JSDThreadState *jsdthreadstate, JSDStackFrameInfo *jsdframe)
JSBool jsd_IsStackFrameConstructing (JSDContext *jsdc, JSDThreadState *jsdthreadstate, JSDStackFrameInfo *jsdframe)
JSDValuejsd_GetThisForStackFrame (JSDContext *jsdc, JSDThreadState *jsdthreadstate, JSDStackFrameInfo *jsdframe)
const char * jsd_GetNameForStackFrame (JSDContext *jsdc, JSDThreadState *jsdthreadstate, JSDStackFrameInfo *jsdframe)
JSDThreadStatejsd_NewThreadState (JSDContext *jsdc, JSContext *cx)
void jsd_DestroyThreadState (JSDContext *jsdc, JSDThreadState *jsdthreadstate)
JSBool jsd_EvaluateUCScriptInStackFrame (JSDContext *jsdc, JSDThreadState *jsdthreadstate, JSDStackFrameInfo *jsdframe, const jschar *bytes, uintN length, const char *filename, uintN lineno, JSBool eatExceptions, jsval *rval)
JSBool jsd_EvaluateScriptInStackFrame (JSDContext *jsdc, JSDThreadState *jsdthreadstate, JSDStackFrameInfo *jsdframe, const char *bytes, uintN length, const char *filename, uintN lineno, JSBool eatExceptions, jsval *rval)
JSStringjsd_ValToStringInStackFrame (JSDContext *jsdc, JSDThreadState *jsdthreadstate, JSDStackFrameInfo *jsdframe, jsval val)
JSBool jsd_IsValidThreadState (JSDContext *jsdc, JSDThreadState *jsdthreadstate)
JSBool jsd_IsValidFrameInThreadState (JSDContext *jsdc, JSDThreadState *jsdthreadstate, JSDStackFrameInfo *jsdframe)
JSDValuejsd_GetException (JSDContext *jsdc, JSDThreadState *jsdthreadstate)
JSBool jsd_SetException (JSDContext *jsdc, JSDThreadState *jsdthreadstate, JSDValue *jsdval)
JSDValuejsd_NewValue (JSDContext *jsdc, jsval val)
void jsd_DropValue (JSDContext *jsdc, JSDValue *jsdval)
jsval jsd_GetValueWrappedJSVal (JSDContext *jsdc, JSDValue *jsdval)
void jsd_RefreshValue (JSDContext *jsdc, JSDValue *jsdval)
JSBool jsd_IsValueObject (JSDContext *jsdc, JSDValue *jsdval)
JSBool jsd_IsValueNumber (JSDContext *jsdc, JSDValue *jsdval)
JSBool jsd_IsValueInt (JSDContext *jsdc, JSDValue *jsdval)
JSBool jsd_IsValueDouble (JSDContext *jsdc, JSDValue *jsdval)
JSBool jsd_IsValueString (JSDContext *jsdc, JSDValue *jsdval)
JSBool jsd_IsValueBoolean (JSDContext *jsdc, JSDValue *jsdval)
JSBool jsd_IsValueNull (JSDContext *jsdc, JSDValue *jsdval)
JSBool jsd_IsValueVoid (JSDContext *jsdc, JSDValue *jsdval)
JSBool jsd_IsValuePrimitive (JSDContext *jsdc, JSDValue *jsdval)
JSBool jsd_IsValueFunction (JSDContext *jsdc, JSDValue *jsdval)
JSBool jsd_IsValueNative (JSDContext *jsdc, JSDValue *jsdval)
JSBool jsd_GetValueBoolean (JSDContext *jsdc, JSDValue *jsdval)
int32 jsd_GetValueInt (JSDContext *jsdc, JSDValue *jsdval)
jsdoublejsd_GetValueDouble (JSDContext *jsdc, JSDValue *jsdval)
JSStringjsd_GetValueString (JSDContext *jsdc, JSDValue *jsdval)
const char * jsd_GetValueFunctionName (JSDContext *jsdc, JSDValue *jsdval)
uintN jsd_GetCountOfProperties (JSDContext *jsdc, JSDValue *jsdval)
JSDPropertyjsd_IterateProperties (JSDContext *jsdc, JSDValue *jsdval, JSDProperty **iterp)
JSDPropertyjsd_GetValueProperty (JSDContext *jsdc, JSDValue *jsdval, JSString *name)
JSDValuejsd_GetValuePrototype (JSDContext *jsdc, JSDValue *jsdval)
JSDValuejsd_GetValueParent (JSDContext *jsdc, JSDValue *jsdval)
JSDValuejsd_GetValueConstructor (JSDContext *jsdc, JSDValue *jsdval)
const char * jsd_GetValueClassName (JSDContext *jsdc, JSDValue *jsdval)
void jsd_DropProperty (JSDContext *jsdc, JSDProperty *jsdprop)
JSDValuejsd_GetPropertyName (JSDContext *jsdc, JSDProperty *jsdprop)
JSDValuejsd_GetPropertyValue (JSDContext *jsdc, JSDProperty *jsdprop)
JSDValuejsd_GetPropertyAlias (JSDContext *jsdc, JSDProperty *jsdprop)
uintN jsd_GetPropertyFlags (JSDContext *jsdc, JSDProperty *jsdprop)
uintN jsd_GetPropertyVarArgSlot (JSDContext *jsdc, JSDProperty *jsdprop)
void *JS_DLL_CALLBACK jsd_FunctionCallHook (JSContext *cx, JSStackFrame *fp, JSBool before, JSBool *ok, void *closure)
void *JS_DLL_CALLBACK jsd_TopLevelCallHook (JSContext *cx, JSStackFrame *fp, JSBool before, JSBool *ok, void *closure)
JSBool jsd_InitObjectManager (JSDContext *jsdc)
void jsd_DestroyObjectManager (JSDContext *jsdc)
void JS_DLL_CALLBACK jsd_ObjectHook (JSContext *cx, JSObject *obj, JSBool isNew, void *closure)
void jsd_Constructing (JSDContext *jsdc, JSContext *cx, JSObject *obj, JSStackFrame *fp)
JSDObjectjsd_IterateObjects (JSDContext *jsdc, JSDObject **iterp)
JSObjectjsd_GetWrappedObject (JSDContext *jsdc, JSDObject *jsdobj)
const char * jsd_GetObjectNewURL (JSDContext *jsdc, JSDObject *jsdobj)
uintN jsd_GetObjectNewLineNumber (JSDContext *jsdc, JSDObject *jsdobj)
const char * jsd_GetObjectConstructorURL (JSDContext *jsdc, JSDObject *jsdobj)
uintN jsd_GetObjectConstructorLineNumber (JSDContext *jsdc, JSDObject *jsdobj)
const char * jsd_GetObjectConstructorName (JSDContext *jsdc, JSDObject *jsdobj)
JSDObjectjsd_GetJSDObjectForJSObject (JSDContext *jsdc, JSObject *jsobj)
JSDObjectjsd_GetObjectForValue (JSDContext *jsdc, JSDValue *jsdval)
JSDValuejsd_GetValueForObject (JSDContext *jsdc, JSDObject *jsdobj)
JSBool jsd_CreateAtomTable (JSDContext *jsdc)
void jsd_DestroyAtomTable (JSDContext *jsdc)
JSDAtomjsd_AddAtom (JSDContext *jsdc, const char *str)
JSDAtomjsd_CloneAtom (JSDContext *jsdc, JSDAtom *atom)
void jsd_DropAtom (JSDContext *jsdc, JSDAtom *atom)

Class Documentation

struct JSDContext

Definition at line 134 of file jsd.h.

Collaboration diagram for JSDContext:
Class Members
JSHashTable * atoms
JSDProfileData * callingFunctionPData
void * data
JSD_ExecutionHookProc debugBreakHook
void * debugBreakHookData
JSD_ExecutionHookProc debuggerHook
void * debuggerHookData
JSContext * dumbContext
JSD_ErrorReporter errorReporter
void * errorReporterData
uint32 flags
JSD_CallHookProc functionHook
void * functionHookData
JSObject * glob
JSBool inited
JSD_ExecutionHookProc interruptHook
void * interruptHookData
JSRuntime * jsrt
int64 lastReturnTime
JSCList links
JSCList objectsList
JSHashTable * objectsTable
JSCList removedSources
JSD_ScriptHookProc scriptHook
void * scriptHookData
JSCList scripts
JSHashTable * scriptsTable
uintN sourceAlterCount
JSCList sources
JSCList threadsStates
JSD_ExecutionHookProc throwHook
void * throwHookData
JSD_CallHookProc toplevelHook
void * toplevelHookData
void * user
JSD_UserCallbacks userCallbacks
struct JSDScript

Definition at line 185 of file jsd.h.

Collaboration diagram for JSDScript:
Class Members
void * data
uint32 flags
JSFunction * function
JSCList hooks
JSDContext * jsdc
uintN lineBase
uintN lineExtent
JSCList links
JSDProfileData * profileData
JSScript * script
char * url
struct JSDProfileData

Definition at line 206 of file jsd.h.

Collaboration diagram for JSDProfileData:
Class Members
uintN callCount
JSDProfileData * caller
int64 lastCallStart
jsdouble maxExecutionTime
jsdouble maxOwnExecutionTime
uintN maxRecurseDepth
jsdouble minExecutionTime
jsdouble minOwnExecutionTime
uintN recurseDepth
int64 runningTime
jsdouble totalExecutionTime
jsdouble totalOwnExecutionTime
struct JSDSourceText

Definition at line 222 of file jsd.h.

Collaboration diagram for JSDSourceText:
Class Members
uintN alterCount
JSBool dirty
JSBool doingEval
JSCList links
JSDSourceStatus status
char * text
uintN textLength
uintN textSpace
char * url
struct JSDExecHook

Definition at line 235 of file jsd.h.

Collaboration diagram for JSDExecHook:
Class Members
void * callerdata
JSD_ExecutionHookProc hook
JSDScript * jsdscript
JSCList links
jsuword pc
struct JSDThreadState

Definition at line 246 of file jsd.h.

Collaboration diagram for JSDThreadState:
Class Members
JSContext * context
uintN flags
JSCList links
JSCList stack
uintN stackDepth
void * thread
struct JSDStackFrameInfo

Definition at line 256 of file jsd.h.

Collaboration diagram for JSDStackFrameInfo:
Class Members
JSStackFrame * fp
JSDScript * jsdscript
JSDThreadState * jsdthreadstate
JSCList links
jsuword pc
struct JSDValue

Definition at line 270 of file jsd.h.

Collaboration diagram for JSDValue:
Class Members
const char * className
JSDValue * ctor
uintN flags
const char * funName
intN nref
JSDValue * parent
JSCList props
JSDValue * proto
JSString * string
jsval val
struct JSDProperty

Definition at line 284 of file jsd.h.

Collaboration diagram for JSDProperty:
Class Members
JSDValue * alias
uintN flags
JSCList links
JSDValue * name
intN nref
uintN slot
JSDValue * val
struct JSDAtom

Definition at line 295 of file jsd.h.

Class Members
intN refcount
char * str
struct JSDObject

Definition at line 301 of file jsd.h.

Collaboration diagram for JSDObject:
Class Members
uintN ctorLineno
JSDAtom * ctorName
JSDAtom * ctorURL
JSCList links
uintN newLineno
JSDAtom * newURL
JSObject * obj

Define Documentation

#define CHECK_BIT_FLAG (   f,
  b 
)    ((f)&(b))

Definition at line 106 of file jsd.h.

#define CLEAR_BIT_FLAG (   f,
  b 
)    ((f)&=(~(b)))

Definition at line 110 of file jsd.h.

#define EXPORT_JSD_API   1 /* if used, must be set before include of jsdebug.h */

Definition at line 50 of file jsd.h.

#define GOT_CTOR   ((short) (1 << 3))

Definition at line 268 of file jsd.h.

#define GOT_PARENT   ((short) (1 << 2))

Definition at line 267 of file jsd.h.

#define GOT_PROPS   ((short) (1 << 1))

Definition at line 266 of file jsd.h.

#define GOT_PROTO   ((short) (1 << 0))

Definition at line 265 of file jsd.h.

Definition at line 326 of file jsd.h.

Definition at line 331 of file jsd.h.

#define JSD_ASSERT_VALID_OBJECT (   x)    ((void)0)

Definition at line 334 of file jsd.h.

Definition at line 333 of file jsd.h.

#define JSD_ASSERT_VALID_SCRIPT (   x)    ((void)0)

Definition at line 327 of file jsd.h.

Definition at line 328 of file jsd.h.

Definition at line 330 of file jsd.h.

Definition at line 329 of file jsd.h.

#define JSD_ASSERT_VALID_VALUE (   x)    ((void)0)

Definition at line 332 of file jsd.h.

#define JSD_ATOM_TO_STRING (   a)    ((const char*)((a)->str))

Definition at line 1087 of file jsd.h.

#define JSD_ATOMS_LOCKED (   jsdc)    1

Definition at line 862 of file jsd.h.

#define JSD_ATOMS_UNLOCKED (   jsdc)    1

Definition at line 867 of file jsd.h.

#define JSD_CURRENT_THREAD ( )    ((void*)0)

Definition at line 881 of file jsd.h.

#define JSD_INIT_LOCKS (   jsdc)    1

Definition at line 824 of file jsd.h.

#define JSD_IS_DANGEROUS_THREAD (   jsdc)    0

Definition at line 895 of file jsd.h.

Value:
(!(((jsdc->flags & JSD_DEBUG_WHEN_SET) ? 1 : 0)  ^                     \
           ((jsdscript->flags & JSD_SCRIPT_DEBUG_BIT) ?  1 : 0)))

Definition at line 112 of file jsd.h.

Value:
((jsdc->flags & JSD_COLLECT_PROFILE_DATA) &&                           \
         (!(((jsdc->flags & JSD_PROFILE_WHEN_SET) ? 1 : 0) ^                   \
            ((jsdscript->flags & JSD_SCRIPT_PROFILE_BIT) ? 1 : 0))))

Definition at line 115 of file jsd.h.

#define JSD_LOCK ( )    ((void)0)

Definition at line 821 of file jsd.h.

#define JSD_LOCK_ATOMS (   jsdc)    ((void)0)

Definition at line 832 of file jsd.h.

#define JSD_LOCK_OBJECTS (   jsdc)    ((void)0)

Definition at line 835 of file jsd.h.

#define JSD_LOCK_SCRIPTS (   jsdc)    ((void)0)

Definition at line 826 of file jsd.h.

#define JSD_LOCK_SOURCE_TEXT (   jsdc)    ((void)0)

Definition at line 829 of file jsd.h.

#define JSD_LOCK_THREADSTATES (   jsdc)    ((void)0)

Definition at line 838 of file jsd.h.

Definition at line 100 of file jsd.h.

Definition at line 101 of file jsd.h.

#define JSD_OBJECTS_LOCKED (   jsdc)    1

Definition at line 863 of file jsd.h.

#define JSD_OBJECTS_UNLOCKED (   jsdc)    1

Definition at line 868 of file jsd.h.

#define JSD_SCRIPTS_LOCKED (   jsdc)    1

Definition at line 860 of file jsd.h.

#define JSD_SCRIPTS_UNLOCKED (   jsdc)    1

Definition at line 865 of file jsd.h.

#define JSD_SOURCE_TEXT_LOCKED (   jsdc)    1

Definition at line 861 of file jsd.h.

#define JSD_SOURCE_TEXT_UNLOCKED (   jsdc)    1

Definition at line 866 of file jsd.h.

#define JSD_THREADSTATES_LOCKED (   jsdc)    1

Definition at line 864 of file jsd.h.

#define JSD_THREADSTATES_UNLOCKED (   jsdc)    1

Definition at line 869 of file jsd.h.

#define JSD_UNLOCK ( )    ((void)0)

Definition at line 822 of file jsd.h.

#define JSD_UNLOCK_ATOMS (   jsdc)    ((void)0)

Definition at line 833 of file jsd.h.

#define JSD_UNLOCK_OBJECTS (   jsdc)    ((void)0)

Definition at line 836 of file jsd.h.

#define JSD_UNLOCK_SCRIPTS (   jsdc)    ((void)0)

Definition at line 827 of file jsd.h.

#define JSD_UNLOCK_SOURCE_TEXT (   jsdc)    ((void)0)

Definition at line 830 of file jsd.h.

#define JSD_UNLOCK_THREADSTATES (   jsdc)    ((void)0)

Definition at line 839 of file jsd.h.

#define SET_BIT_FLAG (   f,
  b 
)    ((f)|=(b))

Definition at line 108 of file jsd.h.

Definition at line 244 of file jsd.h.


Typedef Documentation

typedef struct JSDAtom

Definition at line 125 of file jsd.h.

typedef struct JSDExecHook

Definition at line 124 of file jsd.h.

typedef struct JSDProfileData

Definition at line 126 of file jsd.h.


Function Documentation

JSDAtom* jsd_AddAtom ( JSDContext jsdc,
const char *  str 
)

Definition at line 121 of file jsd_atom.c.

{
    JSDAtom* atom;

    if(!str)
    {
        JS_ASSERT(0);
        return NULL;
    }

    JSD_LOCK_ATOMS(jsdc);
    
    atom = (JSDAtom*) JS_HashTableLookup(jsdc->atoms, str);

    if( atom )
        atom->refcount++;
    else
    {
        atom = (JSDAtom*) malloc(sizeof(JSDAtom));
        if( atom )
        {
            atom->str = strdup(str);
            atom->refcount = 1;
            if(!JS_HashTableAdd(jsdc->atoms, atom->str, atom))
            {
                free(atom->str);
                free(atom);
                atom = NULL;
            }
        }
    }

    JSD_UNLOCK_ATOMS(jsdc);
    return atom;
}        

Here is the call graph for this function:

Here is the caller graph for this function:

JSBool jsd_AddFullSourceText ( JSDContext jsdc,
const char *  text,
size_t  length,
const char *  url 
)

Definition at line 499 of file jsd_text.c.

{
    JSDSourceText* jsdsrc;

    JSD_LOCK_SOURCE_TEXT(jsdc);

    jsdsrc = jsd_NewSourceText(jsdc, url);
    if( jsdsrc )
        jsdsrc = jsd_AppendSourceText(jsdc, jsdsrc,
                                      text, length, JSD_SOURCE_PARTIAL );
    if( jsdsrc )
        jsdsrc = jsd_AppendSourceText(jsdc, jsdsrc,
                                      NULL, 0, JSD_SOURCE_COMPLETED );

    JSD_UNLOCK_SOURCE_TEXT(jsdc);

    return jsdsrc ? JS_TRUE : JS_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSDSourceText* jsd_AppendSourceText ( JSDContext jsdc,
JSDSourceText jsdsrc,
const char *  text,
size_t  length,
JSDSourceStatus  status 
)

Definition at line 417 of file jsd_text.c.

{
    JSD_LOCK_SOURCE_TEXT(jsdc);

    if( jsdsrc->doingEval )
    {
        JSD_UNLOCK_SOURCE_TEXT(jsdc);
        return NULL;
    }

    if( ! _isSourceInSourceList( jsdc, jsdsrc ) )
    {
        _removeSourceFromRemovedList( jsdc, jsdsrc );
        JSD_UNLOCK_SOURCE_TEXT(jsdc);
        return NULL;
    }

    if( text && length && ! _appendText( jsdc, jsdsrc, text, length ) )
    {
        jsdsrc->dirty  = JS_TRUE;
        jsdsrc->alterCount  = jsdc->sourceAlterCount++ ;
        jsdsrc->status = JSD_SOURCE_FAILED;
        _moveSourceToRemovedList(jsdc, jsdsrc);
        JSD_UNLOCK_SOURCE_TEXT(jsdc);
        return NULL;    
    }

    jsdsrc->dirty  = JS_TRUE;
    jsdsrc->alterCount  = jsdc->sourceAlterCount++ ;
    jsdsrc->status = status;
    DEBUG_ITERATE_SOURCES(jsdc);
    JSD_UNLOCK_SOURCE_TEXT(jsdc);
    return jsdsrc;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSDSourceText* jsd_AppendUCSourceText ( JSDContext jsdc,
JSDSourceText jsdsrc,
const jschar text,
size_t  length,
JSDSourceStatus  status 
)

Definition at line 457 of file jsd_text.c.

{
#define UNICODE_TRUNCATE_BUF_SIZE 1024
    static char* buf = NULL;
    int remaining = length;

    if(!text || !length)
        return jsd_AppendSourceText(jsdc, jsdsrc, NULL, 0, status);

    JSD_LOCK_SOURCE_TEXT(jsdc);
    if(!buf)
    {
        buf = malloc(UNICODE_TRUNCATE_BUF_SIZE);
        if(!buf)
        {
            JSD_UNLOCK_SOURCE_TEXT(jsdc);
            return NULL;
        }
    }
    while(remaining && jsdsrc) {
        int bytes = JS_MIN(remaining, UNICODE_TRUNCATE_BUF_SIZE);
        int i;
        for(i = 0; i < bytes; i++)
            buf[i] = (const char) *(text++);
        jsdsrc = jsd_AppendSourceText(jsdc,jsdsrc,
                                      buf, bytes,
                                      JSD_SOURCE_PARTIAL);
        remaining -= bytes;
    }
    if(jsdsrc && status != JSD_SOURCE_PARTIAL)
        jsdsrc = jsd_AppendSourceText(jsdc, jsdsrc, NULL, 0, status);

    JSD_UNLOCK_SOURCE_TEXT(jsdc);
    return jsdsrc;
}

Here is the call graph for this function:

Here is the caller graph for this function:

const char* jsd_BuildNormalizedURL ( const char *  url_string)

Definition at line 217 of file jsd_text.c.

{
    char *new_url_string;

    if( ! url_string )
        return NULL;

    if (!strncasecomp(url_string, file_url_prefix, FILE_URL_PREFIX_LEN) &&
        url_string[FILE_URL_PREFIX_LEN + 0] == '/' &&
        url_string[FILE_URL_PREFIX_LEN + 1] == '/') {
        new_url_string = JS_smprintf("%s%s",
                                     file_url_prefix,
                                     url_string + FILE_URL_PREFIX_LEN + 2);
    } else {
        new_url_string = strdup(url_string);
    }
    return new_url_string;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSBool jsd_CallCallHook ( JSDContext jsdc,
JSContext cx,
uintN  type,
JSD_CallHookProc  hook,
void hookData 
)

Definition at line 205 of file jsd_hook.c.

{
    JSBool hookanswer;
    JSDThreadState*  jsdthreadstate;
    
    hookanswer = JS_FALSE;
    if(hook && NULL != (jsdthreadstate = jsd_NewThreadState(jsdc, cx)))
    {
        hookanswer = hook(jsdc, jsdthreadstate, type, hookData);
        jsd_DestroyThreadState(jsdc, jsdthreadstate);
    }

    return hookanswer;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSTrapStatus jsd_CallExecutionHook ( JSDContext jsdc,
JSContext cx,
uintN  type,
JSD_ExecutionHookProc  hook,
void hookData,
jsval rval 
)

Definition at line 153 of file jsd_hook.c.

{
    uintN hookanswer = JSD_HOOK_THROW == type ? 
                            JSD_HOOK_RETURN_CONTINUE_THROW :
                            JSD_HOOK_RETURN_CONTINUE;
    JSDThreadState* jsdthreadstate;

    if(hook && NULL != (jsdthreadstate = jsd_NewThreadState(jsdc,cx)))
    {
        if ((type != JSD_HOOK_THROW && type != JSD_HOOK_INTERRUPTED) ||
            jsdc->flags & JSD_MASK_TOP_FRAME_ONLY ||
            !(jsdthreadstate->flags & TS_HAS_DISABLED_FRAME))
        {
            /*
             * if it's not a throw and it's not an interrupt,
             * or we're only masking the top frame,
             * or there are no disabled frames in this stack,
             * then call out.
             */
             hookanswer = hook(jsdc, jsdthreadstate, type, hookData, rval);
             jsd_DestroyThreadState(jsdc, jsdthreadstate);
        }
    }

    switch(hookanswer)
    {
        case JSD_HOOK_RETURN_ABORT:
        case JSD_HOOK_RETURN_HOOK_ERROR:
            return JSTRAP_ERROR;
        case JSD_HOOK_RETURN_RET_WITH_VAL:
            return JSTRAP_RETURN;
        case JSD_HOOK_RETURN_THROW_WITH_VAL:
            return JSTRAP_THROW;
        case JSD_HOOK_RETURN_CONTINUE:
            break;
        case JSD_HOOK_RETURN_CONTINUE_THROW:
            /* only makes sense for jsd_ThrowHandler (which init'd rval) */
            JS_ASSERT(JSD_HOOK_THROW == type);
            return JSTRAP_THROW;
        default:
            JS_ASSERT(0);
            break;
    }
    return JSTRAP_CONTINUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 836 of file jsd_scpt.c.

{
    JSDScript* jsdscript;
    JSDScript* iterp = NULL;

    JSD_LOCK();
    while( NULL != (jsdscript = jsd_IterateScripts(jsdc, &iterp)) )
        jsd_ClearAllExecutionHooksForScript(jsdc, jsdscript);
    JSD_UNLOCK();
    return JS_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 816 of file jsd_scpt.c.

{
    JSDExecHook* jsdhook;
    JSCList* list = &jsdscript->hooks;

    JSD_LOCK();

    while( (JSDExecHook*)list != (jsdhook = (JSDExecHook*)list->next) )
    {
        JS_REMOVE_LINK(&jsdhook->links);
        free(jsdhook);
    }

    JS_ClearScriptTraps(jsdc->dumbContext, jsdscript->script);
    JSD_UNLOCK();

    return JS_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 284 of file jsd_high.c.

{
    JSDScript *current;
    
    JSD_LOCK_SCRIPTS(jsdc);
    current = (JSDScript *)jsdc->scripts.next;
    while (current != (JSDScript *)&jsdc->scripts)
    {
        jsd_ClearScriptProfileData(jsdc, current);
        current = (JSDScript *)current->links.next;
    }

    JSD_UNLOCK_SCRIPTS(jsdc);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 263 of file jsd_hook.c.

{
    JSD_LOCK();
    jsdc->debugBreakHook      = NULL;
    JSD_UNLOCK();

    return JS_TRUE;
}

Here is the caller graph for this function:

Definition at line 286 of file jsd_hook.c.

{
    JSD_LOCK();
    jsdc->debuggerHook      = NULL;
    JSD_UNLOCK();

    return JS_TRUE;
}

Here is the caller graph for this function:

JSBool jsd_ClearExecutionHook ( JSDContext jsdc,
JSDScript jsdscript,
jsuword  pc 
)

Definition at line 789 of file jsd_scpt.c.

{
    JSDExecHook* jsdhook;

    JSD_LOCK();

    jsdhook = _findHook(jsdc, jsdscript, pc);
    if( ! jsdhook )
    {
        JS_ASSERT(0);
        JSD_UNLOCK();
        return JS_FALSE;
    }

    JS_ClearTrap(jsdc->dumbContext, jsdscript->script, 
                 (jsbytecode*)pc, NULL, NULL );

    JS_REMOVE_LINK(&jsdhook->links);
    free(jsdhook);

    JSD_UNLOCK();
    return JS_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 332 of file jsd_hook.c.

{
    JSD_LOCK();
    jsdc->functionHook      = NULL;
    JSD_UNLOCK();

    return JS_TRUE;
}

Here is the caller graph for this function:

Definition at line 239 of file jsd_hook.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 384 of file jsd_scpt.c.

{
    if (script->profileData)
    {
        free(script->profileData);
        script->profileData = NULL;
    }
}    

Here is the caller graph for this function:

void jsd_ClearSourceText ( JSDContext jsdc,
JSDSourceText jsdsrc 
)

Definition at line 306 of file jsd_text.c.

{
    if( JSD_SOURCE_INITED  != jsdsrc->status &&
        JSD_SOURCE_PARTIAL != jsdsrc->status )
    {
        _clearText(jsdc, jsdsrc);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 309 of file jsd_hook.c.

{
    JSD_LOCK();
    jsdc->throwHook      = NULL;
    JSD_UNLOCK();

    return JS_TRUE;
}

Here is the caller graph for this function:

Definition at line 355 of file jsd_hook.c.

{
    JSD_LOCK();
    jsdc->toplevelHook      = NULL;
    JSD_UNLOCK();

    return JS_TRUE;
}

Here is the caller graph for this function:

JSDAtom* jsd_CloneAtom ( JSDContext jsdc,
JSDAtom atom 
)

Definition at line 158 of file jsd_atom.c.

{
    JSD_LOCK_ATOMS(jsdc);
    atom->refcount++;
    JSD_UNLOCK_ATOMS(jsdc);
    return atom;
}        
void jsd_Constructing ( JSDContext jsdc,
JSContext cx,
JSObject obj,
JSStackFrame fp 
)

Definition at line 187 of file jsd_obj.c.

{
    JSDObject* jsdobj;
    JSScript* script;
    JSDScript* jsdscript;
    const char* ctorURL;
    const char* ctorName;

    JSD_LOCK_OBJECTS(jsdc);
    jsdobj = jsd_GetJSDObjectForJSObject(jsdc, obj);
    if( jsdobj && !jsdobj->ctorURL && !JS_IsNativeFrame(cx, fp) )
    {
        script = JS_GetFrameScript(cx, fp);
        if( script )
        {
            ctorURL = JS_GetScriptFilename(cx, script);
            if( ctorURL )
                jsdobj->ctorURL = jsd_AddAtom(jsdc, ctorURL);

            JSD_LOCK_SCRIPTS(jsdc);
            jsdscript = jsd_FindJSDScript(jsdc, script);
            JSD_UNLOCK_SCRIPTS(jsdc);
            if( jsdscript )
            {
                ctorName = jsd_GetScriptFunctionName(jsdc, jsdscript);
                if( ctorName )
                    jsdobj->ctorName = jsd_AddAtom(jsdc, ctorName);
            }
            jsdobj->ctorLineno = JS_GetScriptBaseLineNumber(cx, script);
        }
    }
    TRACEOBJ(jsdc, jsdobj, 3);
    JSD_UNLOCK_OBJECTS(jsdc);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 98 of file jsd_atom.c.

{
    jsdc->atoms = JS_NewHashTable(256, JS_HashString,
                                  _compareAtomKeys, _compareAtoms,
                                  NULL, NULL);
#ifdef TEST_ATOMS
    _testAtoms(jsdc);
#endif    
    return (JSBool) jsdc->atoms;
}

Here is the call graph for this function:

Here is the caller graph for this function:

jsd_DebugErrorHook ( JSContext cx,
const char *  message,
JSErrorReport report,
void closure 
)

Definition at line 322 of file jsd_high.c.

{
    JSDContext* jsdc = (JSDContext*) closure;
    JSD_ErrorReporter errorReporter;
    void*             errorReporterData;
    
    if( ! jsdc )
    {
        JS_ASSERT(0);
        return JS_TRUE;
    }
    if( JSD_IS_DANGEROUS_THREAD(jsdc) )
        return JS_TRUE;

    /* local in case hook gets cleared on another thread */
    JSD_LOCK();
    errorReporter     = jsdc->errorReporter;
    errorReporterData = jsdc->errorReporterData;
    JSD_UNLOCK();

    if(!errorReporter)
        return JS_TRUE;

    switch(errorReporter(jsdc, cx, message, report, errorReporterData))
    {
        case JSD_ERROR_REPORTER_PASS_ALONG:
            return JS_TRUE;
        case JSD_ERROR_REPORTER_RETURN:
            return JS_FALSE;
        case JSD_ERROR_REPORTER_DEBUG:
        {
            jsval rval;
            JSD_ExecutionHookProc   hook;
            void*                   hookData;

            /* local in case hook gets cleared on another thread */
            JSD_LOCK();
            hook = jsdc->debugBreakHook;
            hookData = jsdc->debugBreakHookData;
            JSD_UNLOCK();

            jsd_CallExecutionHook(jsdc, cx, JSD_HOOK_DEBUG_REQUESTED,
                                  hook, hookData, &rval);
            /* XXX Should make this dependent on ExecutionHook retval */
            return JS_TRUE;
        }
        case JSD_ERROR_REPORTER_CLEAR_RETURN:
            if(report && JSREPORT_IS_EXCEPTION(report->flags))
                JS_ClearPendingException(cx);
            return JS_FALSE;
        default:
            JS_ASSERT(0);
            break;
    }
    return JS_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSTrapStatus JS_DLL_CALLBACK jsd_DebuggerHandler ( JSContext cx,
JSScript script,
jsbytecode pc,
jsval rval,
void closure 
)

Definition at line 84 of file jsd_hook.c.

{
    JSDScript*      jsdscript;
    JSDContext*     jsdc = (JSDContext*) closure;
    JSD_ExecutionHookProc hook;
    void*                 hookData;

    if( ! jsdc || ! jsdc->inited )
        return JSTRAP_CONTINUE;

    if( JSD_IS_DANGEROUS_THREAD(jsdc) )
        return JSTRAP_CONTINUE;

    /* local in case jsdc->debuggerHook gets cleared on another thread */
    JSD_LOCK();
    hook     = jsdc->debuggerHook;
    hookData = jsdc->debuggerHookData;
    JSD_UNLOCK();
    if(!hook)
        return JSTRAP_CONTINUE;

    JSD_LOCK_SCRIPTS(jsdc);
    jsdscript = jsd_FindJSDScript(jsdc, script);
    JSD_UNLOCK_SCRIPTS(jsdc);
    if( ! jsdscript )
        return JSTRAP_CONTINUE;

    return jsd_CallExecutionHook(jsdc, cx, JSD_HOOK_DEBUGGER_KEYWORD,
                                 hook, hookData, rval);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 226 of file jsd_high.c.

{
    /* clear hooks here */
    JS_SetNewScriptHookProc(jsdc->jsrt, NULL, NULL);
    JS_SetDestroyScriptHookProc(jsdc->jsrt, NULL, NULL);
    JS_SetDebuggerHandler(jsdc->jsrt, NULL, NULL);
    JS_SetExecuteHook(jsdc->jsrt, NULL, NULL);
    JS_SetCallHook(jsdc->jsrt, NULL, NULL);
    JS_SetObjectHook(jsdc->jsrt, NULL, NULL);
    JS_SetThrowHook(jsdc->jsrt, NULL, NULL);
    JS_SetDebugErrorHook(jsdc->jsrt, NULL, NULL);
#ifdef LIVEWIRE
    LWDBG_SetNewScriptHookProc(NULL,NULL);
#endif

    /* clean up */
    JSD_LockScriptSubsystem(jsdc);
    jsd_DestroyScriptManager(jsdc);
    JSD_UnlockScriptSubsystem(jsdc);
    jsd_DestroyAllSources(jsdc);
    
    _destroyJSDContext(jsdc);

    if( jsdc->userCallbacks.setContext )
        jsdc->userCallbacks.setContext(NULL, jsdc->user);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 218 of file jsd_high.c.

Here is the call graph for this function:

Here is the caller graph for this function:

JSDContext* jsd_DebuggerOnForUser ( JSRuntime jsrt,
JSD_UserCallbacks callbacks,
void user 
)

Definition at line 189 of file jsd_high.c.

{
    JSDContext* jsdc;
    JSContext* iter = NULL;

    jsdc = _newJSDContext(jsrt, callbacks, user);
    if( ! jsdc )
        return NULL;

    /* set hooks here */
    JS_SetNewScriptHookProc(jsdc->jsrt, jsd_NewScriptHookProc, jsdc);
    JS_SetDestroyScriptHookProc(jsdc->jsrt, jsd_DestroyScriptHookProc, jsdc);
    JS_SetDebuggerHandler(jsdc->jsrt, jsd_DebuggerHandler, jsdc);
    JS_SetExecuteHook(jsdc->jsrt, jsd_TopLevelCallHook, jsdc);
    JS_SetCallHook(jsdc->jsrt, jsd_FunctionCallHook, jsdc);
    JS_SetObjectHook(jsdc->jsrt, jsd_ObjectHook, jsdc);
    JS_SetThrowHook(jsdc->jsrt, jsd_ThrowHandler, jsdc);
    JS_SetDebugErrorHook(jsdc->jsrt, jsd_DebugErrorHook, jsdc);
#ifdef LIVEWIRE
    LWDBG_SetNewScriptHookProc(jsd_NewScriptHookProc, jsdc);
#endif
    if( jsdc->userCallbacks.setContext )
        jsdc->userCallbacks.setContext(jsdc, jsdc->user);
    return jsdc;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 239 of file jsd_text.c.

{
    JSDSourceText *jsdsrc;
    JSDSourceText *next;

    for( jsdsrc = (JSDSourceText*)jsdc->sources.next;
         jsdsrc != (JSDSourceText*)&jsdc->sources;
         jsdsrc = next ) 
    {
        next = (JSDSourceText*)jsdsrc->links.next;
        _removeSource( jsdc, jsdsrc );
    }

    for( jsdsrc = (JSDSourceText*)jsdc->removedSources.next;
         jsdsrc != (JSDSourceText*)&jsdc->removedSources;
         jsdsrc = next ) 
    {
        next = (JSDSourceText*)jsdsrc->links.next;
        _removeSourceFromRemovedList( jsdc, jsdsrc );
    }

}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 110 of file jsd_atom.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 240 of file jsd_obj.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void JS_DLL_CALLBACK jsd_DestroyScriptHookProc ( JSContext cx,
JSScript script,
void callerdata 
)

Definition at line 593 of file jsd_scpt.c.

{
    JSDScript* jsdscript = NULL;
    JSDContext* jsdc = (JSDContext*) callerdata;
    JSD_ScriptHookProc      hook;
    void*                   hookData;
    
    JSD_ASSERT_VALID_CONTEXT(jsdc);

    if( JSD_IS_DANGEROUS_THREAD(jsdc) )
        return;
    
    JSD_LOCK_SCRIPTS(jsdc);
    jsdscript = jsd_FindJSDScript(jsdc, script);
    JSD_UNLOCK_SCRIPTS(jsdc);

    if( ! jsdscript )
        return;

#ifdef JSD_DUMP
    JSD_LOCK_SCRIPTS(jsdc);
    _dumpJSDScript(jsdc, jsdscript, "***DESTROY Script: ");
    JSD_UNLOCK_SCRIPTS(jsdc);
#endif /* JSD_DUMP */

    /* local in case hook gets cleared on another thread */
    JSD_LOCK();
    hook = jsdc->scriptHook;
    hookData = jsdc->scriptHookData;
    JSD_UNLOCK();

    if( hook )
        hook(jsdc, jsdscript, JS_FALSE, hookData);

    JSD_LOCK_SCRIPTS(jsdc);
    JS_HashTableRemove(jsdc->scriptsTable, (void *)script);
    JSD_UNLOCK_SCRIPTS(jsdc);

#ifdef JSD_DUMP
    JSD_LOCK_SCRIPTS(jsdc);
    _dumpJSDScriptList(jsdc);
    JSD_UNLOCK_SCRIPTS(jsdc);
#endif /* JSD_DUMP */
}                

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 274 of file jsd_scpt.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void jsd_DestroyThreadState ( JSDContext jsdc,
JSDThreadState jsdthreadstate 
)

Definition at line 170 of file jsd_stak.c.

{
    JSDStackFrameInfo* jsdframe;
    JSCList* list;

    JS_ASSERT(jsdthreadstate);
    JS_ASSERT(JSD_CURRENT_THREAD() == jsdthreadstate->thread);

    JSD_LOCK_THREADSTATES(jsdc);
    JS_REMOVE_LINK(&jsdthreadstate->links);
    JSD_UNLOCK_THREADSTATES(jsdc);

    list = &jsdthreadstate->stack;
    while( (JSDStackFrameInfo*)list != (jsdframe = (JSDStackFrameInfo*)list->next) )
    {
        JS_REMOVE_LINK(&jsdframe->links);
        _destroyFrame(jsdframe);
    }
    free(jsdthreadstate);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void jsd_DropAtom ( JSDContext jsdc,
JSDAtom atom 
)

Definition at line 167 of file jsd_atom.c.

{
    JSD_LOCK_ATOMS(jsdc);
    if(! --atom->refcount)
    {
        JS_HashTableRemove(jsdc->atoms, atom->str);
        free(atom->str);
        free(atom);
    }
    JSD_UNLOCK_ATOMS(jsdc);
}        

Here is the call graph for this function:

Here is the caller graph for this function:

void jsd_DropProperty ( JSDContext jsdc,
JSDProperty jsdprop 
)

Definition at line 619 of file jsd_val.c.

{
    JS_ASSERT(jsdprop->nref > 0);
    if(0 == --jsdprop->nref)
    {
        JS_ASSERT(JS_CLIST_IS_EMPTY(&jsdprop->links));
        DROP_CLEAR_VALUE(jsdc, jsdprop->val);
        DROP_CLEAR_VALUE(jsdc, jsdprop->name);
        DROP_CLEAR_VALUE(jsdc, jsdprop->alias);
        free(jsdprop);
    }
}

Here is the caller graph for this function:

void jsd_DropValue ( JSDContext jsdc,
JSDValue jsdval 
)

Definition at line 269 of file jsd_val.c.

{
    JS_ASSERT(jsdval->nref > 0);
    if(0 == --jsdval->nref)
    {
        jsd_RefreshValue(jsdc, jsdval);
        if(JSVAL_IS_GCTHING(jsdval->val))
            JS_RemoveRoot(jsdc->dumbContext, &jsdval->val);
        free(jsdval);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSBool jsd_EvaluateScriptInStackFrame ( JSDContext jsdc,
JSDThreadState jsdthreadstate,
JSDStackFrameInfo jsdframe,
const char *  bytes,
uintN  length,
const char *  filename,
uintN  lineno,
JSBool  eatExceptions,
jsval rval 
)

Definition at line 465 of file jsd_stak.c.

{
    JSBool retval;
    JSBool valid;
    JSExceptionState* exceptionState = NULL;
    JSContext *cx;

    JS_ASSERT(JSD_CURRENT_THREAD() == jsdthreadstate->thread);

    JSD_LOCK_THREADSTATES(jsdc);
    valid = jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe);
    JSD_UNLOCK_THREADSTATES(jsdc);

    if (!valid)
        return JS_FALSE;

    cx = jsdthreadstate->context;
    JS_ASSERT(cx);

    if (eatExceptions)
        exceptionState = JS_SaveExceptionState(cx);
    JS_ClearPendingException(cx);
    jsd_StartingEvalUsingFilename(jsdc, filename);
    retval = JS_EvaluateInStackFrame(cx, jsdframe->fp, bytes, length,
                                     filename, lineno, rval);
    jsd_FinishedEvalUsingFilename(jsdc, filename);
    if (eatExceptions)
        JS_RestoreExceptionState(cx, exceptionState);

    return retval;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSBool jsd_EvaluateUCScriptInStackFrame ( JSDContext jsdc,
JSDThreadState jsdthreadstate,
JSDStackFrameInfo jsdframe,
const jschar bytes,
uintN  length,
const char *  filename,
uintN  lineno,
JSBool  eatExceptions,
jsval rval 
)

Definition at line 427 of file jsd_stak.c.

{
    JSBool retval;
    JSBool valid;
    JSExceptionState* exceptionState = NULL;
    JSContext* cx;

    JS_ASSERT(JSD_CURRENT_THREAD() == jsdthreadstate->thread);

    JSD_LOCK_THREADSTATES(jsdc);
    valid = jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe);
    JSD_UNLOCK_THREADSTATES(jsdc);

    if( ! valid )
        return JS_FALSE;

    cx = jsdthreadstate->context;
    JS_ASSERT(cx);

    if (eatExceptions)
        exceptionState = JS_SaveExceptionState(cx);
    JS_ClearPendingException(cx);
    jsd_StartingEvalUsingFilename(jsdc, filename);
    retval = JS_EvaluateUCInStackFrame(cx, jsdframe->fp, bytes, length, 
                                       filename, lineno, rval);
    jsd_FinishedEvalUsingFilename(jsdc, filename);
    if (eatExceptions)
        JS_RestoreExceptionState(cx, exceptionState);

    return retval;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSDScript* jsd_FindJSDScript ( JSDContext jsdc,
JSScript script 
)

Definition at line 283 of file jsd_scpt.c.

{
    JS_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
    return (JSDScript*) JS_HashTableLookup(jsdc->scriptsTable, (void *)script);
}               

Here is the call graph for this function:

Here is the caller graph for this function:

JSDSourceText* jsd_FindSourceForURL ( JSDContext jsdc,
const char *  url 
)

Definition at line 276 of file jsd_text.c.

{
    JSDSourceText *jsdsrc;

    for( jsdsrc = (JSDSourceText *)jsdc->sources.next;
         jsdsrc != (JSDSourceText *)&jsdc->sources;
         jsdsrc = (JSDSourceText *)jsdsrc->links.next )
    {
        if( 0 == strcmp(jsdsrc->url, url) )
            return jsdsrc;
    }
    return NULL;
}

Here is the caller graph for this function:

void jsd_FinishedEvalUsingFilename ( JSDContext jsdc,
const char *  url 
)

Definition at line 544 of file jsd_text.c.

{
    JSDSourceText* jsdsrc;

    /* NOTE: We ASSUME it is locked! */

    jsdsrc = jsd_FindSourceForURL(jsdc, url);
    if(jsdsrc)
    {
#if 0
#ifndef JSD_LOWLEVEL_SOURCE
        /*
        * when using this low level source addition, this jsdsrc might 
        * not have existed before the eval, but does exist now (without
        * this flag set!)
        */
        JS_ASSERT(jsdsrc->doingEval);
#endif
#endif
        jsdsrc->doingEval = JS_FALSE;
    }

    JSD_UNLOCK_SOURCE_TEXT(jsdc);
}    

Here is the call graph for this function:

Here is the caller graph for this function:

void* JS_DLL_CALLBACK jsd_FunctionCallHook ( JSContext cx,
JSStackFrame fp,
JSBool  before,
JSBool ok,
void closure 
)

Definition at line 270 of file jsd_step.c.

{
    JSDContext*       jsdc;
    JSD_CallHookProc  hook;
    void*             hookData;

    jsdc = (JSDContext*) closure;
    
    /* local in case jsdc->functionHook gets cleared on another thread */
    JSD_LOCK();
    hook     = jsdc->functionHook;
    hookData = jsdc->functionHookData;
    JSD_UNLOCK();
    
    if (_callHook (jsdc, cx, fp, before,
                   (before) ? JSD_HOOK_FUNCTION_CALL : JSD_HOOK_FUNCTION_RETURN,
                   hook, hookData))
    {
        return closure;
    }
    
    return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSDStackFrameInfo* jsd_GetCallingStackFrame ( JSDContext jsdc,
JSDThreadState jsdthreadstate,
JSDStackFrameInfo jsdframe 
)

Definition at line 234 of file jsd_stak.c.

{
    JSDStackFrameInfo* nextjsdframe = NULL;

    JSD_LOCK_THREADSTATES(jsdc);

    if( jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe) )
        if( JS_LIST_HEAD(&jsdframe->links) != &jsdframe->jsdthreadstate->stack )
            nextjsdframe = (JSDStackFrameInfo*) JS_LIST_HEAD(&jsdframe->links);

    JSD_UNLOCK_THREADSTATES(jsdc);

    return nextjsdframe;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSDValue* jsd_GetCallObjectForStackFrame ( JSDContext jsdc,
JSDThreadState jsdthreadstate,
JSDStackFrameInfo jsdframe 
)

Definition at line 286 of file jsd_stak.c.

{
    JSObject* obj;
    JSDValue* jsdval = NULL;

    JSD_LOCK_THREADSTATES(jsdc);

    if( jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe) )
    {
        obj = JS_GetFrameCallObject(jsdthreadstate->context, jsdframe->fp); 
        if(obj)                                                             
            jsdval = JSD_NewValue(jsdc, OBJECT_TO_JSVAL(obj));              
    }

    JSD_UNLOCK_THREADSTATES(jsdc);

    return jsdval;
}

Here is the call graph for this function:

Here is the caller graph for this function:

uintN jsd_GetClosestLine ( JSDContext jsdc,
JSDScript jsdscript,
jsuword  pc 
)

Definition at line 497 of file jsd_scpt.c.

{
    uintN first = jsdscript->lineBase;
    uintN last = first + jsd_GetScriptLineExtent(jsdc, jsdscript) - 1;
    uintN line = JS_PCToLineNumber(jsdc->dumbContext, 
                                     jsdscript->script, (jsbytecode*)pc);

    if( line < first )
        return first;
    if( line > last )
        return last;

#ifdef LIVEWIRE
    if( jsdscript && jsdscript->lwscript )
    {
        uintN newline;
        jsdlw_ProcessedToRawLineNumber(jsdc, jsdscript, line, &newline);
        line = newline;
    }
#endif

    return line;    
}

Here is the call graph for this function:

Here is the caller graph for this function:

jsuword jsd_GetClosestPC ( JSDContext jsdc,
JSDScript jsdscript,
uintN  line 
)

Definition at line 480 of file jsd_scpt.c.

{
#ifdef LIVEWIRE
    if( jsdscript && jsdscript->lwscript )
    {
        uintN newline;
        jsdlw_RawToProcessedLineNumber(jsdc, jsdscript, line, &newline);
        if( line != newline )
            line = newline;
    }
#endif

    return (jsuword) JS_LineNumberToPC(jsdc->dumbContext, 
                                       jsdscript->script, line );
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 278 of file jsd_high.c.

{
    return jsdc->data;
}

Here is the caller graph for this function:

uintN jsd_GetCountOfProperties ( JSDContext jsdc,
JSDValue jsdval 
)

Definition at line 389 of file jsd_val.c.

{
    JSDProperty* jsdprop;
    uintN count = 0;

    if(!(CHECK_BIT_FLAG(jsdval->flags, GOT_PROPS)))
        if(!_buildProps(jsdc, jsdval))
            return 0;

    for(jsdprop = (JSDProperty*)jsdval->props.next;
        jsdprop != (JSDProperty*)&jsdval->props;
        jsdprop = (JSDProperty*)jsdprop->links.next)
    {
        count++;
    }
    return count;
}

Here is the call graph for this function:

Here is the caller graph for this function:

uintN jsd_GetCountOfStackFrames ( JSDContext jsdc,
JSDThreadState jsdthreadstate 
)

Definition at line 192 of file jsd_stak.c.

{
    uintN count = 0;

    JSD_LOCK_THREADSTATES(jsdc);

    if( jsd_IsValidThreadState(jsdc, jsdthreadstate) )
        count = jsdthreadstate->stackDepth;

    JSD_UNLOCK_THREADSTATES(jsdc);

    return count;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSBool jsd_GetErrorReporter ( JSDContext jsdc,
JSD_ErrorReporter *  reporter,
void **  callerdata 
)

Definition at line 393 of file jsd_high.c.

Here is the caller graph for this function:

JSDValue* jsd_GetException ( JSDContext jsdc,
JSDThreadState jsdthreadstate 
)

Definition at line 579 of file jsd_stak.c.

{
    JSContext* cx;
    jsval val;

    if(!(cx = _getContextForThreadState(jsdc, jsdthreadstate)))
        return NULL;

    if(JS_GetPendingException(cx, &val))
        return jsd_NewValue(jsdc, val);
    return NULL;
}        

Here is the call graph for this function:

Here is the caller graph for this function:

JSContext* jsd_GetJSContext ( JSDContext jsdc,
JSDThreadState jsdthreadstate 
)

Definition at line 221 of file jsd_stak.c.

{
    JSContext* cx = NULL;

    JSD_LOCK_THREADSTATES(jsdc);
    if( jsd_IsValidThreadState(jsdc, jsdthreadstate) )
        cx = jsdthreadstate->context;
    JSD_UNLOCK_THREADSTATES(jsdc);

    return cx;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 307 of file jsd_obj.c.

{
    JSDObject* jsdobj;

    JSD_LOCK_OBJECTS(jsdc);
    jsdobj = (JSDObject*) JS_HashTableLookup(jsdc->objectsTable, jsobj);
    JSD_UNLOCK_OBJECTS(jsdc);
    return jsdobj;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSFunction* jsd_GetJSFunction ( JSDContext jsdc,
JSDScript script 
)

Definition at line 400 of file jsd_scpt.c.

{
    return script->function;
}

Here is the caller graph for this function:

JSScript* jsd_GetJSScript ( JSDContext jsdc,
JSDScript script 
)

Definition at line 394 of file jsd_scpt.c.

{
    return script->script;
}

Here is the caller graph for this function:

const char* jsd_GetNameForStackFrame ( JSDContext jsdc,
JSDThreadState jsdthreadstate,
JSDStackFrameInfo jsdframe 
)

Definition at line 350 of file jsd_stak.c.

{
    const char *rv = NULL;
    
    JSD_LOCK_THREADSTATES(jsdc);
    
    if( jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe) )
    {
        JSFunction *fun = JS_GetFrameFunction (jsdthreadstate->context,
                                               jsdframe->fp);
        if (fun)
            rv = JS_GetFunctionName (fun);
    }
    
    JSD_UNLOCK_THREADSTATES(jsdc);
    return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 293 of file jsd_obj.c.

{
    return jsdobj->ctorLineno;
}

Here is the caller graph for this function:

const char* jsd_GetObjectConstructorName ( JSDContext jsdc,
JSDObject jsdobj 
)

Definition at line 299 of file jsd_obj.c.

{
    if( jsdobj->ctorName )
        return JSD_ATOM_TO_STRING(jsdobj->ctorName);
    return NULL;
}

Here is the caller graph for this function:

const char* jsd_GetObjectConstructorURL ( JSDContext jsdc,
JSDObject jsdobj 
)

Definition at line 285 of file jsd_obj.c.

{
    if( jsdobj->ctorURL )
        return JSD_ATOM_TO_STRING(jsdobj->ctorURL);
    return NULL;
}

Here is the caller graph for this function:

JSDObject* jsd_GetObjectForValue ( JSDContext jsdc,
JSDValue jsdval 
)

Definition at line 318 of file jsd_obj.c.

{
    return jsd_GetJSDObjectForJSObject(jsdc, JSVAL_TO_OBJECT(jsdval->val));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 279 of file jsd_obj.c.

{
    return jsdobj->newLineno;
}

Here is the caller graph for this function:

const char* jsd_GetObjectNewURL ( JSDContext jsdc,
JSDObject jsdobj 
)

Definition at line 271 of file jsd_obj.c.

{
    if( jsdobj->newURL )
        return JSD_ATOM_TO_STRING(jsdobj->newURL);
    return NULL;
}

Here is the caller graph for this function:

jsuword jsd_GetPCForStackFrame ( JSDContext jsdc,
JSDThreadState jsdthreadstate,
JSDStackFrameInfo jsdframe 
)

Definition at line 269 of file jsd_stak.c.

{
    jsuword pc = 0;

    JSD_LOCK_THREADSTATES(jsdc);

    if( jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe) )
        pc = jsdframe->pc;

    JSD_UNLOCK_THREADSTATES(jsdc);

    return pc;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSDValue* jsd_GetPropertyAlias ( JSDContext jsdc,
JSDProperty jsdprop 
)

Definition at line 599 of file jsd_val.c.

{
    if(jsdprop->alias)
        jsdprop->alias->nref++;
    return jsdprop->alias;
}

Here is the caller graph for this function:

uintN jsd_GetPropertyFlags ( JSDContext jsdc,
JSDProperty jsdprop 
)

Definition at line 607 of file jsd_val.c.

{
    return jsdprop->flags;
}

Here is the caller graph for this function:

JSDValue* jsd_GetPropertyName ( JSDContext jsdc,
JSDProperty jsdprop 
)

Definition at line 585 of file jsd_val.c.

{
    jsdprop->name->nref++;
    return jsdprop->name;
}

Here is the caller graph for this function:

JSDValue* jsd_GetPropertyValue ( JSDContext jsdc,
JSDProperty jsdprop 
)

Definition at line 592 of file jsd_val.c.

{
    jsdprop->val->nref++;
    return jsdprop->val;
}

Here is the caller graph for this function:

Definition at line 613 of file jsd_val.c.

{
    return jsdprop->slot;
}

Here is the caller graph for this function:

JSDValue* jsd_GetScopeChainForStackFrame ( JSDContext jsdc,
JSDThreadState jsdthreadstate,
JSDStackFrameInfo jsdframe 
)

Definition at line 308 of file jsd_stak.c.

{
    JSObject* obj;
    JSDValue* jsdval = NULL;

    JSD_LOCK_THREADSTATES(jsdc);

    if( jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe) )
    {
        obj = JS_GetFrameScopeChain(jsdthreadstate->context, jsdframe->fp); 
        if(obj)                                                             
            jsdval = JSD_NewValue(jsdc, OBJECT_TO_JSVAL(obj));              
    }

    JSD_UNLOCK_THREADSTATES(jsdc);

    return jsdval;
}

Here is the call graph for this function:

Here is the caller graph for this function:

uintN jsd_GetScriptBaseLineNumber ( JSDContext jsdc,
JSDScript jsdscript 
)

Definition at line 466 of file jsd_scpt.c.

{
    return jsdscript->lineBase;
}

Here is the caller graph for this function:

uintN jsd_GetScriptCallCount ( JSDContext jsdc,
JSDScript script 
)

Definition at line 312 of file jsd_scpt.c.

{
    if (script->profileData)
        return script->profileData->callCount;

    return 0;
}

Here is the caller graph for this function:

const char* jsd_GetScriptFilename ( JSDContext jsdc,
JSDScript jsdscript 
)

Definition at line 452 of file jsd_scpt.c.

{
    return jsdscript->url;
}

Here is the caller graph for this function:

uint32 jsd_GetScriptFlags ( JSDContext jsdc,
JSDScript script 
)

Definition at line 300 of file jsd_scpt.c.

{
    return script->flags;
}

Here is the caller graph for this function:

JSDScript* jsd_GetScriptForStackFrame ( JSDContext jsdc,
JSDThreadState jsdthreadstate,
JSDStackFrameInfo jsdframe 
)

Definition at line 252 of file jsd_stak.c.

{
    JSDScript* jsdscript = NULL;

    JSD_LOCK_THREADSTATES(jsdc);

    if( jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe) )
        jsdscript = jsdframe->jsdscript;

    JSD_UNLOCK_THREADSTATES(jsdc);

    return jsdscript;
}

Here is the call graph for this function:

Here is the caller graph for this function:

const char* jsd_GetScriptFunctionName ( JSDContext jsdc,
JSDScript jsdscript 
)

Definition at line 458 of file jsd_scpt.c.

{
    if( ! jsdscript->function )
        return NULL;
    return JS_GetFunctionName(jsdscript->function);
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSBool jsd_GetScriptHook ( JSDContext jsdc,
JSD_ScriptHookProc *  hook,
void **  callerdata 
)

Definition at line 532 of file jsd_scpt.c.

{
    JSD_LOCK();
    if( hook )
        *hook = jsdc->scriptHook;
    if( callerdata )
        *callerdata = jsdc->scriptHookData;
    JSD_UNLOCK();
    return JS_TRUE;
}    

Here is the caller graph for this function:

uintN jsd_GetScriptLineExtent ( JSDContext jsdc,
JSDScript jsdscript 
)

Definition at line 472 of file jsd_scpt.c.

{
    if( NOT_SET_YET == (int)jsdscript->lineExtent )
        jsdscript->lineExtent = JS_GetScriptLineExtent(jsdc->dumbContext, jsdscript->script);
    return jsdscript->lineExtent;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 339 of file jsd_scpt.c.

{
    if (script->profileData)
        return script->profileData->maxExecutionTime;

    return 0.0;
}

Here is the caller graph for this function:

Definition at line 366 of file jsd_scpt.c.

{
    if (script->profileData)
        return script->profileData->maxOwnExecutionTime;

    return 0.0;
}

Here is the caller graph for this function:

Definition at line 321 of file jsd_scpt.c.

{
    if (script->profileData)
        return script->profileData->maxRecurseDepth;

    return 0;
}

Here is the caller graph for this function:

Definition at line 330 of file jsd_scpt.c.

{
    if (script->profileData)
        return script->profileData->minExecutionTime;

    return 0.0;
}

Here is the caller graph for this function:

Definition at line 357 of file jsd_scpt.c.

{
    if (script->profileData)
        return script->profileData->minOwnExecutionTime;

    return 0.0;
}

Here is the caller graph for this function:

void* jsd_GetScriptPrivate ( JSDScript jsdscript)

Definition at line 429 of file jsd_scpt.c.

{
    return jsdscript->data;
}

Here is the caller graph for this function:

Definition at line 291 of file jsd_scpt.c.

{
    if (!script->profileData)
        script->profileData = (JSDProfileData*)calloc(1, sizeof(JSDProfileData));

    return script->profileData;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 348 of file jsd_scpt.c.

{
    if (script->profileData)
        return script->profileData->totalExecutionTime;

    return 0.0;
}

Here is the caller graph for this function:

Definition at line 375 of file jsd_scpt.c.

{
    if (script->profileData)
        return script->profileData->totalOwnExecutionTime;

    return 0.0;
}

Here is the caller graph for this function:

Definition at line 334 of file jsd_text.c.

{
    return jsdsrc->alterCount;
}

Here is the caller graph for this function:

Definition at line 316 of file jsd_text.c.

{
    return jsdsrc->status;
}

Here is the caller graph for this function:

JSBool jsd_GetSourceText ( JSDContext jsdc,
JSDSourceText jsdsrc,
const char **  ppBuf,
intN pLen 
)

Definition at line 297 of file jsd_text.c.

{
    *ppBuf = jsdsrc->text;
    *pLen  = jsdsrc->textLength;
    return JS_TRUE;
}

Here is the caller graph for this function:

const char* jsd_GetSourceURL ( JSDContext jsdc,
JSDSourceText jsdsrc 
)

Definition at line 291 of file jsd_text.c.

{
    return jsdsrc->url;
}

Here is the caller graph for this function:

JSDStackFrameInfo* jsd_GetStackFrame ( JSDContext jsdc,
JSDThreadState jsdthreadstate 
)

Definition at line 207 of file jsd_stak.c.

{
    JSDStackFrameInfo* jsdframe = NULL;

    JSD_LOCK_THREADSTATES(jsdc);

    if( jsd_IsValidThreadState(jsdc, jsdthreadstate) )
        jsdframe = (JSDStackFrameInfo*) JS_LIST_HEAD(&jsdthreadstate->stack);
    JSD_UNLOCK_THREADSTATES(jsdc);

    return jsdframe;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSDValue* jsd_GetThisForStackFrame ( JSDContext jsdc,
JSDThreadState jsdthreadstate,
JSDStackFrameInfo jsdframe 
)

Definition at line 330 of file jsd_stak.c.

{
    JSObject* obj;
    JSDValue* jsdval = NULL;
    JSD_LOCK_THREADSTATES(jsdc);

    if( jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe) )
    {
        obj = JS_GetFrameThis(jsdthreadstate->context, jsdframe->fp);
        if(obj)
            jsdval = JSD_NewValue(jsdc, OBJECT_TO_JSVAL(obj));
    }

    JSD_UNLOCK_THREADSTATES(jsdc);
    return jsdval;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSBool jsd_GetValueBoolean ( JSDContext jsdc,
JSDValue jsdval 
)

Definition at line 172 of file jsd_val.c.

{
    jsval val = jsdval->val;
    if(!JSVAL_IS_BOOLEAN(val))
        return JS_FALSE;
    return JSVAL_TO_BOOLEAN(val);
}

Here is the caller graph for this function:

const char* jsd_GetValueClassName ( JSDContext jsdc,
JSDValue jsdval 
)

Definition at line 567 of file jsd_val.c.

{
    jsval val = jsdval->val;
    if(!jsdval->className && JSVAL_IS_OBJECT(val))
    {
        JSObject* obj;
        if(!(obj = JSVAL_TO_OBJECT(val)))
            return NULL;
        if(JS_GET_CLASS(jsdc->dumbContext, obj))
            jsdval->className = JS_GET_CLASS(jsdc->dumbContext, obj)->name;
    }
    return jsdval->className;
}

Here is the caller graph for this function:

JSDValue* jsd_GetValueConstructor ( JSDContext jsdc,
JSDValue jsdval 
)

Definition at line 542 of file jsd_val.c.

{
    if(!(CHECK_BIT_FLAG(jsdval->flags, GOT_CTOR)))
    {
        JSObject* obj;
        JSObject* proto;
        JSObject* ctor;
        JS_ASSERT(!jsdval->ctor);
        SET_BIT_FLAG(jsdval->flags, GOT_CTOR);
        if(!JSVAL_IS_OBJECT(jsdval->val))
            return NULL;
        if(!(obj = JSVAL_TO_OBJECT(jsdval->val)))
            return NULL;
        if(!(proto = JS_GetPrototype(jsdc->dumbContext,obj)))
            return NULL;
        if(!(ctor = JS_GetConstructor(jsdc->dumbContext,proto)))
            return NULL;
        jsdval->ctor = jsd_NewValue(jsdc, OBJECT_TO_JSVAL(ctor));
    }
    if(jsdval->ctor)
        jsdval->ctor->nref++;
    return jsdval->ctor;
}

Here is the call graph for this function:

Here is the caller graph for this function:

jsdouble* jsd_GetValueDouble ( JSDContext jsdc,
JSDValue jsdval 
)

Definition at line 190 of file jsd_val.c.

{
    jsval val = jsdval->val;
    if(!JSVAL_IS_DOUBLE(val))
        return 0;
    return JSVAL_TO_DOUBLE(val);
}

Here is the caller graph for this function:

JSDValue* jsd_GetValueForObject ( JSDContext jsdc,
JSDObject jsdobj 
)

Definition at line 324 of file jsd_obj.c.

{
    return jsd_NewValue(jsdc, OBJECT_TO_JSVAL(jsdobj->obj));
}

Here is the call graph for this function:

Here is the caller graph for this function:

const char* jsd_GetValueFunctionName ( JSDContext jsdc,
JSDValue jsdval 
)

Definition at line 225 of file jsd_val.c.

{
    JSContext* cx = jsdc->dumbContext;
    JSFunction* fun;
    JSExceptionState* exceptionState;

    if(!jsdval->funName && jsd_IsValueFunction(jsdc, jsdval))
    {
        exceptionState = JS_SaveExceptionState(cx);
        fun = JS_ValueToFunction(cx, jsdval->val);
        JS_RestoreExceptionState(cx, exceptionState);
        if(!fun)
            return NULL;
        jsdval->funName = JS_GetFunctionName(fun);
    }
    return jsdval->funName;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int32 jsd_GetValueInt ( JSDContext jsdc,
JSDValue jsdval 
)

Definition at line 181 of file jsd_val.c.

{
    jsval val = jsdval->val;
    if(!JSVAL_IS_INT(val))
        return 0;
    return JSVAL_TO_INT(val);
}

Here is the caller graph for this function:

JSDValue* jsd_GetValueParent ( JSDContext jsdc,
JSDValue jsdval 
)

Definition at line 520 of file jsd_val.c.

{
    if(!(CHECK_BIT_FLAG(jsdval->flags, GOT_PARENT)))
    {
        JSObject* obj;
        JSObject* parent;
        JS_ASSERT(!jsdval->parent);
        SET_BIT_FLAG(jsdval->flags, GOT_PARENT);
        if(!JSVAL_IS_OBJECT(jsdval->val))
            return NULL;
        if(!(obj = JSVAL_TO_OBJECT(jsdval->val)))
            return NULL;
        if(!(parent = JS_GetParent(jsdc->dumbContext,obj)))
            return NULL;
        jsdval->parent = jsd_NewValue(jsdc, OBJECT_TO_JSVAL(parent));
    }
    if(jsdval->parent)
        jsdval->parent->nref++;
    return jsdval->parent;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSDProperty* jsd_GetValueProperty ( JSDContext jsdc,
JSDValue jsdval,
JSString name 
)

Definition at line 430 of file jsd_val.c.

{
    JSContext* cx = jsdc->dumbContext;
    JSDProperty* jsdprop;
    JSDProperty* iter = NULL;
    JSObject* obj;
    uintN  attrs = 0;
    JSBool found;
    JSPropertyDesc pd;
    const jschar * nameChars;
    size_t nameLen;
    jsval val;

    if(!jsd_IsValueObject(jsdc, jsdval))
        return NULL;

    /* If we already have the prop, then return it */
    while(NULL != (jsdprop = jsd_IterateProperties(jsdc, jsdval, &iter)))
    {
        JSString* propName = jsd_GetValueString(jsdc, jsdprop->name);
        if(propName && !JS_CompareStrings(propName, name))
            return jsdprop;
        JSD_DropProperty(jsdc, jsdprop);
    }
    /* Not found in property list, look it up explicitly */

    if(!(obj = JSVAL_TO_OBJECT(jsdval->val)))
        return NULL;

    nameChars = JS_GetStringChars(name);
    nameLen   = JS_GetStringLength(name);

    JS_GetUCPropertyAttributes(cx, obj, nameChars, nameLen, &attrs, &found);
    if (!found)
        return NULL;

    JS_ClearPendingException(cx);

    if(!JS_GetUCProperty(cx, obj, nameChars, nameLen, &val))
    {
        if (JS_IsExceptionPending(cx))
        {
            if (!JS_GetPendingException(cx, &pd.value))
                return NULL;
            pd.flags = JSPD_EXCEPTION;
        }
        else
        {
            pd.flags = JSPD_ERROR;
            pd.value = JSVAL_VOID;
        }
    }
    else
    {
        pd.value = val;
    }

    pd.id = STRING_TO_JSVAL(name);
    pd.alias = pd.slot = pd.spare = 0;
    pd.flags |= (attrs & JSPROP_ENUMERATE) ? JSPD_ENUMERATE : 0
        | (attrs & JSPROP_READONLY)  ? JSPD_READONLY  : 0
        | (attrs & JSPROP_PERMANENT) ? JSPD_PERMANENT : 0;

    return _newProperty(jsdc, &pd, JSDPD_HINTED);
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSDValue* jsd_GetValuePrototype ( JSDContext jsdc,
JSDValue jsdval 
)

Definition at line 498 of file jsd_val.c.

{
    if(!(CHECK_BIT_FLAG(jsdval->flags, GOT_PROTO)))
    {
        JSObject* obj;
        JSObject* proto;
        JS_ASSERT(!jsdval->proto);
        SET_BIT_FLAG(jsdval->flags, GOT_PROTO);
        if(!JSVAL_IS_OBJECT(jsdval->val))
            return NULL;
        if(!(obj = JSVAL_TO_OBJECT(jsdval->val)))
            return NULL;
        if(!(proto = JS_GetPrototype(jsdc->dumbContext, obj)))
            return NULL;
        jsdval->proto = jsd_NewValue(jsdc, OBJECT_TO_JSVAL(proto));
    }
    if(jsdval->proto)
        jsdval->proto->nref++;
    return jsdval->proto;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSString* jsd_GetValueString ( JSDContext jsdc,
JSDValue jsdval 
)

Definition at line 199 of file jsd_val.c.

{
    JSContext* cx = jsdc->dumbContext;
    JSExceptionState* exceptionState;

    if(!jsdval->string)
    {
        /* if the jsval is a string, then we don't need to double root it */
        if(JSVAL_IS_STRING(jsdval->val))
            jsdval->string = JSVAL_TO_STRING(jsdval->val);
        else
        {
            exceptionState = JS_SaveExceptionState(cx);
            jsdval->string = JS_ValueToString(cx, jsdval->val);
            JS_RestoreExceptionState(cx, exceptionState);
            if(jsdval->string)
            {
                if(!JS_AddNamedRoot(cx, &jsdval->string, "ValueString"))
                    jsdval->string = NULL;
            }
        }
    }
    return jsdval->string;
}

Here is the call graph for this function:

Here is the caller graph for this function:

jsval jsd_GetValueWrappedJSVal ( JSDContext jsdc,
JSDValue jsdval 
)

Definition at line 282 of file jsd_val.c.

{
    return jsdval->val;
}

Here is the caller graph for this function:

JSObject* jsd_GetWrappedObject ( JSDContext jsdc,
JSDObject jsdobj 
)

Definition at line 265 of file jsd_obj.c.

{
    return jsdobj->obj;
}

Here is the caller graph for this function:

Definition at line 340 of file jsd_text.c.

{
    return jsdsrc->alterCount = jsdc->sourceAlterCount++;
}

Here is the caller graph for this function:

Definition at line 230 of file jsd_obj.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 264 of file jsd_scpt.c.

Here is the call graph for this function:

Here is the caller graph for this function:

JSBool jsd_IsActiveScript ( JSDContext jsdc,
JSDScript jsdscript 
)

Definition at line 435 of file jsd_scpt.c.

{
    JSDScript *current;

    JS_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));

    for( current = (JSDScript *)jsdc->scripts.next;
         current != (JSDScript *)&jsdc->scripts;
         current = (JSDScript *)current->links.next )
    {
        if(jsdscript == current)
            return JS_TRUE;
    }
    return JS_FALSE;
}        

Here is the caller graph for this function:

JSBool jsd_IsSourceDirty ( JSDContext jsdc,
JSDSourceText jsdsrc 
)

Definition at line 322 of file jsd_text.c.

{
    return jsdsrc->dirty;
}

Here is the caller graph for this function:

JSBool jsd_IsStackFrameConstructing ( JSDContext jsdc,
JSDThreadState jsdthreadstate,
JSDStackFrameInfo jsdframe 
)

Definition at line 410 of file jsd_stak.c.

{
    JSBool rv = JS_TRUE;
    JSD_LOCK_THREADSTATES(jsdc);

    if( jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe) )
    {
        rv = JS_IsConstructorFrame(jsdthreadstate->context, jsdframe->fp);
    }

    JSD_UNLOCK_THREADSTATES(jsdc);
    return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSBool jsd_IsStackFrameDebugger ( JSDContext jsdc,
JSDThreadState jsdthreadstate,
JSDStackFrameInfo jsdframe 
)

Definition at line 393 of file jsd_stak.c.

{
    JSBool rv = JS_TRUE;
    JSD_LOCK_THREADSTATES(jsdc);

    if( jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe) )
    {
        rv = JS_IsDebuggerFrame(jsdthreadstate->context, jsdframe->fp);
    }

    JSD_UNLOCK_THREADSTATES(jsdc);
    return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSBool jsd_IsStackFrameNative ( JSDContext jsdc,
JSDThreadState jsdthreadstate,
JSDStackFrameInfo jsdframe 
)

Definition at line 371 of file jsd_stak.c.

{
    JSBool rv;
    
    JSD_LOCK_THREADSTATES(jsdc);

    if( jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe) )
    {
        rv = JS_IsNativeFrame(jsdthreadstate->context, jsdframe->fp);
    }
    else
    {
        rv = JS_FALSE;
    }

    JSD_UNLOCK_THREADSTATES(jsdc);
    return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSBool jsd_IsValidFrameInThreadState ( JSDContext jsdc,
JSDThreadState jsdthreadstate,
JSDStackFrameInfo jsdframe 
)

Definition at line 549 of file jsd_stak.c.

{
    JS_ASSERT(JSD_THREADSTATES_LOCKED(jsdc));

    if( ! jsd_IsValidThreadState(jsdc, jsdthreadstate) )
        return JS_FALSE;
    if( jsdframe->jsdthreadstate != jsdthreadstate )
        return JS_FALSE;

    JSD_ASSERT_VALID_THREAD_STATE(jsdthreadstate);
    JSD_ASSERT_VALID_STACK_FRAME(jsdframe);
    
    return JS_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSBool jsd_IsValidThreadState ( JSDContext jsdc,
JSDThreadState jsdthreadstate 
)

Definition at line 531 of file jsd_stak.c.

{
    JSDThreadState *cur;

    JS_ASSERT( JSD_THREADSTATES_LOCKED(jsdc) );

    for( cur = (JSDThreadState*)jsdc->threadsStates.next;
         cur != (JSDThreadState*)&jsdc->threadsStates;
         cur = (JSDThreadState*)cur->links.next ) 
    {
        if( cur == jsdthreadstate )
            return JS_TRUE;
    }
    return JS_FALSE;
}    

Here is the caller graph for this function:

JSBool jsd_IsValueBoolean ( JSDContext jsdc,
JSDValue jsdval 
)

Definition at line 116 of file jsd_val.c.

{
    return JSVAL_IS_BOOLEAN(jsdval->val);
}

Here is the caller graph for this function:

JSBool jsd_IsValueDouble ( JSDContext jsdc,
JSDValue jsdval 
)

Definition at line 104 of file jsd_val.c.

{
    return JSVAL_IS_DOUBLE(jsdval->val);
}

Here is the caller graph for this function:

JSBool jsd_IsValueFunction ( JSDContext jsdc,
JSDValue jsdval 
)

Definition at line 140 of file jsd_val.c.

{
    return !JSVAL_IS_PRIMITIVE(jsdval->val) &&
           JS_ObjectIsFunction(jsdc->dumbContext, JSVAL_TO_OBJECT(jsdval->val));
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSBool jsd_IsValueInt ( JSDContext jsdc,
JSDValue jsdval 
)

Definition at line 98 of file jsd_val.c.

{
    return JSVAL_IS_INT(jsdval->val);
}

Here is the caller graph for this function:

JSBool jsd_IsValueNative ( JSDContext jsdc,
JSDValue jsdval 
)

Definition at line 147 of file jsd_val.c.

{
    JSContext* cx = jsdc->dumbContext;
    jsval val = jsdval->val;
    JSFunction* fun;
    JSExceptionState* exceptionState;

    if(jsd_IsValueFunction(jsdc, jsdval))
    {
        exceptionState = JS_SaveExceptionState(cx);
        fun = JS_ValueToFunction(cx, val);
        JS_RestoreExceptionState(cx, exceptionState);
        if(!fun)
        {
            JS_ASSERT(0);
            return JS_FALSE;
        }
        return JS_GetFunctionScript(cx, fun) ? JS_FALSE : JS_TRUE;
    }
    return !JSVAL_IS_PRIMITIVE(val);
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSBool jsd_IsValueNull ( JSDContext jsdc,
JSDValue jsdval 
)

Definition at line 122 of file jsd_val.c.

{
    return JSVAL_IS_NULL(jsdval->val);
}

Here is the caller graph for this function:

JSBool jsd_IsValueNumber ( JSDContext jsdc,
JSDValue jsdval 
)

Definition at line 92 of file jsd_val.c.

{
    return JSVAL_IS_NUMBER(jsdval->val);
}

Here is the caller graph for this function:

JSBool jsd_IsValueObject ( JSDContext jsdc,
JSDValue jsdval 
)

Definition at line 86 of file jsd_val.c.

{
    return JSVAL_IS_OBJECT(jsdval->val);
}

Here is the caller graph for this function:

JSBool jsd_IsValuePrimitive ( JSDContext jsdc,
JSDValue jsdval 
)

Definition at line 134 of file jsd_val.c.

{
    return JSVAL_IS_PRIMITIVE(jsdval->val);
}

Here is the caller graph for this function:

JSBool jsd_IsValueString ( JSDContext jsdc,
JSDValue jsdval 
)

Definition at line 110 of file jsd_val.c.

{
    return JSVAL_IS_STRING(jsdval->val);
}

Here is the caller graph for this function:

JSBool jsd_IsValueVoid ( JSDContext jsdc,
JSDValue jsdval 
)

Definition at line 128 of file jsd_val.c.

{
    return JSVAL_IS_VOID(jsdval->val);
}

Here is the caller graph for this function:

JSDObject* jsd_IterateObjects ( JSDContext jsdc,
JSDObject **  iterp 
)

Definition at line 250 of file jsd_obj.c.

{
    JSDObject *jsdobj = *iterp;

    JS_ASSERT(JSD_OBJECTS_LOCKED(jsdc));

    if( !jsdobj )
        jsdobj = (JSDObject *)jsdc->objectsList.next;
    if( jsdobj == (JSDObject *)&jsdc->objectsList )
        return NULL;
    *iterp = (JSDObject*) jsdobj->links.next;
    return jsdobj;
}

Here is the caller graph for this function:

JSDProperty* jsd_IterateProperties ( JSDContext jsdc,
JSDValue jsdval,
JSDProperty **  iterp 
)

Definition at line 408 of file jsd_val.c.

{
    JSDProperty* jsdprop = *iterp;
    if(!(CHECK_BIT_FLAG(jsdval->flags, GOT_PROPS)))
    {
        JS_ASSERT(!jsdprop);
        if(!_buildProps(jsdc, jsdval))
            return NULL;
    }

    if(!jsdprop)
        jsdprop = (JSDProperty*)jsdval->props.next;
    if(jsdprop == (JSDProperty*)&jsdval->props)
        return NULL;
    *iterp = (JSDProperty*)jsdprop->links.next;

    JS_ASSERT(jsdprop);
    jsdprop->nref++;
    return jsdprop;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSDScript* jsd_IterateScripts ( JSDContext jsdc,
JSDScript **  iterp 
)

Definition at line 406 of file jsd_scpt.c.

{
    JSDScript *jsdscript = *iterp;
    
    JS_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));

    if( !jsdscript )
        jsdscript = (JSDScript *)jsdc->scripts.next;
    if( jsdscript == (JSDScript *)&jsdc->scripts )
        return NULL;
    *iterp = (JSDScript*) jsdscript->links.next;
    return jsdscript;
}

Here is the caller graph for this function:

Definition at line 263 of file jsd_text.c.

{
    JSDSourceText *jsdsrc = *iterp;
    
    if( !jsdsrc )
        jsdsrc = (JSDSourceText *)jsdc->sources.next;
    if( jsdsrc == (JSDSourceText *)&jsdc->sources )
        return NULL;
    *iterp = (JSDSourceText *)jsdsrc->links.next;
    return jsdsrc;
}

Here is the caller graph for this function:

Definition at line 300 of file jsd_high.c.

{
    JSDContext* iter;
    JSDContext* jsdc = NULL;
    JSRuntime*  runtime = JS_GetRuntime(context);

    JSD_LOCK();
    for( iter = (JSDContext*)_jsd_context_list.next;
         iter != (JSDContext*)&_jsd_context_list;
         iter = (JSDContext*)iter->links.next )
    {
        if( runtime == iter->jsrt )
        {
            jsdc = iter;
            break;
        }
    }
    JSD_UNLOCK();
    return jsdc;
}    

Here is the call graph for this function:

Here is the caller graph for this function:

void JS_DLL_CALLBACK jsd_NewScriptHookProc ( JSContext cx,
const char *  filename,
uintN  lineno,
JSScript script,
JSFunction fun,
void callerdata 
)

Definition at line 546 of file jsd_scpt.c.

{
    JSDScript* jsdscript = NULL;
    JSDContext* jsdc = (JSDContext*) callerdata;
    JSD_ScriptHookProc      hook;
    void*                   hookData;
    
    JSD_ASSERT_VALID_CONTEXT(jsdc);

    if( JSD_IS_DANGEROUS_THREAD(jsdc) )
        return;
    
#ifdef LIVEWIRE
    if( 1 == lineno )
        jsdlw_PreLoadSource(jsdc, LWDBG_GetCurrentApp(), filename, JS_TRUE );
#endif
    
    JSD_LOCK_SCRIPTS(jsdc);
    jsdscript = _newJSDScript(jsdc, cx, script, fun);
    JSD_UNLOCK_SCRIPTS(jsdc);
    if( ! jsdscript )
        return;

#ifdef JSD_DUMP
    JSD_LOCK_SCRIPTS(jsdc);
    _dumpJSDScript(jsdc, jsdscript, "***NEW Script: ");
    _dumpJSDScriptList( jsdc );
    JSD_UNLOCK_SCRIPTS(jsdc);
#endif /* JSD_DUMP */

    /* local in case jsdc->scriptHook gets cleared on another thread */
    JSD_LOCK();
    hook = jsdc->scriptHook;
    hookData = jsdc->scriptHookData;
    JSD_UNLOCK();

    if( hook )
        hook(jsdc, jsdscript, JS_TRUE, hookData);
}                

Here is the call graph for this function:

Here is the caller graph for this function:

JSDSourceText* jsd_NewSourceText ( JSDContext jsdc,
const char *  url 
)

Definition at line 378 of file jsd_text.c.

{
    JSDSourceText* jsdsrc;
    const char* new_url_string;

    JSD_LOCK_SOURCE_TEXT(jsdc);

#ifdef LIVEWIRE
    new_url_string = url; /* we take ownership of alloc'd string */
#else
    new_url_string = jsd_BuildNormalizedURL(url);
#endif
    if( ! new_url_string )
        return NULL;

    jsdsrc = jsd_FindSourceForURL(jsdc, new_url_string);

    if( jsdsrc )
    {
        if( jsdsrc->doingEval )
        {
#ifdef LIVEWIRE
            free((char*)new_url_string);
#endif
            JSD_UNLOCK_SOURCE_TEXT(jsdc);
            return NULL;
        }
        else    
            _moveSourceToRemovedList(jsdc, jsdsrc);
    }

    jsdsrc = _addSource( jsdc, new_url_string );

    JSD_UNLOCK_SOURCE_TEXT(jsdc);

    return jsdsrc;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 108 of file jsd_stak.c.

{
    JSDThreadState* jsdthreadstate;
    JSStackFrame *  iter = NULL;
    JSStackFrame *  fp;

    jsdthreadstate = (JSDThreadState*)calloc(1, sizeof(JSDThreadState));
    if( ! jsdthreadstate )
        return NULL;

    jsdthreadstate->context = cx;
    jsdthreadstate->thread = JSD_CURRENT_THREAD();
    JS_INIT_CLIST(&jsdthreadstate->stack);
    jsdthreadstate->stackDepth = 0;

    while( NULL != (fp = JS_FrameIterator(cx, &iter)) )
    {
        JSScript* script = JS_GetFrameScript(cx, fp);
        jsuword  pc = (jsuword) JS_GetFramePC(cx, fp);

        /*
         * don't construct a JSDStackFrame for dummy frames (those without a
         * |this| object, or native frames, if JSD_INCLUDE_NATIVE_FRAMES
         * isn't set.
         */
        if (JS_GetFrameThis(cx, fp) &&
            ((jsdc->flags & JSD_INCLUDE_NATIVE_FRAMES) ||
             !JS_IsNativeFrame(cx, fp)))
        {
            JSDStackFrameInfo *frame;

            frame = _addNewFrame( jsdc, jsdthreadstate, script, pc, fp );

            if ((jsdthreadstate->stackDepth == 0 && !frame) ||
                (jsdthreadstate->stackDepth == 1 && frame &&
                 frame->jsdscript && !JSD_IS_DEBUG_ENABLED(jsdc, frame->jsdscript)))
            {
                /*
                 * if we failed to create the first frame, or the top frame
                 * is not enabled for debugging, fail the entire thread state.
                 */
                JS_INIT_CLIST(&jsdthreadstate->links);
                jsd_DestroyThreadState(jsdc, jsdthreadstate);
                return NULL;
            }
        }
    }

    if (jsdthreadstate->stackDepth == 0)
    {
        free(jsdthreadstate);
        return NULL;
    }
    
    JSD_LOCK_THREADSTATES(jsdc);
    JS_APPEND_LINK(&jsdthreadstate->links, &jsdc->threadsStates);
    JSD_UNLOCK_THREADSTATES(jsdc);

    return jsdthreadstate;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSDValue* jsd_NewValue ( JSDContext jsdc,
jsval  val 
)

Definition at line 246 of file jsd_val.c.

{
    JSDValue* jsdval;

    if(!(jsdval = (JSDValue*) calloc(1, sizeof(JSDValue))))
        return NULL;

    if(JSVAL_IS_GCTHING(val))
    {
        if(!JS_AddNamedRoot(jsdc->dumbContext, &jsdval->val, "JSDValue"))
        {
            free(jsdval);
            return NULL;
        }
    }
    jsdval->val  = val;
    jsdval->nref = 1;
    JS_INIT_CLIST(&jsdval->props);

    return jsdval;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void JS_DLL_CALLBACK jsd_ObjectHook ( JSContext cx,
JSObject obj,
JSBool  isNew,
void closure 
)

Definition at line 160 of file jsd_obj.c.

{
    JSDObject* jsdobj;
    JSDContext* jsdc = (JSDContext*) closure;

    if( ! jsdc || ! jsdc->inited )
        return;

    JSD_LOCK_OBJECTS(jsdc);
    if(isNew)
    {
        jsdobj = _createJSDObject(jsdc, cx, obj);
        TRACEOBJ(jsdc, jsdobj, 0);
    }
    else
    {
        jsdobj = jsd_GetJSDObjectForJSObject(jsdc, obj);
        if( jsdobj )
        {
            TRACEOBJ(jsdc, jsdobj, 1);
            _destroyJSDObject(jsdc, jsdobj);
        }
    }
    JSD_UNLOCK_OBJECTS(jsdc);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void jsd_RefreshValue ( JSDContext jsdc,
JSDValue jsdval 
)

Definition at line 365 of file jsd_val.c.

{
    JSContext* cx = jsdc->dumbContext;

    if(jsdval->string)
    {
        /* if the jsval is a string, then we didn't need to root the string */
        if(!JSVAL_IS_STRING(jsdval->val))
            JS_RemoveRoot(cx, &jsdval->string);
        jsdval->string = NULL;
    }

    jsdval->funName = NULL;
    jsdval->className = NULL;
    DROP_CLEAR_VALUE(jsdc, jsdval->proto);
    DROP_CLEAR_VALUE(jsdc, jsdval->parent);
    DROP_CLEAR_VALUE(jsdc, jsdval->ctor);
    _freeProps(jsdc, jsdval);
    jsdval->flags = 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void jsd_ScriptCreated ( JSDContext jsdc,
JSContext cx,
const char *  filename,
uintN  lineno,
JSScript script,
JSFunction fun 
)

Definition at line 849 of file jsd_scpt.c.

{
    jsd_NewScriptHookProc(cx, filename, lineno, script, fun, jsdc);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void jsd_ScriptDestroyed ( JSDContext jsdc,
JSContext cx,
JSScript script 
)

Definition at line 860 of file jsd_scpt.c.

{
    jsd_DestroyScriptHookProc(cx, script, jsdc);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void* jsd_SetContextPrivate ( JSDContext jsdc,
void data 
)

Definition at line 270 of file jsd_high.c.

{
    void *rval = jsdc->data;
    jsdc->data = data;
    return data;
}

Here is the caller graph for this function:

JSBool jsd_SetDebugBreakHook ( JSDContext jsdc,
JSD_ExecutionHookProc  hook,
void callerdata 
)

Definition at line 250 of file jsd_hook.c.

Here is the caller graph for this function:

JSBool jsd_SetDebuggerHook ( JSDContext jsdc,
JSD_ExecutionHookProc  hook,
void callerdata 
)

Definition at line 273 of file jsd_hook.c.

Here is the caller graph for this function:

JSBool jsd_SetErrorReporter ( JSDContext jsdc,
JSD_ErrorReporter  reporter,
void callerdata 
)

Definition at line 381 of file jsd_high.c.

Here is the caller graph for this function:

JSBool jsd_SetException ( JSDContext jsdc,
JSDThreadState jsdthreadstate,
JSDValue jsdval 
)

Definition at line 593 of file jsd_stak.c.

{
    JSContext* cx;

    if(!(cx = _getContextForThreadState(jsdc, jsdthreadstate)))
        return JS_FALSE;

    if(jsdval)
        JS_SetPendingException(cx, JSD_GetValueWrappedJSVal(jsdc, jsdval));
    else
        JS_ClearPendingException(cx);
    return JS_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSBool jsd_SetExecutionHook ( JSDContext jsdc,
JSDScript jsdscript,
jsuword  pc,
JSD_ExecutionHookProc  hook,
void callerdata 
)

Definition at line 741 of file jsd_scpt.c.

{
    JSDExecHook* jsdhook;

    JSD_LOCK();
    if( ! hook )
    {
        jsd_ClearExecutionHook(jsdc, jsdscript, pc);
        JSD_UNLOCK();
        return JS_TRUE;
    }

    jsdhook = _findHook(jsdc, jsdscript, pc);
    if( jsdhook )
    {
        jsdhook->hook       = hook;
        jsdhook->callerdata = callerdata;
        return JS_TRUE;
    }
    /* else... */

    jsdhook = (JSDExecHook*)calloc(1, sizeof(JSDExecHook));
    if( ! jsdhook )
        return JS_FALSE;
    jsdhook->jsdscript  = jsdscript;
    jsdhook->pc         = pc;
    jsdhook->hook       = hook;
    jsdhook->callerdata = callerdata;

    if( ! JS_SetTrap(jsdc->dumbContext, jsdscript->script, 
                     (jsbytecode*)pc, jsd_TrapHandler, 
                     (void*) PRIVATE_TO_JSVAL(jsdhook)) )
    {
        free(jsdhook);
        return JS_FALSE;
    }

    JS_APPEND_LINK(&jsdhook->links, &jsdscript->hooks);
    JSD_UNLOCK();

    return JS_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSBool jsd_SetFunctionHook ( JSDContext jsdc,
JSD_CallHookProc  hook,
void callerdata 
)

Definition at line 319 of file jsd_hook.c.

Here is the caller graph for this function:

JSBool jsd_SetInterruptHook ( JSDContext jsdc,
JSD_ExecutionHookProc  hook,
void callerdata 
)

Definition at line 225 of file jsd_hook.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void jsd_SetScriptFlags ( JSDContext jsdc,
JSDScript script,
uint32  flags 
)

Definition at line 306 of file jsd_scpt.c.

{
    script->flags = flags;
}

Here is the caller graph for this function:

JSBool jsd_SetScriptHook ( JSDContext jsdc,
JSD_ScriptHookProc  hook,
void callerdata 
)

Definition at line 522 of file jsd_scpt.c.

{
    JSD_LOCK();
    jsdc->scriptHook = hook;
    jsdc->scriptHookData = callerdata;
    JSD_UNLOCK();
    return JS_TRUE;
}

Here is the caller graph for this function:

void* jsd_SetScriptPrivate ( JSDScript jsdscript,
void data 
)

Definition at line 421 of file jsd_scpt.c.

{
    void *rval = jsdscript->data;
    jsdscript->data = data;
    return rval;
}

Here is the caller graph for this function:

void jsd_SetSourceDirty ( JSDContext jsdc,
JSDSourceText jsdsrc,
JSBool  dirty 
)

Definition at line 328 of file jsd_text.c.

{
    jsdsrc->dirty = dirty;
}

Here is the caller graph for this function:

JSBool jsd_SetThrowHook ( JSDContext jsdc,
JSD_ExecutionHookProc  hook,
void callerdata 
)

Definition at line 296 of file jsd_hook.c.

{
    JSD_LOCK();
    jsdc->throwHookData  = callerdata;
    jsdc->throwHook      = hook;
    JSD_UNLOCK();

    return JS_TRUE;
}

Here is the caller graph for this function:

JSBool jsd_SetTopLevelHook ( JSDContext jsdc,
JSD_CallHookProc  hook,
void callerdata 
)

Definition at line 342 of file jsd_hook.c.

Here is the caller graph for this function:

void jsd_SetUserCallbacks ( JSRuntime jsrt,
JSD_UserCallbacks callbacks,
void user 
)

Definition at line 254 of file jsd_high.c.

{
    _jsrt = jsrt;
    _user = user;

#ifdef JSD_HAS_DANGEROUS_THREAD
    _dangerousThread = JSD_CURRENT_THREAD();
#endif

    if( callbacks )
        memcpy(&_callbacks, callbacks, sizeof(JSD_UserCallbacks));
    else
        memset(&_callbacks, 0 , sizeof(JSD_UserCallbacks));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void jsd_StartingEvalUsingFilename ( JSDContext jsdc,
const char *  url 
)

Definition at line 524 of file jsd_text.c.

{
    JSDSourceText* jsdsrc;

    /* NOTE: We leave it locked! */
    JSD_LOCK_SOURCE_TEXT(jsdc); 

    jsdsrc = jsd_FindSourceForURL(jsdc, url);
    if(jsdsrc)
    {
#if 0
#ifndef JSD_LOWLEVEL_SOURCE
        JS_ASSERT(! jsdsrc->doingEval);
#endif
#endif
        jsdsrc->doingEval = JS_TRUE;
    }
}    

Here is the call graph for this function:

Here is the caller graph for this function:

JSTrapStatus JS_DLL_CALLBACK jsd_ThrowHandler ( JSContext cx,
JSScript script,
jsbytecode pc,
jsval rval,
void closure 
)

Definition at line 118 of file jsd_hook.c.

{
    JSDScript*      jsdscript;
    JSDContext*     jsdc = (JSDContext*) closure;
    JSD_ExecutionHookProc hook;
    void*                 hookData;

    if( ! jsdc || ! jsdc->inited )
        return JSD_HOOK_RETURN_CONTINUE_THROW;

    if( JSD_IS_DANGEROUS_THREAD(jsdc) )
        return JSD_HOOK_RETURN_CONTINUE_THROW;

    /* local in case jsdc->throwHook gets cleared on another thread */
    JSD_LOCK();
    hook     = jsdc->throwHook;
    hookData = jsdc->throwHookData;
    JSD_UNLOCK();
    if (!hook)
        return JSD_HOOK_RETURN_CONTINUE_THROW;

    JSD_LOCK_SCRIPTS(jsdc);
    jsdscript = jsd_FindJSDScript(jsdc, script);
    JSD_UNLOCK_SCRIPTS(jsdc);
    if( ! jsdscript )
        return JSD_HOOK_RETURN_CONTINUE_THROW;

    JS_GetPendingException(cx, rval);

    return jsd_CallExecutionHook(jsdc, cx, JSD_HOOK_THROW,
                                 hook, hookData, rval);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void* JS_DLL_CALLBACK jsd_TopLevelCallHook ( JSContext cx,
JSStackFrame fp,
JSBool  before,
JSBool ok,
void closure 
)

Definition at line 296 of file jsd_step.c.

{
    JSDContext*       jsdc;
    JSD_CallHookProc  hook;
    void*             hookData;

    jsdc = (JSDContext*) closure;

    /* local in case jsdc->toplevelHook gets cleared on another thread */
    JSD_LOCK();
    hook     = jsdc->toplevelHook;
    hookData = jsdc->toplevelHookData;
    JSD_UNLOCK();
    
    if (_callHook (jsdc, cx, fp, before,
                   (before) ? JSD_HOOK_TOPLEVEL_START : JSD_HOOK_TOPLEVEL_END,
                   hook, hookData))
    {
        return closure;
    }
    
    return NULL;
    
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSString* jsd_ValToStringInStackFrame ( JSDContext jsdc,
JSDThreadState jsdthreadstate,
JSDStackFrameInfo jsdframe,
jsval  val 
)

Definition at line 503 of file jsd_stak.c.

{
    JSBool valid;
    JSString* retval;
    JSExceptionState* exceptionState;
    JSContext* cx;

    JSD_LOCK_THREADSTATES(jsdc);
    valid = jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe);
    JSD_UNLOCK_THREADSTATES(jsdc);

    if( ! valid )
        return NULL;

    cx = jsdthreadstate->context;
    JS_ASSERT(cx);

    exceptionState = JS_SaveExceptionState(cx);
    retval = JS_ValueToString(cx, val);
    JS_RestoreExceptionState(cx, exceptionState);

    return retval;
}

Here is the call graph for this function:

Here is the caller graph for this function: