deep

a Cross Development Platform for Java

User Tools

Site Tools


dev:crosscompiler:arrays

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
Next revisionBoth sides next revision
dev:crosscompiler:arrays [2015/03/29 09:46] – [Multidimensional Arrays] ursgrafdev:crosscompiler:arrays [2016/02/25 13:33] – external edit 127.0.0.1
Line 81: Line 81:
 etc. etc.
 </code> </code>
-The problem with the first case is, that only the type descriptor //[[I// would be linked. However, //[I// must be created as well. Im Heapmanager muss die Methode //multianewarray// das Array allozieren und insbesondere auch die Referenzen auf [[I und [I setzenDie Referenz auf [[I wird als Parameter übergebenIm Typdescriptor von [[I steht die Referenz auf [I. Die muss dort geholt werden und am richtigen Ort im Object gespeichert werden. \\ +The problem with the first case is, that only the type descriptor //[[I// would be linked. However, //[I// must be created as well. In the method //multianewarray// of the heap manager the array must be allocated and the references to //[[I// and //[I// must be setThe reference to //[[I// is passed as a parameterIn //[[I// there is the reference to //[I//This reference must be fetched and inserted into the object at the appropriate position. \\ 
-Die gleichen Überlegungen gelten auch für Arrays mit höheren DimensionenAuch dort wird //multianewarray// nur in besonderen Situationen verwendet.+Similar thoughts are true for arrays with higher dimensionsAs well, the instruction //multianewarray// is used solely for special purposes.
 ==== Generating an Multidimensional Array of Objects ==== ==== Generating an Multidimensional Array of Objects ====
-Hier gelten grundsätzlich die gleichen Bedingungen wie oben +Here, the same conditions are true as described above
-Der folgende Javacode +
 <code java> <code java>
   ClassA[][][] a1 = new ClassA[3][2][2];   ClassA[][][] a1 = new ClassA[3][2][2];
 </code> </code>
-wird in den Bytecode+This leads to Bytecode
 <code> <code>
   0 iconst_3   0 iconst_3
Line 97: Line 96:
   7 astore_1 [a1]   7 astore_1 [a1]
 </code> </code>
-übersetzt. Hier wird also bereits also bereits die korrekte Referenz auf //[[[ClassA;// in die SSA aufgenommenDer Heapmanager muss wie bei den Basistypen aus dem Typdescriptor von //[[[ClassA;// die weiteren Typdescriptoren //[[ClassA;//, //[ClassA;// und //ClassA;// rekursiv holen. +The reference to //[[[ClassA;// can be found already in the SSA. The heap manager has to fetch the base types //[[ClassA;//, //[ClassA;// and //ClassA;// from the type descriptor recursively.
dev/crosscompiler/arrays.txt · Last modified: 2022/12/20 11:24 by ursgraf