зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1599416 - Part 7: Remove unused lazyArrayBuffers table. r=mgaudet
Entries are never added to `lazyArrayBuffers` resp. `lazyArrayBuffers` isn't even allocated anymore. Differential Revision: https://phabricator.services.mozilla.com/D54711 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
b576e1d462
Коммит
7818859fb9
|
@ -730,7 +730,6 @@ struct RealmStats {
|
||||||
MACRO(Other, MallocHeap, realmObject) \
|
MACRO(Other, MallocHeap, realmObject) \
|
||||||
MACRO(Other, MallocHeap, realmTables) \
|
MACRO(Other, MallocHeap, realmTables) \
|
||||||
MACRO(Other, MallocHeap, innerViewsTable) \
|
MACRO(Other, MallocHeap, innerViewsTable) \
|
||||||
MACRO(Other, MallocHeap, lazyArrayBuffersTable) \
|
|
||||||
MACRO(Other, MallocHeap, objectMetadataTable) \
|
MACRO(Other, MallocHeap, objectMetadataTable) \
|
||||||
MACRO(Other, MallocHeap, savedStacksSet) \
|
MACRO(Other, MallocHeap, savedStacksSet) \
|
||||||
MACRO(Other, MallocHeap, varNamesSet) \
|
MACRO(Other, MallocHeap, varNamesSet) \
|
||||||
|
|
|
@ -1515,13 +1515,6 @@ uint8_t* TypedObject::typedMemBase() const {
|
||||||
|
|
||||||
bool TypedObject::isAttached() const {
|
bool TypedObject::isAttached() const {
|
||||||
if (is<InlineTransparentTypedObject>()) {
|
if (is<InlineTransparentTypedObject>()) {
|
||||||
ObjectWeakMap* table = ObjectRealm::get(this).lazyArrayBuffers.get();
|
|
||||||
if (table) {
|
|
||||||
JSObject* buffer = table->lookup(this);
|
|
||||||
if (buffer) {
|
|
||||||
return !buffer->as<ArrayBufferObject>().isDetached();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (is<InlineOpaqueTypedObject>()) {
|
if (is<InlineOpaqueTypedObject>()) {
|
||||||
|
|
|
@ -240,9 +240,9 @@ static void StatsRealmCallback(JSContext* cx, void* data,
|
||||||
&realmStats.typeInferenceArrayTypeTables,
|
&realmStats.typeInferenceArrayTypeTables,
|
||||||
&realmStats.typeInferenceObjectTypeTables, &realmStats.realmObject,
|
&realmStats.typeInferenceObjectTypeTables, &realmStats.realmObject,
|
||||||
&realmStats.realmTables, &realmStats.innerViewsTable,
|
&realmStats.realmTables, &realmStats.innerViewsTable,
|
||||||
&realmStats.lazyArrayBuffersTable, &realmStats.objectMetadataTable,
|
&realmStats.objectMetadataTable, &realmStats.savedStacksSet,
|
||||||
&realmStats.savedStacksSet, &realmStats.varNamesSet,
|
&realmStats.varNamesSet, &realmStats.nonSyntacticLexicalScopesTable,
|
||||||
&realmStats.nonSyntacticLexicalScopesTable, &realmStats.jitRealm);
|
&realmStats.jitRealm);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void StatsArenaCallback(JSRuntime* rt, void* data, gc::Arena* arena,
|
static void StatsArenaCallback(JSRuntime* rt, void* data, gc::Arena* arena,
|
||||||
|
|
|
@ -276,10 +276,6 @@ void Realm::traceGlobal(JSTracer* trc) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectRealm::trace(JSTracer* trc) {
|
void ObjectRealm::trace(JSTracer* trc) {
|
||||||
if (lazyArrayBuffers) {
|
|
||||||
lazyArrayBuffers->trace(trc);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (objectMetadataTable) {
|
if (objectMetadataTable) {
|
||||||
objectMetadataTable->trace(trc);
|
objectMetadataTable->trace(trc);
|
||||||
}
|
}
|
||||||
|
@ -324,10 +320,6 @@ void Realm::traceRoots(JSTracer* trc,
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectRealm::finishRoots() {
|
void ObjectRealm::finishRoots() {
|
||||||
if (lazyArrayBuffers) {
|
|
||||||
lazyArrayBuffers->clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (objectMetadataTable) {
|
if (objectMetadataTable) {
|
||||||
objectMetadataTable->clear();
|
objectMetadataTable->clear();
|
||||||
}
|
}
|
||||||
|
@ -739,14 +731,10 @@ void Realm::collectCodeCoverageInfo(JSScript* script, const char* name) {
|
||||||
|
|
||||||
void ObjectRealm::addSizeOfExcludingThis(
|
void ObjectRealm::addSizeOfExcludingThis(
|
||||||
mozilla::MallocSizeOf mallocSizeOf, size_t* innerViewsArg,
|
mozilla::MallocSizeOf mallocSizeOf, size_t* innerViewsArg,
|
||||||
size_t* lazyArrayBuffersArg, size_t* objectMetadataTablesArg,
|
size_t* objectMetadataTablesArg,
|
||||||
size_t* nonSyntacticLexicalEnvironmentsArg) {
|
size_t* nonSyntacticLexicalEnvironmentsArg) {
|
||||||
*innerViewsArg += innerViews.sizeOfExcludingThis(mallocSizeOf);
|
*innerViewsArg += innerViews.sizeOfExcludingThis(mallocSizeOf);
|
||||||
|
|
||||||
if (lazyArrayBuffers) {
|
|
||||||
*lazyArrayBuffersArg += lazyArrayBuffers->sizeOfIncludingThis(mallocSizeOf);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (objectMetadataTable) {
|
if (objectMetadataTable) {
|
||||||
*objectMetadataTablesArg +=
|
*objectMetadataTablesArg +=
|
||||||
objectMetadataTable->sizeOfIncludingThis(mallocSizeOf);
|
objectMetadataTable->sizeOfIncludingThis(mallocSizeOf);
|
||||||
|
@ -761,10 +749,9 @@ void ObjectRealm::addSizeOfExcludingThis(
|
||||||
void Realm::addSizeOfIncludingThis(
|
void Realm::addSizeOfIncludingThis(
|
||||||
mozilla::MallocSizeOf mallocSizeOf, size_t* tiAllocationSiteTables,
|
mozilla::MallocSizeOf mallocSizeOf, size_t* tiAllocationSiteTables,
|
||||||
size_t* tiArrayTypeTables, size_t* tiObjectTypeTables, size_t* realmObject,
|
size_t* tiArrayTypeTables, size_t* tiObjectTypeTables, size_t* realmObject,
|
||||||
size_t* realmTables, size_t* innerViewsArg, size_t* lazyArrayBuffersArg,
|
size_t* realmTables, size_t* innerViewsArg, size_t* objectMetadataTablesArg,
|
||||||
size_t* objectMetadataTablesArg, size_t* savedStacksSet,
|
size_t* savedStacksSet, size_t* varNamesSet,
|
||||||
size_t* varNamesSet, size_t* nonSyntacticLexicalEnvironmentsArg,
|
size_t* nonSyntacticLexicalEnvironmentsArg, size_t* jitRealm) {
|
||||||
size_t* jitRealm) {
|
|
||||||
*realmObject += mallocSizeOf(this);
|
*realmObject += mallocSizeOf(this);
|
||||||
objectGroups_.addSizeOfExcludingThis(mallocSizeOf, tiAllocationSiteTables,
|
objectGroups_.addSizeOfExcludingThis(mallocSizeOf, tiAllocationSiteTables,
|
||||||
tiArrayTypeTables, tiObjectTypeTables,
|
tiArrayTypeTables, tiObjectTypeTables,
|
||||||
|
@ -772,7 +759,7 @@ void Realm::addSizeOfIncludingThis(
|
||||||
wasm.addSizeOfExcludingThis(mallocSizeOf, realmTables);
|
wasm.addSizeOfExcludingThis(mallocSizeOf, realmTables);
|
||||||
|
|
||||||
objects_.addSizeOfExcludingThis(mallocSizeOf, innerViewsArg,
|
objects_.addSizeOfExcludingThis(mallocSizeOf, innerViewsArg,
|
||||||
lazyArrayBuffersArg, objectMetadataTablesArg,
|
objectMetadataTablesArg,
|
||||||
nonSyntacticLexicalEnvironmentsArg);
|
nonSyntacticLexicalEnvironmentsArg);
|
||||||
|
|
||||||
*savedStacksSet += savedStacks_.sizeOfExcludingThis(mallocSizeOf);
|
*savedStacksSet += savedStacks_.sizeOfExcludingThis(mallocSizeOf);
|
||||||
|
|
|
@ -248,11 +248,6 @@ class ObjectRealm {
|
||||||
// Map from array buffers to views sharing that storage.
|
// Map from array buffers to views sharing that storage.
|
||||||
JS::WeakCache<js::InnerViewTable> innerViews;
|
JS::WeakCache<js::InnerViewTable> innerViews;
|
||||||
|
|
||||||
// Inline transparent typed objects do not initially have an array buffer,
|
|
||||||
// but can have that buffer created lazily if it is accessed later. This
|
|
||||||
// table manages references from such typed objects to their buffers.
|
|
||||||
js::UniquePtr<js::ObjectWeakMap> lazyArrayBuffers;
|
|
||||||
|
|
||||||
// Keep track of the metadata objects which can be associated with each JS
|
// Keep track of the metadata objects which can be associated with each JS
|
||||||
// object. Both keys and values are in this realm.
|
// object. Both keys and values are in this realm.
|
||||||
js::UniquePtr<js::ObjectWeakMap> objectMetadataTable;
|
js::UniquePtr<js::ObjectWeakMap> objectMetadataTable;
|
||||||
|
@ -276,7 +271,6 @@ class ObjectRealm {
|
||||||
|
|
||||||
void addSizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf,
|
void addSizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf,
|
||||||
size_t* innerViewsArg,
|
size_t* innerViewsArg,
|
||||||
size_t* lazyArrayBuffersArg,
|
|
||||||
size_t* objectMetadataTablesArg,
|
size_t* objectMetadataTablesArg,
|
||||||
size_t* nonSyntacticLexicalEnvironmentsArg);
|
size_t* nonSyntacticLexicalEnvironmentsArg);
|
||||||
|
|
||||||
|
@ -467,13 +461,15 @@ class JS::Realm : public JS::shadow::Realm {
|
||||||
void destroy(JSFreeOp* fop);
|
void destroy(JSFreeOp* fop);
|
||||||
void clearTables();
|
void clearTables();
|
||||||
|
|
||||||
void addSizeOfIncludingThis(
|
void addSizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf,
|
||||||
mozilla::MallocSizeOf mallocSizeOf, size_t* tiAllocationSiteTables,
|
size_t* tiAllocationSiteTables,
|
||||||
size_t* tiArrayTypeTables, size_t* tiObjectTypeTables,
|
size_t* tiArrayTypeTables,
|
||||||
size_t* realmObject, size_t* realmTables, size_t* innerViewsArg,
|
size_t* tiObjectTypeTables, size_t* realmObject,
|
||||||
size_t* lazyArrayBuffersArg, size_t* objectMetadataTablesArg,
|
size_t* realmTables, size_t* innerViewsArg,
|
||||||
size_t* savedStacksSet, size_t* varNamesSet,
|
size_t* objectMetadataTablesArg,
|
||||||
size_t* nonSyntacticLexicalEnvironmentsArg, size_t* jitRealm);
|
size_t* savedStacksSet, size_t* varNamesSet,
|
||||||
|
size_t* nonSyntacticLexicalEnvironmentsArg,
|
||||||
|
size_t* jitRealm);
|
||||||
|
|
||||||
JS::Zone* zone() { return zone_; }
|
JS::Zone* zone() { return zone_; }
|
||||||
const JS::Zone* zone() const { return zone_; }
|
const JS::Zone* zone() const { return zone_; }
|
||||||
|
|
|
@ -1895,10 +1895,6 @@ static void ReportRealmStats(const JS::RealmStats& realmStats,
|
||||||
realmStats.innerViewsTable,
|
realmStats.innerViewsTable,
|
||||||
"The table for array buffer inner views.");
|
"The table for array buffer inner views.");
|
||||||
|
|
||||||
ZRREPORT_BYTES(realmJSPathPrefix + NS_LITERAL_CSTRING("lazy-array-buffers"),
|
|
||||||
realmStats.lazyArrayBuffersTable,
|
|
||||||
"The table for typed object lazy array buffers.");
|
|
||||||
|
|
||||||
ZRREPORT_BYTES(
|
ZRREPORT_BYTES(
|
||||||
realmJSPathPrefix + NS_LITERAL_CSTRING("object-metadata"),
|
realmJSPathPrefix + NS_LITERAL_CSTRING("object-metadata"),
|
||||||
realmStats.objectMetadataTable,
|
realmStats.objectMetadataTable,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче