mkwan       2003/04/01 13:12:39

  Modified:    java/src/org/apache/xalan/xsltc/compiler/util
                        MethodGenerator.java NodeSetType.java
                        ObjectType.java ReferenceType.java
                        ResultTreeType.java TypeCheckError.java
  Log:
  Merging XSLTC_DTM and common serializer to the head
  
  Changes in org.apache.xalan.xsltc.compiler.util.
  
  Revision  Changes    Path
  1.12      +11 -3     
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
  
  Index: MethodGenerator.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- MethodGenerator.java      30 Jan 2003 18:46:09 -0000      1.11
  +++ MethodGenerator.java      1 Apr 2003 21:12:39 -0000       1.12
  @@ -111,6 +111,7 @@
       private final Instruction _setStartNode;
       private final Instruction _reset;
       private final Instruction _nextNode;
  +    private final Instruction _nextNodeId;
   
       private SlotAllocator _slotAllocator;
       private boolean _allocatorInit = false;
  @@ -143,7 +144,7 @@
   
        final int attribute =
            cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
  -                                   "attribute", 
  +                                   "addAttribute", 
                                      "("
                                      + STRING_SIG
                                      + STRING_SIG
  @@ -152,7 +153,7 @@
   
        final int namespace =
            cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
  -                                   "namespace", 
  +                                   "namespaceAfterStartElement", 
                                      "("
                                      + STRING_SIG
                                      + STRING_SIG
  @@ -182,6 +183,9 @@
        index = cpg.addInterfaceMethodref(NODE_ITERATOR, NEXT, NEXT_SIG);
        _nextNode = new INVOKEINTERFACE(index, 1);
        
  +     index = 
