程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> C語言 >> C++ >> C++入門知識 >> 從匯編看c++中的多態

從匯編看c++中的多態

編輯:C++入門知識

=  ( ii) {
        i =


        esp, 



        
        ecx, DWORD PTR _x$[ebp]
        ??0X@@QAE@H@Z                



        

??0X@@QAE@H@Z PROC                    



        ecx
        DWORD PTR _this$[ebp], ecx
        eax, DWORD PTR _this$[ebp]
        DWORD PTR [eax], OFFSET ??_7X@@6B@



        ecx, DWORD PTR _this$[ebp]
        edx, DWORD PTR _ii$[ebp]
        DWORD PTR [ecx+], edx



        eax, DWORD PTR _this$[ebp]
        

  Y :  X {


        esp,                     



        ecx, DWORD PTR _y$[ebp]
        ??0Y@@QAE@XZ



        

??0Y@@QAE@XZ PROC                    
        ecx
        DWORD PTR _this$[ebp], ecx
        ecx, DWORD PTR _this$[ebp]
        ??0X@@QAE@XZ
        eax, DWORD PTR _this$[ebp]
        DWORD PTR [eax], OFFSET ??_7Y@@6B@
        eax, DWORD PTR _this$[ebp]
        

??0X@@QAE@XZ PROC                    
        ecx
        DWORD PTR _this$[ebp], ecx
        eax, DWORD PTR _this$[ebp]
        DWORD PTR [eax], OFFSET ??_7X@@6B@
        eax, DWORD PTR _this$[ebp]
        

  f(= Y :  X {
  f(=

??0Y@@QAE@XZ PROC                    



        ecx
        DWORD PTR _this$[ebp], ecx
        ecx, DWORD PTR _this$[ebp]
        ??0X@@QAE@XZ                
        eax, DWORD PTR _this$[ebp]
        DWORD PTR [eax], OFFSET ??_7Y@@6B@



        
        ecx, DWORD PTR _this$[ebp]
        ?f@Y@@UAEXH@Z                



        eax, DWORD PTR _this$[ebp]
        

??0X@@QAE@XZ PROC                    



        ecx
        DWORD PTR _this$[ebp], ecx
        eax, DWORD PTR _this$[ebp]
        DWORD PTR [eax], OFFSET ??_7X@@6B@



        
        ecx, DWORD PTR _this$[ebp]
        ?f@X@@UAEXH@Z                



        eax, DWORD PTR _this$[ebp]
        

 

  (=~ Y : 

 

??1Y@@QAE@XZ PROC                    
        ecx
        DWORD PTR _this$[ebp], ecx
        ecx, DWORD PTR _this$[ebp]
        ??1X@@QAE@XZ                
        

 

??1X@@QAE@XZ PROC                    



        ecx
        DWORD PTR _this$[ebp], ecx
        eax, DWORD PTR _this$[ebp]
        DWORD PTR [eax], OFFSET ??_7X@@6B@
        

 

  f() = ;
=  Y :  X {
 = 


??0Y@@QAE@XZ PROC                    
        ecx
        DWORD PTR _this$[ebp], ecx
        ecx, DWORD PTR _this$[ebp]
        ??0X@@QAE@XZ                
        eax, DWORD PTR _this$[ebp]
        DWORD PTR [eax], OFFSET ??_7Y@@6B@
        eax, DWORD PTR _this$[ebp]
        

??0X@@QAE@XZ PROC                    



        ecx
        DWORD PTR _this$[ebp], ecx
        eax, DWORD PTR _this$[ebp]
        DWORD PTR [eax], OFFSET ??_7X@@6B@



        ecx, DWORD PTR _this$[ebp]
        DWORD PTR [ecx+], 



        eax, DWORD PTR _this$[ebp]
        

 =  Y :  X {
 = 
 Y* yp =  Y;
 y.f();
 yp->f();
 =  Y :  X {
 = 
 Y* yp =  Y;
 y.f();
 yp->f();


        ecx, DWORD PTR _y$[ebp]
        ?f@Y@@UAEXXZ                


        ecx, DWORD PTR _yp$[ebp]
        edx, DWORD PTR [ecx]
        ecx, DWORD PTR _yp$[ebp]
        eax, DWORD PTR [edx]
        eax

 

 =  =  Y :   c() {
        i =  b() {
        i = * xp = * yp = ->->->->
}

 


        edx, DWORD PTR _xp$[ebp]
        eax, DWORD PTR [edx]
        ecx, DWORD PTR _xp$[ebp]
        edx, DWORD PTR [eax]
        edx



        eax, DWORD PTR _xp$[ebp]
        edx, DWORD PTR [eax]
        ecx, DWORD PTR _xp$[ebp]
        eax, DWORD PTR [edx+]
        eax



        ecx, DWORD PTR _yp$[ebp]
        edx, DWORD PTR [ecx]
        ecx, DWORD PTR _yp$[ebp]
        eax, DWORD PTR [edx]
        eax



        ecx, DWORD PTR _yp$[ebp]
        edx, DWORD PTR [ecx]
        ecx, DWORD PTR _yp$[ebp]
        eax, DWORD PTR [edx+]
        eax


        ecx, DWORD PTR _yp$[ebp]
        edx, DWORD PTR [ecx]
        ecx, DWORD PTR _yp$[ebp]
        eax, DWORD PTR [edx+]
        eax

 =  =  Y :   c() {
        i =  b() {
        i =  f(X x) {


        esp,                     



        ecx, DWORD PTR _y$[ebp]
        ??0Y@@QAE@XZ



        esp, 
        ecx, esp
        eax, DWORD PTR _y$[ebp]
        eax
        ??0X@@QAE@ABV0@@Z
        ?f@@YAXVX@@@Z                
        esp, 

        

??0X@@QAE@ABV0@@Z PROC                    
        ecx
        DWORD PTR _this$[ebp], ecx
        eax, DWORD PTR _this$[ebp]
        DWORD PTR [eax], OFFSET ??_7X@@6B@
        ecx, DWORD PTR _this$[ebp]
        edx, DWORD PTR ___that$[ebp]
        eax, DWORD PTR [edx+]
        DWORD PTR [ecx+], eax
        eax, DWORD PTR _this$[ebp]
        


    

        ecx, DWORD PTR _x$[ebp]
        ?b@X@@UAEXXZ                

?b@X@@UAEXXZ PROC                    



        ecx
        DWORD PTR _this$[ebp], ecx



        eax, DWORD PTR _this$[ebp]
        DWORD PTR [eax+], 



        

 

 

 

 

 

 

 

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved