harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfur...@apache.org
Subject svn commit: r613188 - in /harmony/enhanced/drlvm/trunk/vm: gc_gen/src/common/gc_for_vm.cpp jitrino/src/optimizer/Inst.cpp jitrino/src/optimizer/helper_inliner.cpp
Date Fri, 18 Jan 2008 15:29:52 GMT
Author: mfursov
Date: Fri Jan 18 07:29:49 2008
New Revision: 613188

URL: http://svn.apache.org/viewvc?rev=613188&view=rev
Log:
Fix for HARMONY-5393 [drlvm][jit][opt] VMMagic based helper inliner optimization passes incorrect
params to helpers with a number params > 2

Enabling WB VMMagic based helper registration in VM's helpers registry 


Modified:
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_vm.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/helper_inliner.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_vm.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_vm.cpp?rev=613188&r1=613187&r2=613188&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_vm.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_vm.cpp Fri Jan 18 07:29:49 2008
@@ -64,6 +64,7 @@
 #endif
     vm_helper_register_magic_helper(VM_RT_NEW_RESOLVED_USING_VTABLE_AND_SIZE, "org/apache/harmony/drlvm/gc_gen/GCHelper",
"alloc");
     vm_helper_register_magic_helper(VM_RT_NEW_VECTOR_USING_VTABLE,  "org/apache/harmony/drlvm/gc_gen/GCHelper",
"allocArray");
+    vm_helper_register_magic_helper(VM_RT_GC_HEAP_WRITE_REF,  "org/apache/harmony/drlvm/gc_gen/GCHelper",
"write_barrier_slot_rem");
 }
 
 int gc_init() 

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.cpp?rev=613188&r1=613187&r2=613188&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.cpp Fri Jan 18 07:29:49 2008
@@ -1855,8 +1855,8 @@
 }
 
 Inst* InstFactory::makeConvUnmanaged(Modifier mod, Type::Tag toType, Opnd* dst, Opnd* src)
{
-    assert ((dst->getType()->isUnmanagedPtr() && src->getType()->isObject())

-        || (dst->getType()->isObject() && src->getType()->isUnmanagedPtr()));

+    assert ((dst->getType()->isUnmanagedPtr() && (src->getType()->isObject()
|| src->getType()->isManagedPtr()))
+        || ((dst->getType()->isObject() || dst->getType()->isManagedPtr())) &&
src->getType()->isUnmanagedPtr()); 
     return makeInst(Op_ConvUnmanaged, mod, toType, dst, src);
 }
 

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/helper_inliner.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/helper_inliner.cpp?rev=613188&r1=613187&r2=613188&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/helper_inliner.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/helper_inliner.cpp Fri Jan 18 07:29:49
2008
@@ -208,7 +208,7 @@
     }
     assert(method);
 
-    //Convert all inst params info helper params
+    //Convert all inst params into helper params
     uint32 numHelperArgs = method->getNumParams();
     uint32 numInstArgs = inst->getNumSrcOperands();
     Opnd** helperArgs =new (irm->getMemoryManager()) Opnd*[numHelperArgs];
@@ -227,11 +227,26 @@
     }
     for (uint32 i = 0; i < numInstArgs; i++) {
         Opnd* instArg = inst->getSrc(i);
-        if (instArg->getType()->tag == Type::Tau) { //TODO: what to do with taus?
+        if (instArg->getType()->tag == Type::Tau) {
             continue;
         }
         assert(currentHelperArg < numHelperArgs);
-        helperArgs[currentHelperArg] = instArg;
+        Type* helperArgType = method->getParamType(currentHelperArg);
+        Type* instArgType = instArg->getType();
+        assert(instArgType->isNumeric() == helperArgType->isNumeric());
+
+        bool needObjToMagicConversion = (instArgType->isObject() || instArgType->isManagedPtr())

+                && helperArgType->isNamedType() && VMMagicUtils::isVMMagicClass(helperArgType->asNamedType()->getName());
+
+        Opnd* helperArg = instArg;
+        if (needObjToMagicConversion) {
+            Type* dstType = typeManager->getUnmanagedPtrType(typeManager->getInt8Type());
//TODO: use convertVMMagicType2HIR here from translator
+            helperArg = opndManager->createSsaTmpOpnd(dstType);
+            Modifier mod = Modifier(Overflow_None)|Modifier(Exception_Never)|Modifier(Strict_No);
+            instFactory->makeConvUnmanaged(mod, dstType->tag, helperArg, instArg)->insertBefore(inst);
+        }
+        helperArgs[currentHelperArg] = helperArg;
+        currentHelperArg++;
     }
     assert(helperArgs[numHelperArgs-1]!=NULL);
 



Mime
View raw message