harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
Subject svn commit: r619840 - in /harmony/enhanced/drlvm/trunk/vm: jitrino/src/codegenerator/ia32/ jitrino/src/optimizer/ jitrino/src/vm/ vmcore/src/class_support/
Date Fri, 08 Feb 2008 11:34:29 GMT
Author: varlax
Date: Fri Feb  8 03:34:23 2008
New Revision: 619840

URL: http://svn.apache.org/viewvc?rev=619840&view=rev
Log:
Applied HARMONY-5241 [drlvm][jit][opt] Emitter provokes java objects creation

Modified:
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/helper_inliner.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/memoryopt.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp?rev=619840&r1=619839&r2=619840&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp Fri Feb
 8 03:34:23 2008
@@ -2026,7 +2026,7 @@
             {
             MethodDesc*  mDesc = (MethodDesc*)info->getValue(0);
             uint32 token = (uint32)(POINTER_SIZE_INT)info->getValue(1);
-            value = (POINTER_SIZE_INT) compilationInterface.loadStringObject(mDesc,token);
+            value = (POINTER_SIZE_INT) compilationInterface.getStringInternAddr(mDesc,token);
             }break;
         case Opnd::RuntimeInfo::Kind_StaticFieldAddress:
             /** The value of the operand is [0]->FieldDesc::getAddress() */

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp?rev=619840&r1=619839&r2=619840&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp
(original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp
Fri Feb  8 03:34:23 2008
@@ -2189,7 +2189,8 @@
     assert(dstType->isSystemString() || dstType->isSystemClass());
     Opnd * retOpnd=irManager.newOpnd(dstType);
 
-    if (codeSelector.methodCodeSelector.slowLdString || dstType->isSystemClass()) {
+    if (codeSelector.methodCodeSelector.slowLdString || dstType->isSystemClass() ||
+        *((POINTER_SIZE_INT *) compilationInterface.getStringInternAddr(enclosingMethod,
refToken)) == 0) {
         NamedType * parentType=enclosingMethod->getParentType();
     #ifdef _EM64T_
         Opnd * tp = irManager.getRegOpnd(RegName_RDI);

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=619840&r1=619839&r2=619840&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 Feb  8 03:34:23
2008
@@ -211,7 +211,7 @@
     //Convert all inst params into helper params
     uint32 numHelperArgs = method->getNumParams();
     uint32 numInstArgs = inst->getNumSrcOperands();
-    Opnd** helperArgs =new (irm->getMemoryManager()) Opnd*[numHelperArgs];
+    Opnd** helperArgs = new (irm->getMemoryManager()) Opnd*[numHelperArgs];
 #ifdef _DEBUG
     std::fill(helperArgs, helperArgs + numHelperArgs, (Opnd*)NULL);
 #endif
@@ -224,7 +224,24 @@
         ldconst->insertBefore(inst);
         helperArgs[currentHelperArg] = typeOpnd;
         currentHelperArg++;
+    } else if (inst->isToken()) {
+        TokenInst* tokenInst = inst->asTokenInst();
+        MethodDesc* methDesc = tokenInst->getEnclosingMethod();
+        uint32 cpIndex = tokenInst->getToken();
+        Opnd* classHandleOpnd = opndManager->createSsaTmpOpnd(typeManager->getUnmanagedPtrType(typeManager->getIntPtrType()));
+        Opnd* cpIndexOpnd = opndManager->createSsaTmpOpnd(typeManager->getUInt32Type());
+        Inst* ldMethDesc = instFactory->makeLdConst(classHandleOpnd, (POINTER_SIZE_SINT)methDesc->getParentHandle());
+        Inst* ldCpIndex = instFactory->makeLdConst(cpIndexOpnd, (int32)cpIndex);
+        
+        ldMethDesc->insertBefore(inst);
+        helperArgs[currentHelperArg] = classHandleOpnd;
+        currentHelperArg++;
+        
+        ldCpIndex->insertBefore(inst);
+         helperArgs[currentHelperArg] = cpIndexOpnd;
+        currentHelperArg++;                
     }
+    
     for (uint32 i = 0; i < numInstArgs; i++) {
         Opnd* instArg = inst->getSrc(i);
         if (instArg->getType()->tag == Type::Tau) {

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/memoryopt.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/memoryopt.cpp?rev=619840&r1=619839&r2=619840&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/memoryopt.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/memoryopt.cpp Fri Feb  8 03:34:23
2008
@@ -1420,6 +1420,7 @@
     case Op_ConvZE:
     case Op_ConvUnmanaged:
     case Op_TauLdInd: // the result of static field load
+    case Op_LdConstant:
         break;
     case Op_VMHelperCall:
         {

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.cpp?rev=619840&r1=619839&r2=619840&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.cpp Fri Feb  8 03:34:23
2008
@@ -4495,7 +4495,8 @@
             if (ch) {
                 ConstInst::ConstValue v;
                 v.i8 = (POINTER_SIZE_SINT)class_get_allocation_handle(ch);
-                res = genLdConstant(tm.getUnmanagedPtrType(tm.getInt8Type()), v);
+                res = genLdConstant(tm.getInt32Type(), v);
+                assert((sizeof(void*) == 4) && "TODO fix allocation helper on 64
bit");
             }
             break;
         case ClassGetTypeSize:

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.cpp?rev=619840&r1=619839&r2=619840&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.cpp Fri Feb  8 03:34:23 2008
@@ -545,7 +545,7 @@
 
 
 void* 
-CompilationInterface::loadStringObject(MethodDesc* enclosingMethodDesc,
+CompilationInterface::getStringInternAddr(MethodDesc* enclosingMethodDesc,
                                                 uint32 stringToken) {
     Class_Handle enclosingDrlVMClass = enclosingMethodDesc->getParentHandle();
     return class_get_const_string_intern_addr(enclosingDrlVMClass,stringToken);

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.h?rev=619840&r1=619839&r2=619840&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.h Fri Feb  8 03:34:23 2008
@@ -352,7 +352,7 @@
 
     ClassHierarchyMethodIterator* getClassHierarchyMethodIterator(ObjectType* baseType, MethodDesc*
methodDesc);
 
-    void*        loadStringObject(MethodDesc* enclosingMethodDesc, uint32 stringToken);
+    void*        getStringInternAddr(MethodDesc* enclosingMethodDesc, uint32 stringToken);
     Type*        getConstantType(MethodDesc* enclosingMethodDesc, uint32 constantToken);
     const void*  getConstantValue(MethodDesc* enclosingMethodDesc, uint32 constantToken);
     const char*  getSignatureString(MethodDesc* enclosingMethodDesc, uint32 methodToken);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp?rev=619840&r1=619839&r2=619840&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp Fri Feb  8 03:34:23
2008
@@ -798,36 +798,9 @@
     String* str = cl->get_constant_pool().get_string(index);
     assert(str);
 
-    bool must_instantiate;
-    REFS_RUNTIME_SWITCH_IF
-#ifdef REFS_RUNTIME_OR_COMPRESSED
-        must_instantiate = (str->intern.compressed_ref == 0 /*NULL*/);
-#endif // REFS_RUNTIME_OR_COMPRESSED
-    REFS_RUNTIME_SWITCH_ELSE
-#ifdef REFS_RUNTIME_OR_UNCOMPRESSED
-        must_instantiate = (str->intern.raw_ref == NULL);
-#endif // REFS_RUNTIME_OR_UNCOMPRESSED
-    REFS_RUNTIME_SWITCH_ENDIF
+    assert((void *)(&(str->intern.raw_ref)) == (void *)(&(str->intern.compressed_ref)));

+    return &(str->intern.raw_ref);
 
-    if (must_instantiate) {
-        BEGIN_RAISE_AREA;
-        // vm_instantiate_cp_string_resolved assumes that GC is disabled
-        tmn_suspend_disable();
-        // Discard the result. We are only interested in the side-effect of setting str->intern.
-        vm_instantiate_cp_string_resolved(str);
-        tmn_suspend_enable();
-        END_RAISE_AREA;
-    }
-
-    REFS_RUNTIME_SWITCH_IF
-#ifdef REFS_RUNTIME_OR_COMPRESSED
-        return &(str->intern.compressed_ref);
-#endif // REFS_RUNTIME_OR_COMPRESSED
-    REFS_RUNTIME_SWITCH_ELSE
-#ifdef REFS_RUNTIME_OR_UNCOMPRESSED
-        return &(str->intern.raw_ref);
-#endif // REFS_RUNTIME_OR_UNCOMPRESSED
-    REFS_RUNTIME_SWITCH_ENDIF
 } //class_get_const_string_intern_addr
 
 



Mime
View raw message