An Introduction to Object-Oriented Programming
By Timothy Budd
Study Guide for Chapter 21
Learning Objectives
After reading this chapter, you should be able to:
-
Understand the different between an interpreter and a compiler.
-
Understand how the introduction of inheritance complicates
programming language implementation.
-
Explain various ways in which these problems are overcome, including
virtual method tables, dispatch tables, and method caches.
Study Questions
You may wish to use the print or save as command
on your web browser to produce a copy of this study guide.
That way you can fill in the answers to the questions as part of
your assimilating the information you learn as you read the material.
-
What are the two broad categories of language implementation?
What are some of the characteristics of each?
What are the purported advantages of each?
-
What is an activation record? How are local variables and parameters
represented in an activation record?
-
How is it that a procedure that is compiled under the assumption that
it is manipulating an instance of a parent class nevertheless still
perform correctly when in fact it is manipulating an instance of
a subclass?
-
How do polymorphic variables complicate the storage of values in an
activation record? What are the two general solutions to this problem?
-
What is a virtual method table? Explain how a message passing operation is
translated into a conventional function call using the virtual method
table.
-
What is a mangled name?
What is it necessary for a compiler to generate mangled names for method
procedures?
-
What is a dispatch table?
How does the dispatch table differ from a virtual method table?
How is it used to match a method with a message name?
-
What is a method cache?
How does the cache overcome the relative inefficiency of the dispatch table
technique?
-
What are bytecodes? How does an interpreter execute bytecodes?
-
What steps must an interpreter perform in order to process a message
sending operation?
Contents copyright
Timothy Budd, 1995.