Replacing the code generation back-end on the compiler [message #256738] |
Fri, 03 October 2008 03:19  |
Eclipse User |
|
|
|
Hello,
I'm currently working on a JVM project for microcontrollers (AVR, MSP430
class). The standard JVM bytecode instruction set is hardly suitable for
8- and 16-bit architectures, so I want to design a new 16-bit instruction
set to save on stack space and increase performance. I've been toying with
static bytecode analysis, type inference and all that, but it might be
easier to just write a new back-end for an existing compiler.
So what I'm looking to do is replace the bytecode generation part of the
eclipse compiler, but I would like to keep all the good stuff like flow
analysis, type inference, etc in tact. I don't need the class file format
either, because I statically link the classes in the end anyway.
Where do I start and what options do I have for hooking in my own
back-end? Do I start by parsing an AST and work from there by invoking
analysis visitors manually, or do I hook into the batch compiler somewhere?
Any suggestions would be greatly appreciated.
|
|
|
Re: Replacing the code generation back-end on the compiler [message #256777 is a reply to message #256738] |
Tue, 07 October 2008 05:39  |
Eclipse User |
|
|
|
> Where do I start and what options do I have for hooking in my own
> back-end? Do I start by parsing an AST and work from there by invoking
> analysis visitors manually, or do I hook into the batch compiler somewhere?
>
> Any suggestions would be greatly appreciated.
>
I think you could plug your own codestream implementation in place of
the standard one. Please have a look at
org.eclipse.jdt.internal.compiler.codegen.CodeStream in JDT/Core plug-in.
|
|
|
Powered by
FUDForum. Page generated in 0.16214 seconds