tools

16:25:33.234 INFO  jd.cli.Main - Decompiling tools.jar
package sun.tools.asm;

import sun.tools.java.Type;

public final class ArrayData
{
  Type type;
  int nargs;
  
  public ArrayData(Type paramType, int paramInt)
  {
    type = paramType;
    nargs = paramInt;
  }
}

/* Location:
 * Qualified Name:     sun.tools.asm.ArrayData
 * Java Class Version: 7 (51.0)
 * JD-Core Version:    0.7.1
 */
package sun.tools.asm;

import java.io.BufferedInputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;
import sun.tools.java.ClassDeclaration;
import sun.tools.java.ClassDefinition;
import sun.tools.java.CompilerError;
import sun.tools.java.Constants;
import sun.tools.java.Environment;
import sun.tools.java.Identifier;
import sun.tools.java.MemberDefinition;
import sun.tools.java.Type;
import sun.tools.javac.SourceClass;

public final class Assembler
  implements Constants
{
  static final int NOTREACHED = 0;
  static final int REACHED = 1;
  static final int NEEDED = 2;
  Label first = new Label();
  Instruction last = first;
  int maxdepth;
  int maxvar;
  int maxpc;
  
  public void add(Instruction paramInstruction)
  {
    if (paramInstruction != null)
    {
      last.next = paramInstruction;
      last = paramInstruction;
    }
  }
  
  public void add(long paramLong, int paramInt)
  {
    add(new Instruction(paramLong, paramInt, null));
  }
  
  public void add(long paramLong, int paramInt, Object paramObject)
  {
    add(new Instruction(paramLong, paramInt, paramObject));
  }
  
  public void add(long paramLong, int paramInt, Object paramObject, boolean paramBoolean)
  {
    add(new Instruction(paramLong, paramInt, paramObject, paramBoolean));
  }
  
  public void add(boolean paramBoolean, long paramLong, int paramInt, Object paramObject)
  {
    add(new Instruction(paramBoolean, paramLong, paramInt, paramObject));
  }
  
  public void add(long paramLong, int paramInt, boolean paramBoolean)
  {
    add(new Instruction(paramLong, paramInt, paramBoolean));
  }
  
  static Vector SourceClassList = new Vector();
  static Vector TmpCovTable = new Vector();
  static int[] JcovClassCountArray = new int[9];
  static String JcovMagicLine = "JCOV-DATA-FILE-VERSION: 2.0";
  static String JcovClassLine = "CLASS: ";
  static String JcovSrcfileLine = "SRCFILE: ";
  static String JcovTimestampLine = "TIMESTAMP: ";
  static String JcovDataLine = "DATA: ";
  static String JcovHeadingLine = "#kind\tcount";
  static int[] arrayModifiers = { 1, 2, 4, 1024, 16, 512 };
  static int[] arrayModifiersOpc = { 121, 120, 122, 130, 128, 114 };
  
  void optimize(Environment paramEnvironment, Label paramLabel)
  {
    pc = 1;
    for (Instruction localInstruction = next; localInstruction != null; localInstruction = next)
    {
      switch (pc)
      {
      case 0: 
        localInstruction.optimize(paramEnvironment);
        pc = 1;
        break;
      case 1: 
        return;
      }
      Object localObject;
      Enumeration localEnumeration;
      switch (opc)
      {
      case -2: 
      case -1: 
        if (pc == 1) {
          pc = 0;
        }
        break;
      case 153: 
      case 154: 
      case 155: 
      case 156: 
      case 157: 
      case 158: 
      case 159: 
      case 160: 
      case 161: 
      case 162: 
      case 163: 
      case 164: 
      case 165: 
      case 166: 
      case 198: 
      case 199: 
        optimize(paramEnvironment, (Label)value);
        break;
      case 167: 
        optimize(paramEnvironment, (Label)value);
        return;
      case 168: 
        optimize(paramEnvironment, (Label)value);
        break;
      case 169: 
      case 172: 
      case 173: 
      case 174: 
      case 175: 
      case 176: 
      case 177: 
      case 191: 
        return;
      case 170: 
      case 171: 
        localObject = (SwitchData)value;
        optimize(paramEnvironment, defaultLabel);
        for (localEnumeration = tab.elements(); localEnumeration.hasMoreElements();) {
          optimize(paramEnvironment, (Label)localEnumeration.nextElement());
        }
        return;
      case -3: 
        localObject = (TryData)value;
        getEndLabelpc = 2;
        for (localEnumeration = catches.elements(); localEnumeration.hasMoreElements();)
        {
          CatchData localCatchData = (CatchData)localEnumeration.nextElement();
          optimize(paramEnvironment, localCatchData.getLabel());
        }
      }
    }
  }
  
  boolean eliminate()
  {
    boolean bool = false;
    Object localObject = first;
    for (Instruction localInstruction = first.next; localInstruction != null; localInstruction = next) {
      if (pc != 0)
      {
        next = localInstruction;
        localObject = localInstruction;
        pc = 0;
      }
      else
      {
        bool = true;
      }
    }
    first.pc = 0;
    next = null;
    return bool;
  }
  
  public void optimize(Environment paramEnvironment)
  {
    do
    {
      optimize(paramEnvironment, first);
    } while ((eliminate()) && (paramEnvironment.opt()));
  }
  
  public void collect(Environment paramEnvironment, MemberDefinition paramMemberDefinition, ConstantPool paramConstantPool)
  {
    if ((paramMemberDefinition != null) && (paramEnvironment.debug_vars()) && 
      (paramMemberDefinition.getArguments() != null)) {
      for (localObject = paramMemberDefinition.getArguments().elements(); ((Enumeration)localObject).hasMoreElements();)
      {
        MemberDefinition localMemberDefinition = (MemberDefinition)((Enumeration)localObject).nextElement();
        paramConstantPool.put(localMemberDefinition.getName().toString());
        paramConstantPool.put(localMemberDefinition.getType().getTypeSignature());
      }
    }
    for (Object localObject = first; localObject != null; localObject = next) {
      ((Instruction)localObject).collect(paramConstantPool);
    }
  }
  
  void balance(Label paramLabel, int paramInt)
  {
    for (Object localObject1 = paramLabel; localObject1 != null; localObject1 = next)
    {
      paramInt += ((Instruction)localObject1).balance();
      if (paramInt < 0) {
        throw new CompilerError("stack under flow: " + ((Instruction)localObject1).toString() + " = " + paramInt);
      }
      if (paramInt > maxdepth) {
        maxdepth = paramInt;
      }
      int i;
      Object localObject2;
      Enumeration localEnumeration;
      switch (opc)
      {
      case -1: 
        paramLabel = (Label)localObject1;
        if (pc == 1)
        {
          if (depth != paramInt) {
            throw new CompilerError("stack depth error " + paramInt + "/" + depth + ": " + ((Instruction)localObject1).toString());
          }
          return;
        }
        pc = 1;
        depth = paramInt;
        break;
      case 153: 
      case 154: 
      case 155: 
      case 156: 
      case 157: 
      case 158: 
      case 159: 
      case 160: 
      case 161: 
      case 162: 
      case 163: 
      case 164: 
      case 165: 
      case 166: 
      case 198: 
      case 199: 
        balance((Label)value, paramInt);
        break;
      case 167: 
        balance((Label)value, paramInt);
        return;
      case 168: 
        balance((Label)value, paramInt + 1);
        break;
      case 169: 
      case 172: 
      case 173: 
      case 174: 
      case 175: 
      case 176: 
      case 177: 
      case 191: 
        return;
      case 21: 
      case 23: 
      case 25: 
      case 54: 
      case 56: 
      case 58: 
        i = ((value instanceof Number) ? ((Number)value).intValue() : value).slot) + 1;
        if (i > maxvar) {
          maxvar = i;
        }
        break;
      case 22: 
      case 24: 
      case 55: 
      case 57: 
        i = ((value instanceof Number) ? ((Number)value).intValue() : value).slot) + 2;
        if (i > maxvar) {
          maxvar = i;
        }
        break;
      case 132: 
        i = ((int[])(int[])value)[0] + 1;
        if (i > maxvar) {
          maxvar = (i + 1);
        }
        break;
      case 170: 
      case 171: 
        localObject2 = (SwitchData)value;
        balance(defaultLabel, paramInt);
        for (localEnumeration = tab.elements(); localEnumeration.hasMoreElements();) {
          balance((Label)localEnumeration.nextElement(), paramInt);
        }
        return;
      case -3: 
        localObject2 = (TryData)value;
        for (localEnumeration = catches.elements(); localEnumeration.hasMoreElements();)
        {
          CatchData localCatchData = (CatchData)localEnumeration.nextElement();
          balance(localCatchData.getLabel(), paramInt + 1);
        }
      }
    }
  }
  
  public void write(Environment paramEnvironment, DataOutputStream paramDataOutputStream, MemberDefinition paramMemberDefinition, ConstantPool paramConstantPool)
    throws IOException
  {
    if ((paramMemberDefinition != null) && (paramMemberDefinition.getArguments() != null))
    {
      int i = 0;
      Vector localVector = paramMemberDefinition.getArguments();
      for (localObject = localVector.elements(); ((Enumeration)localObject).hasMoreElements();)
      {
        MemberDefinition localMemberDefinition = (MemberDefinition)((Enumeration)localObject).nextElement();
        i += localMemberDefinition.getType().stackSize();
      }
      maxvar = i;
    }
    try
    {
      balance(first, 0);
    }
    catch (CompilerError localCompilerError)
    {
      System.out.println("ERROR: " + localCompilerError);
      listing(System.out);
      throw localCompilerError;
    }
    int j = 0;int k = 0;
    for (Object localObject = first; localObject != null; localObject = next)
    {
      pc = j;
      int m = ((Instruction)localObject).size(paramConstantPool);
      if ((j < 65536) && (j + m >= 65536)) {
        paramEnvironment.error(where, "warn.method.too.long");
      }
      j += m;
      if (opc == -3) {
        k += value).catches.size();
      }
    }
    paramDataOutputStream.writeShort(maxdepth);
    paramDataOutputStream.writeShort(maxvar);
    paramDataOutputStream.writeInt(maxpc = j);
    for (localObject = first.next; localObject != null; localObject = next) {
      ((Instruction)localObject).write(paramDataOutputStream, paramConstantPool);
    }
    paramDataOutputStream.writeShort(k);
    if (k > 0) {
      writeExceptions(paramEnvironment, paramDataOutputStream, paramConstantPool, first, last);
    }
  }
  
  void writeExceptions(Environment paramEnvironment, DataOutputStream paramDataOutputStream, ConstantPool paramConstantPool, Instruction paramInstruction1, Instruction paramInstruction2)
    throws IOException
  {
    for (Object localObject = paramInstruction1; localObject != next; localObject = next) {
      if (opc == -3)
      {
        TryData localTryData = (TryData)value;
        writeExceptions(paramEnvironment, paramDataOutputStream, paramConstantPool, next, localTryData.getEndLabel());
        for (Enumeration localEnumeration = catches.elements(); localEnumeration.hasMoreElements();)
        {
          CatchData localCatchData = (CatchData)localEnumeration.nextElement();
          
          paramDataOutputStream.writeShort(pc);
          paramDataOutputStream.writeShort(getEndLabelpc);
          paramDataOutputStream.writeShort(getLabelpc);
          if (localCatchData.getType() != null) {
            paramDataOutputStream.writeShort(paramConstantPool.index(localCatchData.getType()));
          } else {
            paramDataOutputStream.writeShort(0);
          }
        }
        localObject = localTryData.getEndLabel();
      }
    }
  }
  
  public void writeCoverageTable(Environment paramEnvironment, ClassDefinition paramClassDefinition, DataOutputStream paramDataOutputStream, ConstantPool paramConstantPool, long paramLong)
    throws IOException
  {
    Vector localVector1 = new Vector();
    int i = 0;
    int j = 0;
    long l1 = ((SourceClass)paramClassDefinition).getWhere();
    Vector localVector2 = new Vector();
    int k = 0;
    int m = 0;
    long l2;
    for (Object localObject = first; localObject != null; localObject = next)
    {
      l2 = where >> 32;
      if ((l2 > 0L) && (opc != -1))
      {
        if (j == 0)
        {
          if (l1 == where) {
            localVector1.addElement(new Cover(2, paramLong, pc));
          } else {
            localVector1.addElement(new Cover(1, paramLong, pc));
          }
          m++;
          j = 1;
        }
        if ((i == 0) && (!flagNoCovered))
        {
          int n = 0;
          for (Enumeration localEnumeration1 = localVector2.elements(); localEnumeration1.hasMoreElements();) {
            if (((Long)localEnumeration1.nextElement()).longValue() == where) {
              n = 1;
            }
          }
          if (n == 0)
          {
            localVector1.addElement(new Cover(3, where, pc));
            m++;
            i = 1;
          }
        }
      }
      SwitchData localSwitchData;
      switch (opc)
      {
      case -1: 
        i = 0;
        break;
      case 153: 
      case 154: 
      case 155: 
      case 156: 
      case 157: 
      case 158: 
      case 159: 
      case 160: 
      case 161: 
      case 162: 
      case 163: 
      case 164: 
      case 165: 
      case 166: 
      case 198: 
      case 199: 
        if (flagCondInverted)
        {
          localVector1.addElement(new Cover(7, where, pc));
          localVector1.addElement(new Cover(8, where, pc));
        }
        else
        {
          localVector1.addElement(new Cover(8, where, pc));
          localVector1.addElement(new Cover(7, where, pc));
        }
        m += 2;
        i = 0;
        break;
      case 167: 
        i = 0;
        break;
      case 169: 
      case 172: 
      case 173: 
      case 174: 
      case 175: 
      case 176: 
      case 177: 
      case 191: 
        break;
      case -3: 
        localVector2.addElement(new Long(where));
        i = 0;
        break;
      case 170: 
        localSwitchData = (SwitchData)value;
        for (int i1 = minValue; i1 <= maxValue; i1++)
        {
          localVector1.addElement(new Cover(5, localSwitchData.whereCase(new Integer(i1)), pc));
          m++;
        }
        if (!localSwitchData.getDefault())
        {
          localVector1.addElement(new Cover(6, where, pc));
          m++;
        }
        else
        {
          localVector1.addElement(new Cover(5, localSwitchData.whereCase("default"), pc));
          m++;
        }
        i = 0;
        break;
      case 171: 
        localSwitchData = (SwitchData)value;
        for (Enumeration localEnumeration2 = localSwitchData.sortedKeys(); localEnumeration2.hasMoreElements();)
        {
          Integer localInteger = (Integer)localEnumeration2.nextElement();
          localVector1.addElement(new Cover(5, localSwitchData.whereCase(localInteger), pc));
          m++;
        }
        if (!localSwitchData.getDefault())
        {
          localVector1.addElement(new Cover(6, where, pc));
          m++;
        }
        else
        {
          localVector1.addElement(new Cover(5, localSwitchData.whereCase("default"), pc));
          m++;
        }
        i = 0;
      }
    }
    paramDataOutputStream.writeShort(m);
    for (int i2 = 0; i2 < m; i2++)
    {
      localObject = (Cover)localVector1.elementAt(i2);
      l2 = Addr >> 32;
      long l3 = Addr << 32 >> 32;
      paramDataOutputStream.writeShort(NumCommand);
      paramDataOutputStream.writeShort(Type);
      paramDataOutputStream.writeInt((int)l2);
      paramDataOutputStream.writeInt((int)l3);
      if ((Type != 5) || (Addr != 0L)) {
        JcovClassCountArray[Type] += 1;
      }
    }
  }
  
  public void addNativeToJcovTab(Environment paramEnvironment, ClassDefinition paramClassDefinition)
  {
    JcovClassCountArray[1] += 1;
  }
  
  private String createClassJcovElement(Environment paramEnvironment, ClassDefinition paramClassDefinition)
  {
    String str1 = Type.mangleInnerType(paramClassDefinition.getClassDeclaration().getName()).toString();
    
    SourceClassList.addElement(str1);
    String str2 = str1.replace('.', '/');
    String str3 = JcovClassLine + str2;
    
    str3 = str3 + " [";
    String str4 = "";
    for (int i = 0; i < arrayModifiers.length; i++) {
      if ((paramClassDefinition.getModifiers() & arrayModifiers[i]) != 0)
      {
        str3 = str3 + str4 + opNames[arrayModifiersOpc[i]];
        str4 = " ";
      }
    }
    str3 = str3 + "]";
    
    return str3;
  }
  
  public void GenVecJCov(Environment paramEnvironment, ClassDefinition paramClassDefinition, long paramLong)
  {
    String str = ((SourceClass)paramClassDefinition).getAbsoluteName();
    
    TmpCovTable.addElement(createClassJcovElement(paramEnvironment, paramClassDefinition));
    TmpCovTable.addElement(JcovSrcfileLine + str);
    TmpCovTable.addElement(JcovTimestampLine + paramLong);
    TmpCovTable.addElement(JcovDataLine + "A");
    TmpCovTable.addElement(JcovHeadingLine);
    for (int i = 1; i <= 8; i++) {
      if (JcovClassCountArray[i] != 0)
      {
        TmpCovTable.addElement(new String(i + "\t" + JcovClassCountArray[i]));
        JcovClassCountArray[i] = 0;
      }
    }
  }
  
  public void GenJCov(Environment paramEnvironment)
  {
    try
    {
      File localFile = paramEnvironment.getcovFile();
      if (localFile.exists())
      {
        localObject1 = new DataInputStream(new BufferedInputStream(new FileInputStream(localFile)));
        
        localObject2 = null;
        int i = 1;
        
        localObject2 = ((DataInputStream)localObject1).readLine();
        if ((localObject2 != null) && (((String)localObject2).startsWith(JcovMagicLine))) {
          while ((localObject2 = ((DataInputStream)localObject1).readLine()) != null)
          {
            Enumeration localEnumeration;
            if (((String)localObject2).startsWith(JcovClassLine))
            {
              i = 1;
              for (localEnumeration = SourceClassList.elements(); localEnumeration.hasMoreElements();)
              {
                String str2 = ((String)localObject2).substring(JcovClassLine.length());
                int j = str2.indexOf(' ');
                if (j != -1) {
                  str2 = str2.substring(0, j);
                }
                String str1 = (String)localEnumeration.nextElement();
                if (str1.compareTo(str2) == 0)
                {
                  i = 0;
                  break;
                }
              }
            }
            if (i != 0) {
              TmpCovTable.addElement(localObject2);
            }
          }
        }
        ((DataInputStream)localObject1).close();
      }
      Object localObject1 = new PrintStream(new DataOutputStream(new FileOutputStream(localFile)));
      ((PrintStream)localObject1).println(JcovMagicLine);
      for (Object localObject2 = TmpCovTable.elements(); ((Enumeration)localObject2).hasMoreElements();) {
        ((PrintStream)localObject1).println(((Enumeration)localObject2).nextElement());
      }
      ((PrintStream)localObject1).close();
    }
    catch (FileNotFoundException localFileNotFoundException)
    {
      System.out.println("ERROR: " + localFileNotFoundException);
    }
    catch (IOException localIOException)
    {
      System.out.println("ERROR: " + localIOException);
    }
  }
  
  public void writeLineNumberTable(Environment paramEnvironment, DataOutputStream paramDataOutputStream, ConstantPool paramConstantPool)
    throws IOException
  {
    long l1 = -1L;
    int i = 0;
    long l2;
    for (Object localObject = first; localObject != null; localObject = next)
    {
      l2 = where >> 32;
      if ((l2 > 0L) && (l1 != l2))
      {
        l1 = l2;
        i++;
      }
    }
    l1 = -1L;
    paramDataOutputStream.writeShort(i);
    for (localObject = first; localObject != null; localObject = next)
    {
      l2 = where >> 32;
      if ((l2 > 0L) && (l1 != l2))
      {
        l1 = l2;
        paramDataOutputStream.writeShort(pc);
        paramDataOutputStream.writeShort((int)l1);
      }
    }
  }
  
  void flowFields(Environment paramEnvironment, Label paramLabel, MemberDefinition[] paramArrayOfMemberDefinition)
  {
    if (locals != null)
    {
      arrayOfMemberDefinition = locals;
      for (int i = 0; i < maxvar; i++) {
        if (arrayOfMemberDefinition[i] != paramArrayOfMemberDefinition[i]) {
          arrayOfMemberDefinition[i] = null;
        }
      }
      return;
    }
    locals = new MemberDefinition[maxvar];
    System.arraycopy(paramArrayOfMemberDefinition, 0, locals, 0, maxvar);
    
    MemberDefinition[] arrayOfMemberDefinition = new MemberDefinition[maxvar];
    System.arraycopy(paramArrayOfMemberDefinition, 0, arrayOfMemberDefinition, 0, maxvar);
    paramArrayOfMemberDefinition = arrayOfMemberDefinition;
    for (Instruction localInstruction = next; localInstruction != null; localInstruction = next)
    {
      Object localObject;
      Enumeration localEnumeration;
      switch (opc)
      {
      case 54: 
      case 55: 
      case 56: 
      case 57: 
      case 58: 
      case 59: 
      case 60: 
      case 61: 
      case 62: 
      case 63: 
      case 64: 
      case 65: 
      case 66: 
      case 67: 
      case 68: 
      case 69: 
      case 70: 
      case 71: 
      case 72: 
      case 73: 
      case 74: 
      case 75: 
      case 76: 
      case 77: 
      case 78: 
        if ((value instanceof LocalVariable))
        {
          localObject = (LocalVariable)value;
          paramArrayOfMemberDefinition[slot] = field;
        }
        break;
      case -1: 
        flowFields(paramEnvironment, (Label)localInstruction, paramArrayOfMemberDefinition);
        return;
      case 153: 
      case 154: 
      case 155: 
      case 156: 
      case 157: 
      case 158: 
      case 159: 
      case 160: 
      case 161: 
      case 162: 
      case 163: 
      case 164: 
      case 165: 
      case 166: 
      case 168: 
      case 198: 
      case 199: 
        flowFields(paramEnvironment, (Label)value, paramArrayOfMemberDefinition);
        break;
      case 167: 
        flowFields(paramEnvironment, (Label)value, paramArrayOfMemberDefinition);
        return;
      case 169: 
      case 172: 
      case 173: 
      case 174: 
      case 175: 
      case 176: 
      case 177: 
      case 191: 
        return;
      case 170: 
      case 171: 
        localObject = (SwitchData)value;
        flowFields(paramEnvironment, defaultLabel, paramArrayOfMemberDefinition);
        for (localEnumeration = tab.elements(); localEnumeration.hasMoreElements();) {
          flowFields(paramEnvironment, (Label)localEnumeration.nextElement(), paramArrayOfMemberDefinition);
        }
        return;
      case -3: 
        localObject = value).catches;
        for (localEnumeration = ((Vector)localObject).elements(); localEnumeration.hasMoreElements();)
        {
          CatchData localCatchData = (CatchData)localEnumeration.nextElement();
          flowFields(paramEnvironment, localCatchData.getLabel(), paramArrayOfMemberDefinition);
        }
      }
    }
  }
  
  public void writeLocalVariableTable(Environment paramEnvironment, MemberDefinition paramMemberDefinition, DataOutputStream paramDataOutputStream, ConstantPool paramConstantPool)
    throws IOException
  {
    MemberDefinition[] arrayOfMemberDefinition1 = new MemberDefinition[maxvar];
    int i = 0;
    int j;
    if ((paramMemberDefinition != null) && (paramMemberDefinition.getArguments() != null))
    {
      j = 0;
      Vector localVector = paramMemberDefinition.getArguments();
      for (localObject1 = localVector.elements(); ((Enumeration)localObject1).hasMoreElements();)
      {
        localObject2 = (MemberDefinition)((Enumeration)localObject1).nextElement();
        arrayOfMemberDefinition1[j] = localObject2;
        j += ((MemberDefinition)localObject2).getType().stackSize();
      }
    }
    Object localObject2;
    flowFields(paramEnvironment, first, arrayOfMemberDefinition1);
    LocalVariableTable localLocalVariableTable = new LocalVariableTable();
    for (i = 0; i < maxvar; i++) {
      arrayOfMemberDefinition1[i] = null;
    }
    int k;
    if ((paramMemberDefinition != null) && (paramMemberDefinition.getArguments() != null))
    {
      k = 0;
      localObject1 = paramMemberDefinition.getArguments();
      for (localObject2 = ((Vector)localObject1).elements(); ((Enumeration)localObject2).hasMoreElements();)
      {
        MemberDefinition localMemberDefinition = (MemberDefinition)((Enumeration)localObject2).nextElement();
        arrayOfMemberDefinition1[k] = localMemberDefinition;
        localLocalVariableTable.define(localMemberDefinition, k, 0, maxpc);
        k += localMemberDefinition.getType().stackSize();
      }
    }
    int[] arrayOfInt = new int[maxvar];
    for (Object localObject1 = first; localObject1 != null; localObject1 = next) {
      switch (opc)
      {
      case 54: 
      case 55: 
      case 56: 
      case 57: 
      case 58: 
      case 59: 
      case 60: 
      case 61: 
      case 62: 
      case 63: 
      case 64: 
      case 65: 
      case 66: 
      case 67: 
      case 68: 
      case 69: 
      case 70: 
      case 71: 
      case 72: 
      case 73: 
      case 74: 
      case 75: 
      case 76: 
      case 77: 
      case 78: 
        if ((value instanceof LocalVariable))
        {
          localObject2 = (LocalVariable)value;
          int n = next != null ? next.pc : pc;
          if (arrayOfMemberDefinition1[slot] != null) {
            localLocalVariableTable.define(arrayOfMemberDefinition1[slot], slot, arrayOfInt[slot], n);
          }
          arrayOfInt[slot] = n;
          arrayOfMemberDefinition1[slot] = field;
        }
        break;
      case -1: 
        for (i = 0; i < maxvar; i++) {
          if (arrayOfMemberDefinition1[i] != null) {
            localLocalVariableTable.define(arrayOfMemberDefinition1[i], i, arrayOfInt[i], pc);
          }
        }
        int m = pc;
        MemberDefinition[] arrayOfMemberDefinition2 = locals;
        if (arrayOfMemberDefinition2 == null) {
          for (i = 0; i < maxvar; i++) {
            arrayOfMemberDefinition1[i] = null;
          }
        }
        System.arraycopy(arrayOfMemberDefinition2, 0, arrayOfMemberDefinition1, 0, maxvar);
        for (i = 0; i < maxvar; i++) {
          arrayOfInt[i] = m;
        }
      }
    }
    for (i = 0; i < maxvar; i++) {
      if (arrayOfMemberDefinition1[i] != null) {
        localLocalVariableTable.define(arrayOfMemberDefinition1[i], i, arrayOfInt[i], maxpc);
      }
    }
    localLocalVariableTable.write(paramEnvironment, paramDataOutputStream, paramConstantPool);
  }
  
  public boolean empty()
  {
    return first == last;
  }
  
  public void listing(PrintStream paramPrintStream)
  {
    paramPrintStream.println("-- listing --");
    for (Object localObject = first; localObject != null; localObject = next) {
      paramPrintStream.println(((Instruction)localObject).toString());
    }
  }
}

/* Location:
 * Qualified Name:     sun.tools.asm.Assembler
 * Java Class Version: 7 (51.0)
 * JD-Core Version:    0.7.1
 */
package sun.tools.asm;

public final class CatchData
{
  Object type;
  Label label;
  
  CatchData(Object paramObject)
  {
    type = paramObject;
    label = new Label();
  }
  
  public Label getLabel()
  {
    return label;
  }
  
  public Object getType()
  {
    return type;
  }
}

/* Location:
 * Qualified Name:     sun.tools.asm.CatchData
 * Java Class Version: 7 (51.0)
 * JD-Core Version:    0.7.1
 */
package sun.tools.asm;

import java.io.DataOutputStream;
import java.io.IOException;
import sun.tools.java.ClassDeclaration;
import sun.tools.java.Environment;
import sun.tools.java.Type;

final class ClassConstantData
  extends ConstantPoolData
{
  String name;
  
  ClassConstantData(ConstantPool paramConstantPool, ClassDeclaration paramClassDeclaration)
  {
    String str = paramClassDeclaration.getType().getTypeSignature();
    
    name = str.substring(1, str.length() - 1);
    paramConstantPool.put(name);
  }
  
  ClassConstantData(ConstantPool paramConstantPool, Type paramType)
  {
    name = paramType.getTypeSignature();
    paramConstantPool.put(name);
  }
  
  void write(Environment paramEnvironment, DataOutputStream paramDataOutputStream, ConstantPool paramConstantPool)
    throws IOException
  {
    paramDataOutputStream.writeByte(7);
    paramDataOutputStream.writeShort(paramConstantPool.index(name));
  }
  
  int order()
  {
    return 1;
  }
  
  public String toString()
  {
    return "ClassConstantData[" + name + "]";
  }
}

