Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

GETFIELD.java

00001 package de.fub.bytecode.generic;
00002 
00003 import de.fub.bytecode.Constants;
00004 import de.fub.bytecode.ExceptionConstants;
00005 
00006 /** 
00007  * GETFIELD - Fetch field from object
00008  * <PRE>Stack: ..., objectref -&gt; ..., value</PRE>
00009  * OR
00010  * <PRE>Stack: ..., objectref -&gt; ..., value.word1, value.word2</PRE>
00011  *
00012  * @version $Id: GETFIELD.java,v 1.1.1.1 2002/01/24 03:41:39 pserver Exp $
00013  * @author  <A HREF="http://www.inf.fu-berlin.de/~dahm">M. Dahm</A>
00014  */
00015 public class GETFIELD extends FieldInstruction
00016   implements ExceptionThrower, StackConsumer, StackProducer {
00017   /**
00018    * Empty constructor needed for the Class.newInstance() statement in
00019    * Instruction.readInstruction(). Not to be used otherwise.
00020    */
00021   GETFIELD() {}  
00022   public GETFIELD(int index) {
00023     super(Constants.GETFIELD, index);
00024   }  
00025   /**
00026    * Call corresponding visitor method(s). The order is:
00027    * Call visitor methods of implemented interfaces first, then
00028    * call methods according to the class hierarchy in descending order,
00029    * i.e., the most specific visitXXX() call comes last.
00030    *
00031    * @param v Visitor object
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 }

Generated at Thu Feb 7 06:45:57 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001