Closed Bug 1134142 Opened 9 years ago Closed 9 years ago

Replace Baseline ICStub New functions with a variadic template function

Categories

(Core :: JavaScript Engine: JIT, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla38
Tracking Status
firefox38 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

Details

Attachments

(1 file)

Attached patch PatchSplinter Review
There's some boilerplate when creating Baseline IC stubs and we usually end up passing the same arguments to a number of different functions. This is especially annoying for stubs that have many fields, like the ones for getters/setters.

This patch eliminates the static New* method on each stub and replaces it with a single variadic template function in the ICStub base class. Then instead of FooStub::New(...) we have ICStub::New<FooStub>(...), but otherwise it works exactly the same. This shrinks BaselineIC.h a lot:

 2 files changed, 191 insertions(+), 1008 deletions(-)

We use similar things elsewhere in the codebase so hopefully this will work with all our compilers, but I kicked off a Try run just to be sure.
Attachment #8565903 - Flags: review?(kvijayan)
Yay, all compilers happily accept it.
Comment on attachment 8565903 [details] [diff] [review]
Patch

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

Nice!  Yay variadic templates and perfect forwarding!
Attachment #8565903 - Flags: review?(kvijayan) → review+
https://hg.mozilla.org/mozilla-central/rev/cda91b1179bf
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: