You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Ilya Berezhniuk (JIRA)" <ji...@apache.org> on 2007/11/02 21:44:50 UTC
[jira] Created: (HARMONY-5065) [drlvm][jit] OpcodeDesc structure is
padded incorrectly
[drlvm][jit] OpcodeDesc structure is padded incorrectly
-------------------------------------------------------
Key: HARMONY-5065
URL: https://issues.apache.org/jira/browse/HARMONY-5065
Project: Harmony
Issue Type: Bug
Components: DRLVM
Reporter: Ilya Berezhniuk
Priority: Minor
OpcodeDesc structure is padded to 128 bytes with char[] array which size is calculated using a sum of other fields size.
This approach does not consider default enum size and field alignment.
I've checked sizeof(OpcodeDesc) on IA-32 Windows/Linux, it's 132 bytes. So if the goal was performance gain, then this goal is not achieved.
Probably #pragma pack(1) should be used to eliminate field alignment, and sizeof() should be used for padding size calculation.
On the other hand, unaligned fields can also affect performance, so additional padding should be used for frequently accessed fields.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HARMONY-5065) [drlvm][jit] OpcodeDesc structure is
padded incorrectly
Posted by "Ilya Berezhniuk (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-5065?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ilya Berezhniuk updated HARMONY-5065:
-------------------------------------
Attachment: H-5065.patch
Attaching possible solution for this problem.
It needs to be reviewed by JIT expert I guess; probably I did not aligned all needed fields.
> [drlvm][jit] OpcodeDesc structure is padded incorrectly
> -------------------------------------------------------
>
> Key: HARMONY-5065
> URL: https://issues.apache.org/jira/browse/HARMONY-5065
> Project: Harmony
> Issue Type: Bug
> Components: DRLVM
> Reporter: Ilya Berezhniuk
> Priority: Minor
> Attachments: H-5065.patch
>
>
> OpcodeDesc structure is padded to 128 bytes with char[] array which size is calculated using a sum of other fields size.
> This approach does not consider default enum size and field alignment.
> I've checked sizeof(OpcodeDesc) on IA-32 Windows/Linux, it's 132 bytes. So if the goal was performance gain, then this goal is not achieved.
> Probably #pragma pack(1) should be used to eliminate field alignment, and sizeof() should be used for padding size calculation.
> On the other hand, unaligned fields can also affect performance, so additional padding should be used for frequently accessed fields.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-5065) [drlvm][jit] OpcodeDesc structure
is padded incorrectly
Posted by "Ilya Berezhniuk (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-5065?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540745 ]
Ilya Berezhniuk commented on HARMONY-5065:
------------------------------------------
This way is actually better, but unnamed union does not work (I tried on Windows).
The following should work:
union OpcodeDesc {
char dummy[128]; // To make total size a power of 2
struct {
};
};
I tried this on Windows, and now trying on Linux.
> [drlvm][jit] OpcodeDesc structure is padded incorrectly
> -------------------------------------------------------
>
> Key: HARMONY-5065
> URL: https://issues.apache.org/jira/browse/HARMONY-5065
> Project: Harmony
> Issue Type: Bug
> Components: DRLVM
> Reporter: Ilya Berezhniuk
> Priority: Minor
> Attachments: H-5065.patch
>
>
> OpcodeDesc structure is padded to 128 bytes with char[] array which size is calculated using a sum of other fields size.
> This approach does not consider default enum size and field alignment.
> I've checked sizeof(OpcodeDesc) on IA-32 Windows/Linux, it's 132 bytes. So if the goal was performance gain, then this goal is not achieved.
> Probably #pragma pack(1) should be used to eliminate field alignment, and sizeof() should be used for padding size calculation.
> On the other hand, unaligned fields can also affect performance, so additional padding should be used for frequently accessed fields.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HARMONY-5065) [drlvm][jit] OpcodeDesc structure is
padded incorrectly
Posted by "Ilya Berezhniuk (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-5065?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ilya Berezhniuk updated HARMONY-5065:
-------------------------------------
Patch Info: [Patch Available]
> [drlvm][jit] OpcodeDesc structure is padded incorrectly
> -------------------------------------------------------
>
> Key: HARMONY-5065
> URL: https://issues.apache.org/jira/browse/HARMONY-5065
> Project: Harmony
> Issue Type: Bug
> Components: DRLVM
> Reporter: Ilya Berezhniuk
> Priority: Minor
> Attachments: H-5065.patch
>
>
> OpcodeDesc structure is padded to 128 bytes with char[] array which size is calculated using a sum of other fields size.
> This approach does not consider default enum size and field alignment.
> I've checked sizeof(OpcodeDesc) on IA-32 Windows/Linux, it's 132 bytes. So if the goal was performance gain, then this goal is not achieved.
> Probably #pragma pack(1) should be used to eliminate field alignment, and sizeof() should be used for padding size calculation.
> On the other hand, unaligned fields can also affect performance, so additional padding should be used for frequently accessed fields.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HARMONY-5065) [drlvm][jit] OpcodeDesc structure is
padded incorrectly
Posted by "Ilya Berezhniuk (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-5065?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ilya Berezhniuk updated HARMONY-5065:
-------------------------------------
Attachment: H-5065.patch
the same patch without trailing workspaces.
> [drlvm][jit] OpcodeDesc structure is padded incorrectly
> -------------------------------------------------------
>
> Key: HARMONY-5065
> URL: https://issues.apache.org/jira/browse/HARMONY-5065
> Project: Harmony
> Issue Type: Bug
> Components: DRLVM
> Reporter: Ilya Berezhniuk
> Priority: Minor
> Attachments: H-5065.patch, H-5065.patch, H-5065.patch
>
>
> OpcodeDesc structure is padded to 128 bytes with char[] array which size is calculated using a sum of other fields size.
> This approach does not consider default enum size and field alignment.
> I've checked sizeof(OpcodeDesc) on IA-32 Windows/Linux, it's 132 bytes. So if the goal was performance gain, then this goal is not achieved.
> Probably #pragma pack(1) should be used to eliminate field alignment, and sizeof() should be used for padding size calculation.
> On the other hand, unaligned fields can also affect performance, so additional padding should be used for frequently accessed fields.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (HARMONY-5065) [drlvm][jit] OpcodeDesc structure
is padded incorrectly
Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-5065?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexey Varlamov reassigned HARMONY-5065:
----------------------------------------
Assignee: Alexey Varlamov
> [drlvm][jit] OpcodeDesc structure is padded incorrectly
> -------------------------------------------------------
>
> Key: HARMONY-5065
> URL: https://issues.apache.org/jira/browse/HARMONY-5065
> Project: Harmony
> Issue Type: Bug
> Components: DRLVM
> Reporter: Ilya Berezhniuk
> Assignee: Alexey Varlamov
> Priority: Minor
> Attachments: H-5065.patch, H-5065.patch, H-5065.patch
>
>
> OpcodeDesc structure is padded to 128 bytes with char[] array which size is calculated using a sum of other fields size.
> This approach does not consider default enum size and field alignment.
> I've checked sizeof(OpcodeDesc) on IA-32 Windows/Linux, it's 132 bytes. So if the goal was performance gain, then this goal is not achieved.
> Probably #pragma pack(1) should be used to eliminate field alignment, and sizeof() should be used for padding size calculation.
> On the other hand, unaligned fields can also affect performance, so additional padding should be used for frequently accessed fields.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HARMONY-5065) [drlvm][jit] OpcodeDesc structure is
padded incorrectly
Posted by "Ilya Berezhniuk (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-5065?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ilya Berezhniuk updated HARMONY-5065:
-------------------------------------
Attachment: H-5065.patch
Updated patch is in attachment.
I've checked this approach with unnamed structure on IA-32 Windows/Linux , it works fine. The size of union is 128, and fields are aligned properly.
> [drlvm][jit] OpcodeDesc structure is padded incorrectly
> -------------------------------------------------------
>
> Key: HARMONY-5065
> URL: https://issues.apache.org/jira/browse/HARMONY-5065
> Project: Harmony
> Issue Type: Bug
> Components: DRLVM
> Reporter: Ilya Berezhniuk
> Priority: Minor
> Attachments: H-5065.patch, H-5065.patch
>
>
> OpcodeDesc structure is padded to 128 bytes with char[] array which size is calculated using a sum of other fields size.
> This approach does not consider default enum size and field alignment.
> I've checked sizeof(OpcodeDesc) on IA-32 Windows/Linux, it's 132 bytes. So if the goal was performance gain, then this goal is not achieved.
> Probably #pragma pack(1) should be used to eliminate field alignment, and sizeof() should be used for padding size calculation.
> On the other hand, unaligned fields can also affect performance, so additional padding should be used for frequently accessed fields.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-5065) [drlvm][jit] OpcodeDesc structure
is padded incorrectly
Posted by "Evgueni Brevnov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-5065?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540727 ]
Evgueni Brevnov commented on HARMONY-5065:
------------------------------------------
I'd suggest using union to make size of OpcodeDesc be equal to 128. Something like:
union {
char dummy[128];
struct OpcodeDesc {
};
};
This approach is more reliable and you still let compiler to align fields. What do you think?
Thanks
Evgueni
> [drlvm][jit] OpcodeDesc structure is padded incorrectly
> -------------------------------------------------------
>
> Key: HARMONY-5065
> URL: https://issues.apache.org/jira/browse/HARMONY-5065
> Project: Harmony
> Issue Type: Bug
> Components: DRLVM
> Reporter: Ilya Berezhniuk
> Priority: Minor
> Attachments: H-5065.patch
>
>
> OpcodeDesc structure is padded to 128 bytes with char[] array which size is calculated using a sum of other fields size.
> This approach does not consider default enum size and field alignment.
> I've checked sizeof(OpcodeDesc) on IA-32 Windows/Linux, it's 132 bytes. So if the goal was performance gain, then this goal is not achieved.
> Probably #pragma pack(1) should be used to eliminate field alignment, and sizeof() should be used for padding size calculation.
> On the other hand, unaligned fields can also affect performance, so additional padding should be used for frequently accessed fields.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-5065) [drlvm][jit] OpcodeDesc structure
is padded incorrectly
Posted by "Ilya Berezhniuk (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-5065?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12541261 ]
Ilya Berezhniuk commented on HARMONY-5065:
------------------------------------------
Thanks a lot, Evgueni, Alexey!
> [drlvm][jit] OpcodeDesc structure is padded incorrectly
> -------------------------------------------------------
>
> Key: HARMONY-5065
> URL: https://issues.apache.org/jira/browse/HARMONY-5065
> Project: Harmony
> Issue Type: Bug
> Components: DRLVM
> Reporter: Ilya Berezhniuk
> Assignee: Alexey Varlamov
> Priority: Minor
> Attachments: H-5065.patch, H-5065.patch, H-5065.patch
>
>
> OpcodeDesc structure is padded to 128 bytes with char[] array which size is calculated using a sum of other fields size.
> This approach does not consider default enum size and field alignment.
> I've checked sizeof(OpcodeDesc) on IA-32 Windows/Linux, it's 132 bytes. So if the goal was performance gain, then this goal is not achieved.
> Probably #pragma pack(1) should be used to eliminate field alignment, and sizeof() should be used for padding size calculation.
> On the other hand, unaligned fields can also affect performance, so additional padding should be used for frequently accessed fields.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (HARMONY-5065) [drlvm][jit] OpcodeDesc structure is
padded incorrectly
Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-5065?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexey Varlamov closed HARMONY-5065.
------------------------------------
Resolution: Fixed
Applied at revision: 593440, thanks!
> [drlvm][jit] OpcodeDesc structure is padded incorrectly
> -------------------------------------------------------
>
> Key: HARMONY-5065
> URL: https://issues.apache.org/jira/browse/HARMONY-5065
> Project: Harmony
> Issue Type: Bug
> Components: DRLVM
> Reporter: Ilya Berezhniuk
> Assignee: Alexey Varlamov
> Priority: Minor
> Attachments: H-5065.patch, H-5065.patch, H-5065.patch
>
>
> OpcodeDesc structure is padded to 128 bytes with char[] array which size is calculated using a sum of other fields size.
> This approach does not consider default enum size and field alignment.
> I've checked sizeof(OpcodeDesc) on IA-32 Windows/Linux, it's 132 bytes. So if the goal was performance gain, then this goal is not achieved.
> Probably #pragma pack(1) should be used to eliminate field alignment, and sizeof() should be used for padding size calculation.
> On the other hand, unaligned fields can also affect performance, so additional padding should be used for frequently accessed fields.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.