summaryrefslogtreecommitdiffstats
path: root/js/src/jsiter.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-05-15 20:56:36 +0000
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-05-15 20:56:36 +0000
commit8feffe7079e516a63a6cc5fd9b2c759c7431cf33 (patch)
tree44903c087da792c1cc118557977f2f5fa57bdf71 /js/src/jsiter.cpp
parent5fd4b87267ba8f3c667533b0336554a7cc008876 (diff)
downloadUXP-8feffe7079e516a63a6cc5fd9b2c759c7431cf33.tar
UXP-8feffe7079e516a63a6cc5fd9b2c759c7431cf33.tar.gz
UXP-8feffe7079e516a63a6cc5fd9b2c759c7431cf33.tar.lz
UXP-8feffe7079e516a63a6cc5fd9b2c759c7431cf33.tar.xz
UXP-8feffe7079e516a63a6cc5fd9b2c759c7431cf33.zip
Remove unboxed object code from iteration.
Diffstat (limited to 'js/src/jsiter.cpp')
-rw-r--r--js/src/jsiter.cpp42
1 files changed, 10 insertions, 32 deletions
diff --git a/js/src/jsiter.cpp b/js/src/jsiter.cpp
index c1ae5dc15..004c7fc0d 100644
--- a/js/src/jsiter.cpp
+++ b/js/src/jsiter.cpp
@@ -157,8 +157,11 @@ SortComparatorIntegerIds(jsid a, jsid b, bool* lessOrEqualp)
}
static bool
-EnumerateNativeProperties(JSContext* cx, HandleNativeObject pobj, unsigned flags, Maybe<IdSet>& ht,
- AutoIdVector* props, Handle<UnboxedPlainObject*> unboxed = nullptr)
+EnumerateNativeProperties(JSContext* cx,
+ HandleNativeObject pobj,
+ unsigned flags,
+ Maybe<IdSet>& ht,
+ AutoIdVector* props)
{
bool enumerateSymbols;
if (flags & JSITER_SYMBOLSONLY) {
@@ -220,16 +223,6 @@ EnumerateNativeProperties(JSContext* cx, HandleNativeObject pobj, unsigned flags
return false;
}
- if (unboxed) {
- // If |unboxed| is set then |pobj| is the expando for an unboxed
- // plain object we are enumerating. Add the unboxed properties
- // themselves here since they are all property names that were
- // given to the object before any of the expando's properties.
- MOZ_ASSERT(pobj->is<UnboxedExpandoObject>());
- if (!EnumerateExtraProperties(cx, unboxed, flags, ht, props))
- return false;
- }
-
size_t initialLength = props->length();
/* Collect all unique property names from this object's shape. */
@@ -355,22 +348,12 @@ Snapshot(JSContext* cx, HandleObject pobj_, unsigned flags, AutoIdVector* props)
do {
if (pobj->getOpsEnumerate()) {
- if (pobj->is<UnboxedPlainObject>() && pobj->as<UnboxedPlainObject>().maybeExpando()) {
- // Special case unboxed objects with an expando object.
- RootedNativeObject expando(cx, pobj->as<UnboxedPlainObject>().maybeExpando());
- if (!EnumerateNativeProperties(cx, expando, flags, ht, props,
- pobj.as<UnboxedPlainObject>()))
- {
- return false;
- }
- } else {
- if (!EnumerateExtraProperties(cx, pobj, flags, ht, props))
- return false;
+ if (!EnumerateExtraProperties(cx, pobj, flags, ht, props))
+ return false;
- if (pobj->isNative()) {
- if (!EnumerateNativeProperties(cx, pobj.as<NativeObject>(), flags, ht, props))
- return false;
- }
+ if (pobj->isNative()) {
+ if (!EnumerateNativeProperties(cx, pobj.as<NativeObject>(), flags, ht, props))
+ return false;
}
} else if (pobj->isNative()) {
// Give the object a chance to resolve all lazy properties
@@ -785,11 +768,6 @@ CanCompareIterableObjectToCache(JSObject* obj)
{
if (obj->isNative())
return obj->as<NativeObject>().hasEmptyElements();
- if (obj->is<UnboxedPlainObject>()) {
- if (UnboxedExpandoObject* expando = obj->as<UnboxedPlainObject>().maybeExpando())
- return expando->hasEmptyElements();
- return true;
- }
return false;
}