Closed Bug 1190457 Opened 4 years ago Closed 4 years ago

Convert AutoPropertyDescriptorVector to normal Rooted usage

Categories

(Core :: JavaScript: GC, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla42
Tracking Status
firefox42 --- fixed

People

(Reporter: terrence, Assigned: terrence)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

AutoVector exposes [Mutable]Handle through operator[]. Given that [Mutable]TraceableVectorOperations is only used via Rooted primitives, I think it is safe to add such there as well. Once we do that (and fix up the AutoShapeVector usage), converting from AutoPropertyDescriptorVector to Rooted<TraceableVector<PropertyDescriptor>> is as trivial as changing the names.
Attachment #8642498 - Flags: review?(jcoppeard)
Comment on attachment 8642498 [details] [diff] [review]
auto_propdesc_vec-v1.diff

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

Looks good!

::: js/public/TraceableVector.h
@@ +96,5 @@
>      T& back() { return vec().back(); }
>  
> +    JS::MutableHandle<T> operator[](size_t aIndex) {
> +        return JS::MutableHandle<T>::fromMarkedLocation(&vec().operator[](aIndex));
> +    }

You may need to add the const version here as well, as per bug 1189722.
Attachment #8642498 - Flags: review?(jcoppeard) → review+
https://hg.mozilla.org/mozilla-central/rev/30a773d3e4c1
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
You need to log in before you can comment on or make changes to this bug.