Closed Bug 1405122 Opened 7 years ago Closed 7 years ago

Use variadic templates for MixPolicy

Categories

(Core :: JavaScript Engine: JIT, enhancement, P5)

enhancement

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: anba, Assigned: anba)

Details

Attachments

(1 file, 1 obsolete file)

This allows us to remove the separate Mix3Policy and Mix4Policy classes.
Priority: -- → P5
Attached patch bug1405122.patch (obsolete) — Splinter Review
Recursive functions are a standard pattern when working with variadic templates, so in this case the new recursive helper functions(s) |staticAdjustInputsHelper| is responsible for calling |staticAdjustInputs| on each of the combined policies.
Attachment #8914673 - Flags: review?(nicolas.b.pierron)
Attachment #8914673 - Flags: review?(nicolas.b.pierron) → review+
Attached patch bug1405122.patchSplinter Review
Updated patch to ensure it compiles on clang. Two changes were necessary:
- Explicit |MixPolicy::| qualifier when calling |staticAdjustInputsHelper| <http://blog.llvm.org/2009/12/dreaded-two-phase-name-lookup.html>
- |sizeof...(Rest)| wasn't accepted as a boolean expression in the template parameter, I had to change it to |(sizeof...(Rest) > 0)|

Carrying r+ because both changes are trivial.
Attachment #8914673 - Attachment is obsolete: true
Attachment #8914812 - Flags: review+
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d722a5c47f87
Use variadic templates for MixPolicy. r=nbp
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/d722a5c47f87
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: