B
Bo Persson
Noah Roberts said:Why would it be loading it into an address register?
Because the calling convention specifies that the 'this' pointer is
passed in an address register.
Answer: it wouldn't. A call to A_x in the case when it is not
virtual
is resolved by the compiler. The result is the same as calling a
function. It wouldn't load into an address register because no
address
is accessed...not the one you are thinking is anyway.
So the standard specifies how address registers are handles in
function calls?
No, it doesn't. It is unspecified!
You are forgetting that the source code and the machine code do not
have to be at all equivelant. In these cases a-> doesn't actually
result in machine code that accesses a pointer...it results in a
function call that is passed a pointer.
And how is the pointer passed to the function?
It could be implemented so that all function calls really result in
something like:
It *could*, but the standard doesn't specify this, so it is undefined!
Bo Persson