I need to know if calling the class method in C ++ will be the implicit pointer to 'this' as the first argument or the last. ie: first or last pushed the stack.
In other words, I ask if the method of the class that is being called is a compiler:
int foo::bar(foo *const this, int arg1, int arg2);
Thus, and, more importantly, it would also answer whether g ++ would indicate this pointer last or first, respectively. I interrogated Google, but I did not find much.
And as a side note, when C ++ functions are called, do they do the same thing as C functions? i.e:
push ebp mov ebp, esp
In general: is the class method called this way?
; About to call foo::bar. push dword 0xDEADBEEF push dword 0x2BADBABE push dword 0x2454ABCD ; This one is the this ptr for the example. ; this code example would match up if the this ptr is the first argument. call _ZN3foo3barEpjj
Thanks and very grateful.
EDIT: to clarify the situation, I am using GCC / g ++ 4.3
c ++ assembly stack pointers this
gravaera
source share