CS536 Final Study Guide: 1 Topic Overview
CS536 Final Study Guide: 1 Topic Overview
CS536 Final Study Guide: 1 Topic Overview
1 Topic Overview
This is a brief overview of the topics you should be familiar with. The final will cover all of the material since the
midterm (everything after type checking).
• Runtime Storage
• Variable Access
– Global variables
– Local variables
– Non-local variables (as in nested functions)
– Display vs. Access Link
– Variable access for dynamic scoping
– Shallow vs. deep binding
• Parameter Passing
– By-value
– By-reference
– By-value-result
– By-name
– By-need
• Code Generation
1
– Handling of conditionals
– Expression evaluation
– Simple register allocation for expressions
• Heap Management
2 Runtime Storage
You should understand the layout of a program in memory, including the uses for the various sections. You should be
very familiar with how functions are called and their local storage is managed, as well as the trade-offs between the
various different methods.
3 Variable Access
You should know the differences between the different types of and locations for variable storage. You should know
how to access variables from any context we have discussed.
• Show the sequence of assignments for managing the display for non-local variables
4 Parameter Passing
You should know the trade-offs and implications of each of the parameter passing methods we have discussed.
2
4.1 Specific Skills
• Be able to describe the output of a code snippet under each of the methods
• Write a code snippet that shows different output under a set of parameter passing methods
5 Function Access
You should understand the code generated for each of the types of method dispatch, along with the associated run-time
costs.
6 Code Generation
You should be familiar with the code generated for the constructs we discussed in class. Code will be represented in a
simple abstract assembly syntax. You will not need to memorize any details of a specific instruction set architecture.
7 Heap Management
You should be able to discuss the trade-offs and mechanics of the various heap management schemes. You should
understand how coalescing of free blocks is accomplished, along with the required metadata. You should understand
the problems addressed by copying and generational collectors.
8 Dataflow Analysis
You should understand the type of problem addressed by dataflow analysis. In particular, you should understand the
questions that are difficult to answer with an AST. You should also understand how a control flow graph can make
those questions more tractable.
3
8.1 Specific Skills
• Draw the CFG for a function