Skip to content

Commit

Permalink
Backed out 5 changesets (bug 1473213) for devtools/client/debugger/ne…
Browse files Browse the repository at this point in the history
…w/test/mochitest/browser_dbg_rr_breakpoints-01.js failures

Backed out changeset 29f9f3ab9b41 (bug 1473213)
Backed out changeset 129c9ab66f59 (bug 1473213)
Backed out changeset 96e57dd562b8 (bug 1473213)
Backed out changeset e40d822d886b (bug 1473213)
Backed out changeset 8a10fc261acb (bug 1473213)
  • Loading branch information
bogdant-old committed Aug 8, 2018
1 parent 4e20187 commit 80c3d56
Show file tree
Hide file tree
Showing 15 changed files with 7 additions and 163 deletions.
3 changes: 0 additions & 3 deletions js/src/gc/Allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,6 @@ GCRuntime::tryNewTenuredThing(JSContext* cx, AllocKind kind, size_t thingSize)

checkIncrementalZoneState(cx, t);
gcTracer.traceTenuredAlloc(t, kind);
#if defined(NIGHTLY_BUILD)
cx->noteTenuredAlloc();
#endif
return t;
}

Expand Down
10 changes: 0 additions & 10 deletions js/src/gc/GC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7935,14 +7935,6 @@ GCRuntime::minorGC(JS::gcreason::Reason reason, gcstats::PhaseKind phase)
if (rt->mainContextFromOwnThread()->suppressGC)
return;

// Note that we aren't collecting the updated alloc counts from any helper
// threads. We should be but I'm not sure where to add that
// synchronisation.
uint32_t numAllocs = rt->mainContextFromOwnThread()->getAndResetAllocsThisZoneSinceMinorGC();
for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next())
numAllocs += zone->getAndResetTenuredAllocsSinceMinorGC();
rt->gc.stats().setAllocsSinceMinorGCTenured(numAllocs);

gcstats::AutoPhase ap(rt->gc.stats(), phase);

nursery().clearMinorGCRequest();
Expand Down Expand Up @@ -8228,8 +8220,6 @@ GCRuntime::mergeRealms(Realm* source, Realm* target)

// Merge the allocator, stats and UIDs in source's zone into target's zone.
target->zone()->arenas.adoptArenas(&source->zone()->arenas, targetZoneIsCollecting);
target->zone()->addTenuredAllocsSinceMinorGC(
source->zone()->getAndResetTenuredAllocsSinceMinorGC());
target->zone()->usage.adopt(source->zone()->usage);
target->zone()->adoptUniqueIds(source->zone());
target->zone()->adoptMallocBytes(source->zone());
Expand Down
3 changes: 0 additions & 3 deletions js/src/gc/GCRuntime.h
Original file line number Diff line number Diff line change
Expand Up @@ -1023,9 +1023,6 @@ class GCRuntime
const void* addressOfStringNurseryCurrentEnd() {
return nursery_.refNoCheck().addressOfCurrentStringEnd();
}
uint32_t* addressOfNurseryAllocCount() {
return stats().addressOfAllocsSinceMinorGCNursery();
}

void minorGC(JS::gcreason::Reason reason,
gcstats::PhaseKind phase = gcstats::PhaseKind::MINOR_GC) JS_HAZ_GC_CALL;
Expand Down
3 changes: 0 additions & 3 deletions js/src/gc/Marking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3003,7 +3003,6 @@ js::TenuringTracer::moveToTenuredSlow(JSObject* src)
}

tenuredSize += dstSize;
tenuredCells++;

// Copy the Cell contents.
MOZ_ASSERT(OffsetToChunkEnd(src) >= ptrdiff_t(srcSize));
Expand Down Expand Up @@ -3052,7 +3051,6 @@ js::TenuringTracer::movePlainObjectToTenured(PlainObject* src)

size_t srcSize = Arena::thingSize(dstKind);
tenuredSize += srcSize;
tenuredCells++;

// Copy the Cell contents.
MOZ_ASSERT(OffsetToChunkEnd(src) >= ptrdiff_t(srcSize));
Expand Down Expand Up @@ -3169,7 +3167,6 @@ js::TenuringTracer::moveToTenured(JSString* src)

JSString* dst = allocTenured<JSString>(zone, dstKind);
tenuredSize += moveStringToTenured(dst, src, dstKind);
tenuredCells++;

RelocationOverlay* overlay = RelocationOverlay::fromCell(src);
overlay->forwardTo(dst);
Expand Down
16 changes: 0 additions & 16 deletions js/src/gc/Nursery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,6 @@ js::Nursery::disable()
freeChunksFrom(0);
maxChunkCount_ = 0;

