CompressedOops

Version 8 by john.rose
on May 15, 2009 14:03.

compared with
Current by k_v_n
on May 15, 2009 16:55.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (25)

View page history
h4. Zero based compressed oops
_(To do: format the following nicely.}_
Compressed oops use an arbitrary address for the narrow oop base which is calculated as java heap base minus one (protected) page size for implicit NULL checks to work. This means a generic field reference is next:
{noformat}
The 64-bit VM with compressed oops uses an arbitrary address
for the narrow oop base which is calculated as java heap base
minus one (protected) page size for implicit NULL checks to work.
This means a generic field reference is
<narrow-oop-base> + (<narrow-oop> << 3) + <field-offset>.
{noformat}
If the narrow oop base can be made to be zero (the java heap doesn't actually have to start at offset zero), then a generic field reference can be just next:
doesn't actually have to start at offset zero), then a generic
field reference can be just (<narrow-oop << 3) + <field-offset>,
allowing to save the heap base add (current Register Allocator
does not allow to save register).
Also with zero base the null check of compressed oop is not
needed. Current code for decoding compressed oops looks like this:
{noformat}
(<narrow-oop << 3) + <field-offset>
{noformat}
 
Theoretically it allows to save the heap base add (current Register Allocator does not allow to save register). Also with zero base the null check of compressed oop is not needed.
Current code for decoding compressed oops looks like this:

{noformat}
if (<narrow-oop> == NULL)
<wide_oop> = NULL
else
<wide_oop> = <narrow-oop-base> + (<narrow-oop> << 3)
{noformat}
 
With zero base the code is much simpler:
With zero narrow oop base the code is much simpler. It needs only shift to decode/encode a compressed oop:
 
{noformat}
<wide_oop> = <narrow-oop> << 3
{noformat}
 
Also if java heap size < 4Gb and it can be moved into low virtual address space (below 4Gb) then compressed oops can be used without encoding/decoding.
address space then compressed oops can be used without
encoding/decoding.
 
Zero based implementation tries to allocated java heap using different strategies based on the heap size and a platform it runs on.
strategies based on the heap size and a platform it runs on.
First, it tries to allocate java heap below 4Gb to use compressed oops without decoding if heap size < 4Gb.
compressed oops without decoding if heap size < 4Gb.
If it fails or heap size > 4Gb it will try to allocate the heap below 32Gb to use zero based compressed oops.
below 32Gb to use zero based compressed oops.
If this also fails it will switch to regular compressed oops with narrow oop base.
with narrow oop base.
{noformat}

The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact