Quantcast

Value::isGCThing now does what you'd expect

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Value::isGCThing now does what you'd expect

Jan de Mooij-2
Hey all,

I landed a JS::Value change that might affect some embedders. JS::Value
used to have the following methods:

* isMarkable(): returned true iff the Value was a GC thing (object, string,
symbol, private GC thing).
* isGCThing(): returned true if isMarkable() *or NullValue*.

Unsurprisingly, most callers of isGCThing actually wanted isMarkable (we
had some DOM code for instance where we took a slower path if isGCThing()
returned true).

Bug 1325075 [0] (in Firefox/SpiderMonkey 53) fixed this footgun. Now
there's just isGCThing and it returns true iff the Value is a GC thing. The
isMarkable and toMarkablePointer methods are gone.

Thanks,
Jan

[0] https://bugzilla.mozilla.org/show_bug.cgi?id=1325075
_______________________________________________
dev-tech-js-engine mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-js-engine
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [JS-internals] Value::isGCThing now does what you'd expect

Alex Webster
Thanks,
Tom

On Tue, Dec 27, 2016 at 4:12 AM, Jan de Mooij <[hidden email]> wrote:

> Hey all,
>
> I landed a JS::Value change that might affect some embedders. JS::Value
> used to have the following methods:
>
> * isMarkable(): returned true iff the Value was a GC thing (object, string,
> symbol, private GC thing).
> * isGCThing(): returned true if isMarkable() *or NullValue*.
>
> Unsurprisingly, most callers of isGCThing actually wanted isMarkable (we
> had some DOM code for instance where we took a slower path if isGCThing()
> returned true).
>
> Bug 1325075 [0] (in Firefox/SpiderMonkey 53) fixed this footgun. Now
> there's just isGCThing and it returns true iff the Value is a GC thing. The
> isMarkable and toMarkablePointer methods are gone.
>
> Thanks,
> Jan
>
> [0] https://bugzilla.mozilla.org/show_bug.cgi?id=1325075
> _______________________________________________
> dev-tech-js-engine-internals mailing list
> [hidden email]
> https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals
>
_______________________________________________
dev-tech-js-engine mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-js-engine
Loading...