forked from JavaTX/JavaCompilerCore
1099 lines
27 KiB
Java
Executable File
1099 lines
27 KiB
Java
Executable File
//PL 14-03-21: calculate_max_stack() duerfte nicht stimmen
|
|
//vorübergehend max_stack und set_max_stack eingeführt
|
|
//in codegen "short max_stack = calculate_max_stack();" auskommentiert
|
|
//muss wieder einkommentiert werden
|
|
|
|
// ino.module.CodeAttribute.8532.package
|
|
package de.dhbwstuttgart.bytecode;
|
|
// ino.end
|
|
|
|
// ino.module.CodeAttribute.8532.import
|
|
import java.io.FileOutputStream;
|
|
import java.io.IOException;
|
|
import java.io.OutputStream;
|
|
import java.lang.reflect.Array;
|
|
import java.util.Vector;
|
|
|
|
import de.dhbwstuttgart.myexception.JVMCodeException;
|
|
import de.dhbwstuttgart.syntaxtree.type.Type;
|
|
|
|
// ino.class.CodeAttribute.21681.declaration
|
|
public class CodeAttribute extends Attribute
|
|
// ino.end
|
|
// ino.class.CodeAttribute.21681.body
|
|
{
|
|
// ino.attribute.code_vector.21685.declaration
|
|
private Vector<Byte> code_vector = new Vector<Byte>();
|
|
// ino.end
|
|
// ino.attribute.exception_tables.21688.declaration
|
|
private Vector<ExceptionTable> exception_tables = new Vector<ExceptionTable>();
|
|
// ino.end
|
|
// ino.attribute.attributes.21691.declaration
|
|
private Vector<Attribute> attributes = new Vector<Attribute>();
|
|
// ino.end
|
|
// ino.attribute.local_name_vector.21694.declaration
|
|
private Vector<String> local_name_vector = new Vector<String>();
|
|
// ino.end
|
|
// ino.attribute.local_type_vector.21697.declaration
|
|
private Vector<Type> local_type_vector = new Vector<Type>();
|
|
// ino.end
|
|
|
|
short max_stack;
|
|
|
|
public CodeAttribute() {
|
|
super();
|
|
}
|
|
|
|
// ino.method.CodeAttribute.21700.definition
|
|
public CodeAttribute(String class_name, short acc_flags)
|
|
// ino.end
|
|
// ino.method.CodeAttribute.21700.body
|
|
{
|
|
if ((acc_flags & 8) == 0)
|
|
add_local(class_name, new Type("void",-1));
|
|
}
|
|
// ino.end
|
|
|
|
// ino.method.get_code_Vector.21703.definition
|
|
public Vector<Byte> get_code_Vector()
|
|
// ino.end
|
|
// ino.method.get_code_Vector.21703.body
|
|
{
|
|
return this.code_vector;
|
|
}
|
|
// ino.end
|
|
|
|
// ino.method.get_exception_table_Vector.21706.definition
|
|
public Vector<ExceptionTable> get_exception_table_Vector()
|
|
// ino.end
|
|
// ino.method.get_exception_table_Vector.21706.body
|
|
{
|
|
return this.exception_tables;
|
|
}
|
|
// ino.end
|
|
|
|
// ino.method.get_attributes_Vector.21709.definition
|
|
public Vector<Attribute> get_attributes_Vector()
|
|
// ino.end
|
|
// ino.method.get_attributes_Vector.21709.body
|
|
{
|
|
return this.attributes;
|
|
}
|
|
// ino.end
|
|
|
|
// ino.method.get_local_Vector.21712.definition
|
|
public Vector<String> get_local_Vector()
|
|
// ino.end
|
|
// ino.method.get_local_Vector.21712.body
|
|
{
|
|
return this.local_name_vector;
|
|
}
|
|
// ino.end
|
|
|
|
// ino.method.get_code_length.21715.definition
|
|
public int get_code_length()
|
|
// ino.end
|
|
// ino.method.get_code_length.21715.body
|
|
{
|
|
return this.code_vector.size();
|
|
}
|
|
// ino.end
|
|
|
|
// ino.method.add_local.21718.definition
|
|
public void add_local(String s, Type t)
|
|
// ino.end
|
|
// ino.method.add_local.21718.body
|
|
{
|
|
local_name_vector.addElement(s);
|
|
local_type_vector.addElement(t);
|
|
String type = t.getName();
|
|
if (type.equals("double") || type.equals("long")) {
|
|
local_name_vector.addElement(s);
|
|
local_type_vector.addElement(t);
|
|
}
|
|
}
|
|
// ino.end
|
|
|
|
// ino.method.add_code.21721.definition
|
|
public void add_code(Byte b)
|
|
// ino.end
|
|
// ino.method.add_code.21721.body
|
|
{
|
|
code_vector.addElement(b);
|
|
}
|
|
// ino.end
|
|
|
|
// ino.method.set_code.21724.definition
|
|
public void set_code(Byte b, int i)
|
|
// ino.end
|
|
// ino.method.set_code.21724.body
|
|
{
|
|
code_vector.setElementAt(b, i);
|
|
}
|
|
// ino.end
|
|
|
|
// ino.method.add_code_int.21727.definition
|
|
public void add_code_int(int i)
|
|
// ino.end
|
|
// ino.method.add_code_int.21727.body
|
|
{
|
|
code_vector.addElement(new Byte((byte) ((i >> 24) & 255)));
|
|
code_vector.addElement(new Byte((byte) ((i >> 16) & 255)));
|
|
code_vector.addElement(new Byte((byte) ((i >> 8) & 255)));
|
|
code_vector.addElement(new Byte((byte) (i & 255)));
|
|
}
|
|
// ino.end
|
|
|
|
// ino.method.add_code_short.21730.definition
|
|
public void add_code_short(int s)
|
|
// ino.end
|
|
// ino.method.add_code_short.21730.body
|
|
{
|
|
code_vector.addElement(new Byte((byte) ((s >> 8) & 255)));
|
|
code_vector.addElement(new Byte((byte) (s & 255)));
|
|
}
|
|
// ino.end
|
|
|
|
// ino.method.set_code_short.21733.definition
|
|
public void set_code_short(int s, int i)
|
|
// ino.end
|
|
// ino.method.set_code_short.21733.body
|
|
{
|
|
code_vector.setElementAt(new Byte((byte) ((s >> 8) & 255)), i);
|
|
code_vector.setElementAt(new Byte((byte) (s & 255)), i + 1);
|
|
}
|
|
// ino.end
|
|
|
|
// ino.method.add_code_byte.21736.definition
|
|
public void add_code_byte(int b)
|
|
// ino.end
|
|
// ino.method.add_code_byte.21736.body
|
|
{
|
|
code_vector.addElement(new Byte((byte) (b & 255)));
|
|
}
|
|
// ino.end
|
|
|
|
// ino.method.add_code_byte_array.21739.definition
|
|
public void add_code_byte_array(byte[] b)
|
|
// ino.end
|
|
// ino.method.add_code_byte_array.21739.body
|
|
{
|
|
for (int i = 0; i < Array.getLength(b); i++)
|
|
code_vector.addElement(new Byte(b[i]));
|
|
}
|
|
// ino.end
|
|
|
|
// ino.method.get_indexOf_Var.21742.definition
|
|
public int get_indexOf_Var(String name)
|
|
// ino.end
|
|
// ino.method.get_indexOf_Var.21742.body
|
|
{
|
|
for (int i = 0; i < local_name_vector.size(); i++)
|
|
if (name.equals((String) local_name_vector.elementAt(i)))
|
|
return i;
|
|
return -1;
|
|
}
|
|
// ino.end
|
|
|
|
// ino.method.get_TypeOf_Var.21745.definition
|
|
public Type get_TypeOf_Var(String name)
|
|
throws JVMCodeException
|
|
// ino.end
|
|
// ino.method.get_TypeOf_Var.21745.body
|
|
{
|
|
int index = get_indexOf_Var(name);
|
|
if (index != -1)
|
|
return (Type) local_type_vector.elementAt(index);
|
|
throw new JVMCodeException(
|
|
"JVMCodeException: Code_attribute: Type get_TypeOf_Var(String name)");
|
|
}
|
|
// ino.end
|
|
|
|
// ino.method.get_attributes_length.21748.definition
|
|
public int get_attributes_length()
|
|
// ino.end
|
|
// ino.method.get_attributes_length.21748.body
|
|
{
|
|
int ret = 8;//2(max_stack)+2(max_locals)+4(code_length)
|
|
ret += code_vector.size();
|
|
ret += 2; //exception table length
|
|
ret += (exception_tables.size() * 8);
|
|
ret += 2; //Attribute_count
|
|
for (int i = 0; i < attributes.size(); i++)
|
|
ret += attributes.elementAt(i)
|
|
.get_attributes_length();
|
|
return ret;
|
|
}
|
|
// ino.end
|
|
|
|
// ino.method.set_exception_table_Vector.21751.definition
|
|
public void set_exception_table_Vector(Vector<ExceptionTable> t)
|
|
// ino.end
|
|
// ino.method.set_exception_table_Vector.21751.body
|
|
{
|
|
this.exception_tables = t;
|
|
}
|
|
// ino.end
|
|
|
|
// ino.method.set_attributes_Vector.21754.definition
|
|
public void set_attributes_Vector(Vector<Attribute> t)
|
|
// ino.end
|
|
// ino.method.set_attributes_Vector.21754.body
|
|
{
|
|
this.attributes = t;
|
|
}
|
|
// ino.end
|
|
|
|
public void set_max_stack(short ms) {
|
|
max_stack = ms;
|
|
}
|
|
|
|
|
|
// ino.method.codegen.21757.definition
|
|
public void codegen(ClassFile classfile, OutputStream f)
|
|
throws JVMCodeException, IOException
|
|
// ino.end
|
|
// ino.method.codegen.21757.body
|
|
{
|
|
int attributes_length = this.get_attributes_length();
|
|
//PL 14-03-21: muss wieder einkommentiert werden
|
|
//short max_stack = calculate_max_stack();
|
|
classfile.writeShort(f, get_attribute_name_index());
|
|
classfile.writeInt(f, attributes_length);
|
|
classfile.writeShort(f, max_stack);
|
|
classfile.writeShort(f, (short) local_name_vector.size());
|
|
classfile.writeInt(f, code_vector.size());
|
|
|
|
codegenlog.debug("Code_attribute_name_index=" + get_attribute_name_index()
|
|
+ ", Length=" + attributes_length + ", Max_Stack=" + max_stack
|
|
+ ", Max_Locals=" + (short) local_name_vector.size()
|
|
+ ", Code_Length=" + code_vector.size());
|
|
|
|
for (int i = 0; i < code_vector.size(); i++) { // code_vector
|
|
classfile.writeByte(f, (code_vector.elementAt(i)).byteValue());
|
|
}
|
|
|
|
// Verarbeitung der Exception-Table
|
|
JVMCode.get_Command(code_vector);
|
|
codegenlog.debug("Groesse der Exception-Table: " + exception_tables.size());
|
|
classfile.writeShort(f, (short) exception_tables.size());
|
|
for (int i = 0; i < exception_tables.size(); i++) {
|
|
exception_tables.elementAt(i).codegen(classfile,f);
|
|
}
|
|
|
|
// Verarbeitung der Attribute
|
|
codegenlog.debug("Anzahl der Attribute: " + attributes.size());
|
|
classfile.writeShort(f, (short) attributes.size());
|
|
for (int i = 0; i < attributes.size(); i++) { // attributes
|
|
attributes.elementAt(i).codegen(classfile, f);
|
|
}
|
|
/*
|
|
* if(classfile.get_system_out()) { System.out.println(" locals:");
|
|
* for(int i = 0; i < local_name_vector.size(); i++) // locals
|
|
* System.out.println(" " + i +" " +
|
|
* (String)local_name_vector.elementAt(i) +
|
|
* ((Type)local_type_vector.elementAt(i)).get_Type()); }
|
|
*/
|
|
}
|
|
// ino.end
|
|
|
|
// ino.method.calculate_max_stack.21760.definition
|
|
//PL 14-03-21: Diese Methode duerfte nicht stimmen
|
|
private short calculate_max_stack()
|
|
throws JVMCodeException
|
|
// ino.end
|
|
// ino.method.calculate_max_stack.21760.body
|
|
{
|
|
short max_stack = 0;
|
|
short stack = 0;
|
|
for (int y = 0; y < code_vector.size(); y++) {
|
|
int x = JVMCode.bytes_to_int(code_vector.elementAt(y));
|
|
switch (x) {
|
|
case 0: {
|
|
break;
|
|
}
|
|
case 1: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 2: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 3: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 4: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 5: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 6: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 7: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 8: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 9: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 10: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 11: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 12: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 13: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 14: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 15: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 16: {
|
|
stack++;
|
|
y++;
|
|
break;
|
|
}
|
|
case 17: {
|
|
stack++;
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 18: {
|
|
stack++;
|
|
y++;
|
|
break;
|
|
}
|
|
case 19: {
|
|
stack++;
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 20: {
|
|
stack++;
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 21: {
|
|
stack++;
|
|
y++;
|
|
break;
|
|
}
|
|
case 22: {
|
|
stack++;
|
|
y++;
|
|
break;
|
|
}
|
|
case 23: {
|
|
stack++;
|
|
y++;
|
|
break;
|
|
}
|
|
case 24: {
|
|
stack++;
|
|
y++;
|
|
break;
|
|
}
|
|
case 25: {
|
|
stack++;
|
|
y++;
|
|
break;
|
|
}
|
|
case 26: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 27: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 28: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 29: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 30: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 31: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 32: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 33: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 34: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 35: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 36: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 37: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 38: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 39: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 40: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 41: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 42: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 43: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 44: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 45: {
|
|
stack++;
|
|
break;
|
|
}
|
|
/*
|
|
* case 46: { System.out.print("iaload"); break; } case 47: {
|
|
* System.out.print("laload"); break; } case 48: {
|
|
* System.out.print("faload"); break; } case 49: {
|
|
* System.out.print("daload"); break; } case 50: {
|
|
* System.out.print("aaload"); break; } case 51: {
|
|
* System.out.print("baload"); break; } case 52: {
|
|
* System.out.print("caload"); break; } case 53: {
|
|
* System.out.print("saload"); break; }
|
|
*/
|
|
case 54: {
|
|
stack--;
|
|
y++;
|
|
break;
|
|
}
|
|
case 55: {
|
|
stack--;
|
|
y++;
|
|
break;
|
|
}
|
|
case 56: {
|
|
stack--;
|
|
y++;
|
|
break;
|
|
}
|
|
case 57: {
|
|
stack--;
|
|
y++;
|
|
break;
|
|
}
|
|
case 58: {
|
|
stack--;
|
|
y++;
|
|
break;
|
|
}
|
|
case 59: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 60: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 61: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 62: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 63: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 64: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 65: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 66: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 67: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 68: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 69: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 70: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 71: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 72: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 73: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 74: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 75: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 76: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 77: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 78: {
|
|
stack--;
|
|
break;
|
|
}
|
|
/*
|
|
* case 79: { System.out.print("iastore"); break; } case 80: {
|
|
* System.out.print("lastore"); break; } case 81: {
|
|
* System.out.print("fastore"); break; } case 82: {
|
|
* System.out.print("dastore"); break; } case 83: {
|
|
* System.out.print("aastore"); break; } case 84: {
|
|
* System.out.print("bastore"); break; } case 85: {
|
|
* System.out.print("castore"); break; } case 86: {
|
|
* System.out.print("sastore"); break; }
|
|
*/
|
|
case 87: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 88: {
|
|
stack -= 2;
|
|
break;
|
|
}
|
|
case 89: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 90: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 91: {
|
|
stack++;
|
|
break;
|
|
}
|
|
case 92: {
|
|
stack += 2;
|
|
break;
|
|
}
|
|
case 93: {
|
|
stack += 2;
|
|
break;
|
|
}
|
|
case 94: {
|
|
stack += 2;
|
|
break;
|
|
}
|
|
case 95: {
|
|
break;
|
|
}
|
|
case 96: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 97: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 98: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 99: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 100: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 101: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 102: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 103: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 104: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 105: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 106: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 107: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 108: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 109: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 110: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 111: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 112: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 113: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 114: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 115: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 116: {
|
|
break;
|
|
}
|
|
case 117: {
|
|
break;
|
|
}
|
|
case 118: {
|
|
break;
|
|
}
|
|
case 119: {
|
|
break;
|
|
}
|
|
case 120: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 121: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 122: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 123: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 124: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 125: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 126: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 127: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 128: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 129: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 130: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 131: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 132: {
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 133: {
|
|
break;
|
|
}
|
|
case 134: {
|
|
break;
|
|
}
|
|
case 135: {
|
|
break;
|
|
}
|
|
case 136: {
|
|
break;
|
|
}
|
|
case 137: {
|
|
break;
|
|
}
|
|
case 138: {
|
|
break;
|
|
}
|
|
case 139: {
|
|
break;
|
|
}
|
|
case 140: {
|
|
break;
|
|
}
|
|
case 141: {
|
|
break;
|
|
}
|
|
case 142: {
|
|
break;
|
|
}
|
|
case 143: {
|
|
break;
|
|
}
|
|
case 144: {
|
|
break;
|
|
}
|
|
case 145: {
|
|
break;
|
|
}
|
|
case 146: {
|
|
break;
|
|
}
|
|
case 147: {
|
|
break;
|
|
}
|
|
case 148: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 149: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 150: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 151: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 152: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 153: {
|
|
stack--;
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 154: {
|
|
stack--;
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 155: {
|
|
stack--;
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 156: {
|
|
stack--;
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 157: {
|
|
stack--;
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 158: {
|
|
stack--;
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 159: {
|
|
stack -= 2;
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 160: {
|
|
stack -= 2;
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 161: {
|
|
stack -= 2;
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 162: {
|
|
stack -= 2;
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 163: {
|
|
stack -= 2;
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 164: {
|
|
stack -= 2;
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 165: {
|
|
stack -= 2;
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 166: {
|
|
stack -= 2;
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 167: {
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 168: {
|
|
stack++;
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 169: {
|
|
y++;
|
|
break;
|
|
}
|
|
// case 170: { System.out.print("tableswitch"); break; }
|
|
// case 171: { System.out.print("lookupswitch"); break; }
|
|
case 172: {
|
|
stack = 0;
|
|
break;
|
|
}
|
|
case 173: {
|
|
stack = 0;
|
|
break;
|
|
}
|
|
case 174: {
|
|
stack = 0;
|
|
break;
|
|
}
|
|
case 175: {
|
|
stack = 0;
|
|
break;
|
|
}
|
|
case 176: {
|
|
stack = 0;
|
|
break;
|
|
}
|
|
case 177: {
|
|
stack = 0;
|
|
break;
|
|
}
|
|
case 178: {
|
|
stack++;
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 179: {
|
|
stack++;
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 180: {
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 181: {
|
|
stack += 2;
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 182: {
|
|
y += 2;
|
|
stack = 0;
|
|
break;
|
|
} // invokevirtual
|
|
case 183: {
|
|
y += 2;
|
|
stack = 0;
|
|
break;
|
|
} // invokespecial
|
|
case 184: {
|
|
y += 2;
|
|
stack = 0;
|
|
break;
|
|
} // invokestatic
|
|
// case 185: { System.out.print("invokeinterface"); y+=4; break; }
|
|
case 187: {
|
|
stack++;
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 188: {
|
|
y++;
|
|
break;
|
|
}
|
|
case 189: {
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 190: {
|
|
break;
|
|
}
|
|
case 191: {
|
|
break;
|
|
}
|
|
case 192: {
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 193: {
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 194: {
|
|
stack--;
|
|
break;
|
|
}
|
|
case 195: {
|
|
stack--;
|
|
break;
|
|
}
|
|
// case 196: { System.out.print("wide"); break; }
|
|
case 197: {
|
|
y += 3;
|
|
break;
|
|
}
|
|
case 198: {
|
|
stack--;
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 199: {
|
|
stack--;
|
|
y += 2;
|
|
break;
|
|
}
|
|
case 200: {
|
|
y += 4;
|
|
break;
|
|
}
|
|
case 201: {
|
|
stack++;
|
|
y += 4;
|
|
break;
|
|
}
|
|
// case 202: { System.out.print("breakpoint"); break; }
|
|
// case 254: { System.out.print("impdep1"); break; }
|
|
default: {
|
|
throw new JVMCodeException(
|
|
"JVMCodeException: Code_attribute: short calculate_max_stack()");
|
|
}
|
|
}
|
|
if (stack > max_stack)
|
|
max_stack = stack;
|
|
}
|
|
return max_stack;
|
|
}
|
|
// ino.end
|
|
|
|
// @Override
|
|
// public void codegen(ClassFile classfile, OutputStream f)
|
|
// throws JVMCodeException, IOException {
|
|
// throw new NotImplementedException();
|
|
// }
|
|
|
|
}
|
|
// ino.end
|