Closed Bug 849420 Opened 11 years ago Closed 11 years ago

Use MaybeRooted in Shape::Range

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: bhackett1024, Unassigned)

Details

Attachments

(1 file)

Attached patch patchSplinter Review
Rooting a Shape::Range currently requires a separate Shape::Range::AutoRooter class, which is both ugly and confuses the static rooting analysis.  It would be better if Range instead wrapped a MaybeRooted values, so that whether it roots its contents depends on a template parameter.
Attachment #722979 - Flags: review?(sphink)
Comment on attachment 722979 [details] [diff] [review]
patch

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

Wow, this is way nicer.

::: js/src/jsiter.cpp
@@ +141,5 @@
>  
>      size_t initialLength = props->length();
>  
>      /* Collect all unique properties from this object's scope. */
> +    Shape::Range<NoGC> r(pobj->lastProperty());

This one is CanGC.
Attachment #722979 - Flags: review?(sphink) → review+
Actually, the Enumerate call inside that AutoRooter can't GC.

https://hg.mozilla.org/integration/mozilla-inbound/rev/65bb00392010
https://hg.mozilla.org/mozilla-central/rev/65bb00392010
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: