harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r446800 - in /incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src: optimizer/abcd/abcd.cpp optimizer/simplifier.cpp translator/java/JavaByteCodeTranslator.cpp
Date Sat, 16 Sep 2006 01:04:54 GMT
Author: geirm
Date: Fri Sep 15 18:04:50 2006
New Revision: 446800

URL: http://svn.apache.org/viewvc?view=rev&rev=446800
Log:
HARMONY-1430

The bug in optimizing simple arithmetic instruction consist of two parts:
    - copy/paste caused bug in simplifier::simplifyAnd(xxx)
    - erroneuos conversion elimination in abcd
The first is fixed in the code.
The second is fixed by turning off conversion elimination in abcd.
(It should be rewritten completely later)


The second bug: Jitrino does not throw a LinkingException when ldc tries to load
incorrect class literal.

As 1.5 support is available 'ldc' can loads class literals.
These classes may be incorrect (not resolved successfully).
It actually does not distrub ldc activity but according to specification
LinkingException must be thrown.
Bugfix:ThrowLinkingException helper call is generated at the place of ldc in managed
code if literal type can not be resolved. 



Modified:
    incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/abcd/abcd.cpp
    incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.cpp
    incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/abcd/abcd.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/abcd/abcd.cpp?view=diff&rev=446800&r1=446799&r2=446800
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/abcd/abcd.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/abcd/abcd.cpp Fri Sep
15 18:04:50 2006
@@ -65,7 +65,7 @@
     flags->dryRun = argSource->getBoolArg(p, "abcd.dry_run", false);
     flags->useAliases = argSource->getBoolArg(p, "abcd.use_aliases", true);
     flags->useConv = argSource->getBoolArg(p, "abcd.use_conv", true);
-    flags->remConv = argSource->getBoolArg(p, "abcd.rem_conv", true);
+    flags->remConv = argSource->getBoolArg(p, "abcd.rem_conv", false);
     flags->useShr = argSource->getBoolArg(p, "abcd.use_shr", true);
     flags->unmaskShifts = argSource->getBoolArg(p, "abcd.unmask_shifts", true);
     flags->remBr = argSource->getBoolArg(p, "abcd.rem_br", true);

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.cpp?view=diff&rev=446800&r1=446799&r2=446800
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.cpp Fri Sep
15 18:04:50 2006
@@ -946,8 +946,8 @@
     } else if (ConstantFolder::isConstant(src2->getInst(), val64) &&
            (inst1->getOpcode() == Op_Conv) &&
            (((typeTag1 == Type::Int8) && (((uint64)val64) <= 0xff)) ||
-            ((typeTag2 == Type::Int16) && (((uint64)val64) <= 0xffff)) ||
-            ((typeTag2 == Type::Int32) && (((uint64)val64) <= 0xffffffff)))) {
+            ((typeTag1 == Type::Int16) && (((uint64)val64) <= 0xffff)) ||
+            ((typeTag1 == Type::Int32) && (((uint64)val64) <= 0xffffffff)))) {
         Opnd *src1opnd = inst1->getSrc(0);
         if (src1opnd->getType() == src1->getType()) {
         return genAnd(theType, src1opnd, src2)->getDst();
@@ -964,8 +964,8 @@
     } else if (ConstantFolder::isConstant(src2->getInst(), val32) &&
            (inst1->getOpcode() == Op_Conv) &&
            (((typeTag1 == Type::Int8) && (((uint32)val32) <= 0xff)) ||
-            ((typeTag2 == Type::Int16) && (((uint32)val32) <= 0xffff)) ||
-            ((typeTag2 == Type::Int32) && (((uint32)val32) <= 0xffffffff)))) {
+            ((typeTag1 == Type::Int16) && (((uint32)val32) <= 0xffff)) ||
+            ((typeTag1 == Type::Int32) && (((uint32)val32) <= 0xffffffff)))) {
         Opnd *src1opnd = inst1->getSrc(0);
         if (src1opnd->getType() == src1->getType()) {
         return genAnd(theType, src1opnd, src2)->getDst();
@@ -984,8 +984,8 @@
     } else if (ConstantFolder::isConstant(src2->getInst(), val64) &&
            (inst1->getOpcode() == Op_TauLdInd) &&
            (((typeTag1 == Type::UInt8) && (((uint64)val64) == 0xff)) ||
-            ((typeTag2 == Type::UInt16) && (((uint64)val64) == 0xffff)) ||
-            ((typeTag2 == Type::UInt32) && (((uint64)val64) == 0xffffffff)))) {
+            ((typeTag1 == Type::UInt16) && (((uint64)val64) == 0xffff)) ||
+            ((typeTag1 == Type::UInt32) && (((uint64)val64) == 0xffffffff)))) {
         if (theType == src1->getType()) {
         return src1;
         }
@@ -1000,8 +1000,8 @@
     } else if (ConstantFolder::isConstant(src2->getInst(), val32) &&
            (inst1->getOpcode() == Op_TauLdInd) &&
            (((typeTag1 == Type::UInt8) && (((uint32)val32) == 0xff)) ||
-            ((typeTag2 == Type::UInt16) && (((uint32)val32) == 0xffff)) ||
-            ((typeTag2 == Type::UInt32) && (((uint32)val32) == 0xffffffff)))) {
+            ((typeTag1 == Type::UInt16) && (((uint32)val32) == 0xffff)) ||
+            ((typeTag1 == Type::UInt32) && (((uint32)val32) == 0xffffffff)))) {
         if (theType == src1->getType()) {
         return src1;
         }

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp?view=diff&rev=446800&r1=446799&r2=446800
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp
(original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp
Fri Sep 15 18:04:50 2006
@@ -885,8 +885,17 @@
     Type* constantType = 
         compilationInterface.getConstantType(&methodToCompile,constPoolIndex);
     Opnd* opnd = NULL;
-    if (constantType->isSystemString() || constantType->isSystemClass()) {
+    if (constantType->isSystemString()) {
         opnd = irBuilder.genLdRef(&methodToCompile,constPoolIndex,constantType);
+    } else if (constantType->isSystemClass()) {
+        NamedType *literalType = resolveType(constPoolIndex);
+        if (!literalType) {
+            linkingException(constPoolIndex, OPCODE_LDC);
+            pushOpnd(irBuilder.genLdNull());
+            return;
+        } else {
+            opnd = irBuilder.genLdRef(&methodToCompile,constPoolIndex,constantType);
+        }
     } else {
         const void* constantAddress =
            compilationInterface.getConstantValue(&methodToCompile,constPoolIndex);



Mime
View raw message