/* Location:
 * Qualified Name:     sun.tools.asm.ClassConstantData
 * Java Class Version: 7 (51.0)
 * JD-Core Version:    0.7.1
 */
package sun.tools.asm;

import java.io.DataOutputStream;
import java.io.IOException;
import java.util.Enumeration;
import java.util.Hashtable;
import sun.tools.java.ClassDeclaration;
import sun.tools.java.Environment;
import sun.tools.java.MemberDefinition;
import sun.tools.java.RuntimeConstants;
import sun.tools.java.Type;
import sun.tools.tree.StringExpression;

public final class ConstantPool
  implements RuntimeConstants
{
  Hashtable hash = new Hashtable(101);
  
  public int index(Object paramObject)
  {
    return hash.get(paramObject)).index;
  }
  
  public void put(Object paramObject)
  {
    Object localObject = (ConstantPoolData)hash.get(paramObject);
    if (localObject == null)
    {
      if ((paramObject instanceof String)) {
        localObject = new StringConstantData(this, (String)paramObject);
      } else if ((paramObject instanceof StringExpression)) {
        localObject = new StringExpressionConstantData(this, (StringExpression)paramObject);
      } else if ((paramObject instanceof ClassDeclaration)) {
        localObject = new ClassConstantData(this, (ClassDeclaration)paramObject);
      } else if ((paramObject instanceof Type)) {
        localObject = new ClassConstantData(this, (Type)paramObject);
      } else if ((paramObject instanceof MemberDefinition)) {
        localObject = new FieldConstantData(this, (MemberDefinition)paramObject);
      } else if ((paramObject instanceof NameAndTypeData)) {
        localObject = new NameAndTypeConstantData(this, (NameAndTypeData)paramObject);
      } else if ((paramObject instanceof Number)) {
        localObject = new NumberConstantData(this, (Number)paramObject);
      }
      hash.put(paramObject, localObject);
    }
  }
  
  public void write(Environment paramEnvironment, DataOutputStream paramDataOutputStream)
    throws IOException
  {
    ConstantPoolData[] arrayOfConstantPoolData = new ConstantPoolData[hash.size()];
    String[] arrayOfString = new String[arrayOfConstantPoolData.length];
    int i = 1;int j = 0;
    for (int k = 0; k < 5; k++)
    {
      int m = j;
      for (Enumeration localEnumeration = hash.elements(); localEnumeration.hasMoreElements();)
      {
        ConstantPoolData localConstantPoolData2 = (ConstantPoolData)localEnumeration.nextElement();
        if (localConstantPoolData2.order() == k)
        {
          arrayOfString[j] = sortKey(localConstantPoolData2);
          arrayOfConstantPoolData[(j++)] = localConstantPoolData2;
        }
      }
      xsort(arrayOfConstantPoolData, arrayOfString, m, j - 1);
    }
    for (k = 0; k < arrayOfConstantPoolData.length; k++)
    {
      ConstantPoolData localConstantPoolData1 = arrayOfConstantPoolData[k];
      index = i;
      i += localConstantPoolData1.width();
    }
    paramDataOutputStream.writeShort(i);
    for (k = 0; k < j; k++) {
      arrayOfConstantPoolData[k].write(paramEnvironment, paramDataOutputStream, this);
    }
  }
  
  private static String sortKey(ConstantPoolData paramConstantPoolData)
  {
    Object localObject;
    if ((paramConstantPoolData instanceof NumberConstantData))
    {
      localObject = num;
      String str = localObject.toString();
      int i = 3;
      if ((localObject instanceof Integer)) {
        i = 0;
      } else if ((localObject instanceof Float)) {
        i = 1;
      } else if ((localObject instanceof Long)) {
        i = 2;
      }
      return "\000" + (char)(str.length() + i << 8) + str;
    }
    if ((paramConstantPoolData instanceof StringExpressionConstantData)) {
      return (String)str.getValue();
    }
    if ((paramConstantPoolData instanceof FieldConstantData))
    {
      localObject = field;
      return ((MemberDefinition)localObject).getName() + " " + ((MemberDefinition)localObject).getType().getTypeSignature() + " " + ((MemberDefinition)localObject).getClassDeclaration().getName();
    }
    if ((paramConstantPoolData instanceof NameAndTypeConstantData)) {
      return name + " " + type;
    }
    if ((paramConstantPoolData instanceof ClassConstantData)) {
      return name;
    }
    return str;
  }
  
  private static void xsort(ConstantPoolData[] paramArrayOfConstantPoolData, String[] paramArrayOfString, int paramInt1, int paramInt2)
  {
    if (paramInt1 >= paramInt2) {
      return;
    }
    String str1 = paramArrayOfString[paramInt1];
    int i = paramInt1;
    int j = paramInt2;
    while (i < j)
    {
      while ((i <= paramInt2) && (paramArrayOfString[i].compareTo(str1) <= 0)) {
        i++;
      }
      while ((j >= paramInt1) && (paramArrayOfString[j].compareTo(str1) > 0)) {
        j--;
      }
      if (i < j)
      {
        ConstantPoolData localConstantPoolData = paramArrayOfConstantPoolData[i];
        localObject = paramArrayOfString[i];
        paramArrayOfConstantPoolData[i] = paramArrayOfConstantPoolData[j];paramArrayOfConstantPoolData[j] = localConstantPoolData;
        paramArrayOfString[i] = paramArrayOfString[j];paramArrayOfString[j] = localObject;
      }
    }
    int k = j;
    
    Object localObject = paramArrayOfConstantPoolData[paramInt1];
    String str2 = paramArrayOfString[paramInt1];
    paramArrayOfConstantPoolData[paramInt1] = paramArrayOfConstantPoolData[k];paramArrayOfConstantPoolData[k] = localObject;
    paramArrayOfString[paramInt1] = paramArrayOfString[k];paramArrayOfString[k] = str2;
    xsort(paramArrayOfConstantPoolData, paramArrayOfString, paramInt1, k - 1);
    xsort(paramArrayOfConstantPoolData, paramArrayOfString, k + 1, paramInt2);
  }
}

