don't allow gc's during script hooks if CAUTIOUS_SCRIPTHOOK is defined (which it is, by default.) Should help with stability until we can fix the real problems.
Use JSVAL_ macros instead of JSD_* calls in jsdValue::GetJSType method, avoiding two c++ frames per call.
git-svn-id: svn://10.0.0.236/trunk@101912 18797224-902f-48f8-a5cc-f745e15eee43
remove isActive attribute from jsdScript (it's the same thing as isValid)
fix bug in jsdValue::GetDoubleValue()
add jsdService::GC()
git-svn-id: svn://10.0.0.236/trunk@100262 18797224-902f-48f8-a5cc-f745e15eee43
move debug object counters and various constructors to jsd_xpc.cpp
add LiveEphemeral struct to reperesent a link in a PRCList of ephemeral objects.
declare jsdIEphemeral interface in objects that need it, add invalidaAll static method to jsdIProperty and jsdIValue. jsdIObject still needs work.
git-svn-id: svn://10.0.0.236/trunk@98577 18797224-902f-48f8-a5cc-f745e15eee43
Large changes to improve the way we deal with our wrappers around js engine structures. jsdIScript, jsdIStackFrame, jsdIValue, and jsdIProperty interfaces now inherit from a new interface "jsdIEphemeral". This interface is used to invalidate the wrapper. Once the wrapper is invalidated, *most* methods throw NS_ERROR_NOT_AVAILABLE, some interfaces, such as jsdIScript, cache important information so that the wrapper isn't utterly useless once it has been invalidated. The boolean isValid attribute can be used to see if the wrapper is still valid.
factor debug object counters into some simple macros
add new velid assertion macros for the new ephemeral objects
add utility functions for dealing with PR_CLISTs full of ephemeral objects.
invalidate the jsdIFrame after the execution hook completes
move some c/dtors from jsd_xpc.h over here to avoid exposing debug object counters, and repeating some macros
fix incorrectly set out parameter in getValue::GetDoubleValue
git-svn-id: svn://10.0.0.236/trunk@98576 18797224-902f-48f8-a5cc-f745e15eee43
declare and initialize new provate members in jsdScript, copy important script properties at jsdScript creation time, so they're around after Invalidate().
git-svn-id: svn://10.0.0.236/trunk@98153 18797224-902f-48f8-a5cc-f745e15eee43
large changes to fix the following bugs:
82684, crash manually clearing breakpoint
*actually* clearing mValid in jsdScript::Invalidate fixed this one.
85636, assertions on quiting venkman
jsdService::Off now disconnects the hooks into JSD, to avoid calling back into js after that. It also processes any pending script delete events that occurred during the last GC. The code to process the gPendingScripts list has been factored out of the gc callback. Processing the dead script list allows us to properly finalize all of the jsdIScript object, which seems to clear up the "gc roots exist at shutdown" assertions. In effect, these changes get rid of *all* of the jsd related assertions on exit.
Added isOn attribute to jsdIService.
Added isValid attribute to jsdIScript. We now prefetch appropriate properties from the underlying JSDScript, so that it's available after the script is Invalidate()d
moved jsdService constructor to jsd_xpc.h
Save the runtime passed to OnForRuntime so we can use it to clear the GC Gallback in Off().
git-svn-id: svn://10.0.0.236/trunk@98152 18797224-902f-48f8-a5cc-f745e15eee43
add enumerateScripts() method to jsdIDebugger service
don't create a new debugger context if the user trys to call on[ForRuntime]() multiple times
git-svn-id: svn://10.0.0.236/trunk@95587 18797224-902f-48f8-a5cc-f745e15eee43
add onForRuntime() method to jsdIDebuggerService to let native code turn on the deubgger (on() can only be called from js)
register an app-start observer so we can turn on the debugger at startup if "js.debugger.autostart" pref is true.
r=peterv, bug 81840
git-svn-id: svn://10.0.0.236/trunk@95583 18797224-902f-48f8-a5cc-f745e15eee43
check for valid PC in ClearBreakpoint
Lock script subsystem while clearing all breakpoints
git-svn-id: svn://10.0.0.236/trunk@94823 18797224-902f-48f8-a5cc-f745e15eee43
remove jsdIContext and jsdIThreadstate interfaces
add TYPE_BOOLEAN to jsdIValue
update callback signatures to reflect the removal of jsdIContext and jsdIThreadstate
add errorHook and throwHook attributes to jsdIDebuggerService
git-svn-id: svn://10.0.0.236/trunk@93977 18797224-902f-48f8-a5cc-f745e15eee43
remove jsdThreadState and jsdContext objects.
consolidate ExecutionHook and BreakpointHook callbacks
remove return value checking from all methods (xpconnect does this for us.)
git-svn-id: svn://10.0.0.236/trunk@93975 18797224-902f-48f8-a5cc-f745e15eee43
validate integrity of jsdScript data to guard against calling into a destroyed script.
queue up script deletes that happen during the JS GC cycle, call them when GC finishes (bug 76979.)
don't NS_IF_ADDREF objects that we get using *::FromPtr()
add jsdScript::Invalidate()
git-svn-id: svn://10.0.0.236/trunk@93560 18797224-902f-48f8-a5cc-f745e15eee43
register for gc callbacks
explicitly create a singleton factory
only call OnScriptLoaded() if |creating| is true
git-svn-id: svn://10.0.0.236/trunk@93089 18797224-902f-48f8-a5cc-f745e15eee43
move from pc as a ulong to pc as an object wrapped around a uword (jsdIPC)
rename init() to on() on jsdIService
move lineToPc and pcToLine from jsdIThreadState to jsdIScript (where they belong)
add setBreakpoint(), clearBreakpoint(), and clearAllBreakpoints() to jsdIScript
add off(), clearAllBreakpoints(), and breakpointHook attribute to jsdIService
add creatorURL, creatorLine, constructorURL, constructorLine, and value attribut
es to jsdIObject
git-svn-id: svn://10.0.0.236/trunk@93078 18797224-902f-48f8-a5cc-f745e15eee43
move from pc as a ulong to pc as an object wrapped around a uword
relocate jsdService constructor to jsd_xpp.cpp in order to initialize the global
service
git-svn-id: svn://10.0.0.236/trunk@93077 18797224-902f-48f8-a5cc-f745e15eee43
add global service for the breakpoint callback
add breakpoint callback
move c callbacks to top of source
add creatorURL, creatorLine, constructorURL, constructorLine, and value attribut
es to jsdObject
move from pc as a ulong to pc as an object wrapped around a uword
move lineToPc and pcToLine from ThreadState to Script (where it belongs)
add setBreakpoint(), clearBreakpoint(), and clearAllBreakpoints() to jsdScript
relocate jsdService constructor from jsd_xpp.h in order to initialize the global
service
rename init() to on() on jsdService
add off(), clearAllBreakpoints(), and breakpointHook attribute to jsdService
git-svn-id: svn://10.0.0.236/trunk@93076 18797224-902f-48f8-a5cc-f745e15eee43
patch from peterv. We can't use js_* in this module because they're libjs' private stash. I got away with it on Linux somehow, but not on mac, and probably not on windows. jsd_EvaluateScriptInStackFrame now uses JS_EvaluateInStackFrame, instead of doing the inflation itself and calling JS_EvaluateUCInStackFrame.
git-svn-id: svn://10.0.0.236/trunk@93033 18797224-902f-48f8-a5cc-f745e15eee43
add line attribute to jsdIStackFrame
remove isFuction from jsdIValue
add TYPE_UNKNOWN to jsType "enumeration" so we don't fail hard if we can't figure out the type.
add hook type "enumeration" to jsdIExecutionHook
git-svn-id: svn://10.0.0.236/trunk@92935 18797224-902f-48f8-a5cc-f745e15eee43
add line attribute to jsdStackFrame
add pcToLine and lineToPc methods to jsdStackFrame
remove isFunction attribute from jsdValue (already covered by jsType attribute)
add propertyCount attribute to jsdValue so you can get the property cound without forcing a bunch of property wrappers to be created (as in GetProperties())
git-svn-id: svn://10.0.0.236/trunk@92934 18797224-902f-48f8-a5cc-f745e15eee43
basic methods for jsdIObject and jsdIProperty
tweak string params
most methods for jsdIScript jsdIStackFrame, jsdIThreadState, and jsdIValue
add hack methods enterNestedEventLoop and exitNestedEventLoop. These should be moved to another interface before long.
git-svn-id: svn://10.0.0.236/trunk@92802 18797224-902f-48f8-a5cc-f745e15eee43
add private data to JSDContexts and JSDScripts, add JSD_EvaluateUCScriptInStackFrame
fix comment for JSD_GetValueProperty
git-svn-id: svn://10.0.0.236/trunk@92801 18797224-902f-48f8-a5cc-f745e15eee43
add private data to JSDContexts and JSDScripts, add JSD_EvaluateUCScriptInStackFrame
git-svn-id: svn://10.0.0.236/trunk@92798 18797224-902f-48f8-a5cc-f745e15eee43