mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-11-03 21:17:31 +09:00
Remove Unboxed Object code from /vm, Part 3.
This commit is contained in:
parent
7ec709fb70
commit
aa89a14709
18 changed files with 13 additions and 1560 deletions
|
|
@ -18,11 +18,10 @@
|
|||
#include "vm/ArrayObject.h"
|
||||
#include "vm/Shape.h"
|
||||
#include "vm/TaggedProto.h"
|
||||
#include "vm/UnboxedObject.h"
|
||||
|
||||
#include "jsobjinlines.h"
|
||||
|
||||
#include "vm/UnboxedObject-inl.h"
|
||||
#include "vm/NativeObject-inl.h"
|
||||
|
||||
using namespace js;
|
||||
|
||||
|
|
@ -56,7 +55,6 @@ ObjectGroup::finalize(FreeOp* fop)
|
|||
if (newScriptDontCheckGeneration())
|
||||
newScriptDontCheckGeneration()->clear();
|
||||
fop->delete_(newScriptDontCheckGeneration());
|
||||
fop->delete_(maybeUnboxedLayoutDontCheckGeneration());
|
||||
if (maybePreliminaryObjectsDontCheckGeneration())
|
||||
maybePreliminaryObjectsDontCheckGeneration()->clear();
|
||||
fop->delete_(maybePreliminaryObjectsDontCheckGeneration());
|
||||
|
|
@ -83,8 +81,6 @@ ObjectGroup::sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const
|
|||
size_t n = 0;
|
||||
if (TypeNewScript* newScript = newScriptDontCheckGeneration())
|
||||
n += newScript->sizeOfIncludingThis(mallocSizeOf);
|
||||
if (UnboxedLayout* layout = maybeUnboxedLayoutDontCheckGeneration())
|
||||
n += layout->sizeOfIncludingThis(mallocSizeOf);
|
||||
return n;
|
||||
}
|
||||
|
||||
|
|
@ -530,8 +526,7 @@ ObjectGroup::defaultNewGroup(ExclusiveContext* cx, const Class* clasp,
|
|||
if (p) {
|
||||
ObjectGroup* group = p->group;
|
||||
MOZ_ASSERT_IF(clasp, group->clasp() == clasp);
|
||||
MOZ_ASSERT_IF(!clasp, group->clasp() == &PlainObject::class_ ||
|
||||
group->clasp() == &UnboxedPlainObject::class_);
|
||||
MOZ_ASSERT_IF(!clasp, group->clasp() == &PlainObject::class_);
|
||||
MOZ_ASSERT(group->proto() == proto);
|
||||
return group;
|
||||
}
|
||||
|
|
@ -971,46 +966,6 @@ js::CombinePlainObjectPropertyTypes(ExclusiveContext* cx, JSObject* newObj,
|
|||
}
|
||||
}
|
||||
}
|
||||
} else if (newObj->is<UnboxedPlainObject>()) {
|
||||
const UnboxedLayout& layout = newObj->as<UnboxedPlainObject>().layout();
|
||||
const int32_t* traceList = layout.traceList();
|
||||
if (!traceList)
|
||||
return true;
|
||||
|
||||
uint8_t* newData = newObj->as<UnboxedPlainObject>().data();
|
||||
uint8_t* oldData = oldObj->as<UnboxedPlainObject>().data();
|
||||
|
||||
for (; *traceList != -1; traceList++) {}
|
||||
traceList++;
|
||||
for (; *traceList != -1; traceList++) {
|
||||
JSObject* newInnerObj = *reinterpret_cast<JSObject**>(newData + *traceList);
|
||||
JSObject* oldInnerObj = *reinterpret_cast<JSObject**>(oldData + *traceList);
|
||||
|
||||
if (!newInnerObj || !oldInnerObj || SameGroup(oldInnerObj, newInnerObj))
|
||||
continue;
|
||||
|
||||
if (!GiveObjectGroup(cx, newInnerObj, oldInnerObj))
|
||||
return false;
|
||||
|
||||
if (SameGroup(oldInnerObj, newInnerObj))
|
||||
continue;
|
||||
|
||||
if (!GiveObjectGroup(cx, oldInnerObj, newInnerObj))
|
||||
return false;
|
||||
|
||||
if (SameGroup(oldInnerObj, newInnerObj)) {
|
||||
for (size_t i = 1; i < ncompare; i++) {
|
||||
if (compare[i].isObject() && SameGroup(&compare[i].toObject(), newObj)) {
|
||||
uint8_t* otherData = compare[i].toObject().as<UnboxedPlainObject>().data();
|
||||
JSObject* otherInnerObj = *reinterpret_cast<JSObject**>(otherData + *traceList);
|
||||
if (otherInnerObj && !SameGroup(otherInnerObj, newInnerObj)) {
|
||||
if (!GiveObjectGroup(cx, otherInnerObj, newInnerObj))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -1234,12 +1189,6 @@ ObjectGroup::newPlainObject(ExclusiveContext* cx, IdValuePair* properties, size_
|
|||
|
||||
RootedObjectGroup group(cx, p->value().group);
|
||||
|
||||
// Watch for existing groups which now use an unboxed layout.
|
||||
if (group->maybeUnboxedLayout()) {
|
||||
MOZ_ASSERT(group->unboxedLayout().properties().length() == nproperties);
|
||||
return UnboxedPlainObject::createWithProperties(cx, group, newKind, properties);
|
||||
}
|
||||
|
||||
// Update property types according to the properties we are about to add.
|
||||
// Do this before we do anything which can GC, which might move or remove
|
||||
// this table entry.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue