Java Doc for Code.java in  » 6.0-JDK-Modules-sun » javac-compiler » com » sun » tools » javac » jvm » 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 » 6.0 JDK Modules sun » javac compiler » com.sun.tools.javac.jvm 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.tools.javac.jvm.Code

Code
public class Code (Code)
An internal structure that corresponds to the code attribute of methods in a classfile. The class also provides some utility operations to generate bytecode instructions.

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.


Inner Class :public enum StackMapFormat
Inner Class :static class StackMapFrame
Inner Class :public static class Chain
Inner Class :class State implements Cloneable
Inner Class :static class LocalVar

Field Summary
 ListBuffer<char[]>catchInfo
     A buffer for expression catch data.
public  byte[]code
     The code buffer.
public  intcp
     the current code pointer.
public  CRTablecrt
    
final public  booleandebugCode
    
public  booleanfatcode
    
 StackMapFrameframeBeforeLast
     The stack map frame before the last one.
static  TypejsrReturnValue
    
 StackMapFramelastFrame
     The last stack map frame in StackMapTable.
 intlastStackMapPC
     The last PC at which we generated a stack map.
 booleanlineDebugInfo
     Switch: emit line number info.
 List<char[]>lineInfo
     A buffer for line number information.
 Position.LineMaplineMap
    
 LocalVar[]lvar
     Local variables, indexed by register.
public  intmax_locals
     The maximum number of local variable slots.
public  intmax_stack
     The maximum stack size.
final  MethodSymbolmeth
    
final public  booleanneedStackMap
    
public  intnextreg
     The next available register.
 ChainpendingJumps
     A chain for jumps to be resolved before the next opcode is emitted.
 booleanpendingStackMap
     Set true when a stackMap is needed at the current PC.
 intpendingStatPos
     The position of the currently statement, if we are at the start of this statement, NOPOS otherwise.
final  Poolpool
     The constant pool of the current class.
 StackMapFormatstackMap
     The stack map format to be generated.
 StackMapFrame[]stackMapBuffer
     A buffer of cldc stack map entries.
 intstackMapBufferSize
    
 StackMapTableFrame[]stackMapTableBuffer
     A buffer of compressed StackMapTable entries.
 Statestate
     The current machine state (registers and stack).
final  Symtabsyms
    
final  Typestypes
    
 LocalVar[]varBuffer
     Previously live local variables, to be put into the variable table.
 intvarBufferSize
    
 booleanvarDebugInfo
     Switch: emit variable debug info.

Constructor Summary
public  Code(MethodSymbol meth, boolean fatcode, Position.LineMap lineMap, boolean varDebugInfo, StackMapFormat stackMap, boolean debugCode, CRTable crt, Symtab syms, Types types, Pool pool)
     Construct a code object, given the settings of the fatcode, debugging info switches and the CharacterRangeTable.

Method Summary
public  voidaddCatch(char startPc, char endPc, char handlerPc, char catchType)
     Add a catch clause to code.
public  voidaddLineNumber(char startPc, char lineNumber)
     Add a line number entry.
