harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfur...@apache.org
Subject svn commit: r556007 [3/3] - in /harmony/enhanced/drlvm/trunk/vm: jitrino/src/codegenerator/ jitrino/src/codegenerator/ia32/ jitrino/src/codegenerator/ipf/ jitrino/src/codegenerator/ipf/include/ jitrino/src/dynopt/ jitrino/src/main/ jitrino/src/optimize...
Date Fri, 13 Jul 2007 14:19:39 GMT
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/ControlFlowGraph.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/ControlFlowGraph.h?view=diff&rev=556007&r1=556006&r2=556007
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/ControlFlowGraph.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/ControlFlowGraph.h Fri Jul 13 07:19:35
2007
@@ -231,6 +231,8 @@
     double prob;
 };
 
+
+#define ILLEGAL_BC_MAPPING_VALUE 0xFFFF
   /** 
    * The base abstract class for all CFG instructions.
    * The given class keeps information about the node this instruction belongs
@@ -352,6 +354,12 @@
    */
     virtual bool isLabel() const {return false;}
 
+    /// Returns byte-code offset the inst
+    uint16 getBCOffset() const { return bcOffset;}
+
+    /// Sets byte-code offset the inst
+    void setBCOffset(uint16 newVal) {bcOffset = newVal;}
+
 protected:
     /// Called from CFG to detect edge kinds for BN to BN edges.
     virtual Edge::Kind getEdgeKind(const Edge* edge) const = 0;
@@ -366,10 +374,13 @@
    * Initializes the Node instance field with the <code>NULL</code> 
    * value.
    */
-    CFGInst() : node(NULL) {}
+    CFGInst() : node(NULL), bcOffset(ILLEGAL_BC_MAPPING_VALUE) {}
 
     /// The owner node of the instruction.
     Node* node;
+
+    ///offset in byte-code
+    uint16 bcOffset;
 };
 
   /** 
@@ -1097,7 +1108,7 @@
    *
    * @return The <code>Unwind</code> node of the graph.
    */
