Figure 7.10

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Figure 7.10

Kyle Smith
The figure for "Virtual memory segments just after the bar[2]=19 operation:" has the pointer value in index 0 when it should be in index 1.
Reply | Threaded
Open this post in threaded view
|

Re: Figure 7.10

ybakos
Kyle, in my opinion the mistake is more about the VM code on p138 rather than the diagram. No?
Reply | Threaded
Open this post in threaded view
|

Re: Figure 7.10

Joe E.
ybakos,

Assuming you mean that the VM code should read 'pop pointer 0' instead of 'pop pointer 1', then Figure 7.10 must also have three errors; the three places where it says 'that' should instead say 'this'.

If, on the other hand, we assume the error is in the value '4317' being shown at the 'pointer 0' position instead of the 'pointer 1' position, the error would be limited to '4317' being placed in the wrong box in the figure.

This is my first time through the book, so if anyone is still checking this thread, correct me if I'm wrong!
Reply | Threaded
Open this post in threaded view
|

Re: Figure 7.10

cadet1620
Administrator
I agree with Kyle and Joe.

The compiler generated code would use that to dereference the pointer.  If the code were to change this it would need to be reloaded since it is assumed to point to a method's current object.

Granted, for a code example in isolation it doesn't matter that this gets clobbered, but it would be better not to conflict with the intended future use of this by Jack.

--Mark