// We must reset currentEnd_ so that there is no space for anything in the
// nursery. JIT'd code uses this even if the nursery is disabled.
currentEnd_ = 0;
currentStringEnd_ = 0;
runtime()->gc.storeBuffer().disable();
Expand Down Expand Up @@ -396,9 +394,6 @@ js::Nursery::allocate(size_t size)

void* thing = (void*)position();
position_ = position() + size;
#if defined(NIGHTLY_BUILD)
runtime()->gc.stats().noteNurseryAlloc();
#endif

JS_EXTRA_POISON(thing, JS_ALLOCATED_NURSERY_PATTERN, size, MemCheckKind::MakeUndefined);

Expand Down Expand Up @@ -553,7 +548,6 @@ js::TenuringTracer::TenuringTracer(JSRuntime* rt, Nursery* nursery)
: JSTracer(rt, JSTracer::TracerKindTag::Tenuring, TraceWeakMapKeysValues)
, nursery_(*nursery)
, tenuredSize(0)
, tenuredCells(0)
, objHead(nullptr)
, objTail(&objHead)
, stringHead(nullptr)
Expand Down Expand Up @@ -613,7 +607,6 @@ js::Nursery::renderProfileJSON(JSONPrinter& json) const

json.property("reason", JS::gcreason::ExplainReason(previousGC.reason));
json.property("bytes_tenured", previousGC.tenuredBytes);
json.property("cells_tenured", previousGC.tenuredCells);
json.property("bytes_used", previousGC.nurseryUsedBytes);
json.property("cur_capacity", previousGC.nurseryCapacity);
const size_t newCapacity = spaceToEnd(maxChunkCount());
Expand All @@ -624,13 +617,6 @@ js::Nursery::renderProfileJSON(JSONPrinter& json) const
if (!timeInChunkAlloc_.IsZero())
json.property("chunk_alloc_us", timeInChunkAlloc_, json.MICROSECONDS);

#if defined(NIGHTLY_BUILD)
// We don't want the cost of collecting these on the allocation hot path
// in non-nightly builds.
json.property("cells_allocated_nursery", runtime()->gc.stats().allocsSinceMinorGCNursery());
json.property("cells_allocated_tenured", runtime()->gc.stats().allocsSinceMinorGCTenured());
#endif

json.beginObjectProperty("phase_times");

#define EXTRACT_NAME(name, text) #name,
Expand Down Expand Up @@ -763,7 +749,6 @@ js::Nursery::collect(JS::gcreason::Reason reason)
previousGC.nurseryCapacity = spaceToEnd(maxChunkCount());
previousGC.nurseryLazyCapacity = spaceToEnd(allocatedChunkCount());
previousGC.tenuredBytes = 0;
previousGC.tenuredCells = 0;
}

// Resize the nursery.
Expand Down Expand Up @@ -977,7 +962,6 @@ js::Nursery::doCollection(JS::gcreason::Reason reason, TenureCountCache& tenureC
previousGC.nurseryLazyCapacity = spaceToEnd(allocatedChunkCount());
previousGC.nurseryUsedBytes = initialNurseryUsedBytes;
previousGC.tenuredBytes = mover.tenuredSize;
previousGC.tenuredCells = mover.tenuredCells;
}

void
Expand Down
3 changes: 0 additions & 3 deletions js/src/gc/Nursery.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ class TenuringTracer : public JSTracer

// Amount of data moved to the tenured generation during collection.
size_t tenuredSize;
// Number of cells moved to the tenured generation.
size_t tenuredCells;

// These lists are threaded through the Nursery using the space from
// already moved things. The lists are used to fix up the moved things and
Expand Down Expand Up @@ -442,7 +440,6 @@ class Nursery
size_t nurseryLazyCapacity = 0;
size_t nurseryUsedBytes = 0;
size_t tenuredBytes = 0;
size_t tenuredCells = 0;
} previousGC;

