Java Doc for CodeAttr.java in  » Scripting » Kawa » gnu » bytecode » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Scripting » Kawa » gnu.bytecode 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   gnu.bytecode.Attribute
      gnu.bytecode.CodeAttr

CodeAttr
public class CodeAttr extends Attribute implements AttrContainer(Code)
Represents the contents of a standard "Code" attribute.

Most of the actual methods that generate bytecode operation are in this class (typically with names starting with emit), though there are also some in Method.

Note that a CodeAttr is an Attribute of a Method, and can in turn contain other Attributes, such as a LineNumbersAttr.
author:
   Per Bothner



Field Summary
final static  intFIXUP_CASE
     The offset contains a label relative to the previous FIXUP_SWITCH.
final static  intFIXUP_CATCH
     Second half of a FIXUP_TRY/FIXUP_CATCH pair. The label is the ed of the try clause; the current offset is the exception type as a constant pool index.
final static  intFIXUP_DEFINE
     The definition of a label.
final static  intFIXUP_DELETE3
     The offsets points to 3 bytes that should be deleted.
final static  intFIXUP_GOTO
     The offset points to a goto instruction. This case up to FIXUP_TRANSFER2 must be contiguous - see the jump-to-jump optimization in processFixups.
final static  intFIXUP_JSR
     The offset points to a jsr instruction.
final static  intFIXUP_LINE_NUMBER
     With preceding FIXUP_LINE_PC associates an offset with a line number. The fixup_offset is the line number; the fixup_label is null.
final static  intFIXUP_LINE_PC
     With following FIXUP_LINE_NUMBER associates an offset with a line number. The fixup_offset is the code location; the fixup_label is null.