public  voidalign(int incr)
     Align code pointer to next `incr' boundary.
public static  intarraycode(Type type)
     Given a type, return its code for allocating arrays of that type.
public  Chainbranch(int opcode)
     Emit a branch with given opcode; return its chain.
public  booleancheckLimits(DiagnosticPosition pos, Log log)
     Check the code against VM spec limits; if problems report them and return true.
public  intcurPc()
     The current output code pointer.
public  voidemit4(int od)
     Emit four bytes of code.
public  voidemitAnewarray(int od, Type arrayType)
     Emit anewarray.
 voidemitCLDCStackMap(int pc, int localsSize)
     Emit a CLDC stack map frame.
public  voidemitInvokeinterface(int meth, Type mtype)
     Emit an invokeinterface instruction.
public  voidemitInvokespecial(int meth, Type mtype)
     Emit an invokespecial instruction.
public  voidemitInvokestatic(int meth, Type mtype)
     Emit an invokestatic instruction.
public  voidemitInvokevirtual(int meth, Type mtype)
     Emit an invokevirtual instruction.
public  intemitJump(int opcode)
     Emit a jump instruction.
public  voidemitMultianewarray(int ndims, int type, Type arrayType)
     Emit a multinewarray instruction.
public  voidemitNewarray(int elemcode, Type arrayType)
     Emit newarray.
public  voidemitStackMap()
     Emit a stack map entry.
 voidemitStackMapFrame(int pc, int localsSize)
    
public  voidemitop0(int op)
     Emit an opcode with no operand field.
public  voidemitop1(int op, int od)
     Emit an opcode with a one-byte operand field.
public  voidemitop1w(int op, int od)
     Emit an opcode with a one-byte operand field; widen if field does not fit in a byte.
public  voidemitop1w(int op, int od1, int od2)
     Emit an opcode with two one-byte operand fields; widen if either field does not fit in a byte.
public  voidemitop2(int op, int od)
     Emit an opcode with a two-byte operand field.
public  voidemitop4(int op, int od)
     Emit an opcode with a four-byte operand field.
public  voidendScopes(int first)
     End scopes of all variables with registers >= first.
public  intentryPoint()
    
public  intentryPoint(State state)
    
public  intentryPoint(State state, Type pushed)
    
public  intget4(int pc)
     Return four code bytes at position pc as an int.
 StackMapFramegetInitialFrame()
    
public  booleanisAlive()
    
public  voidmarkDead()
     Switch code generation on/off.
public  voidmarkStatBegin()
    
public static  ChainmergeChains(Chain chain1, Chain chain2)
     Merge the jumps in of two chains into one.
public static  Stringmnem(int opcode)
    
public static  intnegate(int opcode)
     Negate a branch opcode.
public  intnewLocal(VarSymbol v)
    
public  voidnewRegSegment()
     Start a set of fresh registers.
 voidpostop()
    
public  voidput4(int pc, int od)
     Place four bytes into code at address pc.
 voidputVar(LocalVar var)
     Put a live variable range into the buffer to be output to the class file.
public  voidresolve(Chain chain, int target)
     Resolve chain to point to given target.
public  voidresolve(Chain chain)
     Resolve chain to point to current code pointer.
public  voidresolvePending()
     Resolve any pending jumps.
public  voidsetDefined(Bits newDefined)
     Set the current variable defined state.
public  voidsetDefined(int adr)
     Mark a register as being (possibly) defined.
public  voidsetUndefined(int adr)
     Mark a register as being undefined.
public  voidstatBegin(int pos)
     Mark beginning of statement.
public static  inttruncate(int tc)
     Collapse type code for subtypes of int to INTcode.
public static  inttypecode(Type type)
     Given a type, return its type code (used implicitly in the JVM architecture).
public static  intwidth(int typecode)
     The width in bytes of objects of the type.
public static  intwidth(Type type)
    
public static  intwidth(List<Type> types)
     The total width taken up by a vector of objects.

Field Detail
catchInfo
ListBuffer<char[]> catchInfo(Code)
A buffer for expression catch data. Each enter is a vector of four unsigned shorts.



code
public byte[] code(Code)
The code buffer.



cp
public int cp(Code)
the current code pointer.



crt
public CRTable crt(Code)
The CharacterRangeTable



debugCode
final public boolean debugCode(Code)



fatcode
public boolean fatcode(Code)
Are we generating code with jumps >= 32K?



frameBeforeLast
StackMapFrame frameBeforeLast(Code)
The stack map frame before the last one.



jsrReturnValue
static Type jsrReturnValue(Code)



lastFrame
StackMapFrame lastFrame(Code)
The last stack map frame in StackMapTable.



lastStackMapPC
int lastStackMapPC(Code)
The last PC at which we generated a stack map.



lineDebugInfo
boolean lineDebugInfo(Code)
Switch: emit line number info.



lineInfo
List<char[]> lineInfo(Code)
A buffer for line number information. Each entry is a vector of two unsigned shorts.



lineMap
Position.LineMap lineMap(Code)
Emit line number info if map supplied



lvar
LocalVar[] lvar(Code)
Local variables, indexed by register.



max_locals
public int max_locals(Code)
The maximum number of local variable slots.



max_stack
public int max_stack(Code)
The maximum stack size.



meth
final MethodSymbol meth(Code)



needStackMap
final public boolean needStackMap(Code)



nextreg
public int nextreg(Code)
The next available register.



pendingJumps
Chain pendingJumps(Code)
A chain for jumps to be resolved before the next opcode is emitted. We do this lazily to avoid jumps to jumps.



pendingStackMap
boolean pendingStackMap(Code)
Set true when a stackMap is needed at the current PC.



pendingStatPos
int pendingStatPos(Code)
The position of the currently statement, if we are at the start of this statement, NOPOS otherwise. We need this to emit line numbers lazily, which we need to do because of jump-to-jump optimization.



pool
final Pool pool(Code)
The constant pool of the current class.



stackMap
StackMapFormat stackMap(Code)
The stack map format to be generated.



stackMapBuffer
StackMapFrame[] stackMapBuffer(Code)
A buffer of cldc stack map entries.



stackMapBufferSize
int stackMapBufferSize(Code)



stackMapTableBuffer
StackMapTableFrame[] stackMapTableBuffer(Code)
A buffer of compressed StackMapTable entries.



state
State state(Code)
The current machine state (registers and stack).



syms
final Symtab syms(Code)



types
final Types types(Code)



varBuffer
LocalVar[] varBuffer(Code)
Previously live local variables, to be put into the variable table.



varBufferSize
int varBufferSize(Code)



varDebugInfo
boolean varDebugInfo(Code)
Switch: emit variable debug info.




Constructor Detail
Code
public Code(MethodSymbol meth, boolean fatcode, Position.LineMap lineMap, boolean varDebugInfo, StackMapFormat stackMap, boolean debugCode, CRTable crt, Symtab syms, Types types, Pool pool)(Code)
Construct a code object, given the settings of the fatcode, debugging info switches and the CharacterRangeTable.




Method Detail
addCatch
public void addCatch(char startPc, char endPc, char handlerPc, char catchType)(Code)
Add a catch clause to code.



addLineNumber
public void addLineNumber(char startPc, char lineNumber)(Code)
Add a line number entry.



align
public void align(int incr)(Code)
Align code pointer to next `incr' boundary.



