harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vladimir Strigun (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-4551) [drlvm][gc_gen][perf]improvement for System.identityHashCode method
Date Tue, 11 Sep 2007 15:44:32 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-4551?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12526501
] 

Vladimir Strigun commented on HARMONY-4551:
-------------------------------------------

I've tried to enable the patch, but unfortunately I received crash from VM side.
Here is the steps for reproducing:
Replace original getIdentityHashCode method with the following:
        if (VMHelper.isVMMagicSupported()) {
                return GCHelper.get_hashcode(object);
        } else {
                return getIdentityHashCode(object);
        }

With the code above located in VMMemoryManager class I have crash in VM during System.identityHashCode
invocation:
Windows reported exception: 0xc0000005
Registers:
    EAX: 0x00000000, EBX: 0x000000ac, ECX: 0x0243e408, EDX: 0x018e3c28
    ESI: 0x0013f174, EDI: 0x0243e1cc, ESP: 0x0013f060, EBP: 0x00000099
    EIP: 0x01455e44
Stack trace:
  0: Jitrino::Simplifier::propagateCopy (c:\home\sva\nightly\sources\drlvm\trunk\vm\jitrino\src\optimizer\simplifier.cpp:3742)
  1: ?? (??:-1)
  2: java/lang/VMMemoryManager.getIdentityHashCodeMagic(Ljava/lang/Object;)I (VMMemoryManager.java:85)
  3: java/lang/System.identityHashCode(Ljava/lang/Object;)I (??:-1)
  4: test.main([Ljava/lang/String;)V (test.java:5)
<end of stack trace>


The same implementation works correctly when I move out the code from identityHashCode method
to my own method in the same class. 

> [drlvm][gc_gen][perf]improvement for System.identityHashCode method
> -------------------------------------------------------------------
>
>                 Key: HARMONY-4551
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4551
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Strigun
>         Attachments: hashcode_helper_inline_patch.patch
>
>
> System.identityHashCode could be faster if implemented via vmmagic code. 
> The next implementation shows significant speedup on small testcase (from 1609 msec for
un-patched version to 409 msec on patched one):
> return ObjectReference.fromObject(object).toAddress().toInt()
> Small test:
> public class Test {
>     public static void main(String[] args) {
>         runTest(1000, new Object());
>         long start = System.currentTimeMillis();
>         runTest(10000000, new Object());
>         long end = System.currentTimeMillis() - start;
>         System.out.println("completed in "+end);
>     }
>     public static void runTest(int num, Object obj) {
>         for(int i=0; i<num; i++) {
>             System.identityHashCode(new Object());
>         }
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message