final static  intFIXUP_MOVE
     The following instructions are moved to later in the code stream. Instead the instructions starting at the fixup label are patched here. (If the fixup label is null, we're done.) This allows re-arranging code to avoid unneeded gotos. The following instruction is the target of a later FIXUP_MOVE, and we'll insert then when we get to it.
final static  intFIXUP_MOVE_TO_END
     The following instructions are moved to the end of the code stream. Same as FIXUP_MOVE, but there is no explicit later FIXUP_MOVE that refers to the following instructions.
final static  intFIXUP_NONE
     Not a fixup - a no-op.
final static  intFIXUP_SWITCH
     The offset points to a tableswitch/lookupswitch - handle padding.
final static  intFIXUP_TRANSFER
     The offset points to a conditional transfer (if_xxx) instruction.
final static  intFIXUP_TRANSFER2
     A FIXUP_GOTO_, FIXUP_JSR, or FIXUP_TRANSFER that uses a 2-byte offset.
final static  intFIXUP_TRY
     FIXUP_TRY with the following FIXUP_CATCH marks an exception handler. The label is the start of the try clause; the current offset marks the exception handler.
 intPC
     Current active length of code array. Note that processFixups may expand/contract the code array.
 intSP
    
 Attributeattributes
    
 byte[]code
    
 short[]exception_table
    
 intexception_table_length
    
 intfixup_count
    
 Label[]fixup_labels
    
 int[]fixup_offsets
    
 IfStateif_stack
     The stack of currently active conditionals.
public static  booleaninstructionLineMode
     If true we get a line number entry for each instruction. Normally false, but can be a convenient hack to allow instruction-level stepping/debugging and stacktraces.
 LineNumbersAttrlines
    
public  LocalVarsAttrlocals
    
 SourceDebugExtAttrsourceDbgExt
    
 Type[]stack_types
    
 TryStatetry_stack
     The stack of currently active try statements.

Constructor Summary
public  CodeAttr(Method meth)
    

Method Summary
public  voidaddHandler(int start_pc, int end_pc, int handler_pc, int catch_type)
     Add an exception handler.
public  voidaddHandler(Label start_try, Label end_try, ClassType catch_type)
     Add an exception handler.
public  VariableaddLocal(Type type)
     Add a new local variable (in the current scope).
Parameters:
  type - type of the new Variable.
public  VariableaddLocal(Type type, String name)
     Add a new local variable (in the current scope).
Parameters:
  type - type of the new Variable.
Parameters:
  name - name of the new Variable.
public  voidaddParamLocals()
     Call addLocal for parameters (as implied by method type).
public  voidassignConstants(ClassType cl)
    
public  intbeginFragment(Label start, Label after)
    
final public static  StringcalculateSplit(String str)
     Calculate how many CONSTANT_String constants we need for a string.
public static  booleancastNeeded(Type top, Type required)
    
public  voiddisAssemble(ClassTypeWriter dst, int start, int limit)
    
public  voiddoPendingFinalizers(TryState limit)
     Call pending finalizer functions.
final public  voidemitAdd(char sig)
    
final public  voidemitAdd(PrimType type)
    
final public  voidemitAdd()
    
final public  voidemitAnd()
    
final public  voidemitArrayLength()
    
public  voidemitArrayLoad(Type element_type)
     Load an element from an array.
public  voidemitArrayStore(Type element_type)
     Store into an element of an array.
public  voidemitCatchEnd()
    
public  voidemitCatchStart(Variable var)
    
public  voidemitCheckcast(Type type)
    
final public  voidemitConvert(Type from, Type to)
    
final public  voidemitDiv()
    
public  voidemitDup()
     Emit code to duplicate the top element of the stack.
public  voidemitDup(int size, int offset)
     Compile code to duplicate with offset.
public  voidemitDup(int size)
     Compile code to duplicate the top 1 or 2 words.
public  voidemitDup(Type type)
    
public  voidemitDupX()
     Emit code to duplicate the top element of the stack and place the copy before the previous element.
final public  voidemitElse()
     Compile start of else clause.
final public  voidemitFi()
     Compile end of conditional.
public  voidemitFinallyEnd()
    
public  voidemitFinallyStart()
    
final public  voidemitGetField(Field field)
     Compile code to get a non-static field value.
final public  voidemitGetStatic(Field field)
     Compile code to get a static field value. Stack: ...
final public  voidemitGoto(Label label)
     Compile an unconditional branch (goto).
final public  voidemitGotoIfCompare1(Label label, int opcode)
    
final public  voidemitGotoIfCompare2(Label label, int logop)
    
final public  voidemitGotoIfEq(Label label, boolean invert)
    
final public  voidemitGotoIfEq(Label label)
     Compile a conditional transfer if 2 top stack elements are equal.
final public  voidemitGotoIfGe(Label label)
    
final public  voidemitGotoIfGt(Label label)
    
final public  voidemitGotoIfIntEqZero(Label label)
    
final public  voidemitGotoIfIntGeZero(Label label)
    
final public  voidemitGotoIfIntGtZero(Label label)
    
final public  voidemitGotoIfIntLeZero(Label label)
    
final public  voidemitGotoIfIntLtZero(Label label)
    
final public  voidemitGotoIfIntNeZero(Label label)
    
final public  voidemitGotoIfLe(Label label)
    
final public  voidemitGotoIfLt(Label label)
    
final public  voidemitGotoIfNE(Label label)
     Compile conditional transfer if 2 top stack elements are not equal.
final public  voidemitIOr()
    
final public  voidemitIfCompare1(int opcode)
     Compile start of a conditional: if (!(x opcode 0)) .... The value of x must already have been pushed.
final public  voidemitIfEq()
     Compile start of a conditional: if (x == y) ... The values of x and y must already have been pushed.
final public  voidemitIfGe()
     Compile start of a conditional: if (x >= y) ... The values of x and y must already have been pushed.
final public  voidemitIfGt()
     Compile start of a conditional: if (x > y) ... The values of x and y must already have been pushed.
final public  voidemitIfIntCompare(int opcode)
     Compile start of a conditional: if (!(x OPCODE y)) ... The value of x and y must already have been pushed.
final public  voidemitIfIntEqZero()
     Compile start of conditional: if (x == 0) .... Also use this if you have pushed a boolean value: if (!b) ...
final public  voidemitIfIntLEqZero()
     Compile start of conditional: if (x <= 0).
final public  voidemitIfIntLt()
    
final public  voidemitIfIntNotZero()
     Compile start of conditional: if (x != 0) .... Also use this if you have pushed a boolean value: if (b) ...
final public  voidemitIfLe()
     Compile start of a conditional: if (x <= y) ... The values of x and y must already have been pushed.
final public  voidemitIfLt()
     Compile start of a conditional: if (x < y) ... The values of x and y must already have been pushed.
final public  voidemitIfNEq()
     Compile start of a conditional: if (x != y) ... The values of x and y must already have been pushed.
final public  voidemitIfNotNull()
    
final public  voidemitIfNull()
    
final public  voidemitIfRefCompare1(int opcode)
     Compile start of a conditional: if (!(x opcode null)) .... The value of x must already have been pushed and must be of reference type.
final public  voidemitIfThen()
    
public  voidemitInc(Variable var, short inc)
    
public  voidemitInstanceof(Type type)
    
public  voidemitInvoke(Method method)
    
public  voidemitInvokeInterface(Method method)
    
public  voidemitInvokeMethod(Method method, int opcode)
    
public  voidemitInvokeSpecial(Method method)
    
public  voidemitInvokeStatic(Method method)
     Compile a static method call.
public  voidemitInvokeVirtual(Method method)
     Compile a virtual method call.
final public  voidemitJsr(Label label)
    
final public  voidemitLoad(Variable var)
     Compile code to push the contents of a local variable onto the statck.
 voidemitMaybeWide(int opcode, int index)
    
final public  voidemitMonitorEnter()
    
final public  voidemitMonitorExit()
    
final public  voidemitMul()
    
public  voidemitNew(ClassType type)
     Invoke new on a class type.
 voidemitNewArray(int type_code)
    
public  voidemitNewArray(Type element_type, int dims)
     Compile code to allocate a new array.
public  voidemitNewArray(Type element_type)
    
final public  voidemitNot(Type type)
    
public  voidemitPop(int nvalues)
     Compile code to pop values off the stack (and ignore them).
public  voidemitPrimop(int opcode, int arg_count, Type retType)
    
final public  voidemitPushClass(String name)
     Push a class constant pool entry. This is only supported by JDK 1.5 and later.
final public  voidemitPushConstant(int val, Type type)
    
final public  voidemitPushConstant(CpoolEntry cnst)
    
public  voidemitPushDouble(double x)
    
public  voidemitPushFloat(float x)
    
final public  voidemitPushInt(int i)
    
public  voidemitPushLong(long i)
    
public  voidemitPushNull()
    
final public  voidemitPushPrimArray(Object value, ArrayType arrayType)
     Emit code to push a constant primitive array.
final public  voidemitPushString(String str)
     Emit code to push the value of a constant String.
final public  voidemitPushThis()
    
final public  voidemitPutField(Field field)
     Compile code to put a non-static field value. Stack: ..., objectref, value => ...
final public  voidemitPutStatic(Field field)
     Compile code to put a static field value. Stack: ..., value => ...
final public  voidemitRem()
    
public  voidemitRet(Variable var)
     Emit a 'ret' instruction.
final public  voidemitReturn()
     Compile a method return.
final public  voidemitShl()
    
final public  voidemitShr()
    
public  voidemitStore(Variable var)
    
final public  voidemitSub(char sig)
    
final public  voidemitSub(PrimType type)
    
final public  voidemitSub()
    
public  voidemitSwap()
    
public  voidemitTailCall(boolean pop_args, Scope scope)
     Compile a tail-call to position 0 of the current procedure.
Parameters:
  pop_args - if true, copy argument registers (except this) from stack.
Parameters:
  scope - Scope whose start we jump back to.
final public  voidemitThen()
    
final public  voidemitThrow()
    
final  voidemitTransfer(Label label, int opcode)
    
public  voidemitTryCatchEnd()
    
public  voidemitTryEnd()
    
public  voidemitTryStart(boolean has_finally, Type result_type)
    
final public  voidemitUshr()
    
public  voidemitWithCleanupCatch(Variable catchVar)
     Called after a body that has a cleanup clause.
public  voidemitWithCleanupDone()
     Called after generating a cleanup handler.
public  voidemitWithCleanupStart()
     Beginning of code that has a cleanup handler. This is similar to a try-finally, but the cleanup is only done in the case of an exception.
final public  voidemitXOr()
    
public  voidendFragment(int cookie)
     End a fragment.
public  voidenterScope(Scope scope)
    
final public  voidfixupAdd(int kind, Label label)
     Add a fixup at this location.
Parameters:
  kind - one of the FIXUP_xxx codes.
Parameters:
  label - varies - typically the target of jump.
final  voidfixupAdd(int kind, int offset, Label label)
    
final public  voidfixupChain(Label here, Label target)
     This causes a later processFixup to rearrange the code. The code at target comes here, instead of the following instructions. Fuctionally equivalent to: goto target; here:, but implemented by code re-arranging.
public  VariablegetArg(int index)
     Get the index'th parameter.
final public  AttributegetAttributes()
    
public  byte[]getCode()
     Get the code (instruction bytes) of this method. Does not make a copy.
public  intgetCodeLength()
     Set the current lengthof the code (instruction bytes) of this method.
final public  ConstantPoolgetConstants()
    
public  ScopegetCurrentScope()
    
final public  TryStategetCurrentTry()
    
public  LabelgetLabel()
     Get a new Label for the current location.
final public  intgetLength()
    
public  intgetMaxLocals()
     Get the maximum number of local variable words in this method.
public  intgetMaxStack()
     Get the maximum number of words on the operand stack in this method.
final public  MethodgetMethod()
    
final public  intgetPC()
    
final public  intgetSP()
    
 byteinvert_opcode(byte opcode)
     Get opcode that implements NOT (x OPCODE y).
final public  booleanisInTry()
    
public  Variablelookup(String name)
    
public  ScopepopScope()
    
final public  TypepopType()
    
public  voidprint(ClassTypeWriter dst)
    
public  voidprocessFixups()
    
public  ScopepushScope()
    
final public  voidpushType(Type type)
    
final public  voidput1(int i)
     Write an 8-bit byte to the current code-stream.
final public  voidput2(int i)
    
final public  voidput4(int i)
    
final public  voidputIndex2(CpoolEntry cnst)
    
final public  voidputLineNumber(String filename, int linenumber)
    
final public  voidputLineNumber(int linenumber)
    
final public  booleanreachableHere()
     True if control could reach here.
final public  voidreserve(int bytes)
    
public  voidrestoreStackTypeState(Type[] save)
     Restore a type state as saved by saveStackTypeState.
public  Type[]saveStackTypeState(boolean clear)
     Return an object encapsulating the type state of the JVM stack.
final public  voidsetAttributes(Attribute attributes)
    
public  voidsetCode(byte[] code)
     Set the code (instruction bytes) of this method.
Parameters:
  code - the code bytes (which are not copied).Implicitly calls setCodeLength(code.length).
public  voidsetCodeLength(int len)
     Set the length the the code (instruction bytes) of this method.
public  voidsetMaxLocals(int n)
     Set the maximum number of local variable words in this method.
public  voidsetMaxStack(int n)
     Set the maximum number of words on the operand stack in this method.
final public  voidsetReachable(boolean val)
    
final public  voidsetUnreachable()
    
final public  TypetopType()
    
public  voidwrite(DataOutputStream dstr)
    

Field Detail
FIXUP_CASE
final static int FIXUP_CASE(Code)
The offset contains a label relative to the previous FIXUP_SWITCH.



FIXUP_CATCH
final static int FIXUP_CATCH(Code)
Second half of a FIXUP_TRY/FIXUP_CATCH pair. The label is the ed of the try clause; the current offset is the exception type as a constant pool index.



FIXUP_DEFINE
final static int FIXUP_DEFINE(Code)
The definition of a label.



FIXUP_DELETE3
final static int FIXUP_DELETE3(Code)
The offsets points to 3 bytes that should be deleted.



FIXUP_GOTO
final static int FIXUP_GOTO(Code)
The offset points to a goto instruction. This case up to FIXUP_TRANSFER2 must be contiguous - see the jump-to-jump optimization in processFixups.



FIXUP_JSR
final static int FIXUP_JSR(Code)
The offset points to a jsr instruction.



FIXUP_LINE_NUMBER
final static int FIXUP_LINE_NUMBER(Code)
With preceding FIXUP_LINE_PC associates an offset with a line number. The fixup_offset is the line number; the fixup_label is null.



FIXUP_LINE_PC
final static int FIXUP_LINE_PC(Code)
With following FIXUP_LINE_NUMBER associates an offset with a line number. The fixup_offset is the code location; the fixup_label is null.



FIXUP_MOVE
final static int FIXUP_MOVE(Code)
The following instructions are moved to later in the code stream. Instead the instructions starting at the fixup label are patched here. (If the fixup label is null, we're done.) This allows re-arranging code to avoid unneeded gotos. The following instruction is the target of a later FIXUP_MOVE, and we'll insert then when we get to it.



FIXUP_MOVE_TO_END
final static int FIXUP_MOVE_TO_END(Code)
The following instructions are moved to the end of the code stream. Same as FIXUP_MOVE, but there is no explicit later FIXUP_MOVE that refers to the following instructions. Created by beginFragment. The fixup_offset points to the end of the fragment. (The first processFixups patches these to FIXUP_MOVE.)



FIXUP_NONE
final static int FIXUP_NONE(Code)
Not a fixup - a no-op.



FIXUP_SWITCH
final static int FIXUP_SWITCH(Code)
The offset points to a tableswitch/lookupswitch - handle padding.



FIXUP_TRANSFER
final static int FIXUP_TRANSFER(Code)
The offset points to a conditional transfer (if_xxx) instruction.



FIXUP_TRANSFER2
final static int FIXUP_TRANSFER2(Code)
A FIXUP_GOTO_, FIXUP_JSR, or FIXUP_TRANSFER that uses a 2-byte offset.



FIXUP_TRY
final static int FIXUP_TRY(Code)
FIXUP_TRY with the following FIXUP_CATCH marks an exception handler. The label is the start of the try clause; the current offset marks the exception handler.



PC
int PC(Code)
Current active length of code array. Note that processFixups may expand/contract the code array.



SP
int SP(Code)



attributes
Attribute attributes(Code)



code
byte[] code(Code)



exception_table
short[] exception_table(Code)



exception_table_length
int exception_table_length(Code)



fixup_count
int fixup_count(Code)



fixup_labels
Label[] fixup_labels(Code)



fixup_offsets
int[] fixup_offsets(Code)



if_stack
IfState if_stack(Code)
The stack of currently active conditionals.



instructionLineMode
public static boolean instructionLineMode(Code)
If true we get a line number entry for each instruction. Normally false, but can be a convenient hack to allow instruction-level stepping/debugging and stacktraces. In this case LINE==PC .



lines
LineNumbersAttr lines(Code)



locals
public LocalVarsAttr locals(Code)



sourceDbgExt
SourceDebugExtAttr sourceDbgExt(Code)



stack_types
Type[] stack_types(Code)



try_stack
TryState try_stack(Code)
The stack of currently active try statements.




Constructor Detail
CodeAttr
public CodeAttr(Method meth)(Code)




Method Detail
addHandler
public void addHandler(int start_pc, int end_pc, int handler_pc, int catch_type)(Code)
Add an exception handler.



addHandler
public void addHandler(Label start_try, Label end_try, ClassType catch_type)(Code)
Add an exception handler.



addLocal
public Variable addLocal(Type type)(Code)
Add a new local variable (in the current scope).
Parameters:
  type - type of the new Variable. the new Variable.



addLocal
public Variable addLocal(Type type, String name)(Code)
Add a new local variable (in the current scope).
Parameters:
  type - type of the new Variable.
Parameters:
  name - name of the new Variable. the new Variable.



addParamLocals
public void addParamLocals()(Code)
Call addLocal for parameters (as implied by method type).



assignConstants
public void assignConstants(ClassType cl)(Code)



beginFragment
public int beginFragment(Label start, Label after)(Code)



calculateSplit
final public static String calculateSplit(String str)(Code)
Calculate how many CONSTANT_String constants we need for a string. Each CONSTANT_String can be at most 0xFFFF bytes (as a UTF8 string). Returns a String, where each char, coerced to an int, is the length of a substring of the input that is at most 0xFFFF bytes.



castNeeded
public static boolean castNeeded(Type top, Type required)(Code)



disAssemble
public void disAssemble(ClassTypeWriter dst, int start, int limit)(Code)



doPendingFinalizers
public void doPendingFinalizers(TryState limit)(Code)
Call pending finalizer functions.
Parameters:
  limit - Only call finalizers more recent than this.



emitAdd
final public void emitAdd(char sig)(Code)



emitAdd
final public void emitAdd(PrimType type)(Code)



emitAdd
final public void emitAdd()(Code)



emitAnd
final public void emitAnd()(Code)



emitArrayLength
final public void emitArrayLength()(Code)



emitArrayLoad
public void emitArrayLoad(Type element_type)(Code)
Load an element from an array. Must already have pushed the array and the index (in that order): Stack: ..., array, index => ..., value



emitArrayStore
public void emitArrayStore(Type element_type)(Code)
Store into an element of an array. Must already have pushed the array reference, the index, and the new value (in that order). Stack: ..., array, index, value => ...



emitCatchEnd
public void emitCatchEnd()(Code)



emitCatchStart
public void emitCatchStart(Variable var)(Code)



emitCheckcast
public void emitCheckcast(Type type)(Code)



emitConvert
final public void emitConvert(Type from, Type to)(Code)



emitDiv
final public void emitDiv()(Code)



emitDup
public void emitDup()(Code)
Emit code to duplicate the top element of the stack.



emitDup
public void emitDup(int size, int offset)(Code)
Compile code to duplicate with offset.
Parameters:
  size - the size of the stack item to duplicate (1 or 2)
Parameters:
  offset - where to insert the result (must be 0, 1, or 2)The new words get inserted at stack[SP-size-offset]



emitDup
public void emitDup(int size)(Code)
Compile code to duplicate the top 1 or 2 words.
Parameters:
  size - number of words to duplicate



emitDup
public void emitDup(Type type)(Code)



emitDupX
public void emitDupX()(Code)
Emit code to duplicate the top element of the stack and place the copy before the previous element.



emitElse
final public void emitElse()(Code)
Compile start of else clause.



emitFi
final public void emitFi()(Code)
Compile end of conditional.



emitFinallyEnd
public void emitFinallyEnd()(Code)



emitFinallyStart
public void emitFinallyStart()(Code)



emitGetField
final public void emitGetField(Field field)(Code)
Compile code to get a non-static field value. Stack: ..., objectref => ..., value



emitGetStatic
final public void emitGetStatic(Field field)(Code)
Compile code to get a static field value. Stack: ... => ..., value



emitGoto
final public void emitGoto(Label label)(Code)
Compile an unconditional branch (goto).
Parameters:
  label - target of the branch (must be in this method).



emitGotoIfCompare1
final public void emitGotoIfCompare1(Label label, int opcode)(Code)



emitGotoIfCompare2
final public void emitGotoIfCompare2(Label label, int logop)(Code)



emitGotoIfEq
final public void emitGotoIfEq(Label label, boolean invert)(Code)



emitGotoIfEq
final public void emitGotoIfEq(Label label)(Code)
Compile a conditional transfer if 2 top stack elements are equal.



emitGotoIfGe
final public void emitGotoIfGe(Label label)(Code)



emitGotoIfGt
final public void emitGotoIfGt(Label label)(Code)



emitGotoIfIntEqZero
final public void emitGotoIfIntEqZero(Label label)(Code)



emitGotoIfIntGeZero
final public void emitGotoIfIntGeZero(Label label)(Code)



emitGotoIfIntGtZero
final public void emitGotoIfIntGtZero(Label label)(Code)



emitGotoIfIntLeZero
final public void emitGotoIfIntLeZero(Label label)(Code)



emitGotoIfIntLtZero
final public void emitGotoIfIntLtZero(Label label)(Code)



emitGotoIfIntNeZero
final public void emitGotoIfIntNeZero(Label label)(Code)



emitGotoIfLe
final public void emitGotoIfLe(Label label)(Code)



emitGotoIfLt
final public void emitGotoIfLt(Label label)(Code)



emitGotoIfNE
final public void emitGotoIfNE(Label label)(Code)
Compile conditional transfer if 2 top stack elements are not equal.



emitIOr
final public void emitIOr()(Code)



emitIfCompare1
final public void emitIfCompare1(int opcode)(Code)
Compile start of a conditional: if (!(x opcode 0)) .... The value of x must already have been pushed.



emitIfEq
final public void emitIfEq()(Code)
Compile start of a conditional: if (x == y) ... The values of x and y must already have been pushed.



emitIfGe
final public void emitIfGe()(Code)
Compile start of a conditional: if (x >= y) ... The values of x and y must already have been pushed.



emitIfGt
final public void emitIfGt()(Code)
Compile start of a conditional: if (x > y) ... The values of x and y must already have been pushed.



emitIfIntCompare
final public void emitIfIntCompare(int opcode)(Code)
Compile start of a conditional: if (!(x OPCODE y)) ... The value of x and y must already have been pushed.



emitIfIntEqZero
final public void emitIfIntEqZero()(Code)
Compile start of conditional: if (x == 0) .... Also use this if you have pushed a boolean value: if (!b) ...



emitIfIntLEqZero
final public void emitIfIntLEqZero()(Code)
Compile start of conditional: if (x <= 0).



emitIfIntLt
final public void emitIfIntLt()(Code)



emitIfIntNotZero
final public void emitIfIntNotZero()(Code)
Compile start of conditional: if (x != 0) .... Also use this if you have pushed a boolean value: if (b) ...



emitIfLe
final public void emitIfLe()(Code)
Compile start of a conditional: if (x <= y) ... The values of x and y must already have been pushed.



emitIfLt
final public void emitIfLt()(Code)
Compile start of a conditional: if (x < y) ... The values of x and y must already have been pushed.



emitIfNEq
final public void emitIfNEq()(Code)
Compile start of a conditional: if (x != y) ... The values of x and y must already have been pushed.



emitIfNotNull
final public void emitIfNotNull()(Code)
Compile start of conditional: if (x != null)



emitIfNull
final public void emitIfNull()(Code)
Compile start of conditional: if (x == null)



emitIfRefCompare1
final public void emitIfRefCompare1(int opcode)(Code)
Compile start of a conditional: if (!(x opcode null)) .... The value of x must already have been pushed and must be of reference type.



emitIfThen
final public void emitIfThen()(Code)



emitInc
public void emitInc(Variable var, short inc)(Code)



emitInstanceof
public void emitInstanceof(Type type)(Code)



emitInvoke
public void emitInvoke(Method method)(Code)



emitInvokeInterface
public void emitInvokeInterface(Method method)(Code)



emitInvokeMethod
public void emitInvokeMethod(Method method, int opcode)(Code)



emitInvokeSpecial
public void emitInvokeSpecial(Method method)(Code)



emitInvokeStatic
public void emitInvokeStatic(Method method)(Code)
Compile a static method call. The stack contains the the arguments in order.
Parameters:
  method - the static method to invoke



emitInvokeVirtual
public void emitInvokeVirtual(Method method)(Code)
Compile a virtual method call. The stack contains the 'this' object, followed by the arguments in order.
Parameters:
  method - the method to invoke virtually



emitJsr
final public void emitJsr(Label label)(Code)



emitLoad
final public void emitLoad(Variable var)(Code)
Compile code to push the contents of a local variable onto the statck.
Parameters:
  var - The variable whose contents we want to push.



emitMaybeWide
void emitMaybeWide(int opcode, int index)(Code)



emitMonitorEnter
final public void emitMonitorEnter()(Code)



emitMonitorExit
final public void emitMonitorExit()(Code)



emitMul
final public void emitMul()(Code)



emitNew
public void emitNew(ClassType type)(Code)
Invoke new on a class type. Does not call the constructor!
Parameters:
  type - the desired new object type



emitNewArray
void emitNewArray(int type_code)(Code)



emitNewArray
public void emitNewArray(Type element_type, int dims)(Code)
Compile code to allocate a new array. The size should have been already pushed on the stack.
Parameters:
  element_type - type of the array elements



emitNewArray
public void emitNewArray(Type element_type)(Code)



emitNot
final public void emitNot(Type type)(Code)



emitPop
public void emitPop(int nvalues)(Code)
Compile code to pop values off the stack (and ignore them).
Parameters:
  nvalues - the number of values (not words) to pop



emitPrimop
public void emitPrimop(int opcode, int arg_count, Type retType)(Code)



emitPushClass
final public void emitPushClass(String name)(Code)
Push a class constant pool entry. This is only supported by JDK 1.5 and later.



emitPushConstant
final public void emitPushConstant(int val, Type type)(Code)



emitPushConstant
final public void emitPushConstant(CpoolEntry cnst)(Code)



emitPushDouble
public void emitPushDouble(double x)(Code)



emitPushFloat
public void emitPushFloat(float x)(Code)



emitPushInt
final public void emitPushInt(int i)(Code)



emitPushLong
public void emitPushLong(long i)(Code)



emitPushNull
public void emitPushNull()(Code)



emitPushPrimArray
final public void emitPushPrimArray(Object value, ArrayType arrayType)(Code)
Emit code to push a constant primitive array.
Parameters:
  value - The array value that we want the emitted code to re-create.
Parameters:
  arrayType - The ArrayType that matches value.



emitPushString
final public void emitPushString(String str)(Code)
Emit code to push the value of a constant String. Uses CONSTANT_String and CONSTANT_Utf8 constant pool entries as needed. Can handle Strings whose UTF8 length is greates than 0xFFFF bytes (the limit of a CONSTANT_Utf8) by generating String concatenation.



emitPushThis
final public void emitPushThis()(Code)



emitPutField
final public void emitPutField(Field field)(Code)
Compile code to put a non-static field value. Stack: ..., objectref, value => ...



emitPutStatic
final public void emitPutStatic(Field field)(Code)
Compile code to put a static field value. Stack: ..., value => ...



emitRem
final public void emitRem()(Code)



emitRet
public void emitRet(Variable var)(Code)
Emit a 'ret' instruction.
Parameters:
  var - the variable containing the return address



emitReturn
final public void emitReturn()(Code)
Compile a method return. If inside a 'catch' clause, first call 'finally' clauses. The return value (unless the return type is void) must be on the stack, and have the correct type.



emitShl
final public void emitShl()(Code)



emitShr
final public void emitShr()(Code)



emitStore
public void emitStore(Variable var)(Code)



emitSub
final public void emitSub(char sig)(Code)



emitSub
final public void emitSub(PrimType type)(Code)



emitSub
final public void emitSub()(Code)



emitSwap
public void emitSwap()(Code)



emitTailCall
public void emitTailCall(boolean pop_args, Scope scope)(Code)
Compile a tail-call to position 0 of the current procedure.
Parameters:
  pop_args - if true, copy argument registers (except this) from stack.
Parameters:
  scope - Scope whose start we jump back to.



emitThen
final public void emitThen()(Code)



emitThrow
final public void emitThrow()(Code)



emitTransfer
final void emitTransfer(Label label, int opcode)(Code)



emitTryCatchEnd
public void emitTryCatchEnd()(Code)



emitTryEnd
public void emitTryEnd()(Code)



emitTryStart
public void emitTryStart(boolean has_finally, Type result_type)(Code)



emitUshr
final public void emitUshr()(Code)



emitWithCleanupCatch
public void emitWithCleanupCatch(Variable catchVar)(Code)
Called after a body that has a cleanup clause. Followed by the cleanup code.



emitWithCleanupDone
public void emitWithCleanupDone()(Code)
Called after generating a cleanup handler.



emitWithCleanupStart
public void emitWithCleanupStart()(Code)
Beginning of code that has a cleanup handler. This is similar to a try-finally, but the cleanup is only done in the case of an exception. Alternatively, the try clause has to manually do the cleanup with code duplication. Equivalent to: try body catch (Throwable ex) { cleanup; throw ex; } Call emitWithCleanupStart before the body.



emitXOr
final public void emitXOr()(Code)



endFragment
public void endFragment(int cookie)(Code)
End a fragment.
Parameters:
  cookie - the return value from the previous beginFragment.



enterScope
public void enterScope(Scope scope)(Code)



fixupAdd
final public void fixupAdd(int kind, Label label)(Code)
Add a fixup at this location.
Parameters:
  kind - one of the FIXUP_xxx codes.
Parameters:
  label - varies - typically the target of jump.



fixupAdd
final void fixupAdd(int kind, int offset, Label label)(Code)



fixupChain
final public void fixupChain(Label here, Label target)(Code)
This causes a later processFixup to rearrange the code. The code at target comes here, instead of the following instructions. Fuctionally equivalent to: goto target; here:, but implemented by code re-arranging. Therefore there should be at some later point a goto here; target:.



getArg
public Variable getArg(int index)(Code)
Get the index'th parameter.



getAttributes
final public Attribute getAttributes()(Code)



getCode
public byte[] getCode()(Code)
Get the code (instruction bytes) of this method. Does not make a copy.



getCodeLength
public int getCodeLength()(Code)
Set the current lengthof the code (instruction bytes) of this method.



getConstants
final public ConstantPool getConstants()(Code)



getCurrentScope
public Scope getCurrentScope()(Code)



getCurrentTry
final public TryState getCurrentTry()(Code)



getLabel
public Label getLabel()(Code)
Get a new Label for the current location. Unlike Label.define, Does not change reachableHere().



getLength
final public int getLength()(Code)



getMaxLocals
public int getMaxLocals()(Code)
Get the maximum number of local variable words in this method.



getMaxStack
public int getMaxStack()(Code)
Get the maximum number of words on the operand stack in this method.



getMethod
final public Method getMethod()(Code)



getPC
final public int getPC()(Code)



getSP
final public int getSP()(Code)



invert_opcode
byte invert_opcode(byte opcode)(Code)
Get opcode that implements NOT (x OPCODE y).



isInTry
final public boolean isInTry()(Code)



lookup
public Variable lookup(String name)(Code)
Search by name for a Variable
Parameters:
  name - name to search for the Variable, or null if not found (in any scope of this Method).



popScope
public Scope popScope()(Code)



popType
final public Type popType()(Code)



print
public void print(ClassTypeWriter dst)(Code)



processFixups
public void processFixups()(Code)



pushScope
public Scope pushScope()(Code)



pushType
final public void pushType(Type type)(Code)



put1
final public void put1(int i)(Code)
Write an 8-bit byte to the current code-stream.
Parameters:
  i - the byte to write



put2
final public void put2(int i)(Code)
Write a 16-bit short to the current code-stream
Parameters:
  i - the value to write



put4
final public void put4(int i)(Code)
Write a 32-bit int to the current code-stream
Parameters:
  i - the value to write



putIndex2
final public void putIndex2(CpoolEntry cnst)(Code)



putLineNumber
final public void putLineNumber(String filename, int linenumber)(Code)



putLineNumber
final public void putLineNumber(int linenumber)(Code)



reachableHere
final public boolean reachableHere()(Code)
True if control could reach here.



reserve
final public void reserve(int bytes)(Code)



restoreStackTypeState
public void restoreStackTypeState(Type[] save)(Code)
Restore a type state as saved by saveStackTypeState.



saveStackTypeState
public Type[] saveStackTypeState(boolean clear)(Code)
Return an object encapsulating the type state of the JVM stack.



setAttributes
final public void setAttributes(Attribute attributes)(Code)



setCode
public void setCode(byte[] code)(Code)
Set the code (instruction bytes) of this method.
Parameters:
  code - the code bytes (which are not copied).Implicitly calls setCodeLength(code.length).



setCodeLength
public void setCodeLength(int len)(Code)
Set the length the the code (instruction bytes) of this method. That is the number of current used bytes in getCode(). (Any remaing bytes provide for future growth.)



setMaxLocals
public void setMaxLocals(int n)(Code)
Set the maximum number of local variable words in this method.



setMaxStack
public void setMaxStack(int n)(Code)
Set the maximum number of words on the operand stack in this method.



setReachable
final public void setReachable(boolean val)(Code)



setUnreachable
final public void setUnreachable()(Code)



topType
final public Type topType()(Code)



write
public void write(DataOutputStream dstr) throws java.io.IOException(Code)



Fields inherited from gnu.bytecode.Attribute
AttrContainer container(Code)(Java Doc)
String name(Code)(Java Doc)
int name_index(Code)(Java Doc)
Attribute next(Code)(Java Doc)

Methods inherited from gnu.bytecode.Attribute
public void addToFrontOf(AttrContainer container)(Code)(Java Doc)
public void assignConstants(ClassType cl)(Code)(Java Doc)
public static void assignConstants(AttrContainer container, ClassType cl)(Code)(Java Doc)
public static int count(AttrContainer container)(Code)(Java Doc)
public static Attribute get(AttrContainer container, String name)(Code)(Java Doc)
final public AttrContainer getContainer()(Code)(Java Doc)
abstract public int getLength()(Code)(Java Doc)
public static int getLengthAll(AttrContainer container)(Code)(Java Doc)
final public String getName()(Code)(Java Doc)
final public int getNameIndex()(Code)(Java Doc)
final public Attribute getNext()(Code)(Java Doc)
final public boolean isSkipped()(Code)(Java Doc)
public void print(ClassTypeWriter dst)(Code)(Java Doc)
final public void setContainer(AttrContainer container)(Code)(Java Doc)
final public void setName(String name)(Code)(Java Doc)
final public void setNameIndex(int index)(Code)(Java Doc)
final public void setNext(Attribute next)(Code)(Java Doc)
final public void setSkipped(boolean skip)(Code)(Java Doc)
final public void setSkipped()(Code)(Java Doc)
abstract public void write(DataOutputStream dstr) throws java.io.IOException(Code)(Java Doc)
public static void writeAll(AttrContainer container, DataOutputStream dstr) throws java.io.IOException(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.