You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Aleksey Shipilev (JIRA)" <ji...@apache.org> on 2007/10/29 15:42:50 UTC

[jira] Created: (HARMONY-5040) [drlvm] Java field ordering must be preserved

[drlvm] Java field ordering must be preserved
---------------------------------------------

                 Key: HARMONY-5040
                 URL: https://issues.apache.org/jira/browse/HARMONY-5040
             Project: Harmony
          Issue Type: Improvement
          Components: DRLVM
            Reporter: Aleksey Shipilev


Current implementation of class support in Harmony sorts the class fields decrementally by size to avoid misalignment. However, it's done with quicksort which is known to be unstable (e.g. there are no guarantees that order of elements with equal keys will not be changed). That lead to shaking Java field order which could be optimized to achieve the spatial locality. 

Proposed patch changes the sorting algorithm to bubblesort, which is known to be stable. That's performance-safe since average field count is not high.

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


[jira] Commented: (HARMONY-5040) [drlvm][classloader] Java field ordering must be preserved

Posted by "Pavel Pervov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5040?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12541309 ] 

Pavel Pervov commented on HARMONY-5040:
---------------------------------------

If 'qsort' is not needed anymore, we probably should remove the code. I'll update the patch. Thanks.

> [drlvm][classloader] Java field ordering must be preserved
> ----------------------------------------------------------
>
>                 Key: HARMONY-5040
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5040
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Shipilev
>         Attachments: fo-stable-1.patch
>
>
> Current implementation of class support in Harmony sorts the class fields decrementally by size to avoid misalignment. However, it's done with quicksort which is known to be unstable (e.g. there are no guarantees that order of elements with equal keys will not be changed). That lead to shaking Java field order which could be optimized to achieve the spatial locality. 
> Proposed patch changes the sorting algorithm to bubblesort, which is known to be stable. That's performance-safe since average field count is not high.

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


[jira] Assigned: (HARMONY-5040) [drlvm][classloader] Java field ordering must be preserved

Posted by "Gregory Shimansky (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-5040?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gregory Shimansky reassigned HARMONY-5040:
------------------------------------------

    Assignee: Gregory Shimansky

> [drlvm][classloader] Java field ordering must be preserved
> ----------------------------------------------------------
>
>                 Key: HARMONY-5040
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5040
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Shipilev
>            Assignee: Gregory Shimansky
>         Attachments: fo-stable-1.patch, fo-stable-1.patch, fo-stable-1.patch
>
>
> Current implementation of class support in Harmony sorts the class fields decrementally by size to avoid misalignment. However, it's done with quicksort which is known to be unstable (e.g. there are no guarantees that order of elements with equal keys will not be changed). That lead to shaking Java field order which could be optimized to achieve the spatial locality. 
> Proposed patch changes the sorting algorithm to bubblesort, which is known to be stable. That's performance-safe since average field count is not high.

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


[jira] Closed: (HARMONY-5040) [drlvm][classloader] Java field ordering must be preserved

Posted by "Aleksey Shipilev (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-5040?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aleksey Shipilev closed HARMONY-5040.
-------------------------------------


Patch is applied OK, thanks. Closing the issue.
BTW, Pavel, I can't see any significant difference between your patches: have you solved the JVMTI breaks Gregory mentioned?

> [drlvm][classloader] Java field ordering must be preserved
> ----------------------------------------------------------
>
>                 Key: HARMONY-5040
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5040
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Shipilev
>            Assignee: Gregory Shimansky
>         Attachments: fo-stable-1.patch, fo-stable-1.patch, fo-stable-1.patch, fo-stable-1.patch
>
>
> Current implementation of class support in Harmony sorts the class fields decrementally by size to avoid misalignment. However, it's done with quicksort which is known to be unstable (e.g. there are no guarantees that order of elements with equal keys will not be changed). That lead to shaking Java field order which could be optimized to achieve the spatial locality. 
> Proposed patch changes the sorting algorithm to bubblesort, which is known to be stable. That's performance-safe since average field count is not high.

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


