Type Feedback for Bytecode Interpreters


Published on

This position paper proposes the exploitation of type feedback mechanisms, or more precisely, polymorphic inline caches, for purely interpreting implementations of object-oriented programming languages. Using Squeak's virtual machine as an example, polymorphic inline caches are discussed as an alternative to global caching. An implementation proposal for polymorphic inline caches in the Squeak virtual machine is presented, and possible future applications for online optimization are outlined.

(Position Paper ICOOOLPS 07)

Published in: Technology, Business
1 Comment
1 Like
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Type Feedback for Bytecode Interpreters

  1. 1. Type Feedback for Bytecode Interpreters Position Paper, ICOOOLPS 2007 Michael Haupt, HPI Potsdam Robert Hirschfeld, HPI Potsdam Marcus Denker, SCG Bern
  2. 2. Message Lookup Method call in dynamic object oriented languages: 1. Message is send to an object 2. The class of the object is searched for a method 3. If not found, go to superclass 4. Execute the method found or raise exception Problem: slow
  3. 3. Global Cache • <target class, selector> Method • Frequent collisions • Flushed often • Any change in the class hierarchy • GC • No information per send site
  4. 4. Inline Caching • Cache per send site class method • Simple Inline Cache: one entry • PIC: multiple entries • Provides type-feedback data • Only used in VMs with JIT compilers • Examples: Self, Strongtalk, some Java VMs
  5. 5. Interpreter PIC • Why no PIC in Interpreters? • Performance? • Type feedback data!
  6. 6. Prototype • Squeak Smalltalk • Very simple interpreter • Easy to modify • Uses global lookup cache
  7. 7. PICs as Objects • PICs should be objects, not VM level data structures • VM level modification minimized • All management code implemented in high-level language • PIC data reflectively accessible
  8. 8. Implementation Method with Inline Cache object method #test ... literals ... ... bytecodes ... ... trailer ... header header selector send send bytecode bytecode object method hotness #test class trip counter header address counter inline cache object PIC (CompiledMethod instance literal slot) object method hotness method hotness #test class class ... header address counter address counter polymorphic inline cache object
  9. 9. Status • Image side code for PIC implemented • Compiler / method layout modifications • First virtual machine experiments • Future: use dynamic feedback for optimizations (AOStA)
  10. 10. Conclusion • Experiment with PICs in the Interpreter • PICs as Objects • Implement as much as possible outside the VM
  11. 11. Conclusion • Experiment with PICs in the Interpreter • PICs as Objects • Implement as much as possible outside the VM Feedback?