You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Mikhail Fursov (JIRA)" <ji...@apache.org> on 2006/12/04 14:06:24 UTC

[jira] Created: (HARMONY-2424) [drlvm] Inlining of array allocation helper.

[drlvm] Inlining of array allocation helper.
--------------------------------------------

                 Key: HARMONY-2424
                 URL: http://issues.apache.org/jira/browse/HARMONY-2424
             Project: Harmony
          Issue Type: New Feature
          Components: DRLVM
            Reporter: Mikhail Fursov
         Attachments: allocArray.diff

The implementation of inlining of arrays allocation helper.

The patch contains:
1) The code of array allocation helper written in Java.
2) JIT modifications to inline the array allocation helper.
3) JIT modification to support InlinePragma method marker for helpers.
4) Minor fixes in Jitrino.OPT magics support found while testing.

The array allocation helper inlining will be enabled by default in -Xem:server mode after the patch is applied.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-2424) [drlvm] Inlining of array allocation helper.

Posted by "Ivan Volosyuk (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-2424?page=comments#action_12455619 ] 
            
Ivan Volosyuk commented on HARMONY-2424:
----------------------------------------

The patch will certainly break IPF and EM64T:

 +    private static final int GC_OBJECT_ALIGNMENT = 4; //TODO: EM64 or IPF could have 8!

GC_OBJECT_ALIGNMENT should be at least sizeof(void*) and should be equal to those in C header files.
Even on 32 bit architecture it can be 8 after fixes for double 'volatile' fields handling.

Why the alloc is never null? Fast allocation helper will fail in some cases.
+            Address arrayAddress = alloc(size, allocationHandle); //never null!
+            arrayAddress.store(arrayLen, Offset.fromInt(ARRAY_LEN_OFFSET));
+            return arrayAddress;

I'm not familiar with jitrino, could some one else review the changes in it?

> [drlvm] Inlining of array allocation helper.
> --------------------------------------------
>
>                 Key: HARMONY-2424
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2424
>             Project: Harmony
>          Issue Type: New Feature
>          Components: DRLVM
>            Reporter: Mikhail Fursov
>         Attachments: allocArray.diff, allocArray_2.diff
>
>
> The implementation of inlining of arrays allocation helper.
> The patch contains:
> 1) The code of array allocation helper written in Java.
> 2) JIT modifications to inline the array allocation helper.
> 3) JIT modification to support InlinePragma method marker for helpers.
> 4) Minor fixes in Jitrino.OPT magics support found while testing.
> The array allocation helper inlining will be enabled by default in -Xem:server mode after the patch is applied.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-2424) [drlvm] Inlining of array allocation helper.

Posted by "Mikhail Fursov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-2424?page=comments#action_12455989 ] 
            
Mikhail Fursov commented on HARMONY-2424:
-----------------------------------------

Egor, here are my answers

1) Yes, we can extend it. Let's check if there will any performance benefit with the next patch.
2) Yes, not only translator but helper inliner by itself too. I have patches for 2 more helpers to submit (wb + monitor) so I do not do any refactoring just to avoid patches collision
3) Why in this case? Does strcmp computes length before comparison? Anyway this comparison will never affect compilation time.

> [drlvm] Inlining of array allocation helper.
> --------------------------------------------
>
>                 Key: HARMONY-2424
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2424
>             Project: Harmony
>          Issue Type: New Feature
>          Components: DRLVM
>            Reporter: Mikhail Fursov
>         Attachments: allocArray.diff, allocArray_2.diff, allocArray_3.diff
>
>
> The implementation of inlining of arrays allocation helper.
> The patch contains:
> 1) The code of array allocation helper written in Java.
> 2) JIT modifications to inline the array allocation helper.
> 3) JIT modification to support InlinePragma method marker for helpers.
> 4) Minor fixes in Jitrino.OPT magics support found while testing.
> The array allocation helper inlining will be enabled by default in -Xem:server mode after the patch is applied.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (HARMONY-2424) [drlvm] Inlining of array allocation helper.

Posted by "Mikhail Fursov (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2424?page=all ]

Mikhail Fursov updated HARMONY-2424:
------------------------------------

    Attachment: allocArray_3.diff

Merged with H2398, fixed IPF build problem

> [drlvm] Inlining of array allocation helper.
> --------------------------------------------
>
>                 Key: HARMONY-2424
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2424
>             Project: Harmony
>          Issue Type: New Feature
>          Components: DRLVM
>            Reporter: Mikhail Fursov
>         Attachments: allocArray.diff, allocArray_2.diff, allocArray_3.diff
>
>
> The implementation of inlining of arrays allocation helper.
> The patch contains:
> 1) The code of array allocation helper written in Java.
> 2) JIT modifications to inline the array allocation helper.
> 3) JIT modification to support InlinePragma method marker for helpers.
> 4) Minor fixes in Jitrino.OPT magics support found while testing.
> The array allocation helper inlining will be enabled by default in -Xem:server mode after the patch is applied.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-2424) [drlvm] Inlining of array allocation helper.

Posted by "Mikhail Fursov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-2424?page=comments#action_12455978 ] 
            
Mikhail Fursov commented on HARMONY-2424:
-----------------------------------------

Ivan,
the slow path called from GCHelper is VMHelper, but not 'slow_path' method from GC. This can be the reason of our misunderstanding.

> [drlvm] Inlining of array allocation helper.
> --------------------------------------------
>
>                 Key: HARMONY-2424
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2424
>             Project: Harmony
>          Issue Type: New Feature
>          Components: DRLVM
>            Reporter: Mikhail Fursov
>         Attachments: allocArray.diff, allocArray_2.diff, allocArray_3.diff
>
>
> The implementation of inlining of arrays allocation helper.
> The patch contains:
> 1) The code of array allocation helper written in Java.
> 2) JIT modifications to inline the array allocation helper.
> 3) JIT modification to support InlinePragma method marker for helpers.
> 4) Minor fixes in Jitrino.OPT magics support found while testing.
> The array allocation helper inlining will be enabled by default in -Xem:server mode after the patch is applied.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (HARMONY-2424) [drlvm] Inlining of array allocation helper.

Posted by "Mikhail Fursov (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2424?page=all ]

Mikhail Fursov updated HARMONY-2424:
------------------------------------

    Attachment: allocArray.diff

The patch

> [drlvm] Inlining of array allocation helper.
> --------------------------------------------
>
>                 Key: HARMONY-2424
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2424
>             Project: Harmony
>          Issue Type: New Feature
>          Components: DRLVM
>            Reporter: Mikhail Fursov
>         Attachments: allocArray.diff
>
>
> The implementation of inlining of arrays allocation helper.
> The patch contains:
> 1) The code of array allocation helper written in Java.
> 2) JIT modifications to inline the array allocation helper.
> 3) JIT modification to support InlinePragma method marker for helpers.
> 4) Minor fixes in Jitrino.OPT magics support found while testing.
> The array allocation helper inlining will be enabled by default in -Xem:server mode after the patch is applied.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-2424) [drlvm] Inlining of array allocation helper.

Posted by "Egor Pasko (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-2424?page=comments#action_12455985 ] 
            
Egor Pasko commented on HARMONY-2424:
-------------------------------------

Mikhail, 

I tried your ver2 patch on SUSE9 ia32, smoke tests and kernel tests passed smoothly *in server mode*
I reviewed the JIT part. The patch is great! A couple of remarks:

1. Why is helper inliner pipeline so short? only "ssa" pass.. 
   There could be at least "simplify"

2. it is probably time to refactor JavaByteCodeTranslator a little to avoid
   copy-pasted code like this for each helper:

+    if (!strcmp(mname,"newVectorUsingAllocHandle")) {
+        assert(numArgs == 3);
+        Opnd* res = irBuilder.genVMHelperCall(CompilationInterface::Helper_NewVector_UsingVtable, resType, numArgs, srcOpnds);
+        pushOpnd(res);
+        return;
+    }
+

3. strncmp is a better replacement to strcmp


> [drlvm] Inlining of array allocation helper.
> --------------------------------------------
>
>                 Key: HARMONY-2424
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2424
>             Project: Harmony
>          Issue Type: New Feature
>          Components: DRLVM
>            Reporter: Mikhail Fursov
>         Attachments: allocArray.diff, allocArray_2.diff, allocArray_3.diff
>
>
> The implementation of inlining of arrays allocation helper.
> The patch contains:
> 1) The code of array allocation helper written in Java.
> 2) JIT modifications to inline the array allocation helper.
> 3) JIT modification to support InlinePragma method marker for helpers.
> 4) Minor fixes in Jitrino.OPT magics support found while testing.
> The array allocation helper inlining will be enabled by default in -Xem:server mode after the patch is applied.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (HARMONY-2424) [drlvm] Inlining of array allocation helper.

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2424?page=all ]

Alexey Varlamov closed HARMONY-2424.
------------------------------------

    Resolution: Fixed

Applied latest patch at r483073. Thank you guys!

> [drlvm] Inlining of array allocation helper.
> --------------------------------------------
>
>                 Key: HARMONY-2424
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2424
>             Project: Harmony
>          Issue Type: New Feature
>          Components: DRLVM
>            Reporter: Mikhail Fursov
>         Assigned To: Alexey Varlamov
>         Attachments: allocArray.diff, allocArray_2.diff, allocArray_3.diff
>
>
> The implementation of inlining of arrays allocation helper.
> The patch contains:
> 1) The code of array allocation helper written in Java.
> 2) JIT modifications to inline the array allocation helper.
> 3) JIT modification to support InlinePragma method marker for helpers.
> 4) Minor fixes in Jitrino.OPT magics support found while testing.
> The array allocation helper inlining will be enabled by default in -Xem:server mode after the patch is applied.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Assigned: (HARMONY-2424) [drlvm] Inlining of array allocation helper.

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2424?page=all ]

Alexey Varlamov reassigned HARMONY-2424:
----------------------------------------

    Assignee: Alexey Varlamov

> [drlvm] Inlining of array allocation helper.
> --------------------------------------------
>
>                 Key: HARMONY-2424
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2424
>             Project: Harmony
>          Issue Type: New Feature
>          Components: DRLVM
>            Reporter: Mikhail Fursov
>         Assigned To: Alexey Varlamov
>         Attachments: allocArray.diff, allocArray_2.diff, allocArray_3.diff
>
>
> The implementation of inlining of arrays allocation helper.
> The patch contains:
> 1) The code of array allocation helper written in Java.
> 2) JIT modifications to inline the array allocation helper.
> 3) JIT modification to support InlinePragma method marker for helpers.
> 4) Minor fixes in Jitrino.OPT magics support found while testing.
> The array allocation helper inlining will be enabled by default in -Xem:server mode after the patch is applied.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-2424) [drlvm] Inlining of array allocation helper.

Posted by "Ivan Volosyuk (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-2424?page=comments#action_12455971 ] 
            
Ivan Volosyuk commented on HARMONY-2424:
----------------------------------------

Mikhail, second billet is incorrect. Slow path alloc may return 0 on out of memory conditions.

> [drlvm] Inlining of array allocation helper.
> --------------------------------------------
>
>                 Key: HARMONY-2424
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2424
>             Project: Harmony
>          Issue Type: New Feature
>          Components: DRLVM
>            Reporter: Mikhail Fursov
>         Attachments: allocArray.diff, allocArray_2.diff, allocArray_3.diff
>
>
> The implementation of inlining of arrays allocation helper.
> The patch contains:
> 1) The code of array allocation helper written in Java.
> 2) JIT modifications to inline the array allocation helper.
> 3) JIT modification to support InlinePragma method marker for helpers.
> 4) Minor fixes in Jitrino.OPT magics support found while testing.
> The array allocation helper inlining will be enabled by default in -Xem:server mode after the patch is applied.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-2424) [drlvm] Inlining of array allocation helper.

Posted by "Mikhail Fursov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-2424?page=comments#action_12455622 ] 
            
Mikhail Fursov commented on HARMONY-2424:
-----------------------------------------

Ivan, 
1) helper inlining framework is targeted to work on IA32 only today. It's turned OFF on EM64T or IPF so "TODO EM64T"-like comments are OK.

2) fast alloc helper never returns NULL because it calls slow alloc if fast-path fails.


> [drlvm] Inlining of array allocation helper.
> --------------------------------------------
>
>                 Key: HARMONY-2424
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2424
>             Project: Harmony
>          Issue Type: New Feature
>          Components: DRLVM
>            Reporter: Mikhail Fursov
>         Attachments: allocArray.diff, allocArray_2.diff
>
>
> The implementation of inlining of arrays allocation helper.
> The patch contains:
> 1) The code of array allocation helper written in Java.
> 2) JIT modifications to inline the array allocation helper.
> 3) JIT modification to support InlinePragma method marker for helpers.
> 4) Minor fixes in Jitrino.OPT magics support found while testing.
> The array allocation helper inlining will be enabled by default in -Xem:server mode after the patch is applied.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (HARMONY-2424) [drlvm] Inlining of array allocation helper.

Posted by "Mikhail Fursov (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2424?page=all ]

Mikhail Fursov updated HARMONY-2424:
------------------------------------

    Attachment: allocArray_2.diff

the previous patch has incorrect handling of PragmaInline marker. The problem is fixed in the new patch.

> [drlvm] Inlining of array allocation helper.
> --------------------------------------------
>
>                 Key: HARMONY-2424
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2424
>             Project: Harmony
>          Issue Type: New Feature
>          Components: DRLVM
>            Reporter: Mikhail Fursov
>         Attachments: allocArray.diff, allocArray_2.diff
>
>
> The implementation of inlining of arrays allocation helper.
> The patch contains:
> 1) The code of array allocation helper written in Java.
> 2) JIT modifications to inline the array allocation helper.
> 3) JIT modification to support InlinePragma method marker for helpers.
> 4) Minor fixes in Jitrino.OPT magics support found while testing.
> The array allocation helper inlining will be enabled by default in -Xem:server mode after the patch is applied.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-2424) [drlvm] Inlining of array allocation helper.

Posted by "Mikhail Fursov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-2424?page=comments#action_12455977 ] 
            
Mikhail Fursov commented on HARMONY-2424:
-----------------------------------------

I think it is correct.
If slow path throws OOM an exception - alloc will never return 0.

> [drlvm] Inlining of array allocation helper.
> --------------------------------------------
>
>                 Key: HARMONY-2424
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2424
>             Project: Harmony
>          Issue Type: New Feature
>          Components: DRLVM
>            Reporter: Mikhail Fursov
>         Attachments: allocArray.diff, allocArray_2.diff, allocArray_3.diff
>
>
> The implementation of inlining of arrays allocation helper.
> The patch contains:
> 1) The code of array allocation helper written in Java.
> 2) JIT modifications to inline the array allocation helper.
> 3) JIT modification to support InlinePragma method marker for helpers.
> 4) Minor fixes in Jitrino.OPT magics support found while testing.
> The array allocation helper inlining will be enabled by default in -Xem:server mode after the patch is applied.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira