<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	《深入了解.NET中继承和多态（中）》的评论	</title>
	<atom:link href="https://www.ccarea.cn/archives/329/feed" rel="self" type="application/rss+xml" />
	<link>https://www.ccarea.cn/archives/329</link>
	<description>天地定位，山泽通气，雷风相薄，水火不相射，八卦相错。数往者顺，知来者逆，是故《易》逆数也。</description>
	<lastBuildDate>Sun, 02 Sep 2018 07:10:17 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.2</generator>
	<item>
		<title>
		评论者：cc_net		</title>
		<link>https://www.ccarea.cn/archives/329#comment-4206</link>

		<dc:creator><![CDATA[cc_net]]></dc:creator>
		<pubDate>Tue, 29 Jul 2014 22:51:27 +0000</pubDate>
		<guid isPermaLink="false">https://blog.csdn.net/cc_net/article/details/2956122#comment-4206</guid>

					<description><![CDATA[回复：u010401287 
我sample code里写的是：
Cpu c2 = new IntelCpu();  
c2.fun();  
C2申明的变量类型是Cpu，实际指向的类型是IntelCpu，这也是多态的必备条件。这个时候编译成native code时，只能根据Cpu类型来确定槽的偏移。

而你的列子中是IntelCpu c3 = new IntelCpu(); 这个时候，在编译成native时c3.fun()，用的是IntelCpu的槽偏移。和是否override tostring没关系，因为会全部被继承下来]]></description>
			<content:encoded><![CDATA[<p>回复：u010401287<br />
我sample code里写的是：<br />
Cpu c2 = new IntelCpu();<br />
c2.fun();<br />
C2申明的变量类型是Cpu，实际指向的类型是IntelCpu，这也是多态的必备条件。这个时候编译成native code时，只能根据Cpu类型来确定槽的偏移。</p>
<p>而你的列子中是IntelCpu c3 = new IntelCpu(); 这个时候，在编译成native时c3.fun()，用的是IntelCpu的槽偏移。和是否override tostring没关系，因为会全部被继承下来		</p>
<div class="wpulike wpulike-default ">
<div class="wp_ulike_general_class wp_ulike_is_not_liked"><button type="button"
					aria-label="Like Button"
					data-ulike-id="4206"
					data-ulike-nonce="23f1adc133"
					data-ulike-type="comment"
					data-ulike-template="wpulike-default"
					data-ulike-display-likers="0"
					data-ulike-likers-style="popover"
					class="wp_ulike_btn wp_ulike_put_image wp_comment_btn_4206"></button><span class="count-box wp_ulike_counter_up" data-ulike-counter-value="0"></span>			</div>
</div>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		评论者：u010401287		</title>
		<link>https://www.ccarea.cn/archives/329#comment-4205</link>

		<dc:creator><![CDATA[u010401287]]></dc:creator>
		<pubDate>Mon, 14 Jul 2014 02:24:43 +0000</pubDate>
		<guid isPermaLink="false">https://blog.csdn.net/cc_net/article/details/2956122#comment-4205</guid>

					<description><![CDATA[&#034;在JIT编译时同样获得了Cpu::fun()方法在Cpu类型对象中的槽偏移量&#034;
关于这句话，如果我在Cpu重写ToString方法（如下）
 public override string ToString()  
   {  
       return base.ToString();  
   } 
然后我
IntelCpu c3 = new IntelCpu();  
c3.fun();
此时为啥在JIT编译时还是获得了Cpu::fun()方法在Cpu类型对象中的槽偏移量，而不是IntelCpu::fun()方法在Cpu类型对象中的槽偏移量，虽然我知道在IL代码中c3.fun()会被写成类似callvirt  ...........Cpu::fun() ,但是不知道为何不写成callvirt  ...........IntelCpu::fun()。。。。]]></description>
			<content:encoded><![CDATA[<p>&quot;在JIT编译时同样获得了Cpu::fun()方法在Cpu类型对象中的槽偏移量&quot;<br />
关于这句话，如果我在Cpu重写ToString方法（如下）<br />
 public override string ToString()<br />
   {<br />
       return base.ToString();<br />
   }<br />
然后我<br />
IntelCpu c3 = new IntelCpu();<br />
c3.fun();<br />
此时为啥在JIT编译时还是获得了Cpu::fun()方法在Cpu类型对象中的槽偏移量，而不是IntelCpu::fun()方法在Cpu类型对象中的槽偏移量，虽然我知道在IL代码中c3.fun()会被写成类似callvirt  &#8230;&#8230;&#8230;..Cpu::fun() ,但是不知道为何不写成callvirt  &#8230;&#8230;&#8230;..IntelCpu::fun()。。。。		</p>
<div class="wpulike wpulike-default ">
<div class="wp_ulike_general_class wp_ulike_is_not_liked"><button type="button"
					aria-label="Like Button"
					data-ulike-id="4205"
					data-ulike-nonce="70d91cb595"
					data-ulike-type="comment"
					data-ulike-template="wpulike-default"
					data-ulike-display-likers="0"
					data-ulike-likers-style="popover"
					class="wp_ulike_btn wp_ulike_put_image wp_comment_btn_4205"></button><span class="count-box wp_ulike_counter_up" data-ulike-counter-value="0"></span>			</div>
</div>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		评论者：tracine0513		</title>
		<link>https://www.ccarea.cn/archives/329#comment-4207</link>

		<dc:creator><![CDATA[tracine0513]]></dc:creator>
		<pubDate>Thu, 19 Jun 2014 04:06:43 +0000</pubDate>
		<guid isPermaLink="false">https://blog.csdn.net/cc_net/article/details/2956122#comment-4207</guid>

					<description><![CDATA[以前上大学时犯浑，学习不努力，操作系统、汇编语言什么的经常逃课，现在严重感觉基础知识不够啊]]></description>
			<content:encoded><![CDATA[<p>以前上大学时犯浑，学习不努力，操作系统、汇编语言什么的经常逃课，现在严重感觉基础知识不够啊		</p>
<div class="wpulike wpulike-default ">
<div class="wp_ulike_general_class wp_ulike_is_not_liked"><button type="button"
					aria-label="Like Button"
					data-ulike-id="4207"
					data-ulike-nonce="a84ca8e488"
					data-ulike-type="comment"
					data-ulike-template="wpulike-default"
					data-ulike-display-likers="0"
					data-ulike-likers-style="popover"
					class="wp_ulike_btn wp_ulike_put_image wp_comment_btn_4207"></button><span class="count-box wp_ulike_counter_up" data-ulike-counter-value="0"></span>			</div>
</div>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		评论者：videosender		</title>
		<link>https://www.ccarea.cn/archives/329#comment-4208</link>

		<dc:creator><![CDATA[videosender]]></dc:creator>
		<pubDate>Thu, 02 Oct 2008 14:21:00 +0000</pubDate>
		<guid isPermaLink="false">https://blog.csdn.net/cc_net/article/details/2956122#comment-4208</guid>

					<description><![CDATA[呵呵，发现是老乡。写得不错，研究的挺底层啊]]></description>
			<content:encoded><![CDATA[<p>呵呵，发现是老乡。写得不错，研究的挺底层啊		</p>
<div class="wpulike wpulike-default ">
<div class="wp_ulike_general_class wp_ulike_is_not_liked"><button type="button"
					aria-label="Like Button"
					data-ulike-id="4208"
					data-ulike-nonce="0f50538c6b"
					data-ulike-type="comment"
					data-ulike-template="wpulike-default"
					data-ulike-display-likers="0"
					data-ulike-likers-style="popover"
					class="wp_ulike_btn wp_ulike_put_image wp_comment_btn_4208"></button><span class="count-box wp_ulike_counter_up" data-ulike-counter-value="0"></span>			</div>
</div>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
