mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-11-02 12:37:31 +09:00
Remove remaining conditional GCZeal code.
Creates stubs: jsgc.h/cpp VerifyBarriers() stub MaybeVerifyBarriers() stub GCRuntime::computeNonIncrementalMarkingForValidation() stub GCRuntime::validateIncrementalMarking() stub GCRuntime::finishMarkingValidation() stub GCRuntime::pushZealSelectedObjects() stub bool useZeal? GCRuntime::runDebugGC() stub XPConnect: nsXPCComponents_Utils::SetGCZeal() stub (always NS_OK)
This commit is contained in:
parent
97a0673483
commit
b5de790f2a
20 changed files with 4 additions and 832 deletions
|
|
@ -94,36 +94,6 @@ BEGIN_TEST(testGCFinalizeCallback)
|
|||
CHECK(checkFinalizeStatus());
|
||||
CHECK(checkFinalizeIsZoneGC(true));
|
||||
|
||||
#ifdef JS_GC_ZEAL
|
||||
|
||||
/* Full GC with reset due to new zone, becoming zone GC. */
|
||||
|
||||
FinalizeCalls = 0;
|
||||
JS_SetGCZeal(cx, 9, 1000000);
|
||||
JS::PrepareForFullGC(cx);
|
||||
js::SliceBudget budget(js::WorkBudget(1));
|
||||
cx->gc.startDebugGC(GC_NORMAL, budget);
|
||||
CHECK(cx->gc.state() == js::gc::State::Mark);
|
||||
CHECK(cx->gc.isFullGc());
|
||||
|
||||
JS::RootedObject global4(cx, createTestGlobal());
|
||||
budget = js::SliceBudget(js::WorkBudget(1));
|
||||
cx->gc.debugGCSlice(budget);
|
||||
while (cx->gc.isIncrementalGCInProgress())
|
||||
cx->gc.debugGCSlice(budget);
|
||||
CHECK(!cx->gc.isIncrementalGCInProgress());
|
||||
CHECK(!cx->gc.isFullGc());
|
||||
CHECK(checkMultipleGroups());
|
||||
CHECK(checkFinalizeStatus());
|
||||
|
||||
for (unsigned i = 0; i < FinalizeCalls - 1; ++i)
|
||||
CHECK(!IsZoneGCBuffer[i]);
|
||||
CHECK(IsZoneGCBuffer[FinalizeCalls - 1]);
|
||||
|
||||
JS_SetGCZeal(cx, 0, 0);
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Make some use of the globals here to ensure the compiler doesn't optimize
|
||||
* them away in release builds, causing the zones to be collected and
|
||||
|
|
|
|||
|
|
@ -40,10 +40,6 @@ JSFunction* CreateGCThing(JSContext* cx)
|
|||
|
||||
BEGIN_TEST(testGCHeapPostBarriers)
|
||||
{
|
||||
#ifdef JS_GC_ZEAL
|
||||
AutoLeaveZeal nozeal(cx);
|
||||
#endif /* JS_GC_ZEAL */
|
||||
|
||||
/* Sanity check - objects start in the nursery and then become tenured. */
|
||||
JS_GC(cx);
|
||||
JS::RootedObject obj(cx, CreateGCThing<JSObject>(cx));
|
||||
|
|
|
|||
|
|
@ -101,10 +101,6 @@ class CCWTestTracer : public JS::CallbackTracer {
|
|||
|
||||
BEGIN_TEST(testTracingIncomingCCWs)
|
||||
{
|
||||
#ifdef JS_GC_ZEAL
|
||||
// Disable zeal modes because this test needs to control exactly when the GC happens.
|
||||
JS_SetGCZeal(cx, 0, 100);
|
||||
#endif
|
||||
JS_GC(cx);
|
||||
|
||||
JS::RootedObject global1(cx, JS::CurrentGlobalOrNull(cx));
|
||||
|
|
@ -146,10 +142,6 @@ countWrappers(JSCompartment* comp)
|
|||
|
||||
BEGIN_TEST(testDeadNurseryCCW)
|
||||
{
|
||||
#ifdef JS_GC_ZEAL
|
||||
// Disable zeal modes because this test needs to control exactly when the GC happens.
|
||||
JS_SetGCZeal(cx, 0, 100);
|
||||
#endif
|
||||
JS_GC(cx);
|
||||
|
||||
JS::RootedObject global1(cx, JS::CurrentGlobalOrNull(cx));
|
||||
|
|
@ -177,10 +169,6 @@ END_TEST(testDeadNurseryCCW)
|
|||
|
||||
BEGIN_TEST(testLiveNurseryCCW)
|
||||
{
|
||||
#ifdef JS_GC_ZEAL
|
||||
// Disable zeal modes because this test needs to control exactly when the GC happens.
|
||||
JS_SetGCZeal(cx, 0, 100);
|
||||
#endif
|
||||
JS_GC(cx);
|
||||
|
||||
JS::RootedObject global1(cx, JS::CurrentGlobalOrNull(cx));
|
||||
|
|
@ -208,10 +196,6 @@ END_TEST(testLiveNurseryCCW)
|
|||
|
||||
BEGIN_TEST(testLiveNurseryWrapperCCW)
|
||||
{
|
||||
#ifdef JS_GC_ZEAL
|
||||
// Disable zeal modes because this test needs to control exactly when the GC happens.
|
||||
JS_SetGCZeal(cx, 0, 100);
|
||||
#endif
|
||||
JS_GC(cx);
|
||||
|
||||
JS::RootedObject global1(cx, JS::CurrentGlobalOrNull(cx));
|
||||
|
|
@ -244,10 +228,6 @@ END_TEST(testLiveNurseryWrapperCCW)
|
|||
|
||||
BEGIN_TEST(testLiveNurseryWrappeeCCW)
|
||||
{
|
||||
#ifdef JS_GC_ZEAL
|
||||
// Disable zeal modes because this test needs to control exactly when the GC happens.
|
||||
JS_SetGCZeal(cx, 0, 100);
|
||||
#endif
|
||||
JS_GC(cx);
|
||||
|
||||
JS::RootedObject global1(cx, JS::CurrentGlobalOrNull(cx));
|
||||
|
|
@ -280,11 +260,6 @@ BEGIN_TEST(testIncrementalRoots)
|
|||
{
|
||||
JSRuntime* rt = cx->runtime();
|
||||
|
||||
#ifdef JS_GC_ZEAL
|
||||
// Disable zeal modes because this test needs to control exactly when the GC happens.
|
||||
JS_SetGCZeal(cx, 0, 100);
|
||||
#endif
|
||||
|
||||
// Construct a big object graph to mark. In JS, the resulting object graph
|
||||
// is equivalent to:
|
||||
//
|
||||
|
|
|
|||
|
|
@ -23,10 +23,6 @@ MinimizeHeap(JSContext* cx)
|
|||
|
||||
BEGIN_TEST(testGCUID)
|
||||
{
|
||||
#ifdef JS_GC_ZEAL
|
||||
AutoLeaveZeal nozeal(cx);
|
||||
#endif /* JS_GC_ZEAL */
|
||||
|
||||
uint64_t uid = 0;
|
||||
uint64_t tmp = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -418,39 +418,4 @@ class TestJSPrincipals : public JSPrincipals
|
|||
}
|
||||
};
|
||||
|
||||
#ifdef JS_GC_ZEAL
|
||||
/*
|
||||
* Temporarily disable the GC zeal setting. This is only useful in tests that
|
||||
* need very explicit GC behavior and should not be used elsewhere.
|
||||
*/
|
||||
class AutoLeaveZeal
|
||||
{
|
||||
JSContext* cx_;
|
||||
uint32_t zealBits_;
|
||||
uint32_t frequency_;
|
||||
|
||||
public:
|
||||
explicit AutoLeaveZeal(JSContext* cx) : cx_(cx) {
|
||||
uint32_t dummy;
|
||||
JS_GetGCZealBits(cx_, &zealBits_, &frequency_, &dummy);
|
||||
JS_SetGCZeal(cx_, 0, 0);
|
||||
JS::PrepareForFullGC(cx_);
|
||||
JS::GCForReason(cx_, GC_SHRINK, JS::gcreason::DEBUG_GC);
|
||||
}
|
||||
~AutoLeaveZeal() {
|
||||
for (size_t i = 0; i < sizeof(zealBits_) * 8; i++) {
|
||||
if (zealBits_ & (1 << i))
|
||||
JS_SetGCZeal(cx_, i, frequency_);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
uint32_t zealBitsAfter, frequencyAfter, dummy;
|
||||
JS_GetGCZealBits(cx_, &zealBitsAfter, &frequencyAfter, &dummy);
|
||||
MOZ_ASSERT(zealBitsAfter == zealBits_);
|
||||
MOZ_ASSERT(frequencyAfter == frequency_);
|
||||
#endif
|
||||
}
|
||||
};
|
||||
#endif /* JS_GC_ZEAL */
|
||||
|
||||
#endif /* jsapi_tests_tests_h */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue