[fpc-devel] Newbie question: how does the compiler know the class type of an object ( the Is operator)
dennis at avidsoft.com.hk
Sat Aug 23 11:34:52 CEST 2014
> Table 8.6 is the class instance memory layout and 8.7 is the class vmt
> which has info on it's name and ancestor classes.
the page says:
8.2.13 Class types
Just like objects, classes are stored....
Look like it is referring to a TClass instance instead of an TObject
instance but thanks a lot for pointing me into the right direction.
My second newbie question is, in modern day CPUs and fpc compiler, are
optimized code generated for fpc program to cleverly use the available
registers and instructions to look up method address of an object when
the method is called, so that Object oriented language code can now run
as fast as procedural languages?
I don't know assembly so cannot tell from the asm generated for the
#  t := TTest.Create;
With modern CPU, can the above 4 lines be further optimized?
> Andrew Haines
> fpc-devel maillist - fpc-devel at lists.freepascal.org
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 2014.0.4745 / Virus Database: 4007/8083 - Release Date: 08/22/14
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-devel