| AOT | Ahead Of Time compilation |
| AST | Abstract Syntax Tree |
| CST | Concrete Syntax Tree |
| GC | Garbage Collection |
| IL | Intermediate Language |
| IR | Intermediate Representation |
| JIT | Just In Time compilation |
| JVM | Java Virtual Machine |
| LALR | Look Ahead Left-to-right Right derivation |
| LL | Left-to-right Left derivation |
| LR | Left-to-right Right derivation |
| LSP | Local Stack Pointer |
| PC | Program Counter |
| SP | Stack Pointer |
| VM | Virtual Machine |
ifvar0{| - alternation |
363.EQ.363; avoids mattching 363. as float(a) * b is either a type cast or a multiplication if a is a type or variable respectively. rule at the end to match any unexpected character if no other rules matchflex
\n%option yylineno to get the updated variable0 prefix), and throw if rule matcheselse with the closest unmatched ifif then end, if then else end becomes if then ifend, where ifend → end | else end| Left recursion also a problem. A → A β | ε expands to ε | A | A β | A β β … |
S') is on the stack.class files
0xCAFEBABE)java.lang.ClassLoaderthis) if anysp) pointing to top of stacklsp) points to location in current stack framepc) points to current instruction.method <modifiers> <name>(<parameter types>) <return type>.limit stack <limit>, .limit locals <limit>.end methodineg - negatei2c - to char, % 65536iaddisubiremiinc k a - local[k] += aiconst_0 - load 0aconst_null -load nullldc_int i - load intiload k - add local[k] to stackistore k - pop stack and store to local[k]aload, astore, counterparts for referencesgetfield f sig, putfield f sig, modify fields of objects using value from stack.goto Lifeq L, ifgt L, ifnonnull L - reads first stack valueif_icmpeq_L - compares top two elementsdup - repeat stack valuepopswapnop - does nothingnew C - allocate spaceinvokespecial C/<init>()V - execute constructorinstance_of C - puts 0 or 1 on stackcheckcastinvokevirtual m sig - calls method taking in o (self) plus all argsireturn, returnClassLoader finds class and checks that method exists0xCAFEBABEif - 1 labelifelse - 2 labelswhile - 2 labels|| and && - 1 label (short circuit)== ,<, >, <=, >=, and != - 2 labels (like ifelse branching, as we are not saving a value in the stack)!: - 2 labelstoString coercion - 2 labels| Template | Jasmin |
|---|---|
| if (E) S | E ifeq stop S stop: |
| if (E) S_1 else S_2 | E ifeq else S_1 goto stop else: S_2 stop: |
register count;
{
register n = (count + 7) / 8;
switch (count % 8) {
case 0: do { *to = *from++;
case 7: *to = *from++;
case 6: *to = *from++;
case 5: *to = *from++;
case 4: *to = *from++;
case 3: *to = *from++;
case 2: *to = *from++;
case 1: *to = *from++;
} while (--n > 0);
}
}
retain and release inserted at compile timeForward to ensure that all reference go to the to-space (before the switch)Ri - unbounded general purpose registerssp - stack pointer to top of stackfp - frame pointer to current stack framepc - program counter to current instruction
[..] indicates memory location store in registerst <src>, <dst>
st Ri, [Rj]; [Rj] := Rild <src>, <dst>
ld [Ri + C], Rj; Rj := [Ri + C]mov <src>, <dst>
mov Ri, Rj; Rj := Riop <src1>, <src2>, <dst>add Ri, Rj, Rk; Rk := Ri + Rj; (sub, mul, div)b L; (bg, bge, bl, ble, bne)if R1 <= 0 goto L1 → cmp R1, 0; ble L1call L; R15 := pc; pc := Lsave sp, -C, sp; save registers, allocating C bytes on stackrestore; restore registersret; pc := R15 + 8nop; do nothingpush fp; fp := sp; sp := sp + Csp := fp; fp = popfpsave sp, -C, sp, where C is arbitrarily large (eg 112; multiple of 4)restore, then ret, where the value is R0R0, R1, etcfp = 68 + 4k, where k is a non-negative integer; this is stored in the callers framefp = 4k, where k is a non-negative integer (in class, starts at [fp = 12])ulimit -a0x7F → i32flex or SableCCdup, swap, putfield Class