Compilers and computer architecture: Compiling OO language
Martin Berger 1 December 2019
1Email: M.F.Berger@sussex.ac.uk, Office hours: Wed 12-13 in
Chi-2R312
1 / 1
Compilers and computer architecture: Compiling OO language Martin - - PowerPoint PPT Presentation
Compilers and computer architecture: Compiling OO language Martin Berger 1 December 2019 1 Email: M.F.Berger@sussex.ac.uk , Office hours: Wed 12-13 in Chi-2R312 1 / 1 Recall the function of compilers 2 / 1 Recall the structure of compilers
1Email: M.F.Berger@sussex.ac.uk, Office hours: Wed 12-13 in
1 / 1
2 / 1
Lexical analysis Syntax analysis Source program Semantic analysis, e.g. type checking Intermediate code generation Optimisation Code generation Translated program
3 / 1
4 / 1
5 / 1
6 / 1
7 / 1
8 / 1
9 / 1
A
10 / 1
11 / 1
12 / 1
(Example: ex5.java) 13 / 1
14 / 1
15 / 1
16 / 1
17 / 1
18 / 1
19 / 1
20 / 1
21 / 1
22 / 1
23 / 1
24 / 1
25 / 1
26 / 1
27 / 1
28 / 1
29 / 1
b a dptr Instances of A Pointer to f_A Pointer to g_A mtptr mtptr mtptr Method table for A Code for f_A Code for g_A Method bodies Pointer to f_B Method table for B Method bodies a Pointer to g_A Code for f_B mtptr b mtptr a Instances of B b
30 / 1
b a dptr Instances of A Pointer to f_A Pointer to g_A mtptr mtptr mtptr Method table for A Code for f_A Code for g_A Method bodies Pointer to f_B Method table for B Method bodies a Pointer to g_A Code for f_B mtptr b mtptr a Instances of B b
31 / 1
(Example: prog/ex4.java) 32 / 1
33 / 1
34 / 1
35 / 1