Improved RISC Support for the Smalltalk-80 Language
Technical rept. 7 Aug 1984-6 Aug 1987
CALIFORNIA UNIV BERKELEY DEPT OF COMPUTER SCIENCES
Pagination or Media Count:
The Smalltalk-80 language is polymorphic and dynamically typed. That is, subprograms methods in Smalltalk jargon legally may operate on arguments of different types the method invoked as a result of a given textual call send depends on the type class of the first operand and the classes of local variables, parameters, and fields instance variables in general cannot be deduced at compilation time. Because all sends can involve polymorphism, a straightforward implementation requires run-time dispatching on the class of the first operand for every send. Typical Samlltalk-80 coding style results in many small methods, implying that sends figure prominently in dynamic instruction counts, and that their fast execution is important. There are two basic ways that have been used to reduce the time required for a polymorphic send. First, one can use some form of method caching. Second, one can use type inference and in-line substitution. Polymorphism is relatively rare about 5 of sends reach the same target on consecutive executions. As a result, it makes sense to save the result of each method look up operation so that it can be quickly retrieved upon subsequent re-execution of the same text. Ungar describes the in-line caching scheme used in the SOAR project at Berkeley, in which the result of each look up is saved by replacing the look up code with a direct call on the method found.
- Computer Programming and Software
- Computer Hardware