Closed
Bug 1445194
Opened 6 years ago
Closed 3 years ago
[meta] Remove some LIR/MIR boilerplate
Categories
(Core :: JavaScript Engine: JIT, enhancement, P3)
Core
JavaScript Engine: JIT
Tracking
()
RESOLVED
FIXED
People
(Reporter: jandem, Unassigned)
References
Details
(Keywords: meta)
With bug 1445181 and bug 1425580 fixed, I think we should consider moving all visitFoo methods currently defined in platform-specific files to Lowering.h/CodeGenerator.h so we can use a macro to define them automatically. The definitions could still live in platform-specific cpp files. I also wonder if we should use a build-time script to generate the MOpcodes/LOpcodes header files automatically based on the INSTRUCTION_HEADER macros in MIR.h and the LIR files. Then when we add a new instruction, we no longer have to touch Lowering.h, CodeGenerator.h, MOpcodes.h, LOpcodes-shared.h - we just have to add classes to MIR.h and LIR-shared.h and define the Lowering.cpp and CodeGenerator.cpp code.
Comment 2•6 years ago
|
||
I think this is a good idea to have a single file which does the big switches over the instruction definitions. Generating the LOpcodes and MOpcodes from the INSTRUCTION_HEADER should be easy to do, with potentially a tiny bit of complexity for platform specific LIR instruction.
Flags: needinfo?(nicolas.b.pierron)
Reporter | ||
Comment 3•6 years ago
|
||
Making this more of a meta bug. Also, we currently pass operands/temps to LIR instruction constructors - there might be a nicer design where lowering calls setTemp/setOperand somehow so that we don't need to pass this data to all the constructors.
Keywords: meta
Summary: Consider using a macro to define visit* functions in Lowering.h and CodeGenerator.h → Remove some LIR/MIR boilerplate
Updated•6 years ago
|
Priority: -- → P3
Reporter | ||
Comment 4•6 years ago
|
||
So what's described in comment 0 is done now: adding/removing an instruction no longer requires touching MOpcodes.h, LOpcodes.h, Lowering.h, CodeGenerator.h. I'll keep this open because there's more code in the LIR classes I want to try to get rid of. My goal is for LIR classes to be really simple and short.
Comment 5•3 years ago
|
||
Since we are now going to be auto generating the boilerplate I'm going to close this.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Updated•3 years ago
|
Summary: Remove some LIR/MIR boilerplate → [meta] Remove some LIR/MIR boilerplate
You need to log in
before you can comment on or make changes to this bug.
Description
•