summaryrefslogtreecommitdiff
path: root/js/src/vm/Shape.h
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/vm/Shape.h')
-rw-r--r--js/src/vm/Shape.h33
1 files changed, 12 insertions, 21 deletions
diff --git a/js/src/vm/Shape.h b/js/src/vm/Shape.h
index 52b9197da6..b292bd58f2 100644
--- a/js/src/vm/Shape.h
+++ b/js/src/vm/Shape.h
@@ -1264,9 +1264,10 @@ struct InitialShapeEntry
bool needsSweep() {
Shape* ushape = shape.unbarrieredGet();
- JSObject* protoObj = proto.proto().raw();
+ TaggedProto uproto = proto.proto().unbarrieredGet();
+ JSObject* protoObj = uproto.raw();
return (gc::IsAboutToBeFinalizedUnbarriered(&ushape) ||
- (proto.proto().isObject() && gc::IsAboutToBeFinalizedUnbarriered(&protoObj)));
+ (uproto.isObject() && gc::IsAboutToBeFinalizedUnbarriered(&protoObj)));
}
};
@@ -1356,9 +1357,10 @@ struct StackShape
void trace(JSTracer* trc);
};
-template <typename Outer>
-class StackShapeOperations {
- const StackShape& ss() const { return static_cast<const Outer*>(this)->get(); }
+template <typename Wrapper>
+class WrappedPtrOperations<StackShape, Wrapper>
+{
+ const StackShape& ss() const { return static_cast<const Wrapper*>(this)->get(); }
public:
bool hasSlot() const { return ss().hasSlot(); }
@@ -1370,9 +1372,11 @@ class StackShapeOperations {
uint8_t attrs() const { return ss().attrs; }
};
-template <typename Outer>
-class MutableStackShapeOperations : public StackShapeOperations<Outer> {
- StackShape& ss() { return static_cast<Outer*>(this)->get(); }
+template <typename Wrapper>
+class MutableWrappedPtrOperations<StackShape, Wrapper>
+ : public WrappedPtrOperations<StackShape, Wrapper>
+{
+ StackShape& ss() { return static_cast<Wrapper*>(this)->get(); }
public:
void updateGetterSetter(GetterOp rawGetter, SetterOp rawSetter) {
@@ -1383,19 +1387,6 @@ class MutableStackShapeOperations : public StackShapeOperations<Outer> {
void setAttrs(uint8_t attrs) { ss().attrs = attrs; }
};
-template <>
-class RootedBase<StackShape> : public MutableStackShapeOperations<JS::Rooted<StackShape>>
-{};
-
-template <>
-class HandleBase<StackShape> : public StackShapeOperations<JS::Handle<StackShape>>
-{};
-
-template <>
-class MutableHandleBase<StackShape>
- : public MutableStackShapeOperations<JS::MutableHandle<StackShape>>
-{};
-
inline
Shape::Shape(const StackShape& other, uint32_t nfixed)
: base_(other.base),