/*
Expand Down
3 changes: 0 additions & 3 deletions js/src/gc/Statistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,6 @@ Statistics::Statistics(JSRuntime* rt)
gcTimerFile(nullptr),
gcDebugFile(nullptr),
nonincrementalReason_(gc::AbortReason::None),
allocsSinceMinorGC({0, 0}),
preBytes(0),
thresholdTriggered(false),
triggerAmount(0.0),
Expand Down Expand Up @@ -1047,8 +1046,6 @@ Statistics::endNurseryCollection(JS::gcreason::Reason reason)
JS::GCNurseryProgress::GC_NURSERY_COLLECTION_END,
reason);
}

allocsSinceMinorGC = {0, 0};
}

void
Expand Down
30 changes: 0 additions & 30 deletions js/src/gc/Statistics.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,27 +192,6 @@ struct Statistics
thresholdTriggered = true;
}

void noteNurseryAlloc() {
allocsSinceMinorGC.nursery++;
}

// tenured allocs don't include nursery evictions.
void setAllocsSinceMinorGCTenured(uint32_t allocs) {
allocsSinceMinorGC.tenured = allocs;
}

uint32_t allocsSinceMinorGCNursery() {
return allocsSinceMinorGC.nursery;
}

uint32_t allocsSinceMinorGCTenured() {
return allocsSinceMinorGC.tenured;
}

uint32_t* addressOfAllocsSinceMinorGCNursery() {
return &allocsSinceMinorGC.nursery;
}

void beginNurseryCollection(JS::gcreason::Reason reason);
void endNurseryCollection(JS::gcreason::Reason reason);

Expand Down Expand Up @@ -336,15 +315,6 @@ struct Statistics
mozilla::Atomic<uint32_t, mozilla::ReleaseAcquire,
mozilla::recordreplay::Behavior::DontPreserve>> counts;

/*
* These events cannot be kept in the above array, we need to take their
* address.
*/
struct {
uint32_t nursery;
uint32_t tenured;
} allocsSinceMinorGC;

/* Allocated space before the GC started. */
size_t preBytes;

Expand Down
1 change: 0 additions & 1 deletion js/src/gc/Zone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ JS::Zone::Zone(JSRuntime* rt)
uniqueIds_(this),
suppressAllocationMetadataBuilder(this, false),
arenas(this),
tenuredAllocsSinceMinorGC_(0),
types(this),
gcWeakMapList_(this),
compartments_(),
Expand Down
13 changes: 0 additions & 13 deletions js/src/gc/Zone.h
Original file line number Diff line number Diff line change
Expand Up @@ -340,19 +340,6 @@ class Zone : public JS::shadow::Zone,

js::gc::ArenaLists arenas;

private:
// Number of allocations since the most recent minor GC for this thread.
mozilla::Atomic<uint32_t, mozilla::Relaxed> tenuredAllocsSinceMinorGC_;

public:
void addTenuredAllocsSinceMinorGC(uint32_t allocs) {
tenuredAllocsSinceMinorGC_ += allocs;
}

uint32_t getAndResetTenuredAllocsSinceMinorGC() {
return tenuredAllocsSinceMinorGC_.exchange(0);
}

js::TypeZone types;

private:
Expand Down
6 changes: 0 additions & 6 deletions js/src/jit/CompileWrappers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,6 @@ CompileZone::addressOfStringNurseryCurrentEnd()
return zone()->runtimeFromAnyThread()->gc.addressOfStringNurseryCurrentEnd();
}

uint32_t*
CompileZone::addressOfNurseryAllocCount()
{
return zone()->runtimeFromAnyThread()->gc.addressOfNurseryAllocCount();
}

