зеркало из https://github.com/mozilla/gecko-dev.git
Bug 474500 - TM: Need an API to flush and (optionally?) deallocate the code cache per thread. r=dvander
This commit is contained in:
Родитель
defb6d3791
Коммит
f18ded3596
|
@ -2604,6 +2604,12 @@ JS_GetGCParameterForThread(JSContext *cx, JSGCParamKey key)
|
|||
#endif
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(void)
|
||||
JS_FlushCaches(JSContext *cx)
|
||||
{
|
||||
js_FlushJITCache(cx);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(intN)
|
||||
JS_AddExternalStringFinalizer(JSStringFinalizeOp finalizer)
|
||||
{
|
||||
|
|
|
@ -1324,6 +1324,15 @@ JS_SetGCParameterForThread(JSContext *cx, JSGCParamKey key, uint32 value);
|
|||
extern JS_PUBLIC_API(uint32)
|
||||
JS_GetGCParameterForThread(JSContext *cx, JSGCParamKey key);
|
||||
|
||||
/*
|
||||
* Flush the code cache for the current thread. The operation might be
|
||||
* delayed if the cache cannot be flushed currently because native
|
||||
* code is currently executing.
|
||||
*/
|
||||
|
||||
extern JS_PUBLIC_API(void)
|
||||
JS_FlushCaches(JSContext *cx);
|
||||
|
||||
/*
|
||||
* Add a finalizer for external strings created by JS_NewExternalString (see
|
||||
* below) using a type-code returned from this function, and that understands
|
||||
|
|
|
@ -3267,7 +3267,7 @@ class RegExpNativeCompiler {
|
|||
js_FragProfiling_FragFinalizer(frag, tm);
|
||||
}
|
||||
)
|
||||
js_ResetJIT(cx);
|
||||
js_FlushJITCache(cx);
|
||||
} else {
|
||||
if (!guard) insertGuard(loopLabel, re_chars, re_length);
|
||||
re->flags |= JSREG_NOCOMPILE;
|
||||
|
|
|
@ -2293,6 +2293,12 @@ ResetJIT(JSContext* cx, TraceVisFlushReason r)
|
|||
#define ResetJIT(cx, r) ResetJITImpl(cx)
|
||||
#endif
|
||||
|
||||
void
|
||||
js_FlushJITCache(JSContext *cx)
|
||||
{
|
||||
ResetJIT(cx, FR_OOM);
|
||||
}
|
||||
|
||||
static void
|
||||
TrashTree(JSContext* cx, TreeFragment* f);
|
||||
|
||||
|
|
|
@ -1479,7 +1479,7 @@ extern bool
|
|||
js_OverfullJITCache(JSTraceMonitor* tm);
|
||||
|
||||
extern void
|
||||
js_ResetJIT(JSContext* cx);
|
||||
js_FlushJITCache(JSContext* cx);
|
||||
|
||||
extern void
|
||||
js_PurgeJITOracle();
|
||||
|
|
Загрузка…
Ссылка в новой задаче