00001 package de.fub.bytecode.generic;
00002
00003 import de.fub.bytecode.Constants;
00004 import de.fub.bytecode.ExceptionConstants;
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 public class GETFIELD extends FieldInstruction
00016 implements ExceptionThrower, StackConsumer, StackProducer {
00017
00018
00019
00020
00021 GETFIELD() {}
00022 public GETFIELD(int index) {
00023 super(Constants.GETFIELD, index);
00024 }
00025
00026
00027
00028
00029
00030
00031
00032
00033 public void accept(Visitor v) {
00034 v.visitExceptionThrower(this);
00035 v.visitStackConsumer(this);
00036 v.visitStackProducer(this);
00037 v.visitTypedInstruction(this);
00038 v.visitLoadClass(this);
00039 v.visitCPInstruction(this);
00040 v.visitFieldOrMethod(this);
00041 v.visitFieldInstruction(this);
00042 v.visitGETFIELD(this);
00043 }
00044 public Class[] getExceptions() {
00045 Class[] cs = new Class[2 + ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length];
00046
00047 System.arraycopy(ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION, 0,
00048 cs, 0, ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length);
00049
00050 cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length+1] =
00051 ExceptionConstants.INCOMPATIBLE_CLASS_CHANGE_ERROR;
00052 cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length] =
00053 ExceptionConstants.NULL_POINTER_EXCEPTION;
00054
00055 return cs;
00056 }
00057 public int produceStack(ConstantPoolGen cpg) { return getFieldSize(cpg); }
00058 }