1994 · 141 citations · 0 references
ComputingComputer ScienceCompilersProgramming LanguagesSystems ProgrammingCode GenerationPerformance OptimizationAbstractionAdaptive OptimizationCompiler DesignDeoptimizationHigh PerformanceInline CachingPolymorphic Inline CachesSource-level Debugging
Object-oriented programming languages confer many benefits, including abstraction, which lets the programmer hide \nthe details of an object’s implementation from the object’s clients. Unfortunately, crossing abstraction boundaries \noften incurs a substantial run-time overhead in the form of frequent procedure calls. Thus, pervasive use of abstraction, \nwhile desirable from a design standpoint, may be impractical when it leads to inefficient programs. \nAggressive compiler optimizations can reduce the overhead of abstraction. However, the long compilation times \nintroduced by optimizing compilers delay the programming environment‘s responses to changes in the program. \nFurthermore, optimization also conflicts with source-level debugging. Thus, programmers are caught on the horns of \ntwo dilemmas: they have to choose between abstraction and efficiency, and between responsive programming environments \nand efficiency. This dissertation shows how to reconcile these seemingly contradictory goals by performing \noptimizations lazily. \nFour new techniques work together to achieve high performance and high responsiveness: \n• Type feedback achieves high performance by allowing the compiler to inline message sends based on information \nextracted from the runtime system. On average, programs run 1.5 times faster than the previous SELF system; \ncompared to a commercial Smalltalk implementation, two medium-sized benchmarks run about three times faster. \nThis level of performance is obtained with a compiler that is both simpler and faster than previous SELF compilers. \n• Adaptive optimization achieves high responsiveness without sacrificing performance by using a fast nonoptimizing \ncompiler to generate initial code while automatically recompiling heavily used parts of the program \nwith an optimizing compiler. On a previous-generation workstation like the SPARCstation-2, fewer than 200 \npauses exceeded 200 ms during a 50-minute interaction, and 21 pauses exceeded one second. On a currentgeneration \nworkstation, only 13 pauses exceed 400 ms. \n• Dynamic deoptimization shields the programmer from the complexity of debugging optimized code by \ntransparently recreating non-optimized code as needed. No matter whether a program is optimized or not, it can \nalways be stopped, inspected, and single-stepped. Compared to previous approaches, deoptimization allows more \ndebugging while placing fewer restrictions on the optimizations that can be performed. \n• Polymorphic inline caching generates type-case sequences on-the-fly to speed up messages sent from the same \ncall site to several different types of object. More significantly, they collect concrete type information for the \noptimizing compiler. \nWith better performance yet good interactive behavior, these techniques make exploratory programming possible \nboth for pure object-oriented languages and for application domains requiring higher ultimate performance, reconciling \nexploratory programming, ubiquitous abstraction, and high performance.