This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
dev:crosscompiler:interfaces [2019/07/04 15:57] – [Methods] ursgraf | dev:crosscompiler:interfaces [2019/07/11 19:20] – [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 | + | |
- | ==== Practical Implementation ==== | + | The // |
- | 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.\\ | + | Important: For jumping into the interface |
- | R0 holds the necessary information for the delegate | + | |
==== 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. |