mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 877473 - Expose tools to help fuzz generational GC; r=billm
--HG-- extra : rebase_source : 46dd430429e31ab380b61ef8b0019fc20a411961
This commit is contained in:
parent
429053fc39
commit
302cbbbed5
@ -224,6 +224,20 @@ GC(JSContext *cx, unsigned argc, jsval *vp)
|
||||
return true;
|
||||
}
|
||||
|
||||
static JSBool
|
||||
MinorGC(JSContext *cx, unsigned argc, jsval *vp)
|
||||
{
|
||||
#ifdef JSGC_GENERATIONAL
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
|
||||
if (args.get(0) == BooleanValue(true))
|
||||
cx->runtime()->gcStoreBuffer.setOverflowed();
|
||||
|
||||
MinorGC(cx->runtime(), gcreason::API);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
static const struct ParamPair {
|
||||
const char *name;
|
||||
JSGCParamKey param;
|
||||
@ -993,6 +1007,11 @@ static JSFunctionSpecWithHelp TestingFunctions[] = {
|
||||
" If 'compartment' is given, GC any compartments that were scheduled for\n"
|
||||
" GC via schedulegc."),
|
||||
|
||||
JS_FN_HELP("minorgc", ::MinorGC, 0, 0,
|
||||
"minorgc([overflow])",
|
||||
" Run a minor collector on the Nursery. When overflow is true, marks the\n"
|
||||
" store buffer as overflowed before collecting."),
|
||||
|
||||
JS_FN_HELP("gcparam", GCParameter, 2, 0,
|
||||
"gcparam(name [, value])",
|
||||
" Wrapper for JS_[GS]etGCParameter. The name is either maxBytes,\n"
|
||||
|
@ -433,10 +433,6 @@ class StoreBuffer
|
||||
RelocValueBufferSize + RelocCellBufferSize +
|
||||
GenericBufferSize;
|
||||
|
||||
/* For use by our owned buffers. */
|
||||
void setAboutToOverflow();
|
||||
void setOverflowed();
|
||||
|
||||
public:
|
||||
explicit StoreBuffer(JSRuntime *rt)
|
||||
: bufferVal(this), bufferCell(this), bufferSlot(this), bufferWholeObject(this),
|
||||
@ -496,6 +492,10 @@ class StoreBuffer
|
||||
bool coalesceForVerification();
|
||||
void releaseVerificationData();
|
||||
bool containsEdgeAt(void *loc) const;
|
||||
|
||||
/* For use by our owned buffers and for testing. */
|
||||
void setAboutToOverflow();
|
||||
void setOverflowed();
|
||||
};
|
||||
|
||||
} /* namespace gc */
|
||||
|
Loading…
Reference in New Issue
Block a user