harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xiao-Feng Li" <xiaofeng...@gmail.com>
Subject Re: [jira] Created: (HARMONY-5713) [drlvm][performance] Implementation of System.identityHashCode() on magics
Date Sat, 12 Apr 2008 01:31:22 GMT
On Fri, Apr 11, 2008 at 3:02 PM, Aleksey Shipilev
<aleksey.shipilev@gmail.com> wrote:
> Hi, Xiao Feng!
>
>  Thank you for the interest in this issue. Let me explain a bit about
>  these JIRAs.
>
>  Originally there was the problem discovered with
>  System.identityHashCode [1] and proposed patch with draft
>  implementation of GCHelper for iHC. The problem there though is lack
>  of bindings of such the helper to actual VM. As the proof-of-concept
>  there was hack in kernel classes which called GCHelper explicitly,
>  this is for sure non-portable way and sticks VM to exact GC compiled
>  against.
>
>  To tolerate this inconvenience, I had to make VM helper, bind GCHelper
>  to VM helper at runtime, then use power of helper inliner to actually
>  include the code into execution path, this is subtask in
>  j.l.ThreadLocal [2]. This patch is still dirty, as it works only on my
>  microtest, but Dacapo and some other workloads still fails. I will try
>  to fix the problem in near term, you're welcome to fresh JIRA [2]. Do
>  you like for patch to be splitted in GC/VM/JIT parts?

I think it's ok as a single patch, as long as it gets acceptance from
other components' owners.

>  BTW, can you point me to code or docs where I can get more info on
>  hashcode computation in GCv5? I'm particularly interested in hashcode
>  states (HASHCODE_SET_ATTACHED, HASHCODE_SET_ATTACHED,
>  HASHCODE_SET_BUFFERED), that would help me to understand the code in
>  helper. F.ex. I haven't idea why HASHCODE_SET_BUFFERED is not covered
>  by helper.

A quick answer is,
1. normally hash bit is not set;
2. when an object is accessed for hash, the bit is set, and its
address is returned as hash;
3. when the object with hashbit is moved during minor collection, its
original address (old hash) is attached to the obj end;
4. in major collection, we don't want to have the complexity of
attaching hash for hashbit set objects, we use a buffer per block to
store the info (a map between object address (of offset) and its
hashcode).

The assumption is, most objects are accessed with address returned or
hattached ashcode returned. For the fast path, no need to return
buffered hash. It might not be case for micro-bench, but it's the case
for most real applications. Unless we have evidence showing it's
important to have buffered hash in fast path, we may just ignore it in
fast path.

Thanks,
xiaofeng

>  And some good news: draft helper gives 2.5x boost on ThreadLocal
>  benchmark, and I expect more since I had a look into generated JITted
>  code.
>
>  Thanks,
>  Aleksey.
>
>  [1] https://issues.apache.org/jira/browse/HARMONY-4551
>  [2] https://issues.apache.org/jira/browse/HARMONY-5713
>
>
>
>  On Fri, Apr 11, 2008 at 5:07 AM, Xiao-Feng Li <xiaofeng.li@gmail.com> wrote:
>  > Aleksey, is this patch supposed to be committed? I guess some
>  >  committer on perf would take care of it? If not, I can commit it.
>  >
>  >  Thanks,
>  >  xiaofeng
>  >
>  >
>  >
>  >  On Fri, Apr 11, 2008 at 12:08 AM, Aleksey Shipilev (JIRA)
>  >  <jira@apache.org> wrote:
>  >  > [drlvm][performance] Implementation of System.identityHashCode() on magics
>  >  >  --------------------------------------------------------------------------
>  >  >
>  >  >                  Key: HARMONY-5713
>  >  >                  URL: https://issues.apache.org/jira/browse/HARMONY-5713
>  >  >              Project: Harmony
>  >  >           Issue Type: Sub-task
>  >  >             Reporter: Aleksey Shipilev
>  >  >
>  >  >
>  >  >  This is the working sub-task for implementation of System.identityHashCode()
on magics, inspired by HARMONY-4551.
>  >  >
>  >  >  --
>  >  >  This message is automatically generated by JIRA.
>  >  >  -
>  >  >  You can reply to this email to add a comment to the issue online.
>  >  >
>  >  >
>  >
>  >
>  >
>  >  --
>  >  http://xiao-feng.blogspot.com
>  >
>



-- 
http://xiao-feng.blogspot.com

Mime
View raw message