com.sun.tools.javac.jvm
Class Items

java.lang.Object
  extended by com.sun.tools.javac.jvm.Items

public class Items
extends java.lang.Object

A helper class for code generation. Items are objects that stand for addressable entities in the bytecode. Each item supports a fixed protocol for loading the item on the stack, storing into it, converting it into a jump condition, and several others. There are many individual forms of items, such as local, static, indexed, or instance variables, values on the top of stack, the special values this or super, etc. Individual items are represented as inner classes in class Items.

This is NOT part of any API supported by Sun Microsystems. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.


Nested Class Summary
(package private)  class Items.AssignItem
          An item representing an assignment expressions.
(package private)  class Items.CondItem
          An item representing a conditional or unconditional jump.
(package private)  class Items.ImmediateItem
          An item representing a literal.
(package private)  class Items.IndexedItem
          An item representing an indexed expression.
(package private)  class Items.Item
          The base class of all items, which implements default behavior.
(package private)  class Items.LocalItem
          An item representing a local variable.
(package private)  class Items.MemberItem
          An item representing an instance variable or method.
(package private)  class Items.SelfItem
          An item representing `this' or `super'.
(package private)  class Items.StackItem
          An item representing a value on stack.
(package private)  class Items.StaticItem
          An item representing a static variable or method.
 
Field Summary
(package private)  Code code
          The current code buffer.
(package private)  Pool pool
          The current constant pool.
private  Items.Item[] stackItem
           
private  Items.Item superItem
           
(package private)  Symtab syms
          The current symbol table.
private  Items.Item thisItem
           
(package private)  Types types
          Type utilities.
private  Items.Item voidItem
          Items that exist only once (flyweight pattern).
 
Constructor Summary
Items(Pool pool, Code code, Symtab syms, Types types)
           
 
Method Summary
(package private)  Items.Item makeAssignItem(Items.Item lhs)
          Make an item representing an assignment expression.
(package private)  Items.CondItem makeCondItem(int opcode)
          Make an item representing a conditional or unconditional jump.
(package private)  Items.CondItem makeCondItem(int opcode, Code.Chain trueJumps, Code.Chain falseJumps)
          Make an item representing a conditional or unconditional jump.
(package private)  Items.Item makeImmediateItem(Type type, java.lang.Object value)
          Make an item representing a literal.
(package private)  Items.Item makeIndexedItem(Type type)
          Make an item representing an indexed expression.
(package private)  Items.LocalItem makeLocalItem(Symbol.VarSymbol v)
          Make an item representing a local variable.
private  Items.LocalItem makeLocalItem(Type type, int reg)
          Make an item representing a local anonymous variable.
(package private)  Items.Item makeMemberItem(Symbol member, boolean nonvirtual)
          Make an item representing an instance variable or method.
(package private)  Items.Item makeStackItem(Type type)
          Make an item representing a value on stack.
(package private)  Items.Item makeStaticItem(Symbol member)
          Make an item representing a static variable or method.
(package private)  Items.Item makeSuperItem()
          Make an item representing `super'.
(package private)  Items.Item makeThisItem()
          Make an item representing `this'.
(package private)  Items.Item makeVoidItem()
          Make a void item
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pool

Pool pool
The current constant pool.


code

Code code
The current code buffer.


syms

Symtab syms
The current symbol table.


types

Types types
Type utilities.


voidItem

private final Items.Item voidItem
Items that exist only once (flyweight pattern).


thisItem

private final Items.Item thisItem

superItem

private final Items.Item superItem

stackItem

private final Items.Item[] stackItem
Constructor Detail

Items

public Items(Pool pool,
             Code code,
             Symtab syms,
             Types types)
Method Detail

makeVoidItem

Items.Item makeVoidItem()
Make a void item


makeThisItem

Items.Item makeThisItem()
Make an item representing `this'.


makeSuperItem

Items.Item makeSuperItem()
Make an item representing `super'.


makeStackItem

Items.Item makeStackItem(Type type)
Make an item representing a value on stack.

Parameters:
type - The value's type.

makeIndexedItem

Items.Item makeIndexedItem(Type type)
Make an item representing an indexed expression.

Parameters:
type - The expression's type.

makeLocalItem

Items.LocalItem makeLocalItem(Symbol.VarSymbol v)
Make an item representing a local variable.

Parameters:
v - The represented variable.

makeLocalItem

private Items.LocalItem makeLocalItem(Type type,
                                      int reg)
Make an item representing a local anonymous variable.

Parameters:
type - The represented variable's type.
reg - The represented variable's register.

makeStaticItem

Items.Item makeStaticItem(Symbol member)
Make an item representing a static variable or method.

Parameters:
member - The represented symbol.

makeMemberItem

Items.Item makeMemberItem(Symbol member,
                          boolean nonvirtual)
Make an item representing an instance variable or method.

Parameters:
member - The represented symbol.
nonvirtual - Is the reference not virtual? (true for constructors and private members).

makeImmediateItem

Items.Item makeImmediateItem(Type type,
                             java.lang.Object value)
Make an item representing a literal.

Parameters:
type - The literal's type.
value - The literal's value.

makeAssignItem

Items.Item makeAssignItem(Items.Item lhs)
Make an item representing an assignment expression.

Parameters:
lhs - The item representing the assignment's left hand side.

makeCondItem

Items.CondItem makeCondItem(int opcode,
                            Code.Chain trueJumps,
                            Code.Chain falseJumps)
Make an item representing a conditional or unconditional jump.

Parameters:
opcode - The jump's opcode.
trueJumps - A chain encomassing all jumps that can be taken if the condition evaluates to true.
falseJumps - A chain encomassing all jumps that can be taken if the condition evaluates to false.

makeCondItem

Items.CondItem makeCondItem(int opcode)
Make an item representing a conditional or unconditional jump.

Parameters:
opcode - The jump's opcode.