Make public tracing functions allow nullable pointers by default

RESOLVED FIXED in Firefox 46

Status

()

Core
JavaScript: GC
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: terrence, Assigned: terrence)

Tracking

(Blocks: 1 bug)

Trunk
mozilla46
Points:
---

Firefox Tracking Flags

(firefox46 fixed)

Details

Attachments

(2 attachments)

(Assignee)

Description

2 years ago
Created attachment 8706667 [details] [diff] [review]
1_implicit_nullable_public_tracing-sm-v0.diff

When I moved everything over to JS::TraceEdge<T> and friends last week, I kept the same null-handling semantics as we currently expose. I'd like to change these to always null-check to simplify callers, but put it off to a later change in the off chance that one of these callers is actually hot on some benchmark we care about. I don't think that's too likely though, so let's make it happen.

https://treeherder.mozilla.org/#/jobs?repo=try&revision=f5188f30e186
Attachment #8706667 - Flags: review?(sphink)
(Assignee)

Comment 1

2 years ago
Created attachment 8706668 [details] [diff] [review]
2_implicit_nullable_public_tracing-gk-v0.diff
Attachment #8706668 - Flags: review?(bugs)
Comment on attachment 8706667 [details] [diff] [review]
1_implicit_nullable_public_tracing-sm-v0.diff

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

::: js/public/TracingAPI.h
@@ +295,5 @@
>  // is used as a key in a hashtable, then the object must be removed and
>  // re-inserted with the correct hash.
> +//
> +// Note that while |edgep| must never be null, it fine to call this on nullable
> +// pointers without checking for nullptr first.

"it fine"

Though I wonder if it reads better as:

  Note that while |edgep| must never be null, it is fine for *edgep to be nullptr.
Attachment #8706667 - Flags: review?(sphink) → review+

Updated

2 years ago
Attachment #8706668 - Flags: review?(bugs) → review+
(Assignee)

Comment 3

2 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/560e1ee498a5662d02806b21db11107359f95d13
Bug 1238786 - Part 1: Allow null pointers in public tracing APIs; r=sfink

https://hg.mozilla.org/integration/mozilla-inbound/rev/a9935197c5b73c8f8fe2e736587393379ec38ffc
Bug 1238786 - Part 2: We no longer need to null check before using trace APIs; r=smaug

Comment 4

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/560e1ee498a5
https://hg.mozilla.org/mozilla-central/rev/a9935197c5b7
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
status-firefox46: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
You need to log in before you can comment on or make changes to this bug.