This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
dev:crosscompiler:interfaces [2016/02/25 13:33] – external edit 127.0.0.1 | dev:crosscompiler:interfaces [2019/07/11 19:34] (current) – [Methods] ursgraf | ||
---|---|---|---|
Line 72: | Line 72: | ||
=== Case 2 === | === Case 2 === | ||
- | A class implements one interface with several methods or several interfaces -> in the type descriptor we place the address of a // | + | If a class implements one interface with several methods or several interfaces -> in the type descriptor we place the address of a // |
- | Important: For jumping into the interface method the LR cannot be used anymore, because the LR contains the address of the caller and the LR was not saved so far. This happens only at the start of the interface method. | + | The // |
- | + | Important: For jumping into the interface method the LR cannot be used anymore, because the LR contains the address of the caller and the LR was not saved so far. This happens only at the start of the interface method. | |
- | ==== Practical Implementation ==== | + | |
- | Case 2 needs 3 auxiliary registers. At compile time we cannot reserve such auxiliary registers as these registers must always be the same. Therefore, we use parameter registers. They are volatile and can be freely used though this means, that interface methods can pass less parameters, which is generally true. If not true the compiler will report.\\ | + | |
- | R0 holds the necessary information | + | |
==== Special Case ==== | ==== Special Case ==== | ||
- | What happens if two independent interfaces each give a method with identical signature and class A implements both? A will have the address of method once in its method table and will have the method | + | What happens if two independent interfaces each give a method with identical signature and class A implements both? A will have the address of the method once in its method table and will have the method listed in both interface blocks. |