50#define OOJS_PROFILE OOLITE_DEBUG
55#define OOJS_PROFILE_ENTER_NAMED(NAME) \
57 OOJS_DECLARE_PROFILE_STACK_FRAME(oojsProfilerStackFrame) \
59 OOJSProfileEnter(&oojsProfilerStackFrame, NAME);
61#define OOJS_PROFILE_ENTER \
62 OOJS_PROFILE_ENTER_NAMED(__FUNCTION__)
64#define OOJS_PROFILE_EXIT_VAL(rval) \
66 OOJSProfileExit(&oojsProfilerStackFrame); \
68 OOJSUnreachable(__FUNCTION__, __FILE__, __LINE__); \
71#define OOJS_PROFILE_EXIT_VOID return; OOJS_PROFILE_EXIT_VAL()
73#define OOJS_PROFILE_ENTER_FOR_NATIVE OOJS_PROFILE_ENTER
77#define OOJS_PROFILE_ENTER {
78#define OOJS_PROFILE_EXIT_VAL(rval) } OOJSUnreachable(__FUNCTION__, __FILE__, __LINE__); return (rval);
79#define OOJS_PROFILE_EXIT_VOID } return;
80#define OOJS_PROFILE_ENTER_FOR_NATIVE @try {
84#define OOJS_NATIVE_ENTER(cx) \
86 JSContext *oojsNativeContext = (cx); \
87 OOJS_PROFILE_ENTER_FOR_NATIVE
89#define OOJS_NATIVE_EXIT \
90 } @catch(id exception) { \
91 OOJSReportWrappedException(oojsNativeContext, exception); \
93 OOJS_PROFILE_EXIT_VAL(NO) \
103#define OOJSUnreachable(function, file, line) OO_UNREACHABLE()
107#define OOJS_PROFILE_EXIT OOJS_PROFILE_EXIT_VAL(0)
108#define OOJS_PROFILE_EXIT_JSVAL OOJS_PROFILE_EXIT_VAL(JSVAL_VOID)
124#define OOJS_BEGIN_FULL_NATIVE(context) \
126 OOJSPauseTimeLimiter(); \
127 JSContext *oojsRequestContext = (context); \
128 jsrefcount oojsRequestRefCount = JS_SuspendRequest(oojsRequestContext); \
132#define OOJS_END_FULL_NATIVE \
136 JS_ResumeRequest(oojsRequestContext, oojsRequestRefCount); \
137 OOJSResumeTimeLimiter(); \
141#define OOJS_BEGIN_FULL_NATIVE(context) \
144 OOJSPauseTimeLimiter(); \
148#define OOJS_END_FULL_NATIVE \
152 OOJSResumeTimeLimiter(); \
169typedef struct OOJSProfileStackFrame OOJSProfileStackFrame;
170struct OOJSProfileStackFrame
172 OOJSProfileStackFrame *back;
174 const char *function;
178 void (*cleanup)(OOJSProfileStackFrame *);
183#define OOJS_DECLARE_PROFILE_STACK_FRAME(name) OOJSProfileStackFrame name;
189#define OOJS_DECLARE_PROFILE_STACK_FRAME(name)
190#define OOJSProfileEnter(frame, function) do {} while (0)
191#define OOJSProfileExit(frame) do {} while (0)
void OOJSReportWrappedException(JSContext *context, id exception)
#define OOJSProfileExit(frame)
#define OOJSProfileEnter(frame, function)
void OOJSUnreachable(const char *function, const char *file, unsigned line) NO_RETURN_FUNC
uint64_t OOHighResTimeValue