cpg.addInterfaceMethodref("org.apache.xalan.xsltc.dom.SAXImpl$SingletonNodeIDIterator",
 NEXTID, NEXT_SIG);
  +     _nextNodeId = new INVOKEINTERFACE(index, 1);
  +     
        _slotAllocator = new SlotAllocator();
        _slotAllocator.initialize(getLocalVariables());
        _allocatorInit = true;
  @@ -248,6 +252,10 @@
       
       public final Instruction nextNode() {
        return _nextNode;
  +    }
  +    
  +    public final Instruction nextNodeId() {
  +     return _nextNodeId;
       }
       
       public final Instruction startElement() {
  
  
  
  1.15      +4 -4      
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/NodeSetType.java
  
  Index: NodeSetType.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/NodeSetType.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- NodeSetType.java  30 Jan 2003 18:46:09 -0000      1.14
  +++ NodeSetType.java  1 Apr 2003 21:12:39 -0000       1.15
  @@ -68,7 +68,7 @@
   import org.apache.bcel.generic.BranchHandle;
   import org.apache.bcel.generic.ConstantPoolGen;
   import org.apache.bcel.generic.GOTO;
  -import org.apache.bcel.generic.IFEQ;
  +import org.apache.bcel.generic.IFLT;
   import org.apache.bcel.generic.INVOKEINTERFACE;
   import org.apache.bcel.generic.INVOKESTATIC;
   import org.apache.bcel.generic.Instruction;
  @@ -208,7 +208,7 @@
        final InstructionList il = methodGen.getInstructionList();
        getFirstNode(classGen, methodGen);
        il.append(DUP);
  -     final BranchHandle falsec = il.append(new IFEQ(null));
  +     final BranchHandle falsec = il.append(new IFLT(null));
        Type.Node.translateTo(classGen, methodGen, type);
        final BranchHandle truec = il.append(new GOTO(null));
        falsec.setTarget(il.append(POP));
  @@ -260,7 +260,7 @@
                                             BooleanType type) {
        final InstructionList il = methodGen.getInstructionList();
        getFirstNode(classGen, methodGen);
  -     return new FlowList(il.append(new IFEQ(null)));
  +     return new FlowList(il.append(new IFLT(null)));
       }
   
       /**
  
  
  
  1.5       +2 -2      
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/ObjectType.java
  
  Index: ObjectType.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/ObjectType.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ObjectType.java   30 Jan 2003 18:46:09 -0000      1.4
  +++ ObjectType.java   1 Apr 2003 21:12:39 -0000       1.5
  @@ -125,7 +125,7 @@
       }
   
       public String toString() {
  -     return "object";
  +     return _javaClassName;
       }
   
       public boolean identicalTo(Type other) {
  
  
  
  1.16      +5 -3      
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/ReferenceType.java
  
  Index: ReferenceType.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/ReferenceType.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- ReferenceType.java        26 Feb 2003 20:11:19 -0000      1.15
  +++ ReferenceType.java        1 Apr 2003 21:12:39 -0000       1.16
  @@ -64,7 +64,6 @@
   
   package org.apache.xalan.xsltc.compiler.util;
   
  -import org.apache.xalan.xsltc.DOM;
   import org.apache.bcel.generic.PUSH;
   import org.apache.bcel.generic.ALOAD;
   import org.apache.bcel.generic.ASTORE;
  @@ -75,9 +74,12 @@
   import org.apache.bcel.generic.INVOKESTATIC;
   import org.apache.bcel.generic.Instruction;
   import org.apache.bcel.generic.InstructionList;
  +
   import org.apache.xalan.xsltc.compiler.Constants;
   import org.apache.xalan.xsltc.compiler.FlowList;
   
  +import org.apache.xml.dtm.DTM;
  +
   public final class ReferenceType extends Type {
       protected ReferenceType() {}
   
  @@ -146,7 +148,7 @@
   
        // If no current, conversion is a top-level
        if (current < 0) {
  -         il.append(new PUSH(cpg, DOM.ROOTNODE));  // push root node
  +         il.append(new PUSH(cpg, DTM.ROOT_NODE));  // push root node
        }
        else {
            il.append(new ILOAD(current));
  
  
  
  1.18      +18 -11    
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/ResultTreeType.java
  
  Index: ResultTreeType.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/ResultTreeType.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- ResultTreeType.java       30 Jan 2003 18:46:09 -0000      1.17
  +++ ResultTreeType.java       1 Apr 2003 21:12:39 -0000       1.18
  @@ -276,13 +276,15 @@
            }
            il.append(methodGen.loadDOM());
   
  -         // Create new instance of DOM class 
  -         int index = cpg.addMethodref(DOM_IMPL, "<init>", "(I)V");
  -         il.append(new NEW(cpg.addClass(DOM_IMPL)));
  -         il.append(DUP);
  -         il.append(DUP);
  +         // Create new instance of DOM class (with RTF_INITIAL_SIZE nodes)
  +         il.append(methodGen.loadDOM());
  +         int index = cpg.addInterfaceMethodref(DOM_INTF,
  +                              "getResultTreeFrag",
  +                              "(IZ)" + DOM_INTF_SIG);
            il.append(new PUSH(cpg, RTF_INITIAL_SIZE));
  -         il.append(new INVOKESPECIAL(index));
  +         il.append(new PUSH(cpg, false));
  +         il.append(new INVOKEINTERFACE(index,3));
  +         il.append(DUP);
            
            // Store new DOM into a local variable
            newDom = methodGen.addLocalVariable("rt_to_reference_dom", 
  @@ -292,10 +294,15 @@
            il.append(new ASTORE(newDom.getIndex()));
   
            // Overwrite old handler with DOM handler
  -         index = cpg.addMethodref(DOM_IMPL,
  -                                  "getOutputDomBuilder", 
  -                                  "()" + TRANSLET_OUTPUT_SIG);
  -         il.append(new INVOKEVIRTUAL(index));
  +         index = cpg.addInterfaceMethodref(DOM_INTF,
  +                              "getOutputDomBuilder",
  +                              "()" + TRANSLET_OUTPUT_SIG);
  +
  +         il.append(new INVOKEINTERFACE(index,1));
  +         //index = cpg.addMethodref(DOM_IMPL,
  +             //                   "getOutputDomBuilder", 
  +             //                   "()" + TRANSLET_OUTPUT_SIG);
  +         //il.append(new INVOKEVIRTUAL(index));
            il.append(DUP);
            il.append(DUP);
   
  
  
  
  1.6       +5 -1      
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/TypeCheckError.java
  
  Index: TypeCheckError.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/TypeCheckError.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TypeCheckError.java       19 Mar 2003 22:14:09 -0000      1.5
  +++ TypeCheckError.java       1 Apr 2003 21:12:39 -0000       1.6
  @@ -93,6 +93,10 @@
           return _error;
       }
   
  +    public String getMessage() {
  +        return toString();
  +    }
  +
       public String toString() {
        String result;
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to