This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
dev:crosscompiler:backend_arm:code_generator [2019/07/09 14:27] – [Compiler Specific Subroutines] ursgraf | dev:crosscompiler:backend_arm:code_generator [2019/07/16 13:24] – [Code Generator for ARM] ursgraf | ||
---|---|---|---|
Line 2: | Line 2: | ||
Everything which is not fully implemented is listed below | Everything which is not fully implemented is listed below | ||
^topic^I^L^F^remarks^ | ^topic^I^L^F^remarks^ | ||
- | |instanceof| ||| | | ||
- | |checkcast| ||| | | ||
|throw| ||| | | |throw| ||| | | ||
- | |call| |||class & instance methods can be called| | ||
|new| |||primitive array & array of objects & string implemented| | |new| |||primitive array & array of objects & string implemented| | ||
|exceptions| ||| | | |exceptions| ||| | | ||
Line 19: | Line 16: | ||
Important: volatile EXTR's must be saved as well if '' | Important: volatile EXTR's must be saved as well if '' | ||
- | The field //local variables// is only used if the number of registers does not suffice and locals must be assigned a slot on the stack. When dealing with FPR' | + | The field //local variables// is only used if the number of registers does not suffice and locals must be assigned a slot on the stack. When calling interface methods |
The field // | The field // | ||
The stack pointer always points to the top of the actual frame. At the top the stack pointer of the caller has to be stored. The back chain pointer is used for the debugger, for exceptions and for the garbage collection. | The stack pointer always points to the top of the actual frame. At the top the stack pointer of the caller has to be stored. The back chain pointer is used for the debugger, for exceptions and for the garbage collection. | ||
Line 55: | Line 52: | ||
Subroutines are methods for which there is no Java code (and hence no Bytecode or SSA) but only machine code. This is useful for the delegation of interface methods (see [[.: | Subroutines are methods for which there is no Java code (and hence no Bytecode or SSA) but only machine code. This is useful for the delegation of interface methods (see [[.: | ||
Such methods are listed in // | Such methods are listed in // | ||
- | Currently, there are three types of compiler specific methods | + | Currently, there are two types of compiler specific methods |
* Delegation of interface methods: address of this method inserted into the type descriptor by the linker | * Delegation of interface methods: address of this method inserted into the type descriptor by the linker | ||
* Exception handling: call to this methods inserted by the code generator | * Exception handling: call to this methods inserted by the code generator | ||
+ | |||
+ | ==== Practical Implementation of Searching the Correct Interface Method ==== | ||
+ | imDelegIiMm needs 3 auxiliary registers. At compile time we cannot reserve such auxiliary registers as these registers must always be the same. Therefore, we use a special chunk of memory on the stack. This storage is only necessary and allocated for methods invoking interface methods. At the start of the delegate method three volatile registers which might contain parameters are saved onto the stack and reloaded at the end of the delegate method. |