/* Location:
 * Qualified Name:     sun.tools.asm.ConstantPool
 * Java Class Version: 7 (51.0)
 * JD-Core Version:    0.7.1
 */
package sun.tools.asm;

import java.io.DataOutputStream;
import java.io.IOException;
import sun.tools.java.Environment;
import sun.tools.java.RuntimeConstants;

abstract class ConstantPoolData
  implements RuntimeConstants
{
  int index;
  
  abstract void write(Environment paramEnvironment, DataOutputStream paramDataOutputStream, ConstantPool paramConstantPool)
    throws IOException;
  
  int order()
  {
    return 0;
  }
  
  int width()
  {
    return 1;
  }
}

/* Location:
 * Qualified Name:     sun.tools.asm.ConstantPoolData
 * Java Class Version: 7 (51.0)
 * JD-Core Version:    0.7.1
 */
package sun.tools.asm;

public class Cover
{
  public int Type;
  public long Addr;
  public int NumCommand;
  
  public Cover(int paramInt1, long paramLong, int paramInt2)
  {
    Type = paramInt1;
    Addr = paramLong;
    NumCommand = paramInt2;
  }
}

/* Location:
 * Qualified Name:     sun.tools.asm.Cover
 * Java Class Version: 7 (51.0)
 * JD-Core Version:    0.7.1
 */
