Closed Bug 1205454 Opened 9 years ago Closed 9 years ago

Consolidate the tagged pointer marking definitions

Categories

(Core :: JavaScript: GC, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox43 --- affected
firefox44 --- fixed

People

(Reporter: terrence, Assigned: terrence)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

I expected this to involve a nest of new macros, but it turned out to be pretty much trivial with templates. Enough to make me paranoid that C++ is having a laugh at my expense:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=376df5937a3d

11 files changed, 82 insertions(+), 150 deletions(-)
Attachment #8662075 - Flags: review?(sphink)
Comment on attachment 8662075 [details] [diff] [review]
consolidate_tagged_pointer_methods_in_marking-v0.diff

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

Wow. This is really awesome. And yet, bizarrely indirect and insane. All those lines removed cannot lie, though. r=me.

::: js/public/HeapAPI.h
@@ +247,5 @@
>  
> +template <typename F, typename... Args>
> +auto
> +DispatchTyped(F f, GCCellPtr thing, Args&&... args)
> +  -> decltype(f(reinterpret_cast<JSObject*>(0), mozilla::Forward<Args>(args)...))

that really needs to be a reinterpret_cast? I'd expect static_cast<JSObject*>(nullptr) or something.

This specialization needs a comment describing what it's for. The mysterious cast to JSObject* is mysterious.

@@ +256,5 @@
> +          return f(&thing.as<type>(), mozilla::Forward<Args>(args)...);
> +      JS_FOR_EACH_TRACEKIND(JS_EXPAND_DEF);
> +#undef JS_EXPAND_DEF
> +      default:
> +          MOZ_CRASH("Invalid trace kind in DispatchTraceKindTyped.");

DispatchTraceKindTyped?

::: js/src/gc/Marking.cpp
@@ +1875,5 @@
>          *objp = moveToTenured(*objp);
>  }
>  
> +template <typename S>
> +struct TenuringTraversalFunctor : public IdentityDefaultAdaptor<S> {

IdentityDefaultAd... what? <moans and holds his head>
Attachment #8662075 - Flags: review?(sphink) → review+
https://hg.mozilla.org/mozilla-central/rev/d8f7ef55e351
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in before you can comment on or make changes to this bug.