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 PUTFIELD extends FieldInstruction implements ExceptionThrower{
00016
00017
00018
00019
00020 PUTFIELD() {}
00021 public PUTFIELD(int index) {
00022 super(Constants.PUTFIELD, index);
00023 }
00024
00025
00026
00027
00028
00029
00030
00031
00032 public void accept(Visitor v) {
00033 v.visitExceptionThrower(this);
00034 v.visitTypedInstruction(this);
00035 v.visitLoadClass(this);
00036 v.visitCPInstruction(this);
00037 v.visitFieldOrMethod(this);
00038 v.visitFieldInstruction(this);
00039 v.visitPUTFIELD(this);
00040 }
00041 public int consumeStack(ConstantPoolGen cpg) { return getFieldSize(cpg) + 1; }
00042 public Class[] getExceptions() {
00043 Class[] cs = new Class[2 + ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length];
00044
00045 System.arraycopy(ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION, 0,
00046 cs, 0, ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length);
00047
00048 cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length+1] =
00049 ExceptionConstants.INCOMPATIBLE_CLASS_CHANGE_ERROR;
00050 cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length] =
00051 ExceptionConstants.NULL_POINTER_EXCEPTION;
00052
00053 return cs;
00054 }
00055 }