| Page(s) | Problem |
|---|---|
| 35, 42 | Figure 3.1 and Figure 3.3: Labels can appear anywhere. Thus, the function up and sub-statements must be clearly defined. |
| 40 | What is the meaning of restbody[result/up(pos)]? |
| 42, 43 | How is Abr propagated upward in if and while statements? |
| 44 | Are the reductions for assignment operators on page 44 valid for arbitrary lvalues? |
| 50 | The introduction states that JavaC uses only static features, but Section 4.1.2 introduces non-static features (i.e. instance features). |
| 52 | Item 1 and Item 2: Same sentence "Let app(alpha) be the set ... such that" is confusing. |
| 61-65 | The function body must update the nullary global body. |
| 64 | Is there a need for primitive constant definitions? |
| 65 | invokeMethod need invokeNative which is defined in JavaT. |
| 79 | Declaration of defaultVal and type already used in the definition of initialize on Page 64. |
| 239 | The phrase "The verify type unusable is allowed ... but not as the type of a register" is in Definition 16.3.8. Why not prefixed by T9? Where does this restriction come from? |
| 242 | The page states that "A compiler for Java, however, had to use more local registers for storing return values and for storing exceptions in default handlers." Why? |
public class Test {
public static void main(String[] argv) {
m(true);
}
public static void m(boolean b) {
try {
int j, k, l;
try {
if (b) return;
j = 1;
k = 2;
l = 3;
} finally { // Subroutine S
if (b) return;
}
if (j==1) return;
if (k==2) return;
if (l==3) return;
} finally { // Subroutine T
if (b) return;
Object o = new Object();
}
}
}
The Jbook-Compiler uses for the variables l and
o the same register number in the bytecode. This is
legal, because the variables are defined in disjoint scopes.
Obviously, variable o is modified in subroutine T and
therefore o is in the set mod(T). Since
subroutine S calls subroutine T (due to the
return statement), the variable o is also in the
set mod(S) by Item 2 of the modified definition
of the inductive mod. Since variable l uses the
same register number as variable o, the
bytecode verifier thinks, that l is modified by the
subroutine S which is obviously not the case. In fact,
the Jbook-Verifier with the inductive definition for mod
as described on Page 239
would reject this program compiled with the Jbook-Compiler. Hence,
for this example, a compiler must use different register numbers
for l and o.
The Sun Java Compiler (in JDK 1.3, e.g.) already uses more local
register numbers. Therefore, one has to use the Jbook-Compiler
(which uses less register numbers) to reproduce the problem.
| ETH Home | August 2001 Responsible |
![]() |