summaryrefslogtreecommitdiffstats
path: root/js/src/jsapi-tests/tests.h
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-02-03 19:02:06 +0100
committerwolfbeast <mcwerewolf@gmail.com>2018-02-03 19:03:05 +0100
commit10494e1b7d0b3cd945bb76dca10f5637cf786f27 (patch)
tree8a6487e386c06e7dfe63f2a4f2ffe5b589c59f60 /js/src/jsapi-tests/tests.h
parent559933a9a58f96ac62ad0f60602f45344581604f (diff)
parente27da6cc5e825b58f810b368b2bd59bca2164ab0 (diff)
downloadUXP-10494e1b7d0b3cd945bb76dca10f5637cf786f27.tar
UXP-10494e1b7d0b3cd945bb76dca10f5637cf786f27.tar.gz
UXP-10494e1b7d0b3cd945bb76dca10f5637cf786f27.tar.lz
UXP-10494e1b7d0b3cd945bb76dca10f5637cf786f27.tar.xz
UXP-10494e1b7d0b3cd945bb76dca10f5637cf786f27.zip
Merge branch 'ported-moebius'
Remove GCZeal code from Spidermonkey. This resolves #8
Diffstat (limited to 'js/src/jsapi-tests/tests.h')
-rw-r--r--js/src/jsapi-tests/tests.h35
1 files changed, 0 insertions, 35 deletions
diff --git a/js/src/jsapi-tests/tests.h b/js/src/jsapi-tests/tests.h
index 9955621ef..7f7309c16 100644
--- a/js/src/jsapi-tests/tests.h
+++ b/js/src/jsapi-tests/tests.h
@@ -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 */