<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<pre wrap="">
</pre>
<blockquote cite="mid:53F7F183.4040409@aol.com" type="cite">
<pre wrap="">
<a class="moz-txt-link-freetext" href="http://www.freepascal.org/docs-html/prog/progsu168.html#x212-2250008.2.13">http://www.freepascal.org/docs-html/prog/progsu168.html#x212-2250008.2.13</a>
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.
</pre>
</blockquote>
Andrew,<br>
<br>
the page says: <br>
<h4 class="subsectionHead"><span class="titlemark">8.2.13 </span> <a
href="http://www.freepascal.org/docs-html/prog/prog.html#QQ2-212-239"
id="x212-2250008.2.13">Class types</a></h4>
Just like objects, classes are stored....<br>
<br>
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.<br>
<br>
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?<br>
<br>
I don't know assembly so cannot tell from the asm generated for the
sample program:<br>
# [18] t := TTest.Create;
<br>
movl $VMT_TVMTPTR_TTEST,%edx
<br>
movl $0,%eax
<br>
call SYSTEM_TOBJECT_$__CREATE$$TOBJECT
<br>
movl %eax,U_TVMTPTR_T
<br>
<br>
With modern CPU, can the above 4 lines be further optimized?<br>
<br>
Dennis<br>
<blockquote cite="mid:53F7F183.4040409@aol.com" type="cite">
<pre wrap="">
Regards,
Andrew Haines
_______________________________________________
fpc-devel maillist - <a class="moz-txt-link-abbreviated" href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</a>
-----
No virus found in this message.
Checked by AVG - <a class="moz-txt-link-abbreviated" href="http://www.avg.com">www.avg.com</a>
Version: 2014.0.4745 / Virus Database: 4007/8083 - Release Date: 08/22/14
</pre>
</blockquote>
</body>
</html>