1 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 : * vim: set ts=8 sw=4 et tw=99:
3 : *
4 : * ***** BEGIN LICENSE BLOCK *****
5 : * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 : *
7 : * The contents of this file are subject to the Mozilla Public License Version
8 : * 1.1 (the "License"); you may not use this file except in compliance with
9 : * the License. You may obtain a copy of the License at
10 : * http://www.mozilla.org/MPL/
11 : *
12 : * Software distributed under the License is distributed on an "AS IS" basis,
13 : * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
14 : * for the specific language governing rights and limitations under the
15 : * License.
16 : *
17 : * The Original Code is Mozilla Communicator client code, released
18 : * March 31, 1998.
19 : *
20 : * The Initial Developer of the Original Code is
21 : * Netscape Communications Corporation.
22 : * Portions created by the Initial Developer are Copyright (C) 1998
23 : * the Initial Developer. All Rights Reserved.
24 : *
25 : * Contributor(s):
26 : * Nick Fitzgerald <nfitzgerald@mozilla.com>
27 : *
28 : * Alternatively, the contents of this file may be used under the terms of
29 : * either of the GNU General Public License Version 2 or later (the "GPL"),
30 : * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
31 : * in which case the provisions of the GPL or the LGPL are applicable instead
32 : * of those above. If you wish to allow use of your version of this file only
33 : * under the terms of either the GPL or the LGPL, and not to allow others to
34 : * use your version of this file under the terms of the MPL, indicate your
35 : * decision by deleting the provisions above and replace them with the notice
36 : * and other provisions required by the GPL or the LGPL. If you do not delete
37 : * the provisions above, a recipient may use your version of this file under
38 : * the terms of any one of the MPL, the GPL or the LGPL.
39 : *
40 : * ***** END LICENSE BLOCK ***** */
41 :
42 : #ifndef jsdbgapi_h___
43 : #define jsdbgapi_h___
44 : /*
45 : * JS debugger API.
46 : */
47 : #include "jsapi.h"
48 : #include "jsprvtd.h"
49 :
50 : JS_BEGIN_EXTERN_C
51 :
52 : extern JS_PUBLIC_API(JSCrossCompartmentCall *)
53 : JS_EnterCrossCompartmentCallScript(JSContext *cx, JSScript *target);
54 :
55 : extern JS_PUBLIC_API(JSCrossCompartmentCall *)
56 : JS_EnterCrossCompartmentCallStackFrame(JSContext *cx, JSStackFrame *target);
57 :
58 : #ifdef __cplusplus
59 : JS_END_EXTERN_C
60 :
61 : namespace JS {
62 :
63 : class JS_PUBLIC_API(AutoEnterScriptCompartment)
64 : {
65 : protected:
66 : JSCrossCompartmentCall *call;
67 :
68 : public:
69 1496110 : AutoEnterScriptCompartment() : call(NULL) {}
70 :
71 : bool enter(JSContext *cx, JSScript *target);
72 :
73 : bool entered() const { return call != NULL; }
74 :
75 1496110 : ~AutoEnterScriptCompartment() {
76 1496110 : if (call && call != reinterpret_cast<JSCrossCompartmentCall*>(1))
77 12 : JS_LeaveCrossCompartmentCall(call);
78 1496110 : }
79 : };
80 :
81 : class JS_PUBLIC_API(AutoEnterFrameCompartment) : public AutoEnterScriptCompartment
82 2992220 : {
83 : public:
84 : bool enter(JSContext *cx, JSStackFrame *target);
85 : };
86 :
87 : } /* namespace JS */
88 :
89 : #ifdef DEBUG
90 : JS_FRIEND_API(void) js_DumpValue(const js::Value &val);
91 : JS_FRIEND_API(void) js_DumpId(jsid id);
92 : JS_FRIEND_API(void) js_DumpStackFrame(JSContext *cx, js::StackFrame *start = NULL);
93 : #endif
94 :
95 : JS_BEGIN_EXTERN_C
96 : #endif
97 :
98 : extern JS_PUBLIC_API(JSString *)
99 : JS_DecompileScript(JSContext *cx, JSScript *script, const char *name, unsigned indent);
100 :
101 : /*
102 : * Currently, we only support runtime-wide debugging. In the future, we should
103 : * be able to support compartment-wide debugging.
104 : */
105 : extern JS_PUBLIC_API(void)
106 : JS_SetRuntimeDebugMode(JSRuntime *rt, JSBool debug);
107 :
108 : /*
109 : * Debug mode is a compartment-wide mode that enables a debugger to attach
110 : * to and interact with running methodjit-ed frames. In particular, it causes
111 : * every function to be compiled as if an eval was present (so eval-in-frame)
112 : * can work, and it ensures that functions can be re-JITed for other debug
113 : * features. In general, it is not safe to interact with frames that were live
114 : * before debug mode was enabled. For this reason, it is also not safe to
115 : * enable debug mode while frames are live.
116 : */
117 :
118 : /* Get current state of debugging mode. */
119 : extern JS_PUBLIC_API(JSBool)
120 : JS_GetDebugMode(JSContext *cx);
121 :
122 : /*
123 : * Turn on/off debugging mode for a single compartment. This should only be
124 : * used when no code from this compartment is running or on the stack in any
125 : * thread.
126 : */
127 : JS_FRIEND_API(JSBool)
128 : JS_SetDebugModeForCompartment(JSContext *cx, JSCompartment *comp, JSBool debug);
129 :
130 : /*
131 : * Turn on/off debugging mode for a context's compartment.
132 : */
133 : JS_FRIEND_API(JSBool)
134 : JS_SetDebugMode(JSContext *cx, JSBool debug);
135 :
136 : /* Turn on single step mode. */
137 : extern JS_PUBLIC_API(JSBool)
138 : JS_SetSingleStepMode(JSContext *cx, JSScript *script, JSBool singleStep);
139 :
140 : /* The closure argument will be marked. */
141 : extern JS_PUBLIC_API(JSBool)
142 : JS_SetTrap(JSContext *cx, JSScript *script, jsbytecode *pc,
143 : JSTrapHandler handler, jsval closure);
144 :
145 : extern JS_PUBLIC_API(void)
146 : JS_ClearTrap(JSContext *cx, JSScript *script, jsbytecode *pc,
147 : JSTrapHandler *handlerp, jsval *closurep);
148 :
149 : extern JS_PUBLIC_API(void)
150 : JS_ClearScriptTraps(JSContext *cx, JSScript *script);
151 :
152 : extern JS_PUBLIC_API(void)
153 : JS_ClearAllTrapsForCompartment(JSContext *cx);
154 :
155 : extern JS_PUBLIC_API(JSBool)
156 : JS_SetInterrupt(JSRuntime *rt, JSInterruptHook handler, void *closure);
157 :
158 : extern JS_PUBLIC_API(JSBool)
159 : JS_ClearInterrupt(JSRuntime *rt, JSInterruptHook *handlerp, void **closurep);
160 :
161 : /************************************************************************/
162 :
163 : extern JS_PUBLIC_API(JSBool)
164 : JS_SetWatchPoint(JSContext *cx, JSObject *obj, jsid id,
165 : JSWatchPointHandler handler, JSObject *closure);
166 :
167 : extern JS_PUBLIC_API(JSBool)
168 : JS_ClearWatchPoint(JSContext *cx, JSObject *obj, jsid id,
169 : JSWatchPointHandler *handlerp, JSObject **closurep);
170 :
171 : extern JS_PUBLIC_API(JSBool)
172 : JS_ClearWatchPointsForObject(JSContext *cx, JSObject *obj);
173 :
174 : extern JS_PUBLIC_API(JSBool)
175 : JS_ClearAllWatchPoints(JSContext *cx);
176 :
177 : /************************************************************************/
178 :
179 : extern JS_PUBLIC_API(unsigned)
180 : JS_PCToLineNumber(JSContext *cx, JSScript *script, jsbytecode *pc);
181 :
182 : extern JS_PUBLIC_API(jsbytecode *)
183 : JS_LineNumberToPC(JSContext *cx, JSScript *script, unsigned lineno);
184 :
185 : extern JS_PUBLIC_API(jsbytecode *)
186 : JS_EndPC(JSContext *cx, JSScript *script);
187 :
188 : extern JS_PUBLIC_API(JSBool)
189 : JS_GetLinePCs(JSContext *cx, JSScript *script,
190 : unsigned startLine, unsigned maxLines,
191 : unsigned* count, unsigned** lines, jsbytecode*** pcs);
192 :
193 : extern JS_PUBLIC_API(unsigned)
194 : JS_GetFunctionArgumentCount(JSContext *cx, JSFunction *fun);
195 :
196 : extern JS_PUBLIC_API(JSBool)
197 : JS_FunctionHasLocalNames(JSContext *cx, JSFunction *fun);
198 :
199 : /*
200 : * N.B. The mark is in the context temp pool and thus the caller must take care
201 : * to call JS_ReleaseFunctionLocalNameArray in a LIFO manner (wrt to any other
202 : * call that may use the temp pool.
203 : */
204 : extern JS_PUBLIC_API(uintptr_t *)
205 : JS_GetFunctionLocalNameArray(JSContext *cx, JSFunction *fun, void **markp);
206 :
207 : extern JS_PUBLIC_API(JSAtom *)
208 : JS_LocalNameToAtom(uintptr_t w);
209 :
210 : extern JS_PUBLIC_API(JSString *)
211 : JS_AtomKey(JSAtom *atom);
212 :
213 : extern JS_PUBLIC_API(void)
214 : JS_ReleaseFunctionLocalNameArray(JSContext *cx, void *mark);
215 :
216 : extern JS_PUBLIC_API(JSScript *)
217 : JS_GetFunctionScript(JSContext *cx, JSFunction *fun);
218 :
219 : extern JS_PUBLIC_API(JSNative)
220 : JS_GetFunctionNative(JSContext *cx, JSFunction *fun);
221 :
222 : extern JS_PUBLIC_API(JSPrincipals *)
223 : JS_GetScriptPrincipals(JSContext *cx, JSScript *script);
224 :
225 : extern JS_PUBLIC_API(JSPrincipals *)
226 : JS_GetScriptOriginPrincipals(JSContext *cx, JSScript *script);
227 :
228 : /*
229 : * Stack Frame Iterator
230 : *
231 : * Used to iterate through the JS stack frames to extract
232 : * information from the frames.
233 : */
234 :
235 : extern JS_PUBLIC_API(JSStackFrame *)
236 : JS_FrameIterator(JSContext *cx, JSStackFrame **iteratorp);
237 :
238 : extern JS_PUBLIC_API(JSScript *)
239 : JS_GetFrameScript(JSContext *cx, JSStackFrame *fp);
240 :
241 : extern JS_PUBLIC_API(jsbytecode *)
242 : JS_GetFramePC(JSContext *cx, JSStackFrame *fp);
243 :
244 : extern JS_PUBLIC_API(void *)
245 : JS_GetFrameAnnotation(JSContext *cx, JSStackFrame *fp);
246 :
247 : extern JS_PUBLIC_API(void)
248 : JS_SetFrameAnnotation(JSContext *cx, JSStackFrame *fp, void *annotation);
249 :
250 : extern JS_PUBLIC_API(JSBool)
251 : JS_IsScriptFrame(JSContext *cx, JSStackFrame *fp);
252 :
253 : extern JS_PUBLIC_API(JSObject *)
254 : JS_GetFrameScopeChain(JSContext *cx, JSStackFrame *fp);
255 :
256 : extern JS_PUBLIC_API(JSObject *)
257 : JS_GetFrameCallObject(JSContext *cx, JSStackFrame *fp);
258 :
259 : extern JS_PUBLIC_API(JSBool)
260 : JS_GetFrameThis(JSContext *cx, JSStackFrame *fp, jsval *thisv);
261 :
262 : extern JS_PUBLIC_API(JSFunction *)
263 : JS_GetFrameFunction(JSContext *cx, JSStackFrame *fp);
264 :
265 : extern JS_PUBLIC_API(JSObject *)
266 : JS_GetFrameFunctionObject(JSContext *cx, JSStackFrame *fp);
267 :
268 : JS_PUBLIC_API(JSFunction *)
269 : JS_GetScriptFunction(JSContext *cx, JSScript *script);
270 :
271 : extern JS_PUBLIC_API(JSObject *)
272 : JS_GetParentOrScopeChain(JSContext *cx, JSObject *obj);
273 :
274 : /* XXXrginda Initially published with typo */
275 : #define JS_IsContructorFrame JS_IsConstructorFrame
276 : extern JS_PUBLIC_API(JSBool)
277 : JS_IsConstructorFrame(JSContext *cx, JSStackFrame *fp);
278 :
279 : extern JS_PUBLIC_API(JSBool)
280 : JS_IsDebuggerFrame(JSContext *cx, JSStackFrame *fp);
281 :
282 : extern JS_PUBLIC_API(JSBool)
283 : JS_IsGlobalFrame(JSContext *cx, JSStackFrame *fp);
284 :
285 : extern JS_PUBLIC_API(jsval)
286 : JS_GetFrameReturnValue(JSContext *cx, JSStackFrame *fp);
287 :
288 : extern JS_PUBLIC_API(void)
289 : JS_SetFrameReturnValue(JSContext *cx, JSStackFrame *fp, jsval rval);
290 :
291 : /**
292 : * Return fp's callee function object (fp->callee) if it has one. Note that
293 : * this API cannot fail. A null return means "no callee": fp is a global or
294 : * eval-from-global frame, not a call frame.
295 : *
296 : * This API began life as an infallible getter, but now it can return either:
297 : *
298 : * 1. An optimized closure that was compiled assuming the function could not
299 : * escape and be called from sites the compiler could not see.
300 : *
301 : * 2. A "joined function object", an optimization whereby SpiderMonkey avoids
302 : * creating fresh function objects for every evaluation of a function
303 : * expression that is used only once by a consumer that either promises to
304 : * clone later when asked for the value or that cannot leak the value.
305 : *
306 : * Because Mozilla's Gecko embedding of SpiderMonkey (and no doubt other
307 : * embeddings) calls this API in potentially performance-sensitive ways (e.g.
308 : * in nsContentUtils::GetDocumentFromCaller), we are leaving this API alone. It
309 : * may now return an unwrapped non-escaping optimized closure, or a joined
310 : * function object. Such optimized objects may work well if called from the
311 : * correct context, never mutated or compared for identity, etc.
312 : *
313 : * However, if you really need to get the same callee object that JS code would
314 : * see, which means undoing the optimizations, where an undo attempt can fail,
315 : * then use JS_GetValidFrameCalleeObject.
316 : */
317 : extern JS_PUBLIC_API(JSObject *)
318 : JS_GetFrameCalleeObject(JSContext *cx, JSStackFrame *fp);
319 :
320 : /**
321 : * Return fp's callee function object after running the deferred closure
322 : * cloning "method read barrier". This API can fail! If the frame has no
323 : * callee, this API returns true with JSVAL_IS_VOID(*vp).
324 : */
325 : extern JS_PUBLIC_API(JSBool)
326 : JS_GetValidFrameCalleeObject(JSContext *cx, JSStackFrame *fp, jsval *vp);
327 :
328 : /************************************************************************/
329 :
330 : extern JS_PUBLIC_API(const char *)
331 : JS_GetScriptFilename(JSContext *cx, JSScript *script);
332 :
333 : extern JS_PUBLIC_API(const jschar *)
334 : JS_GetScriptSourceMap(JSContext *cx, JSScript *script);
335 :
336 : extern JS_PUBLIC_API(unsigned)
337 : JS_GetScriptBaseLineNumber(JSContext *cx, JSScript *script);
338 :
339 : extern JS_PUBLIC_API(unsigned)
340 : JS_GetScriptLineExtent(JSContext *cx, JSScript *script);
341 :
342 : extern JS_PUBLIC_API(JSVersion)
343 : JS_GetScriptVersion(JSContext *cx, JSScript *script);
344 :
345 : /************************************************************************/
346 :
347 : /*
348 : * Hook setters for script creation and destruction, see jsprvtd.h for the
349 : * typedefs. These macros provide binary compatibility and newer, shorter
350 : * synonyms.
351 : */
352 : #define JS_SetNewScriptHook JS_SetNewScriptHookProc
353 : #define JS_SetDestroyScriptHook JS_SetDestroyScriptHookProc
354 :
355 : extern JS_PUBLIC_API(void)
356 : JS_SetNewScriptHook(JSRuntime *rt, JSNewScriptHook hook, void *callerdata);
357 :
358 : extern JS_PUBLIC_API(void)
359 : JS_SetDestroyScriptHook(JSRuntime *rt, JSDestroyScriptHook hook,
360 : void *callerdata);
361 :
362 : /************************************************************************/
363 :
364 : extern JS_PUBLIC_API(JSBool)
365 : JS_EvaluateUCInStackFrame(JSContext *cx, JSStackFrame *fp,
366 : const jschar *chars, unsigned length,
367 : const char *filename, unsigned lineno,
368 : jsval *rval);
369 :
370 : extern JS_PUBLIC_API(JSBool)
371 : JS_EvaluateInStackFrame(JSContext *cx, JSStackFrame *fp,
372 : const char *bytes, unsigned length,
373 : const char *filename, unsigned lineno,
374 : jsval *rval);
375 :
376 : /************************************************************************/
377 :
378 : typedef struct JSPropertyDesc {
379 : jsval id; /* primary id, atomized string, or int */
380 : jsval value; /* property value */
381 : uint8_t flags; /* flags, see below */
382 : uint8_t spare; /* unused */
383 : uint16_t slot; /* argument/variable slot */
384 : jsval alias; /* alias id if JSPD_ALIAS flag */
385 : } JSPropertyDesc;
386 :
387 : #define JSPD_ENUMERATE 0x01 /* visible to for/in loop */
388 : #define JSPD_READONLY 0x02 /* assignment is error */
389 : #define JSPD_PERMANENT 0x04 /* property cannot be deleted */
390 : #define JSPD_ALIAS 0x08 /* property has an alias id */
391 : #define JSPD_ARGUMENT 0x10 /* argument to function */
392 : #define JSPD_VARIABLE 0x20 /* local variable in function */
393 : #define JSPD_EXCEPTION 0x40 /* exception occurred fetching the property, */
394 : /* value is exception */
395 : #define JSPD_ERROR 0x80 /* native getter returned JS_FALSE without */
396 : /* throwing an exception */
397 :
398 : typedef struct JSPropertyDescArray {
399 : uint32_t length; /* number of elements in array */
400 : JSPropertyDesc *array; /* alloc'd by Get, freed by Put */
401 : } JSPropertyDescArray;
402 :
403 : typedef struct JSScopeProperty JSScopeProperty;
404 :
405 : extern JS_PUBLIC_API(JSScopeProperty *)
406 : JS_PropertyIterator(JSObject *obj, JSScopeProperty **iteratorp);
407 :
408 : extern JS_PUBLIC_API(JSBool)
409 : JS_GetPropertyDesc(JSContext *cx, JSObject *obj, JSScopeProperty *shape,
410 : JSPropertyDesc *pd);
411 :
412 : extern JS_PUBLIC_API(JSBool)
413 : JS_GetPropertyDescArray(JSContext *cx, JSObject *obj, JSPropertyDescArray *pda);
414 :
415 : extern JS_PUBLIC_API(void)
416 : JS_PutPropertyDescArray(JSContext *cx, JSPropertyDescArray *pda);
417 :
418 : /************************************************************************/
419 :
420 : extern JS_PUBLIC_API(JSBool)
421 : JS_SetDebuggerHandler(JSRuntime *rt, JSDebuggerHandler hook, void *closure);
422 :
423 : extern JS_PUBLIC_API(JSBool)
424 : JS_SetSourceHandler(JSRuntime *rt, JSSourceHandler handler, void *closure);
425 :
426 : extern JS_PUBLIC_API(JSBool)
427 : JS_SetExecuteHook(JSRuntime *rt, JSInterpreterHook hook, void *closure);
428 :
429 : extern JS_PUBLIC_API(JSBool)
430 : JS_SetCallHook(JSRuntime *rt, JSInterpreterHook hook, void *closure);
431 :
432 : extern JS_PUBLIC_API(JSBool)
433 : JS_SetThrowHook(JSRuntime *rt, JSThrowHook hook, void *closure);
434 :
435 : extern JS_PUBLIC_API(JSBool)
436 : JS_SetDebugErrorHook(JSRuntime *rt, JSDebugErrorHook hook, void *closure);
437 :
438 : /************************************************************************/
439 :
440 : extern JS_PUBLIC_API(size_t)
441 : JS_GetObjectTotalSize(JSContext *cx, JSObject *obj);
442 :
443 : extern JS_PUBLIC_API(size_t)
444 : JS_GetFunctionTotalSize(JSContext *cx, JSFunction *fun);
445 :
446 : extern JS_PUBLIC_API(size_t)
447 : JS_GetScriptTotalSize(JSContext *cx, JSScript *script);
448 :
449 : /*
450 : * Return true if obj is a "system" object, that is, one created by
451 : * JS_NewSystemObject with the system flag set and not JS_NewObject.
452 : *
453 : * What "system" means is up to the API client.
454 : */
455 : extern JS_PUBLIC_API(JSBool)
456 : JS_IsSystemObject(JSContext *cx, JSObject *obj);
457 :
458 : /*
459 : * Mark an object as being a system object. This should be called immediately
460 : * after allocating the object. A system object is an object for which
461 : * JS_IsSystemObject returns true.
462 : */
463 : extern JS_PUBLIC_API(JSBool)
464 : JS_MakeSystemObject(JSContext *cx, JSObject *obj);
465 :
466 : /************************************************************************/
467 :
468 : extern JS_FRIEND_API(void)
469 : js_RevertVersion(JSContext *cx);
470 :
471 : extern JS_PUBLIC_API(const JSDebugHooks *)
472 : JS_GetGlobalDebugHooks(JSRuntime *rt);
473 :
474 : /**
475 : * Start any profilers that are available and have been configured on for this
476 : * platform. This is NOT thread safe.
477 : *
478 : * The profileName is used by some profilers to describe the current profiling
479 : * run. It may be used for part of the filename of the output, but the
480 : * specifics depend on the profiler. Many profilers will ignore it. Passing in
481 : * NULL is legal; some profilers may use it to output to stdout or similar.
482 : *
483 : * Returns true if no profilers fail to start.
484 : */
485 : extern JS_PUBLIC_API(JSBool)
486 : JS_StartProfiling(const char *profileName);
487 :
488 : /**
489 : * Stop any profilers that were previously started with JS_StartProfiling.
490 : * Returns true if no profilers fail to stop.
491 : */
492 : extern JS_PUBLIC_API(JSBool)
493 : JS_StopProfiling(const char *profileName);
494 :
495 : /**
496 : * Write the current profile data to the given file, if applicable to whatever
497 : * profiler is being used.
498 : */
499 : extern JS_PUBLIC_API(JSBool)
500 : JS_DumpProfile(const char *outfile, const char *profileName);
501 :
502 : /**
503 : * Pause currently active profilers (only supported by some profilers). Returns
504 : * whether any profilers failed to pause. (Profilers that do not support
505 : * pause/resume do not count.)
506 : */
507 : extern JS_PUBLIC_API(JSBool)
508 : JS_PauseProfilers(const char *profileName);
509 :
510 : /**
511 : * Resume suspended profilers
512 : */
513 : extern JS_PUBLIC_API(JSBool)
514 : JS_ResumeProfilers(const char *profileName);
515 :
516 : /**
517 : * Add various profiling-related functions as properties of the given object.
518 : */
519 : extern JS_PUBLIC_API(JSBool)
520 : JS_DefineProfilingFunctions(JSContext *cx, JSObject *obj);
521 :
522 : /* Defined in vm/Debugger.cpp. */
523 : extern JS_PUBLIC_API(JSBool)
524 : JS_DefineDebuggerObject(JSContext *cx, JSObject *obj);
525 :
526 : /**
527 : * The profiling API calls are not able to report errors, so they use a
528 : * thread-unsafe global memory buffer to hold the last error encountered. This
529 : * should only be called after something returns false.
530 : */
531 : JS_PUBLIC_API(const char *)
532 : JS_UnsafeGetLastProfilingError();
533 :
534 : #ifdef MOZ_CALLGRIND
535 :
536 : extern JS_FRIEND_API(JSBool)
537 : js_StopCallgrind();
538 :
539 : extern JS_FRIEND_API(JSBool)
540 : js_StartCallgrind();
541 :
542 : extern JS_FRIEND_API(JSBool)
543 : js_DumpCallgrind(const char *outfile);
544 :
545 : #endif /* MOZ_CALLGRIND */
546 :
547 : #ifdef MOZ_VTUNE
548 :
549 : extern JS_FRIEND_API(bool)
550 : js_StartVtune(const char *profileName);
551 :
552 : extern JS_FRIEND_API(bool)
553 : js_StopVtune();
554 :
555 : extern JS_FRIEND_API(bool)
556 : js_PauseVtune();
557 :
558 : extern JS_FRIEND_API(bool)
559 : js_ResumeVtune();
560 :
561 : #endif /* MOZ_VTUNE */
562 :
563 : extern JS_PUBLIC_API(void)
564 : JS_DumpBytecode(JSContext *cx, JSScript *script);
565 :
566 : extern JS_PUBLIC_API(void)
567 : JS_DumpCompartmentBytecode(JSContext *cx);
568 :
569 : extern JS_PUBLIC_API(void)
570 : JS_DumpPCCounts(JSContext *cx, JSScript *script);
571 :
572 : extern JS_PUBLIC_API(void)
573 : JS_DumpCompartmentPCCounts(JSContext *cx);
574 :
575 : extern JS_PUBLIC_API(JSObject *)
576 : JS_UnwrapObject(JSObject *obj);
577 :
578 : /* Call the context debug handler on the topmost scripted frame. */
579 : extern JS_FRIEND_API(JSBool)
580 : js_CallContextDebugHandler(JSContext *cx);
581 :
582 : JS_END_EXTERN_C
583 :
584 : #endif /* jsdbgapi_h___ */
|