[jira] Updated: (HARMONY-5040) [drlvm][classloader] Java field ordering must be preserved

Posted by "Pavel Pervov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-5040?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pavel Pervov updated HARMONY-5040:
----------------------------------

    Attachment: fo-stable-1.patch

Here is the updated patch. qsort and company is also removed.

> [drlvm][classloader] Java field ordering must be preserved
> ----------------------------------------------------------
>
>                 Key: HARMONY-5040
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5040
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Shipilev
>         Attachments: fo-stable-1.patch, fo-stable-1.patch
>
>
> Current implementation of class support in Harmony sorts the class fields decrementally by size to avoid misalignment. However, it's done with quicksort which is known to be unstable (e.g. there are no guarantees that order of elements with equal keys will not be changed). That lead to shaking Java field order which could be optimized to achieve the spatial locality. 
> Proposed patch changes the sorting algorithm to bubblesort, which is known to be stable. That's performance-safe since average field count is not high.

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


[jira] Commented: (HARMONY-5040) [drlvm][classloader] Java field ordering must be preserved

Posted by "Gregory Shimansky (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5040?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12542108 ] 

Gregory Shimansky commented on HARMONY-5040:
--------------------------------------------

With this patch I get assertion failures for JVMTI tests both on windows and linux x86_64. Here is stack trace:

    [junit] java: /nfs/ims/proj/drl/mrt2/users/gregory/em64t/trunk/working_vm/vm/vmcore/src/class_support/Prepare.cpp:286: void Class::assign_offsets_to_static_fields(Field**, bool): Assertion `(m_static_data_size%8)==0' failed.
    [junit] SIGABRT in VM code.
    [junit] Stack trace:
    [junit]   0: raise (??:-1)
    [junit]   1: abort (??:-1)
    [junit]   2: ?? (??:-1)
    [junit]   3: ?? (??:-1)
    [junit]   4: ?? (??:-1)
    [junit]   5: ?? (??:-1)
    [junit]   6: __fxprintf (??:-1)
    [junit]   7: asprintf (??:-1)
    [junit]   8: ?? (??:-1)
    [junit]   9: ?? (??:-1)
    [junit]  10: ?? (??:-1)
    [junit]  11: ?? (??:-1)
    [junit]  12: ?? (??:-1)
    [junit]  13: __assert_fail (??:-1)
    [junit]  14: ?? (??:-1)
    [junit]  15: ?? (??:-1)
    [junit]  16: ?? (??:-1)
    [junit]  17: sizeof_field_type (/nfs/ims/proj/drl/mrt2/users/gregory/em64t/trunk/working_vm/vm/vmcore/src/class_support/Prepare.cpp:69)
    [junit]  18: java/lang/ClassLoader.defineClass0(Ljava/lang/String;[BII)Ljava/lang/Class; (ClassLoader.java:-2)
    [junit]  19: java/lang/ClassLoader.defineClass(Ljava/lang/String;[BIILjava/security/ProtectionDomain;)Ljava/lang/Class; (ClassLoader.java:438)
    [junit]  20: java/security/SecureClassLoader.defineClass(Ljava/lang/String;[BIILjava/security/CodeSource;)Ljava/lang/Class; (SecureClassLoader.java:70)
    [junit]  21: java/net/URLClassLoader.access$3(Ljava/net/URLClassLoader;Ljava/lang/String;[BIILjava/security/CodeSource;)Ljava/lang/Class; (URLClassLoader.java:1)
    [junit]  22: java/net/URLClassLoader$URLJarHandler.createClass(Ljava/util/jar/JarEntry;Ljava/util/jar/Manifest;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Class; (URLClassLoader.java:437)
    [junit]  23: java/net/URLClassLoader$URLJarHandler.findClass(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Class; (URLClassLoader.java:367)
    [junit]  24: java/net/URLClassLoader.findClassImpl(Ljava/lang/String;)Ljava/lang/Class; (URLClassLoader.java:1193)
    [junit]  25: java/net/URLClassLoader$4.run()Ljava/lang/Class; (URLClassLoader.java:888)
    [junit]  26: java/net/URLClassLoader$4.run()Ljava/lang/Object; (URLClassLoader.java:1)
    [junit]  27: java/security/AccessController.doPrivilegedImpl(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object; (AccessController.java:173)
    [junit]  28: java/security/AccessController.doPrivileged(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object; (AccessController.java:64)
    [junit]  29: java/net/URLClassLoader.findClass(Ljava/lang/String;)Ljava/lang/Class; (URLClassLoader.java:885)
    [junit]  30: java/lang/ClassLoader.loadClass(Ljava/lang/String;Z)Ljava/lang/Class; (ClassLoader.java:575)
    [junit]  31: java/lang/ClassLoader$SystemClassLoader.loadClass(Ljava/lang/String;Z)Ljava/lang/Class; (ClassLoader.java:963)
    [junit]  32: java/lang/ClassLoader.loadClass(Ljava/lang/String;)Ljava/lang/Class; (ClassLoader.java:319)
    [junit]  33: org/apache/tools/ant/Project.<clinit>()V (Project.java:119)
    [junit]  34: org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.main([Ljava/lang/String;)V (JUnitTestRunner.java:505)
    [junit] <end of stack trace>


> [drlvm][classloader] Java field ordering must be preserved
> ----------------------------------------------------------
>
>                 Key: HARMONY-5040
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5040
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Shipilev
>            Assignee: Gregory Shimansky
>         Attachments: fo-stable-1.patch, fo-stable-1.patch, fo-stable-1.patch
>
>
> Current implementation of class support in Harmony sorts the class fields decrementally by size to avoid misalignment. However, it's done with quicksort which is known to be unstable (e.g. there are no guarantees that order of elements with equal keys will not be changed). That lead to shaking Java field order which could be optimized to achieve the spatial locality. 
> Proposed patch changes the sorting algorithm to bubblesort, which is known to be stable. That's performance-safe since average field count is not high.

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


[jira] Commented: (HARMONY-5040) [drlvm][classloader] Java field ordering must be preserved

Posted by "Pavel Pervov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5040?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12541331 ] 

Pavel Pervov commented on HARMONY-5040:
---------------------------------------

Anyway it can be added l8r on and the patch can be committed in this form.

> [drlvm][classloader] Java field ordering must be preserved
> ----------------------------------------------------------
>
>                 Key: HARMONY-5040
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5040
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Shipilev
>         Attachments: fo-stable-1.patch, fo-stable-1.patch, fo-stable-1.patch
>
>
> Current implementation of class support in Harmony sorts the class fields decrementally by size to avoid misalignment. However, it's done with quicksort which is known to be unstable (e.g. there are no guarantees that order of elements with equal keys will not be changed). That lead to shaking Java field order which could be optimized to achieve the spatial locality. 
> Proposed patch changes the sorting algorithm to bubblesort, which is known to be stable. That's performance-safe since average field count is not high.

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


[jira] Resolved: (HARMONY-5040) [drlvm][classloader] Java field ordering must be preserved

Posted by "Gregory Shimansky (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-5040?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gregory Shimansky resolved HARMONY-5040.
----------------------------------------

    Resolution: Fixed

Patch is applied at 596313. Please check that it actually helps with performance.

> [drlvm][classloader] Java field ordering must be preserved
> ----------------------------------------------------------
>
>                 Key: HARMONY-5040
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5040
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Shipilev
>            Assignee: Gregory Shimansky
>         Attachments: fo-stable-1.patch, fo-stable-1.patch, fo-stable-1.patch, fo-stable-1.patch
>
>
> Current implementation of class support in Harmony sorts the class fields decrementally by size to avoid misalignment. However, it's done with quicksort which is known to be unstable (e.g. there are no guarantees that order of elements with equal keys will not be changed). That lead to shaking Java field order which could be optimized to achieve the spatial locality. 
> Proposed patch changes the sorting algorithm to bubblesort, which is known to be stable. That's performance-safe since average field count is not high.

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


[jira] Commented: (HARMONY-5040) [drlvm][classloader] Java field ordering must be preserved

Posted by "Aleksey Shipilev (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5040?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12541345 ] 

Aleksey Shipilev commented on HARMONY-5040:
-------------------------------------------

Pavel, the patch is looking good.
I vote to commit it in this form.
Thanks!

> [drlvm][classloader] Java field ordering must be preserved
> ----------------------------------------------------------
>
>                 Key: HARMONY-5040
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5040
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Shipilev
>         Attachments: fo-stable-1.patch, fo-stable-1.patch, fo-stable-1.patch
>
>
> Current implementation of class support in Harmony sorts the class fields decrementally by size to avoid misalignment. However, it's done with quicksort which is known to be unstable (e.g. there are no guarantees that order of elements with equal keys will not be changed). That lead to shaking Java field order which could be optimized to achieve the spatial locality. 
> Proposed patch changes the sorting algorithm to bubblesort, which is known to be stable. That's performance-safe since average field count is not high.

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


[jira] Commented: (HARMONY-5040) [drlvm][classloader] Java field ordering must be preserved

Posted by "Aleksey Shipilev (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5040?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12541311 ] 

Aleksey Shipilev commented on HARMONY-5040:
-------------------------------------------

Sure, qsort seem to be not needed anymore.

> [drlvm][classloader] Java field ordering must be preserved
> ----------------------------------------------------------
>
>                 Key: HARMONY-5040
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5040
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Shipilev
>         Attachments: fo-stable-1.patch
>
>
> Current implementation of class support in Harmony sorts the class fields decrementally by size to avoid misalignment. However, it's done with quicksort which is known to be unstable (e.g. there are no guarantees that order of elements with equal keys will not be changed). That lead to shaking Java field order which could be optimized to achieve the spatial locality. 
> Proposed patch changes the sorting algorithm to bubblesort, which is known to be stable. That's performance-safe since average field count is not high.

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


[jira] Updated: (HARMONY-5040) [drlvm][classloader] Java field ordering must be preserved

Posted by "Gregory Shimansky (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-5040?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gregory Shimansky updated HARMONY-5040:
---------------------------------------

    Summary: [drlvm][classloader] Java field ordering must be preserved  (was: [drlvm] Java field ordering must be preserved)

> [drlvm][classloader] Java field ordering must be preserved
> ----------------------------------------------------------
>
>                 Key: HARMONY-5040
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5040
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Shipilev
>         Attachments: fo-stable-1.patch
>
>
> Current implementation of class support in Harmony sorts the class fields decrementally by size to avoid misalignment. However, it's done with quicksort which is known to be unstable (e.g. there are no guarantees that order of elements with equal keys will not be changed). That lead to shaking Java field order which could be optimized to achieve the spatial locality. 
> Proposed patch changes the sorting algorithm to bubblesort, which is known to be stable. That's performance-safe since average field count is not high.

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


[jira] Updated: (HARMONY-5040) [drlvm] Java field ordering must be preserved

Posted by "Aleksey Shipilev (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-5040?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aleksey Shipilev updated HARMONY-5040:
--------------------------------------

    Attachment: fo-stable-1.patch

> [drlvm] Java field ordering must be preserved
> ---------------------------------------------
>
>                 Key: HARMONY-5040
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5040
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Shipilev
>         Attachments: fo-stable-1.patch
>
>
> Current implementation of class support in Harmony sorts the class fields decrementally by size to avoid misalignment. However, it's done with quicksort which is known to be unstable (e.g. there are no guarantees that order of elements with equal keys will not be changed). That lead to shaking Java field order which could be optimized to achieve the spatial locality. 
> Proposed patch changes the sorting algorithm to bubblesort, which is known to be stable. That's performance-safe since average field count is not high.

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


[jira] Commented: (HARMONY-5040) [drlvm][classloader] Java field ordering must be preserved

Posted by "Pavel Pervov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5040?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12542994 ] 

Pavel Pervov commented on HARMONY-5040:
---------------------------------------

I've tried to make qsort stable but stumpled in unpredictable difficulties and returned to attached patch.

The good thing is that the fixed patch is ready. I'll attach it in a few minutes.

The bad thing is that instance fields are stored in reverse order when read from class file. I'll try to solve this as this also affects the performance. I'll try to solve this in a way that does not affect the performance. :)

> [drlvm][classloader] Java field ordering must be preserved
> ----------------------------------------------------------
>
>                 Key: HARMONY-5040
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5040
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Shipilev
>            Assignee: Gregory Shimansky
>         Attachments: fo-stable-1.patch, fo-stable-1.patch, fo-stable-1.patch
>
>
> Current implementation of class support in Harmony sorts the class fields decrementally by size to avoid misalignment. However, it's done with quicksort which is known to be unstable (e.g. there are no guarantees that order of elements with equal keys will not be changed). That lead to shaking Java field order which could be optimized to achieve the spatial locality. 
> Proposed patch changes the sorting algorithm to bubblesort, which is known to be stable. That's performance-safe since average field count is not high.

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


[jira] Commented: (HARMONY-5040) [drlvm][classloader] Java field ordering must be preserved

Posted by "Aleksey Shipilev (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5040?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12541316 ] 

Aleksey Shipilev commented on HARMONY-5040:
-------------------------------------------

Looking good, thanks.
Now we need to have the ability to enable/disable sorting/compacting with an external option.

> [drlvm][classloader] Java field ordering must be preserved
> ----------------------------------------------------------
>
>                 Key: HARMONY-5040
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5040
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Shipilev
>         Attachments: fo-stable-1.patch, fo-stable-1.patch
>
>
> Current implementation of class support in Harmony sorts the class fields decrementally by size to avoid misalignment. However, it's done with quicksort which is known to be unstable (e.g. there are no guarantees that order of elements with equal keys will not be changed). That lead to shaking Java field order which could be optimized to achieve the spatial locality. 
> Proposed patch changes the sorting algorithm to bubblesort, which is known to be stable. That's performance-safe since average field count is not high.

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


[jira] Updated: (HARMONY-5040) [drlvm][classloader] Java field ordering must be preserved

Posted by "Pavel Pervov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-5040?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pavel Pervov updated HARMONY-5040:
----------------------------------

    Attachment: fo-stable-1.patch

This is the easiest part. :) Here it goes.

Two vm properties are added: vm.sort_fields and vm.compact_fields.

Initially I had an idea of adding one more switch which includes turning them both on, but I couldn't think of the right name for such a property.

> [drlvm][classloader] Java field ordering must be preserved
> ----------------------------------------------------------
>
>                 Key: HARMONY-5040
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5040
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Shipilev
>         Attachments: fo-stable-1.patch, fo-stable-1.patch, fo-stable-1.patch
>
>
> Current implementation of class support in Harmony sorts the class fields decrementally by size to avoid misalignment. However, it's done with quicksort which is known to be unstable (e.g. there are no guarantees that order of elements with equal keys will not be changed). That lead to shaking Java field order which could be optimized to achieve the spatial locality. 
> Proposed patch changes the sorting algorithm to bubblesort, which is known to be stable. That's performance-safe since average field count is not high.

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


[jira] Updated: (HARMONY-5040) [drlvm][classloader] Java field ordering must be preserved

Posted by "Pavel Pervov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-5040?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pavel Pervov updated HARMONY-5040:
----------------------------------

    Attachment: fo-stable-1.patch

Here is the corrected patch.

> [drlvm][classloader] Java field ordering must be preserved
> ----------------------------------------------------------
>
>                 Key: HARMONY-5040
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5040
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Shipilev
>            Assignee: Gregory Shimansky
>         Attachments: fo-stable-1.patch, fo-stable-1.patch, fo-stable-1.patch, fo-stable-1.patch
>
>
> Current implementation of class support in Harmony sorts the class fields decrementally by size to avoid misalignment. However, it's done with quicksort which is known to be unstable (e.g. there are no guarantees that order of elements with equal keys will not be changed). That lead to shaking Java field order which could be optimized to achieve the spatial locality. 
> Proposed patch changes the sorting algorithm to bubblesort, which is known to be stable. That's performance-safe since average field count is not high.

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