package sun.tools.asm;

import java.io.DataOutputStream;
import java.io.IOException;
import sun.tools.java.ClassDefinition;
import sun.tools.java.Environment;
import sun.tools.java.MemberDefinition;

final class FieldConstantData
  extends ConstantPoolData
{
  MemberDefinition field;
  NameAndTypeData nt;
  
  FieldConstantData(ConstantPool paramConstantPool, MemberDefinition paramMemberDefinition)
  {
    field = paramMemberDefinition;
    nt = new NameAndTypeData(paramMemberDefinition);
    paramConstantPool.put(paramMemberDefinition.getClassDeclaration());
    paramConstantPool.put(nt);
  }
  
  void write(Environment paramEnvironment, DataOutputStream paramDataOutputStream, ConstantPool paramConstantPool)
    throws IOException
  {
    if (field.isMethod())
    {
      if (field.getClassDefinition().isInterface()) {
        paramDataOutputStream.writeByte(11);
      } else {
        paramDataOutputStream.writeByte(10);
      }
    }
    else {
      paramDataOutputStream.writeByte(9);
    }
    paramDataOutputStream.writeShort(paramConstantPool.index(field.getClassDeclaration()));
    paramDataOutputStream.writeShort(paramConstantPool.index(nt));
  }
  
  int order()
  {
    return 2;
  }
}

