harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "George Timoshenko (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-3441) [drlvm][jit][opt] redundant reservation of 'this' on EM64T
Date Wed, 21 Mar 2007 08:31:32 GMT

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

George Timoshenko commented on HARMONY-3441:
--------------------------------------------

Here is the necessary changes:

Index: vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp
===================================================================
--- vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp	(revision 520266)
+++ vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp	(working copy)
@@ -1662,8 +1656,10 @@
 
 void IRManager::finalizeCallSites()
 {
+    MethodDesc& md = getMethodDesc();
 #ifdef _EM64T_
-    if (!getMethodDesc().isStatic()) {
+    if (!md.isStatic() 
+            && (md.isSynchronized() || md.isMethodClassIsLikelyExceptionType()))
{
         Type* thisType = entryPointInst->getOpnd(0)->getType();
         entryPointInst->thisOpnd = newMemOpnd(thisType, MemOpndKind_StackAutoLayout, getRegOpnd(STACK_REG),
0); 
         entryPointInst->getBasicBlock()->appendInst(newCopyPseudoInst(Mnemonic_MOV,
entryPointInst->thisOpnd, entryPointInst->getOpnd(0)));
Index: vm/jitrino/src/codegenerator/ia32/Ia32StackInfo.cpp
===================================================================
--- vm/jitrino/src/codegenerator/ia32/Ia32StackInfo.cpp	(revision 520266)
+++ vm/jitrino/src/codegenerator/ia32/Ia32StackInfo.cpp	(working copy)
@@ -338,10 +338,15 @@
 
 void StackInfo::registerInsts(IRManager& irm) 
 {
-    if (!irm.getMethodDesc().isStatic()) {
+    MethodDesc& md = irm.getMethodDesc();
+    if (!md.isStatic()) {
 #ifdef _EM64T_
-        EntryPointPseudoInst * entryPointInst = irm.getEntryPointInst();
-        offsetOfThis = (uint32)entryPointInst->thisOpnd->getMemOpndSubOpnd(MemOpndSubOpndKind_Displacement)->getImmValue();
+        if ((md.isSynchronized() || md.isMethodClassIsLikelyExceptionType())) {
+            EntryPointPseudoInst * entryPointInst = irm.getEntryPointInst();
+            offsetOfThis = (uint32)entryPointInst->thisOpnd->getMemOpndSubOpnd(MemOpndSubOpndKind_Displacement)->getImmValue();
+        } else {
+            offsetOfThis = 0;
+        }
 #else
         EntryPointPseudoInst * entryPointInst = irm.getEntryPointInst();
         offsetOfThis = (uint32)entryPointInst->getOpnd(0)->getMemOpndSubOpnd(MemOpndSubOpndKind_Displacement)->getImmValue();

> [drlvm][jit][opt] redundant reservation of 'this' on EM64T
> ----------------------------------------------------------
>
>                 Key: HARMONY-3441
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3441
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: EM64T
>            Reporter: George Timoshenko
>            Priority: Minor
>
> on EM64T 'this' comes on rdi.
> it should be kept on stack for future use.
> Now it is being kept for all nonstatic methods while it is enough to do it only for synchronized
methods or methods that can throw an exception.

-- 
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