Closed Bug 1159714 Opened 9 years ago Closed 9 years ago

Templatise AutoVectorRooter implementation

Categories

(Core :: JavaScript: GC, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: jonco, Assigned: jonco)

Details

Attachments

(1 file)

At the moment we define subclasses for the different kinds of AutoThingVector.  We can make AutoVectorRooter into a template instead, removing a bunch of boilerplate and allowing new kinds of vector rooter to be added easily.
Attachment #8599291 - Flags: review?(terrence)
Comment on attachment 8599291 [details] [diff] [review]
generalise-auto-vector-rooter

Review of attachment 8599291 [details] [diff] [review]:
-----------------------------------------------------------------

Nice!

::: js/src/ds/IdValuePair.h
@@ +34,5 @@
>  {
>    public:
>      explicit AutoIdValueVector(ContextFriendFields* cx
>                                 MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
> +        : AutoVectorRooterBase<IdValuePair>(cx, IDVALVECTOR)

2 space indent in front of the :.

::: js/src/jsapi.h
@@ +104,1 @@
>                                MOZ_GUARD_OBJECT_NOTIFIER_PARAM)

Alignment.

@@ +111,1 @@
>                                MOZ_GUARD_OBJECT_NOTIFIER_PARAM)

Alignment.

@@ +194,5 @@
> +class MOZ_STACK_CLASS AutoVectorRooter : public AutoVectorRooterBase<T>
> +{
> +  public:
> +    explicit AutoVectorRooter(JSContext* cx
> +                             MOZ_GUARD_OBJECT_NOTIFIER_PARAM)

Alignment.

@@ +195,5 @@
> +{
> +  public:
> +    explicit AutoVectorRooter(JSContext* cx
> +                             MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
> +        : AutoVectorRooterBase<T>(cx, this->GetTag(T()))

2 space indent in front of the :.

@@ +201,5 @@
> +        MOZ_GUARD_OBJECT_NOTIFIER_INIT;
> +    }
> +
> +    explicit AutoVectorRooter(js::ContextFriendFields* cx
> +                             MOZ_GUARD_OBJECT_NOTIFIER_PARAM)

Alignment.

@@ +202,5 @@
> +    }
> +
> +    explicit AutoVectorRooter(js::ContextFriendFields* cx
> +                             MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
> +        : AutoVectorRooterBase<T>(cx, this->GetTag(T()))

2 space indent in front of the :.

::: js/src/jscompartment.h
@@ +735,5 @@
>  {
>    public:
>      explicit AutoWrapperVector(JSContext* cx
>                                 MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
> +        : AutoVectorRooterBase<WrapperValue>(cx, WRAPVECTOR)

2-spaces indent in front of the colon.

::: js/src/vm/String.h
@@ +1144,4 @@
>    public:
>      explicit AutoNameVector(JSContext* cx
>                              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
> +        : AutoVectorRooterBase<PropertyName*>(cx, NAMEVECTOR)

2 space indent in front of the :.
Attachment #8599291 - Flags: review?(terrence) → review+
https://hg.mozilla.org/mozilla-central/rev/5028ca29deec
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in before you can comment on or make changes to this bug.