harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfur...@apache.org
Subject svn commit: r573295 [1/3] - in /harmony/enhanced/drlvm/trunk/vm: include/open/ jitrino/src/jet/ jitrino/src/optimizer/ jitrino/src/shared/ jitrino/src/translator/java/ jitrino/src/vm/drl/ vmcore/src/class_support/
Date Thu, 06 Sep 2007 15:24:10 GMT
Author: mfursov
Date: Thu Sep  6 08:24:09 2007
New Revision: 573295

URL: http://svn.apache.org/viewvc?rev=573295&view=rev
Log:
Fix for HARMONY-4747 [drlvm][jit][opt] Fixes for escape analysis pass to support unresolved
types.

Added:
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/VMMagic.cpp   (with props)
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/VMMagic.h   (with props)
Modified:
    harmony/enhanced/drlvm/trunk/vm/include/open/vm.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_fld_arr.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/magics.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/escanalyzer.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/escanalyzer.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifytaus.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaLabelPrepass.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/include/open/vm.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/open/vm.h?rev=573295&r1=573294&r2=573295&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/open/vm.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/open/vm.h Thu Sep  6 08:24:09 2007
@@ -823,6 +823,11 @@
 VMEXPORT Boolean type_info_is_general_array(Type_Info_Handle tih);
 
 /**
+* Get the name of the class referenced by this type info handle
+*/
+VMEXPORT const char* type_info_get_type_name(Type_Info_Handle tih);
+
+/**
  * Get the class if <code>type_info_is_reference</code> or 
  * <code>type_info_is_unboxed</code> returned <code>TRUE</code>.

  * If the type info is a vector or a general array, return the

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg.h?rev=573295&r1=573294&r2=573295&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg.h Thu Sep  6 08:24:09 2007
@@ -1027,12 +1027,6 @@
         }
     }
 
-    /**
-    * @brief Checks if the class name is vmmagic class
-    * @return  - true if the class name is vmmagic class
-    */
-    static bool is_magic_class(const char* kname);
-
 protected:
     /**
      * @brief Tests whether the specified flag is set in method's compilation

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_fld_arr.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_fld_arr.cpp?rev=573295&r1=573294&r2=573295&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_fld_arr.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_fld_arr.cpp Thu Sep  6 08:24:09 2007
@@ -27,6 +27,7 @@
 #include "cg.h"
 #include <open/vm.h>
 #include "trace.h"
+#include "VMMagic.h"
 
 namespace Jitrino {
 namespace Jet {
@@ -280,7 +281,7 @@
     jtype jt = to_jtype(class_get_cp_field_type(fieldOp.enclClass, fieldOp.cpIndex));
     
     const char* fieldDescName = const_pool_get_field_descriptor(fieldOp.enclClass, fieldOp.cpIndex);
-    bool fieldIsMagic = is_magic_class(fieldDescName);
+    bool fieldIsMagic = VMMagicUtils::isVMMagicClass(fieldDescName);
     if (fieldIsMagic) {
         jt = iplatf;
     }

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/magics.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/magics.cpp?rev=573295&r1=573294&r2=573295&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/magics.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/magics.cpp Thu Sep  6 08:24:09 2007
@@ -30,6 +30,7 @@
 #include "open/vm.h"
 #include "jit_import.h"
 #include "jit_intf.h"
+#include "VMMagic.h"
 
 #include <vector>
 using std::vector;
@@ -37,17 +38,6 @@
 namespace Jitrino {
 namespace Jet {
 
-bool CodeGen::is_magic_class(const char* kname)
-{
-    static const char unboxedName[] = "org/vmmagic/unboxed/";
-    static const unsigned nameLen = sizeof(unboxedName)-1;
-
-    assert(kname!=NULL);
-    if (*kname=='L') {
-        return !strncmp(kname+1, unboxedName, nameLen);
-    }
-    return !strncmp(kname, unboxedName, nameLen);
-}
 
 static size_t sizeof_jt(jtype jt) {
     static size_t sizes[] =  { 
@@ -107,7 +97,7 @@
     
     const char* kname = const_pool_get_method_class_name(m_klass, (unsigned short)jinst.op0);
 
-    if (!is_magic_class(kname)) {
+    if (!VMMagicUtils::isVMMagicClass(kname)) {
         return false;
     }
     // This is a magic -> transform it

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=573295&r1=573294&r2=573295&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.cpp Thu Sep  6 08:24:09 2007
@@ -2127,26 +2127,27 @@
                         tauBaseNonNull, tauAddressInRange, type);
 }
 
-Inst* InstFactory::makeLdVar(Opnd* dst, VarOpnd* var) {
 #ifdef BRM_CHECK_TYPES
-    Type *srcType = var->getType();
+static void doBRMCheck(Opnd* src, Opnd* dst) {
+    Type *srcType = src->getType();
     Type *dstType = dst->getType();
-    assert((srcType == dstType) ||
-           (srcType->isNullObject() && dstType->isObject()) ||
-           (srcType->isObject() && dstType->isObject() &&
-            ((ObjectType *)srcType)->isSubClassOf((ObjectType *)dstType)));
+    assert((srcType == dstType) || (srcType->isNullObject() && dstType->isObject())

+        || (srcType->isObject() && dstType->isObject() 
+            && (srcType->isUnresolvedType() || dstType->isUnresolvedType()
+                || srcType->asObjectType()->isSubClassOf(dstType->asObjectType()))));
+}
+#endif
+
+Inst* InstFactory::makeLdVar(Opnd* dst, VarOpnd* var) {
+#ifdef BRM_CHECK_TYPES
+    doBRMCheck(var, dst);
 #endif
     return makeVarAccessInst(Op_LdVar, dst->getType()->tag, dst, var);
 }
 
 Inst* InstFactory::makeLdVar(Opnd* dst, SsaVarOpnd* var) {
 #ifdef BRM_CHECK_TYPES
-    Type *srcType = var->getType();
-    Type *dstType = dst->getType();
-    assert((srcType == dstType) ||
-           (srcType->isNullObject() && dstType->isObject()) ||
-           (srcType->isObject() && dstType->isObject() &&
-            ((ObjectType *)srcType)->isSubClassOf((ObjectType *)dstType)));
+    doBRMCheck(var, dst);
 #endif
     return makeVarAccessInst(Op_LdVar, dst->getType()->tag, dst, var);
 }
@@ -2345,24 +2346,14 @@
 
 Inst* InstFactory::makeStVar(VarOpnd* var, Opnd* src) {
 #ifdef BRM_CHECK_TYPES
-    Type *srcType = src->getType();
-    Type *dstType = var->getType();
-    assert((srcType == dstType) ||
-           (srcType->isNullObject() && dstType->isObject()) ||
-           (srcType->isObject() && dstType->isObject() &&
-            ((ObjectType *)srcType)->isSubClassOf((ObjectType *)dstType)));
+    doBRMCheck(src, var);
 #endif
     return makeVarAccessInst(Op_StVar, src->getType()->tag, var, src);
 }
 
 Inst* InstFactory::makeStVar(SsaVarOpnd* var, Opnd* src) {
 #ifdef BRM_CHECK_TYPES
-    Type *srcType = src->getType();
-    Type *dstType = var->getType();
-    assert((srcType == dstType) ||
-           (srcType->isNullObject() && dstType->isObject()) ||
-           (srcType->isObject() && dstType->isObject() &&
-            ((ObjectType *)srcType)->isSubClassOf((ObjectType *)dstType)));
+    doBRMCheck(src, var);
 #endif
     return makeVarAccessInst(Op_StVar, src->getType()->tag, var, src);
 }



Mime
View raw message