-    void setUnwindNode(Node* node) {assert(unwindNode==NULL); assert(node->isDispatchNode());
unwindNode = node;}
+    void setUnwindNode(Node* node) {assert(node->isDispatchNode()); unwindNode = node;}
 
   /** 
    * Gets the maximum node ID. 

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp?view=diff&rev=556007&r1=556006&r2=556007
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp
(original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp
Fri Jul 13 07:19:35 2007
@@ -27,7 +27,6 @@
 #include "ExceptionInfo.h"
 #include "simplifier.h"
 #include "methodtable.h"
-#include "InlineInfo.h"
 #include "open/bytecodes.h"
 #include "irmanager.h"
 #include "Jitrino.h"
@@ -147,7 +146,6 @@
               NULL),
       lockAddr(NULL), 
       oldLockValue(NULL),
-      thisLevelBuilder(NULL, methodDesc,irb.getBcOffset()),
       jsrEntryMap(NULL),
       retOffsets(mm),
       jsrEntryOffsets(mm)
@@ -247,6 +245,7 @@
     numLabels = prepass.getNumLabels();
     labels = new (memManager) LabelInst*[numLabels+1];
     irBuilder.createLabels(numLabels,labels);
+
     nextLabel = 0;
     resultOpnd = NULL;
 
@@ -420,8 +419,7 @@
 JavaByteCodeTranslator::offset(uint32 offset) {
 
     // set bc offset in ir builder
-    if (compilationInterface.isBCMapInfoRequired()) irBuilder.setBcOffset(offset);
-
+    irBuilder.setBcOffset(offset);
     if (prepass.isLabel(offset) == false)
         return;
     if (prepassVisited && prepassVisited->getBit(offset) == false) {
@@ -490,6 +488,7 @@
             labelInst = irBuilder.getInstFactory()->makeCatchLabel(
                                             handler->getExceptionOrder(),
                                             handler->getExceptionType());
+            labelInst->setBCOffset((uint16)exceptionInfo->getBeginOffset());
             catchLabels.push_back(labelInst);
             labelInst->setState(oldLabel->getState());
             exceptionInfo->setLabelInst(labelInst);
@@ -1543,8 +1542,7 @@
                                             tauNullChecked, 
                                             0, // let IRBuilder handle types
                                             numArgs,
-                                            srcOpnds, 
-                                            NULL);
+                                            srcOpnds);
     // push the return type
     if (returnType->tag != Type::Void)
         pushOpnd(dst);
@@ -1580,8 +1578,7 @@
         tauNullChecked, 
         0, // let IRBuilder check types
         numArgs,
-        srcOpnds,
-        NULL);
+        srcOpnds);
 
     // push the return type
     if (returnType->tag != Type::Void) {
@@ -1675,8 +1672,7 @@
         tauNullChecked, 
         0, // let IRBuilder handle types
         numArgs,
-        srcOpnds,
-        NULL);
+        srcOpnds);
     // push the return type
     if (returnType->tag != Type::Void)
         pushOpnd(dst);
@@ -2303,8 +2299,7 @@
                         tauNullChecked,
                         0, // let IRBuilder check types
                         numArgs,
-                        srcOpnds,
-                        NULL);
+                        srcOpnds);
     if (returnType->tag != Type::Void)
         pushOpnd(dst);
 }

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.h?view=diff&rev=556007&r1=556006&r2=556007
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.h Fri
Jul 13 07:19:35 2007
@@ -220,29 +220,6 @@
 
     typedef StlMap<uint32, Inst*> OffsetToInstMap;
 
-    class JavaInlineInfoBuilder : public InlineInfoBuilder {
-    public:
-        JavaInlineInfoBuilder(InlineInfoBuilder* parent, 
-                MethodDesc& thisMethodDesc, uint32 byteCodeOffset) :
-            InlineInfoBuilder(parent), methodDesc(thisMethodDesc), 
-                bcOffset(byteCodeOffset)
-        {}
-
-    virtual uint32 getCurrentBcOffset() { return bcOffset; }; 
-    virtual MethodDesc* getCurrentMd() { return &methodDesc; }; 
-
-    private:
-        virtual void addCurrentLevel(InlineInfo* ii, uint32 currOffset)
-        {
-            ii->addLevel(&methodDesc, currOffset);
-        }
-        virtual void setCurrentBcOffset(uint32 offSet) { bcOffset = offSet; };
-
-
-        MethodDesc& methodDesc;
-        uint32 bcOffset;
-    };
-
     //
     // helper methods for generating code
     //
@@ -417,7 +394,6 @@
     // Synchronization
     Opnd*               lockAddr;
     Opnd*               oldLockValue;
-    JavaInlineInfoBuilder  thisLevelBuilder;
     
     //
     // mapping: 

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaFlowGraphBuilder.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaFlowGraphBuilder.cpp?view=diff&rev=556007&r1=556006&r2=556007
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaFlowGraphBuilder.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaFlowGraphBuilder.cpp Fri
Jul 13 07:19:35 2007
@@ -99,12 +99,18 @@
     for (Inst* inst = first->getNextInst(); inst != NULL; inst = inst->getNextInst())
{
         if (lastExceptionalInstSeen != NULL) {
             // start a new basic block
-            Node *newblock = createBlockNodeAfter(block); 
+            LabelInst* label = irBuilder.getInstFactory()->makeLabel();
+            Node *newblock = createBlockNodeAfter(block, label); 
+            uint16 bcOffset = ILLEGAL_BC_MAPPING_VALUE;
             for (Inst *ins = lastExceptionalInstSeen->getNextInst(), *nextIns = NULL;
ins!=NULL; ins = nextIns) {
                 nextIns = ins->getNextInst();
                 ins->unlink();
                 newblock->appendInst(ins);
+                if (bcOffset == ILLEGAL_BC_MAPPING_VALUE) {
+                    bcOffset = ins->getBCOffset();
+                }
             }
+            label->setBCOffset(bcOffset);
 
             // now fix up the CFG, duplicating edges
             if (!lastExceptionalInstSeen->isThrow())
@@ -222,9 +228,7 @@
 }
 
 Node* JavaFlowGraphBuilder::createBlockNodeOrdered(LabelInst* label) {
-    if (label == NULL) {
-        label = irBuilder.getInstFactory()->makeLabel();
-    }
+    assert(label != NULL);
     Node* node = fg->createBlockNode(label);
     fallThruNodes.push_back(node);
     return node;
@@ -233,9 +237,7 @@
 Node* JavaFlowGraphBuilder::createBlockNodeAfter(Node* node, LabelInst* label) {
     NodeList::iterator it = std::find(fallThruNodes.begin(), fallThruNodes.end(), node);
     assert(it!=fallThruNodes.end());
-    if (label == NULL) {
-        label = irBuilder.getInstFactory()->makeLabel();
-    }
+    assert(label != NULL);
     label->setState(((LabelInst*)node->getFirstInst())->getState());
     Node* newNode = fg->createBlockNode(label);
     fallThruNodes.insert(++it, newNode);
@@ -262,7 +264,7 @@
     // create epilog, unwind, and exit
     //
     InstFactory* instFactory = irBuilder.getInstFactory();
-    fg->setReturnNode(createBlockNodeOrdered());
+    fg->setReturnNode(createBlockNodeOrdered(instFactory->makeLabel()));
     fg->setUnwindNode(createDispatchNode());
     fg->setExitNode(fg->createNode(Node::Kind_Exit, instFactory->makeLabel()));
     fg->addEdge(fg->getReturnNode(), fg->getExitNode());
@@ -427,11 +429,11 @@
                if ( !dispatch_target->isCatchBlock() ) {
                    fg->addEdge(dup_dispatch, dispatch_target);
                }else{
-                   CatchLabelInst* catch_label = 
-                       (CatchLabelInst*)dispatch_target->getFirstInst();
+                   CatchLabelInst* catch_label = (CatchLabelInst*)dispatch_target->getFirstInst();
                    assert(dispatch_target->getInstCount() == 0);
-                   Node* dup_catch = createBlockNodeOrdered(
-                           instFactory->makeCatchLabel( catch_label->getOrder(), catch_label->getExceptionType()));
+                   LabelInst* dupCatchInst = instFactory->makeCatchLabel( catch_label->getOrder(),
catch_label->getExceptionType());
+                   dupCatchInst->setBCOffset(catch_label->getBCOffset());
+                   Node* dup_catch = createBlockNodeOrdered(dupCatchInst);
                    fg->addEdge(dup_dispatch, dup_catch);
                    assert(dispatch_target->getOutDegree() == 1);
                    fg->addEdge(dup_catch, (*dispatch_target->getOutEdges().begin())->getTargetNode());
@@ -456,6 +458,7 @@
     memManager(mm), currentBlock(NULL), irBuilder(irB), fallThruNodes(mm)
 {
     fg = irBuilder.getFlowGraph();
+    methodHandle = irBuilder.getIRManager()->getMethodDesc().getMethodHandle();
 }
 
 } //namespace Jitrino 

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaFlowGraphBuilder.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaFlowGraphBuilder.h?view=diff&rev=556007&r1=556006&r2=556007
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaFlowGraphBuilder.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaFlowGraphBuilder.h Fri
Jul 13 07:19:35 2007
@@ -49,8 +49,8 @@
     void         eliminateUnnestedLoopsOnDispatch();
     bool         lastInstIsMonitorExit(Node* node);
 
-    Node* createBlockNodeOrdered(LabelInst* label = NULL);
-    Node* createBlockNodeAfter(Node* node, LabelInst* label = NULL);
+    Node* createBlockNodeOrdered(LabelInst* label);
+    Node* createBlockNodeAfter(Node* node, LabelInst* label);
     void addEdge(Node* source, Node* target);
 
     //
@@ -62,6 +62,7 @@
     IRBuilder&      irBuilder;
 typedef StlList<Node*> NodeList;
     NodeList fallThruNodes;
+    void*    methodHandle;
 };
 
 

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaTranslator.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaTranslator.cpp?view=diff&rev=556007&r1=556006&r2=556007
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaTranslator.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaTranslator.cpp Fri Jul
13 07:19:35 2007
@@ -30,7 +30,6 @@
 #include "ByteCodeParser.h"
 #include "JavaByteCodeTranslator.h"
 #include "Log.h"
-#include "CGSupport.h"
 #include "FlowGraph.h"
 
 namespace Jitrino {

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/inline_info.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/inline_info.h?view=diff&rev=556007&r1=556006&r2=556007
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/include/inline_info.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/inline_info.h Fri Jul 13 07:19:35 2007
@@ -9,7 +9,7 @@
 struct Method;
 
 /**
- * Iformation about methods inlined to a given method.
+ * Information about methods inlined to a given method.
  * Instance of this class holds a collection of Entry objects.
  */
 class InlineInfo



Mime
View raw message