/* Location:
 * Qualified Name:     sun.tools.asm.FieldConstantData
 * Java Class Version: 7 (51.0)
 * JD-Core Version:    0.7.1
 */
package sun.tools.asm;

import java.io.DataOutputStream;
import java.io.IOException;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;
import sun.tools.java.ClassDeclaration;
import sun.tools.java.CompilerError;
import sun.tools.java.Constants;
import sun.tools.java.Environment;
import sun.tools.java.Identifier;
import sun.tools.java.MemberDefinition;
import sun.tools.java.Type;

public class Instruction
  implements Constants
{
  long where;
  int pc;
  int opc;
  Object value;
  Instruction next;
  boolean flagCondInverted;
  boolean flagNoCovered = false;
  public static final double SWITCHRATIO;
  
  public Instruction(long paramLong, int paramInt, Object paramObject, boolean paramBoolean)
  {
    where = paramLong;
    opc = paramInt;
    value = paramObject;
    flagCondInverted = paramBoolean;
  }
  
  public Instruction(boolean paramBoolean, long paramLong, int paramInt, Object paramObject)
  {
    where = paramLong;
    opc = paramInt;
    value = paramObject;
    flagNoCovered = paramBoolean;
  }
  
  public Instruction(long paramLong, int paramInt, boolean paramBoolean)
  {
    where = paramLong;
    opc = paramInt;
    flagNoCovered = paramBoolean;
  }
  
  public Instruction(long paramLong, int paramInt, Object paramObject)
  {
    where = paramLong;
    opc = paramInt;
    value = paramObject;
  }
  
  static
  {
    double d1 = 1.5D;
    String str = System.getProperty("javac.switchratio");
    if (str != null) {
      try
      {
        double d2 = Double.valueOf(str).doubleValue();
        if ((!Double.isNaN(d2)) && (d2 >= 0.0D)) {
          d1 = d2;
        }
      }
      catch (NumberFormatException localNumberFormatException) {}
    }
    SWITCHRATIO = d1;
  }
  
  public int getOpcode()
  {
    return pc;
  }
  
  public Object getValue()
  {
    return value;
  }
  
  public void setValue(Object paramObject)
  {
    value = paramObject;
  }
  
  void optimize(Environment paramEnvironment)
  {
    Object localObject;
    switch (opc)
    {
    case 54: 
    case 55: 
    case 56: 
    case 57: 
    case 58: 
      if (((value instanceof LocalVariable)) && (!paramEnvironment.debug_vars())) {
        value = new Integer(value).slot);
      }
      break;
    case 167: 
      localObject = (Label)value;
      value = (localObject = ((Label)localObject).getDestination());
      if (localObject == next) {
        opc = -2;
      } else if ((next != null) && (paramEnvironment.opt())) {
        switch (next.opc)
        {
        case 172: 
        case 173: 
        case 174: 
        case 175: 
        case 176: 
        case 177: 
          opc = next.opc;
          value = next.value;
        }
      }
      break;
    case 153: 
    case 154: 
    case 155: 
    case 156: 
    case 157: 
    case 158: 
    case 198: 
    case 199: 
      value = ((Label)value).getDestination();
      if (value == next)
      {
        opc = 87;
      }
      else if ((next.opc == 167) && (value == next.next))
      {
       
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd