Run-time Environments
Chapter 7
Compiler Construction Run-time Environments
Run-time Environments Chapter 7 1 Compiler Construction Run-time - - PowerPoint PPT Presentation
Run-time Environments Chapter 7 1 Compiler Construction Run-time Environments Run-time Environment The static source code requires considerable support to be executed on a computer Data objects must be created and destroyed
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
int position = address of start of the local data area within the AR; SymbolTable st = the symbol table for the procedure; for each declaration within the procedure of the form <type var> { st.insert(var, position); // Insert identifier and offset AR[position] is reserved to store the value of variable var; position = position + sizeof(type); }
Compiler Construction Run-time Environments
int counter; char letter; int result;
counter letter result 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2011 2024 (unused) (unused) (unused)
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Dynamic area Local Variables Saved Registers Arguments High Memory Low Memory $sp $fp Compiler Construction Run-time Environments
Dynamic area Local Variables Saved Registers Arguments High Memory Low Memory $sp $fp Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
public class DynamicScope { private static double r; private static void show() { System.out.print(r + " "); } private static void small() { double r; r = 0.125; show(); } public static void main(String[] args) { r = 0.25; show(); small(); System.out.println(); show(); small(); System.out.println(); } }
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments
Compiler Construction Run-time Environments