You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Mikhail Fursov <mi...@gmail.com> on 2006/10/06 17:26:04 UTC

[drlvm][mmtk] Offset.fromSigned() -- what are the semantics?

MMTk gurus!
I'm working on MMTk 'unboxed' package support in DRLVM. I hope I finished
the implementation, but because of the scant comments in JAVA docs (like
http://jikesrvm.sourceforge.net/api/org/vmmagic/unboxed/Offset.html)  I feel
that I do not completely understand the semantics of some operations.

Here is one of the issues I do not completely understand:

Look into this test:
long v1 = Offset.fromIntSignExtend(0xBABA).toLong()
long v2 =Offset.fromIntSignExtend(0xffffffff).toLong()

What result is expected after these transformations on IA32 platform?
The Offset by itself is an Integer of 32 or 64 bits (BTW is it signed?).
If the offset is 32 bit integer on IA32 platform the operations like
fromIntSignExtend or fromIntZeroExtend do nothing and just return the
integer value of the offset.
So, after the operations above
v1=0xBABA and v2=0xFFffFFff   for IA32 and
v1=0xBABA and v2=0xFFffFFffFFffFFff   for EM64T platforms.

Is it right?


-- 
Mikhail Fursov