Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/techtrader/modules/tools/bytecode/GetFieldInstruction.java


1   package com.techtrader.modules.tools.bytecode;
2   
3   
4   import com.techtrader.modules.tools.bytecode.visitor.BCVisitor;
5   
6   
7   /**
8    *  Represents the GETFIELD or GETSTATIC instruction.
9    *
10   *  @author    Abe White
11   */
12  public class GetFieldInstruction
13    extends FieldInstruction
14  {
15    protected GetFieldInstruction (Code owner, int opcode)
16    {
17      super (owner, opcode);
18    }
19  
20  
21    public int getStackChange ()
22    {
23      int stack = 0;
24  
25      String type = getFieldTypeName ();
26      if (type.equals ("long") || type.equals ("double"))
27        stack++;
28  
29      if (_opcode == GETSTATIC)
30        stack++;
31  
32      return stack;
33    }
34  
35  
36    public void acceptVisit (BCVisitor visit)
37    {
38      visit.enterGetFieldInstruction (this);  
39      visit.exitGetFieldInstruction (this);  
40    }
41  }