bool
CompileZone::canNurseryAllocateStrings()
{
Expand Down
2 changes: 0 additions & 2 deletions js/src/jit/CompileWrappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ class CompileZone
const void* addressOfNurseryCurrentEnd();
const void* addressOfStringNurseryCurrentEnd();

uint32_t* addressOfNurseryAllocCount();

bool nurseryExists();
bool canNurseryAllocateStrings();
void setMinorGCShouldCancelIonCompilations();
Expand Down
24 changes: 0 additions & 24 deletions js/src/jit/MacroAssembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -831,15 +831,6 @@ MacroAssembler::freeListAllocate(Register result, Register temp, gc::AllocKind a
Pop(result);

bind(&success);

#ifdef NIGHTLY_BUILD
// Only burden the nightly population with this.
if (GetJitContext()->cx) {
uint32_t* countAddress = GetJitContext()->cx->addressOfTenuredAllocCount();
movePtr(ImmPtr(countAddress), temp);
add32(Imm32(1), Address(temp, 0));
}
#endif
}

void
Expand Down Expand Up @@ -1002,21 +993,6 @@ MacroAssembler::bumpPointerAllocate(Register result, Register temp, Label* fail,
branchPtr(Assembler::Below, Address(temp, endOffset.value()), result, fail);
storePtr(result, Address(temp, 0));
subPtr(Imm32(size), result);

#if defined(NIGHTLY_BUILD)
// Only burden the nightly population with this,
// since this is the allocation fast path.
CompileZone* zone = GetJitContext()->realm->zone();
uint32_t* countAddress = zone->addressOfNurseryAllocCount();
CheckedInt<int32_t> counterOffset = (CheckedInt<uintptr_t>(uintptr_t(countAddress)) -
CheckedInt<uintptr_t>(uintptr_t(posAddr))).toChecked<int32_t>();
if (counterOffset.isValid()) {
add32(Imm32(1), Address(temp, counterOffset.value()));
} else {
movePtr(ImmPtr(countAddress), temp);
add32(Imm32(1), Address(temp, 0));
}
#endif
}

// Inlined equivalent of gc::AllocateString, jumping to fail if nursery
Expand Down
26 changes: 6 additions & 20 deletions js/src/vm/JSContext-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -416,24 +416,8 @@ inline void
JSContext::enterAtomsZone()
{
realm_ = nullptr;
setZone(runtime_->unsafeAtomsZone(), AtomsZone);
}

inline void
JSContext::setZone(js::Zone *zone, JSContext::IsAtomsZone isAtomsZone)
{
if (zone_)
zone_->addTenuredAllocsSinceMinorGC(allocsThisZoneSinceMinorGC_);

allocsThisZoneSinceMinorGC_ = 0;

zone_ = zone;
if (zone == nullptr) {
freeLists_ = nullptr;
return;
}

if (isAtomsZone == AtomsZone && helperThread()) {
zone_ = runtime_->unsafeAtomsZone();
if (helperThread()) {
MOZ_ASSERT(!zone_->wasGCStarted());
freeLists_ = atomsZoneFreeLists_;
} else {
Expand Down Expand Up @@ -500,9 +484,11 @@ JSContext::setRealm(JS::Realm* realm)
// This thread must have exclusive access to the zone.
MOZ_ASSERT(CurrentThreadCanAccessZone(realm->zone()));
MOZ_ASSERT(!realm->zone()->isAtomsZone());
setZone(realm->zone(), NotAtomsZone);
zone_ = realm->zone();
freeLists_ = &zone_->arenas.freeLists();
} else {
setZone(nullptr, NotAtomsZone);
zone_ = nullptr;
freeLists_ = nullptr;
}
}

Expand Down
27 changes: 1 addition & 26 deletions js/src/vm/JSContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,6 @@ struct JSContext : public JS::RootingContext,
// Free lists for allocating in the current zone.
js::ThreadData<js::gc::FreeLists*> freeLists_;

// This is reset each time we switch zone, then added to the variable in the
// zone when we switch away from it. This would be a js::ThreadData but we
// need to take its address.
uint32_t allocsThisZoneSinceMinorGC_;

// Free lists for parallel allocation in the atoms zone on helper threads.
js::ThreadData<js::gc::FreeLists*> atomsZoneFreeLists_;

Expand Down Expand Up @@ -203,20 +198,6 @@ struct JSContext : public JS::RootingContext,
js::ReportAllocationOverflow(this);
}

void noteTenuredAlloc() {
allocsThisZoneSinceMinorGC_++;
}

uint32_t* addressOfTenuredAllocCount() {
return &allocsThisZoneSinceMinorGC_;
}

uint32_t getAndResetAllocsThisZoneSinceMinorGC() {
uint32_t allocs = allocsThisZoneSinceMinorGC_;
allocsThisZoneSinceMinorGC_ = 0;
return allocs;
}

// Accessors for immutable runtime data.
JSAtomState& names() { return *runtime_->commonNames; }
js::StaticStrings& staticStrings() { return *runtime_->staticStrings; }
Expand Down Expand Up @@ -257,14 +238,7 @@ struct JSContext : public JS::RootingContext,
private:
inline void setRealm(JS::Realm* realm);
inline void enterRealm(JS::Realm* realm);

inline void enterAtomsZone();
inline void leaveAtomsZone(JS::Realm* oldRealm);
enum IsAtomsZone {
AtomsZone,
NotAtomsZone
};
inline void setZone(js::Zone* zone, IsAtomsZone isAtomsZone);

friend class js::AutoAllocInAtomsZone;
friend class js::AutoRealm;
Expand All @@ -278,6 +252,7 @@ struct JSContext : public JS::RootingContext,
inline void setRealmForJitExceptionHandler(JS::Realm* realm);

inline void leaveRealm(JS::Realm* oldRealm);
inline void leaveAtomsZone(JS::Realm* oldRealm);

void setHelperThread(js::HelperThread* helperThread);
js::HelperThread* helperThread() const { return helperThread_; }
Expand Down

0 comments on commit 80c3d56

Please sign in to comment.