What would be the consequence of implementing interfaces as fat pointers ?
Ola Fosheim Grøstad" <ola.fosheim.grostad+dlang at gmail.com>
Ola Fosheim Grøstad" <ola.fosheim.grostad+dlang at gmail.com>
Tue Apr 1 07:29:27 PDT 2014
On Tuesday, 1 April 2014 at 09:38:09 UTC, Manu wrote:
> under the impression that the typical implementation would also
> keep the
> value around in a renamed register, and when it pops up again
> at a later
> time, it would use the register directly, rather than load from
> memory.
Not sure how that would work, the memory-page/cache-line would
have to be marked as read-only Section 10.8 in this document only
talks about elimination of register-to-register moves:
http://www.agner.org/optimize/microarchitecture.pdf
But new x86s have a cache for decoded instructions and special
looping optimizations for tight inner loops that bypasses
decoding (microop-cache).
Anyway, I think the best solution to multiple inheritance and
interfaces is whole program optimization either in the compiler
or the linker. The cost of long vtables is probably quite low on
todays desktop.
More information about the Digitalmars-d
mailing list