summaryrefslogtreecommitdiffstats
path: root/js/src/vm/ObjectGroup.cpp
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2019-06-08 19:26:40 -0400
committerGaming4JC <g4jc@hyperbola.info>2019-07-18 22:38:23 -0400
commit6bbc8d66646f49a1aa8a02765c1111bb3a92ee80 (patch)
treeb77ebf0048d8bddf12b51f8942bb38606f06ca2a /js/src/vm/ObjectGroup.cpp
parent2d1d2cefbbaff4b0380bfbcdab4631a1dcf142af (diff)
downloadUXP-6bbc8d66646f49a1aa8a02765c1111bb3a92ee80.tar
UXP-6bbc8d66646f49a1aa8a02765c1111bb3a92ee80.tar.gz
UXP-6bbc8d66646f49a1aa8a02765c1111bb3a92ee80.tar.lz
UXP-6bbc8d66646f49a1aa8a02765c1111bb3a92ee80.tar.xz
UXP-6bbc8d66646f49a1aa8a02765c1111bb3a92ee80.zip
1320408 - Part 6: Change JSObject::splicePrototype to static method.
Diffstat (limited to 'js/src/vm/ObjectGroup.cpp')
-rw-r--r--js/src/vm/ObjectGroup.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/js/src/vm/ObjectGroup.cpp b/js/src/vm/ObjectGroup.cpp
index 6e9000894..fbad85e57 100644
--- a/js/src/vm/ObjectGroup.cpp
+++ b/js/src/vm/ObjectGroup.cpp
@@ -262,19 +262,18 @@ JSObject::shouldSplicePrototype(JSContext* cx)
return isSingleton();
}
-bool
-JSObject::splicePrototype(JSContext* cx, const Class* clasp, Handle<TaggedProto> proto)
+/* static */ bool
+JSObject::splicePrototype(JSContext* cx, HandleObject obj, const Class* clasp,
+ Handle<TaggedProto> proto)
{
- MOZ_ASSERT(cx->compartment() == compartment());
-
- RootedObject self(cx, this);
+ MOZ_ASSERT(cx->compartment() == obj->compartment());
/*
* For singleton groups representing only a single JSObject, the proto
* can be rearranged as needed without destroying type information for
* the old or new types.
*/
- MOZ_ASSERT(self->isSingleton());
+ MOZ_ASSERT(obj->isSingleton());
// Windows may not appear on prototype chains.
MOZ_ASSERT_IF(proto.isObject(), !IsWindow(proto.toObject()));
@@ -283,7 +282,7 @@ JSObject::splicePrototype(JSContext* cx, const Class* clasp, Handle<TaggedProto>
return false;
// Force type instantiation when splicing lazy group.
- RootedObjectGroup group(cx, JSObject::getGroup(cx, self));
+ RootedObjectGroup group(cx, JSObject::getGroup(cx, obj));
if (!group)
return false;
RootedObjectGroup protoGroup(cx, nullptr);