diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-06-16 19:55:05 +0000 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-06-18 10:29:34 +0000 |
commit | e9aac71c6d7fa67c7581e2bd75accae5a9699165 (patch) | |
tree | 4be98a3e8e1e87f974058bce82fe060b2db1885c /js/src/vm/ObjectGroup.cpp | |
parent | 85f9a95ddbc39a1b120eeb8280685e1ae40dc5dc (diff) | |
download | UXP-e9aac71c6d7fa67c7581e2bd75accae5a9699165.tar UXP-e9aac71c6d7fa67c7581e2bd75accae5a9699165.tar.gz UXP-e9aac71c6d7fa67c7581e2bd75accae5a9699165.tar.lz UXP-e9aac71c6d7fa67c7581e2bd75accae5a9699165.tar.xz UXP-e9aac71c6d7fa67c7581e2bd75accae5a9699165.zip |
Remove and clean up more code.
Diffstat (limited to 'js/src/vm/ObjectGroup.cpp')
-rw-r--r-- | js/src/vm/ObjectGroup.cpp | 34 |
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); } |