summaryrefslogtreecommitdiffstats
path: root/js/src/vm/ObjectGroup.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-06-16 19:55:05 +0000
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-06-16 19:55:05 +0000
commit9cfa398a1eca20f4ebf6bd472ad999860ef12cfc (patch)
tree4f4e114527ac511393f8c197cf7bcd3bf273873c /js/src/vm/ObjectGroup.cpp
parent7d93d4989f49bfcb1aa6b87f81332332a750c49c (diff)
downloadUXP-9cfa398a1eca20f4ebf6bd472ad999860ef12cfc.tar
UXP-9cfa398a1eca20f4ebf6bd472ad999860ef12cfc.tar.gz
UXP-9cfa398a1eca20f4ebf6bd472ad999860ef12cfc.tar.lz
UXP-9cfa398a1eca20f4ebf6bd472ad999860ef12cfc.tar.xz
UXP-9cfa398a1eca20f4ebf6bd472ad999860ef12cfc.zip
Remove and clean up more code.
Diffstat (limited to 'js/src/vm/ObjectGroup.cpp')
-rw-r--r--js/src/vm/ObjectGroup.cpp34
1 files changed, 3 insertions, 31 deletions
diff --git a/js/src/vm/ObjectGroup.cpp b/js/src/vm/ObjectGroup.cpp
index 6b984a803..63ac33eea 100644
--- a/js/src/vm/ObjectGroup.cpp
+++ b/js/src/vm/ObjectGroup.cpp
@@ -838,17 +838,6 @@ ObjectGroup::newArrayObject(ExclusiveContext* cx,
AddTypePropertyId(cx, group, nullptr, JSID_VOID, elementType);
- if (elementType != TypeSet::UnknownType()) {
- // Keep track of the initial objects we create with this type.
- // If the initial ones have a consistent shape and property types, we
- // will try to use an unboxed layout for the group.
- PreliminaryObjectArrayWithTemplate* preliminaryObjects =
- cx->new_<PreliminaryObjectArrayWithTemplate>(nullptr);
- if (!preliminaryObjects)
- return nullptr;
- group->setPreliminaryObjects(preliminaryObjects);
- }
-
if (!p.add(cx, *table, ObjectGroupCompartment::ArrayObjectKey(elementType), group))
return nullptr;
}
@@ -856,9 +845,6 @@ ObjectGroup::newArrayObject(ExclusiveContext* cx,
// The type of the elements being added will already be reflected in type
// information.
ShouldUpdateTypes updateTypes = ShouldUpdateTypes::DontUpdate;
- if (group->maybePreliminaryObjects())
- group->maybePreliminaryObjects()->maybeAnalyze(cx, group);
-
return NewCopiedArrayTryUseGroup(cx, group, vp, length, newKind, updateTypes);
}
@@ -868,27 +854,13 @@ GiveObjectGroup(ExclusiveContext* cx, JSObject* source, JSObject* target)
{
MOZ_ASSERT(source->group() != target->group());
- if (!target->is<ArrayObject>())
+ if (!target->is<ArrayObject>() || !source->is<ArrayObject>()) {
return true;
-
- if (target->group()->maybePreliminaryObjects()) {
- bool force = IsInsideNursery(source);
- target->group()->maybePreliminaryObjects()->maybeAnalyze(cx, target->group(), force);
}
- ObjectGroup* sourceGroup = source->group();
-
- if (source->is<ArrayObject>()) {
- source->setGroup(target->group());
- } else {
- return true;
- }
+ source->setGroup(target->group());
- if (sourceGroup->maybePreliminaryObjects())
- sourceGroup->maybePreliminaryObjects()->unregisterObject(source);
- if (target->group()->maybePreliminaryObjects())
- target->group()->maybePreliminaryObjects()->registerNewObject(source);
- for (size_t i = 0; i < source->as<ArrayObject>().getDenseInitializedLength(); i++) {
+ for (size_t i = 0; i < source->as<ArrayObject>().getDenseInitializedLength(); i++) {
Value v = source->as<ArrayObject>().getDenseElement(i);
AddTypePropertyId(cx, source->group(), source, JSID_VOID, v);
}