diff options
author | Matt A. Tobin <email@mattatobin.com> | 2018-02-03 15:50:22 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2018-02-03 15:50:22 -0500 |
commit | 0083d404eff36f873cde465d50cd34b112bd124f (patch) | |
tree | 465b1f4322c3a2439903d9cabb068169bf6b42c9 /js/src/jsapi-tests/tests.h | |
parent | c6856f968b8c85502f14c6c3412b00a05fc0c0de (diff) | |
parent | 10494e1b7d0b3cd945bb76dca10f5637cf786f27 (diff) | |
download | UXP-0083d404eff36f873cde465d50cd34b112bd124f.tar UXP-0083d404eff36f873cde465d50cd34b112bd124f.tar.gz UXP-0083d404eff36f873cde465d50cd34b112bd124f.tar.lz UXP-0083d404eff36f873cde465d50cd34b112bd124f.tar.xz UXP-0083d404eff36f873cde465d50cd34b112bd124f.zip |
Merge branch 'master' into configurebuild-work
Diffstat (limited to 'js/src/jsapi-tests/tests.h')
-rw-r--r-- | js/src/jsapi-tests/tests.h | 35 |
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 */ |