mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Added branch monitoring using a single unified branch frequency counter.
This commit is contained in:
parent
a1bf0819b2
commit
17d0d41459
@ -2840,6 +2840,12 @@ JS_INTERPRET(JSContext *cx)
|
||||
#define LOAD_FUNCTION(PCOFF) \
|
||||
JS_GET_SCRIPT_FUNCTION(script, GET_FULL_INDEX(PCOFF), fun)
|
||||
|
||||
#ifndef MONITOR_BRANCH
|
||||
#define MONITOR_BRANCH \
|
||||
if ((JS_TRACE_MONITOR(cx).freq++ & TRACE_TRIGGER_MASK) == 0) \
|
||||
trace_start(cx, regs.pc);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Prepare to call a user-supplied branch handler, and abort the script
|
||||
* if it returns false.
|
||||
@ -2847,6 +2853,7 @@ JS_INTERPRET(JSContext *cx)
|
||||
#define CHECK_BRANCH(len) \
|
||||
JS_BEGIN_MACRO \
|
||||
if (len <= 0) { \
|
||||
MONITOR_BRANCH; \
|
||||
if ((cx->operationCount -= JSOW_SCRIPT_JUMP) <= 0) { \
|
||||
if (!js_ResetOperationCount(cx)) \
|
||||
goto error; \
|
||||
|
@ -457,8 +457,8 @@ PRIMITIVE(guard_both_jsvals_are_string)(jsval& a, jsval& b)
|
||||
static inline void
|
||||
PRIMITIVE(trace_start)(JSContext* cx, jsbytecode* pc)
|
||||
{
|
||||
jsval args[] = { native_pointer_to_jsval(pc) };
|
||||
js_CallRecorder(cx, "start", 1, args);
|
||||
//jsval args[] = { native_pointer_to_jsval(pc) };
|
||||
//js_CallRecorder(cx, "start", 1, args);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -53,10 +53,11 @@
|
||||
* a certain number of iterations and we recorded a tree for that loop.
|
||||
*/
|
||||
struct JSTraceMonitor {
|
||||
int freq;
|
||||
JSObject* recorder;
|
||||
};
|
||||
|
||||
#define TRACE_THRESHOLD 10
|
||||
#define TRACE_TRIGGER_MASK 0x3f
|
||||
|
||||
jsval js_CallRecorder(JSContext* cx, const char* fn, uintN argc, jsval* argv);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user