deep

a Cross Development Platform for Java

User Tools

Site Tools


dev:crosscompiler:cfr

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dev:crosscompiler:cfr [2016/02/25 13:33] – external edit 127.0.0.1dev:crosscompiler:cfr [2022/12/20 11:20] (current) ursgraf
Line 23: Line 23:
  
 ==== Bytecode Analysis ==== ==== Bytecode Analysis ====
-The Bytecode of all methods are analyzed and the attribute flags of all classes and methods are properly set. For this purpose each object of the object directory has a field //accAndPropFlags//. In the interface //ch.ntb.inf.deep.classItems.ICclassFileConsts// many flags are defined, such as +The Bytecode of all methods are analyzed and the attribute flags of all classes and methods are properly set. For this purpose each object of the object directory has a field //accAndPropFlags//. In the interface //org.deepjava.classItems.ICclassFileConsts// many flags are defined, such as 
 <code java> <code java>
   byte apfPublic = 0,    byte apfPublic = 0,
Line 44: Line 44:
  
 ===== Classes, Interfaces and Arrays ===== ===== Classes, Interfaces and Arrays =====
-Generally all items are linked in lists (using the field //next//). All root classes are listed in a array //rootClasses// which is a static member of the class //ch.ntb.inf.deep.classItems.Class//. There are more lists (all static members in the same class), like:+Generally all items are linked in lists (using the field //next//). All root classes are listed in a array //rootClasses// which is a static member of the class //org.deepjava.classItems.Class//. There are more lists (all static members in the same class), like:
   * //initClasses//: Regular classes and interfaces which have an initializer (a class constructor, see [[.:class_initialization|Initialization]]). This classes are linked with the field //nextClass//.   * //initClasses//: Regular classes and interfaces which have an initializer (a class constructor, see [[.:class_initialization|Initialization]]). This classes are linked with the field //nextClass//.
   * //nonInitClasses//: Regular classes without initialization. Linked with the field //nextClass//.   * //nonInitClasses//: Regular classes without initialization. Linked with the field //nextClass//.
Line 50: Line 50:
   * typeChkInterfaces: See the comment below.   * typeChkInterfaces: See the comment below.
  
-There a a special case where an interface nedds a type descriptor. This happens when type testing for an array of interfaces, see [[type_checking|Type Checking]].+There a a special case where an interface needs a type descriptor. This happens when type testing for an array of interfaces, see [[type_checking|Type Checking]].
 <code java> <code java>
   Object o = new InterfaceA[10];    Object o = new InterfaceA[10]; 
Line 79: Line 79:
 [{{ .:deep_classfilereader_fields.jpg?400&direct | Example of a class with six fields}}] [{{ .:deep_classfilereader_fields.jpg?400&direct | Example of a class with six fields}}]
 \\ \\
-For efficiency reasons all fields of an object or a class (defined as //static//) with the same size in memory should be placed together, which is done by sorting. For this purpose there are three static arrays in //ch.ntb.inf.deep.classItems.Class//. When parsing the fields their size and type is determined and entered according to their size into the appropriate array. Finally, the arrays are read out in proper order and the objects are entered in the lists as shown in the previous figure. +For efficiency reasons all fields of an object or a class (defined as //static//) with the same size in memory should be placed together, which is done by sorting. For this purpose there are three static arrays in //org.deepjava.classItems.Class//. When parsing the fields their size and type is determined and entered according to their size into the appropriate array. Finally, the arrays are read out in proper order and the objects are entered in the lists as shown in the previous figure. 
  
 ===== Constants ===== ===== Constants =====
Line 133: Line 133:
 ===== Methods ===== ===== Methods =====
 All reference types can have methods, even arrays as they inherit from //java/lang/Object//. The methods get sorted for building the type descriptors, see [[.:type_descriptor|Type Descriptor]]. All reference types can have methods, even arrays as they inherit from //java/lang/Object//. The methods get sorted for building the type descriptors, see [[.:type_descriptor|Type Descriptor]].
 +
 +===== Locals =====
 +Local variables within a method are dealt with in a separate section of the bytecode, the ''local variable table''. First of all it contains information about the slot the variable occupies together with the range where the variable is defined. Different locals might occupy the same slot, even with different types.
dev/crosscompiler/cfr.1456403585.txt.gz · Last modified: 2016/02/25 13:33 by 127.0.0.1