arraycode
public static int arraycode(Type type)(Code)
Given a type, return its code for allocating arrays of that type.



branch
public Chain branch(int opcode)(Code)
Emit a branch with given opcode; return its chain. branch differs from jump in that jsr is treated as no-op.



checkLimits
public boolean checkLimits(DiagnosticPosition pos, Log log)(Code)
Check the code against VM spec limits; if problems report them and return true.



curPc
public int curPc()(Code)
The current output code pointer.



emit4
public void emit4(int od)(Code)
Emit four bytes of code.



emitAnewarray
public void emitAnewarray(int od, Type arrayType)(Code)
Emit anewarray.



emitCLDCStackMap
void emitCLDCStackMap(int pc, int localsSize)(Code)
Emit a CLDC stack map frame.



emitInvokeinterface
public void emitInvokeinterface(int meth, Type mtype)(Code)
Emit an invokeinterface instruction.



emitInvokespecial
public void emitInvokespecial(int meth, Type mtype)(Code)
Emit an invokespecial instruction.



emitInvokestatic
public void emitInvokestatic(int meth, Type mtype)(Code)
Emit an invokestatic instruction.



emitInvokevirtual
public void emitInvokevirtual(int meth, Type mtype)(Code)
Emit an invokevirtual instruction.



emitJump
public int emitJump(int opcode)(Code)
Emit a jump instruction. Return code pointer of instruction to be patched.



emitMultianewarray
public void emitMultianewarray(int ndims, int type, Type arrayType)(Code)
Emit a multinewarray instruction.



emitNewarray
public void emitNewarray(int elemcode, Type arrayType)(Code)
Emit newarray.



emitStackMap
public void emitStackMap()(Code)
Emit a stack map entry.



emitStackMapFrame
void emitStackMapFrame(int pc, int localsSize)(Code)



emitop0
public void emitop0(int op)(Code)
Emit an opcode with no operand field.



emitop1
public void emitop1(int op, int od)(Code)
Emit an opcode with a one-byte operand field.



emitop1w
public void emitop1w(int op, int od)(Code)
Emit an opcode with a one-byte operand field; widen if field does not fit in a byte.



emitop1w
public void emitop1w(int op, int od1, int od2)(Code)
Emit an opcode with two one-byte operand fields; widen if either field does not fit in a byte.



emitop2
public void emitop2(int op, int od)(Code)
Emit an opcode with a two-byte operand field.



emitop4
public void emitop4(int op, int od)(Code)
Emit an opcode with a four-byte operand field.



endScopes
public void endScopes(int first)(Code)
End scopes of all variables with registers >= first.



entryPoint
public int entryPoint()(Code)
Declare an entry point; return current code pointer



entryPoint
public int entryPoint(State state)(Code)
Declare an entry point with initial state; return current code pointer



entryPoint
public int entryPoint(State state, Type pushed)(Code)
Declare an entry point with initial state plus a pushed value; return current code pointer



get4
public int get4(int pc)(Code)
Return four code bytes at position pc as an int.



getInitialFrame
StackMapFrame getInitialFrame()(Code)



isAlive
public boolean isAlive()(Code)
Is code generation currently enabled?



markDead
public void markDead()(Code)
Switch code generation on/off.



markStatBegin
public void markStatBegin()(Code)
Force stat begin eagerly



mergeChains
public static Chain mergeChains(Chain chain1, Chain chain2)(Code)
Merge the jumps in of two chains into one.



mnem
public static String mnem(int opcode)(Code)
static tables



negate
public static int negate(int opcode)(Code)
Negate a branch opcode.



newLocal
public int newLocal(VarSymbol v)(Code)



newRegSegment
public void newRegSegment()(Code)
Start a set of fresh registers.



postop
void postop()(Code)



put4
public void put4(int pc, int od)(Code)
Place four bytes into code at address pc. Pre: pc + 4 <= cp.



putVar
void putVar(LocalVar var)(Code)
Put a live variable range into the buffer to be output to the class file.



resolve
public void resolve(Chain chain, int target)(Code)
Resolve chain to point to given target.



resolve
public void resolve(Chain chain)(Code)
Resolve chain to point to current code pointer.



resolvePending
public void resolvePending()(Code)
Resolve any pending jumps.



setDefined
public void setDefined(Bits newDefined)(Code)
Set the current variable defined state.



setDefined
public void setDefined(int adr)(Code)
Mark a register as being (possibly) defined.



setUndefined
public void setUndefined(int adr)(Code)
Mark a register as being undefined.



statBegin
public void statBegin(int pos)(Code)
Mark beginning of statement.



truncate
public static int truncate(int tc)(Code)
Collapse type code for subtypes of int to INTcode.



typecode
public static int typecode(Type type)(Code)
Given a type, return its type code (used implicitly in the JVM architecture).



width
public static int width(int typecode)(Code)
The width in bytes of objects of the type.



width
public static int width(Type type)(Code)



width
public static int width(List<Type> types)(Code)
The total width taken up by a vector of objects.



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.