Closed Bug 1508962 Opened 6 years ago Closed 6 years ago

Add a BaselineCodeGen<Handler> class to abstract opcode compilation

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
mozilla65
Tracking Status
firefox65 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

Details

Attachments

(4 files)

For bug 1499324 we want to add a BaselineCodeGen<Handler> base class to BaselineCompiler, so we can share most of the implementation code between compiler and interpreter. The first patch here will move all the emit_JSOP_* methods (and fields/methods they depend on) to BaselineCodeGen. Then we can incrementally start using template specialization and the Handler template to abstract them.
This is just the first step: the Handler classes are still empty and BaselineCodeGen contains fields/methods that should eventually move out of there. That will happen in follow-up patches. Depends on D11746
I'm pretty happy with how part 2 turned out. We can use lambdas like this for other things as well, where the interpreter will call both of them + emit a branch and the compiler/JIT will call just one depending on static information.
(In reply to Jan de Mooij [:jandem] from comment #3) > We can use lambdas like this > for other things as well, where the interpreter will call both of them + > emit a branch and the compiler/JIT will call just one depending on static > information. And this (the code in emitDebugInstrumentation) can probably be abstracted more, if it becomes a common pattern. However that will be easier to do down the road when we know what the other uses are like.
Priority: -- → P2
Pushed by jdemooij@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/77764799fba3 part 1 - Add a BaselineCodeGen<Handler> base class to BaselineCompiler and use it for JSOp compilation. r=djvj https://hg.mozilla.org/integration/autoland/rev/e0b75c94bc06 part 2 - Implement emitDebugInstrumentation to abstract emitting debugging-specific code. r=djvj https://hg.mozilla.org/integration/autoland/rev/c315f5473734 part 3 - Eliminate some *pc uses where we know the JSOp statically. r=djvj https://hg.mozilla.org/integration/autoland/rev/863959eb64d1 part 4 - Abstract jump opcodes in BaselineCodeGen. r=djvj
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: