Closed Bug 1627893 Opened 5 years ago Closed 5 years ago

Use fold expressions for MixPolicy, ArgSeq, CacheIRSpewer, and CacheIRArgLength

Categories

(Core :: JavaScript Engine: JIT, task, P1)

task

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox76 --- wontfix
firefox77 --- fixed

People

(Reporter: anba, Assigned: anba)

References

Details

Attachments

(4 files)

I couldn't yet use fold expressions for bug 1405122, but now we can finally make this code a bit nicer. Also found some other places where fold expressions can be applied.

Renamed the variadic arguments function to CacheIRArgsLength, so it matches
its semantics a bit better.

Drive-by change:

  • Changed a triple namespace opening block to the short form.

Depends on D69947

Renamed the single argument function to CacheIRArg, because thanks to fold
expressions we no longer have to use the same name for the single- and multi-
arguments functions.

Depends on D69951

Uses std::index_sequence to be able to access the arguments from last to
first, so they can be pushed in the correct order. C++17 doesn't seem to
provide a more straight forward way to traverse tuple elements in reverse
order.

Depends on D69952

See Also: → 1627955
Pushed by ccoroiu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b7210573d422 Part 1: Use fold expression for MixPolicy. r=jandem https://hg.mozilla.org/integration/autoland/rev/d77f091ff2cc Part 2: Use fold expression for CacheIRArgLength. r=jandem https://hg.mozilla.org/integration/autoland/rev/71e5e9ee4531 Part 3: Use fold expression for CacheIR spewer. r=jandem https://hg.mozilla.org/integration/autoland/rev/08860793b6ec Part 4: Use fold expression for ArgSeq. r=jandem
Priority: -- → P1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: