deep

a Cross Development Platform for Java

User Tools

Site Tools


dev:crosscompiler:type_checking

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
Last revisionBoth sides next revision
dev:crosscompiler:type_checking [2019/07/12 15:44] ursgrafdev:crosscompiler:type_checking [2019/07/16 12:07] ursgraf
Line 22: Line 22:
 All the explanations above were for //instanceof//. For //checkcast// there are some modifications:  All the explanations above were for //instanceof//. For //checkcast// there are some modifications: 
   - The check against //Object// is never necessary. It will be eliminated already in the Bytecode.   - The check against //Object// is never necessary. It will be eliminated already in the Bytecode.
-  - Bei einer misslungenen Prüfung wird eine Trap-Instruktion ausgelöst.+  - A failing check has to cause an exception.
   - A ''null'' reference results in a positive check.   - A ''null'' reference results in a positive check.
  
Line 79: Line 79:
   Object[][][] o = new Object[2][3][4];    Object[][][] o = new Object[2][3][4]; 
   A[] x = new AA[5];   A[] x = new AA[5];
-  a1[0][0] = x; +  o[0][0] = x; 
-  a1[0][1][2] = x;+  o[0][1][2] = x;
   short[][] y = new short[2][3];   short[][] y = new short[2][3];
-  a1[1][0] = y; +  o[1][0] = y; 
-  a1[1][1][0] = y;+  o[1][1][0] = y;
 </code> </code>
 leads to\\ leads to\\
 [{{ .:typecheckexample1.png?600|//Type descriptors for complex use case//}}]\\ [{{ .:typecheckexample1.png?600|//Type descriptors for complex use case//}}]\\
 This example can be found in the test cases (//ch.ntb.inf.deep.comp.targettest.arrays.ArrayInstanceTest.testInstance4//). This example can be found in the test cases (//ch.ntb.inf.deep.comp.targettest.arrays.ArrayInstanceTest.testInstance4//).
dev/crosscompiler/type_checking.txt · Last modified: 2022/12/20 11:43 by ursgraf