From 9e51ec3c3005afc9714eb3142c8f5b1d8c3600a5 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Wed, 20 May 2015 16:34:07 -0400 Subject: [PATCH] Backed out 3 changesets (bug 1165966) for WinXP jit-test permatimeouts. Backed out changeset b0e3b5db76dc (bug 1165966) Backed out changeset 73f1d1a18c24 (bug 1165966) Backed out changeset 06899ee5f676 (bug 1165966) CLOSED TREE --- js/src/gc/Barrier.cpp | 7 --- js/src/gc/Barrier.h | 8 +-- js/src/jit-test/tests/gc/bug-1164532.js | 10 ---- js/src/jit-test/tests/gc/bug-1165966.js | 24 --------- js/src/jit/BacktrackingAllocator.cpp | 12 ++--- js/src/jsweakmap.cpp | 5 +- js/src/jsweakmap.h | 2 +- js/src/vm/Debugger.cpp | 2 +- js/src/vm/Runtime.cpp | 1 - js/src/vm/Runtime.h | 68 ------------------------- 10 files changed, 9 insertions(+), 130 deletions(-) delete mode 100644 js/src/jit-test/tests/gc/bug-1164532.js delete mode 100644 js/src/jit-test/tests/gc/bug-1165966.js diff --git a/js/src/gc/Barrier.cpp b/js/src/gc/Barrier.cpp index d79c02a7b361..17d8d44abe1e 100644 --- a/js/src/gc/Barrier.cpp +++ b/js/src/gc/Barrier.cpp @@ -50,13 +50,6 @@ js::CurrentThreadIsGCSweeping() return js::TlsPerThreadData.get()->gcSweeping; } -bool -js::CurrentThreadIsHandlingInitFailure() -{ - JSRuntime* rt = js::TlsPerThreadData.get()->runtimeIfOnOwnerThread(); - return rt && rt->handlingInitFailure; -} - #endif // DEBUG template diff --git a/js/src/gc/Barrier.h b/js/src/gc/Barrier.h index a633508c801c..16dc08d20298 100644 --- a/js/src/gc/Barrier.h +++ b/js/src/gc/Barrier.h @@ -212,9 +212,6 @@ CurrentThreadIsIonCompiling(); bool CurrentThreadIsGCSweeping(); - -bool -CurrentThreadIsHandlingInitFailure(); #endif namespace gc { @@ -442,9 +439,8 @@ class HeapPtr : public BarrieredBase explicit HeapPtr(const HeapPtr& v) : BarrieredBase(v) { post(); } #ifdef DEBUG ~HeapPtr() { - // No prebarrier necessary as this only happens when we are sweeping or - // before the containing obect becomes part of the GC graph. - MOZ_ASSERT(CurrentThreadIsGCSweeping() || CurrentThreadIsHandlingInitFailure()); + // No prebarrier necessary as this only happens when we are sweeping. + MOZ_ASSERT(CurrentThreadIsGCSweeping()); } #endif diff --git a/js/src/jit-test/tests/gc/bug-1164532.js b/js/src/jit-test/tests/gc/bug-1164532.js deleted file mode 100644 index 2452425ad43d..000000000000 --- a/js/src/jit-test/tests/gc/bug-1164532.js +++ /dev/null @@ -1,10 +0,0 @@ -// |jit-test| --fuzzing-safe; --thread-count=2; --no-ggc; allow-unhandlable-oom; allow-oom -if (!("oomAfterAllocations" in this)) - quit(); -var g = newGlobal("ar-u-nu-arab", this); -function attach(g, i) { - var dbg = Debugger(g); - oomAfterAllocations(10); -} -for (var i = 0; i < 3; i++) - attach(g, i); diff --git a/js/src/jit-test/tests/gc/bug-1165966.js b/js/src/jit-test/tests/gc/bug-1165966.js deleted file mode 100644 index 2906ea326472..000000000000 --- a/js/src/jit-test/tests/gc/bug-1165966.js +++ /dev/null @@ -1,24 +0,0 @@ -// |jit-test| --fuzzing-safe; --thread-count=2; --no-ggc; allow-unhandlable-oom; allow-oom -if (!("oomAfterAllocations" in this)) - quit(); -var lfcode = new Array(); -lfcode.push(` -var g = newGlobal(); -var N = 4; -for (var i = 0; i < N; i++) { - var dbg = Debugger(g); - oomAfterAllocations(10); -} -`); -options = function() {} -var lfRunTypeId = -1; -var file = lfcode.shift(); -loadFile(file) -function loadFile(lfVarx) { - if (lfVarx.substr(-7) != ".js" && lfVarx.length != 2) unescape("x"); - try { - if (lfVarx.substr(-3) != ".js" && lfVarx.length != 1) { - evaluate(lfVarx); - } - } catch (lfVare) {} -} diff --git a/js/src/jit/BacktrackingAllocator.cpp b/js/src/jit/BacktrackingAllocator.cpp index fb04435b5c66..6830bdd6f979 100644 --- a/js/src/jit/BacktrackingAllocator.cpp +++ b/js/src/jit/BacktrackingAllocator.cpp @@ -2030,22 +2030,18 @@ BacktrackingAllocator::populateSafepoints() safepoint->addGcPointer(a); break; case LDefinition::SLOTS: - if (!safepoint->addSlotsOrElementsPointer(a)) - return false; + safepoint->addSlotsOrElementsPointer(a); break; #ifdef JS_NUNBOX32 case LDefinition::TYPE: - if (!safepoint->addNunboxType(i, a)) - return false; + safepoint->addNunboxType(i, a); break; case LDefinition::PAYLOAD: - if (!safepoint->addNunboxPayload(i, a)) - return false; + safepoint->addNunboxPayload(i, a); break; #else case LDefinition::BOX: - if (!safepoint->addBoxedValue(a)) - return false; + safepoint->addBoxedValue(a); break; #endif default: diff --git a/js/src/jsweakmap.cpp b/js/src/jsweakmap.cpp index 19fbeac44c83..6e2e1aa6cfa9 100644 --- a/js/src/jsweakmap.cpp +++ b/js/src/jsweakmap.cpp @@ -39,10 +39,7 @@ WeakMapBase::WeakMapBase(JSObject* memOf, JSCompartment* c) WeakMapBase::~WeakMapBase() { - MOZ_ASSERT(CurrentThreadIsGCSweeping() || CurrentThreadIsHandlingInitFailure()); - MOZ_ASSERT_IF(CurrentThreadIsGCSweeping(), !isInList()); - if (isInList()) - removeWeakMapFromList(this); + MOZ_ASSERT(!isInList()); } void diff --git a/js/src/jsweakmap.h b/js/src/jsweakmap.h index cf00158a74cf..0b3923ffe436 100644 --- a/js/src/jsweakmap.h +++ b/js/src/jsweakmap.h @@ -92,7 +92,7 @@ class WeakMapBase { virtual void finish() = 0; // Object that this weak map is part of, if any. - HeapPtrObject memberOf; + RelocatablePtrObject memberOf; // Compartment that this weak map is part of. JSCompartment* compartment; diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp index 0bca1f4fedc7..4359f6b2d4e9 100644 --- a/js/src/vm/Debugger.cpp +++ b/js/src/vm/Debugger.cpp @@ -3109,7 +3109,7 @@ Debugger::construct(JSContext* cx, unsigned argc, Value* vp) Debugger* debugger; { /* Construct the underlying C++ object. */ - AutoInitGCManagedObject dbg(cx->make_unique(cx, obj.get())); + auto dbg = cx->make_unique(cx, obj.get()); if (!dbg || !dbg->init(cx)) return false; diff --git a/js/src/vm/Runtime.cpp b/js/src/vm/Runtime.cpp index 74eda339536f..47693c521580 100644 --- a/js/src/vm/Runtime.cpp +++ b/js/src/vm/Runtime.cpp @@ -172,7 +172,6 @@ JSRuntime::JSRuntime(JSRuntime* parentRuntime) profilingScripts(false), suppressProfilerSampling(false), hadOutOfMemory(false), - handlingInitFailure(false), haveCreatedContext(false), allowRelazificationForTesting(false), data(nullptr), diff --git a/js/src/vm/Runtime.h b/js/src/vm/Runtime.h index 96a7acf4778e..66e1161983ed 100644 --- a/js/src/vm/Runtime.h +++ b/js/src/vm/Runtime.h @@ -1077,9 +1077,6 @@ struct JSRuntime : public JS::shadow::Runtime, /* Had an out-of-memory error which did not populate an exception. */ bool hadOutOfMemory; - /* We are curently deleting an object due to an initialization failure. */ - mozilla::DebugOnly handlingInitFailure; - /* A context has been created on this runtime. */ bool haveCreatedContext; @@ -1929,71 +1926,6 @@ class AutoEnterIonCompilation MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER }; -/* - * AutoInitGCManagedObject is a wrapper for use when initializing a object whose - * lifetime is managed by the GC. It ensures that the object is destroyed if - * initialization fails but also allows us to assert the invariant that such - * objects are only destroyed in this way or by the GC. - * - * It has a limited interface but is a drop-in replacement for UniquePtr is - * this situation. For example: - * - * AutoInitGCManagedObject ptr(cx->make_unique()); - * if (!ptr) { - * ReportOutOfMemory(cx); - * return nullptr; - * } - * - * if (!ptr->init(cx)) - * return nullptr; // Object destroyed here if init() failed. - * - * object->setPrivate(ptr.release()); - * // Initialization successful, ptr is now owned through another object. - */ -template -class MOZ_STACK_CLASS AutoInitGCManagedObject -{ - typedef mozilla::UniquePtr> UniquePtrT; - - UniquePtrT ptr_; - - public: - explicit AutoInitGCManagedObject(UniquePtrT&& ptr) - : ptr_(mozilla::Move(ptr)) - {} - - ~AutoInitGCManagedObject() { -#ifdef DEBUG - if (ptr_) { - JSRuntime* rt = TlsPerThreadData.get()->runtimeFromMainThread(); - MOZ_ASSERT(!rt->handlingInitFailure); - rt->handlingInitFailure = true; - ptr_.reset(nullptr); - rt->handlingInitFailure = false; - } -#endif - } - - T& operator*() const { - return *ptr_.get(); - } - - T* operator->() const { - return ptr_.get(); - } - - explicit operator bool() const { - return ptr_.get() != nullptr; - } - - T* release() { - return ptr_.release(); - } - - AutoInitGCManagedObject(const AutoInitGCManagedObject& other) = delete; - AutoInitGCManagedObject& operator=(const AutoInitGCManagedObject& other) = delete; -}; - } /* namespace js */ #ifdef _MSC_VER