Java Reference
In-Depth Information
Throughout our discussion of compiler design, we draw ideas, solutions, and
shortcomings from many languages. Our primary focus is on Java and C,
but we also consider Ada, C
, Smalltalk, ML, Pascal, and Fortran. We
concentrate on Java and C because they are representative of the issues posed
by modern language designs. We consider other languages so as to identify
alternative design approaches for crafting a compiler.
++
1.7 Computer Architecture and Compiler Design
Advances in computer architecture andmicroprocessor fabrication have spear-
headed the computer revolution. At one time, a computer o
ering one
megaflop performance (1,000,000 floating-point operations per second) was
considered advanced. Computers o
ff
ering teraflop (one trillion flops) perfor-
mance are available and petaflop computers (one thousand trillion flops) have
become a matter of packaging (and cooling!) a su
ff
cient number of individual
computers. Meanwhile, each individual computer is often itself a multipro-
cessor, and each processor in the computer may have multiple cores ,each
o
ering an independent thread of control.
Compiler designers are responsible for making this vast computing capa-
bility available to programmers. Although compilers are rarely visibly to the
end users of application programs, they are an essential enabling technology.
The problems encountered in e
ff
ciently harnessing the capability of a modern
computing platforms are numerous, as follows:
Instruction sets for some popular architectures, particularly the Intel
x86 series, are highly nonuniform. Some operations must be done in
registers, while others can be done in memory. Often a number of
distinct register classes exist, each suitable for only a particular class
of operations.
High-level programming language operations are not always easy to
support. Virtual method dispatch, dynamic heap accesses, and reflec-
tive programming constructs can take hundreds or thousands of ma-
chine instructions to implement. Exceptions, threads, and concurrency
management are typically more expensive and complex to implement
than most users suspect.
Essential architectural features such as hardware caches and distributed
processors and memory are di
cult to present to programmers in an
architecturally independent manner. Yet misuse of these features can
impose immense performance penalties.
E
ective use of a large number of processors has always posed challenges
to application developers and compiler writers. Many developers have
ff
 
 
Search WWH ::




Custom Search