SlideShare a Scribd company logo
Type Feedback
        for
Bytecode Interpreters
  Position Paper, ICOOOLPS 2007

     Michael Haupt, HPI Potsdam
    Robert Hirschfeld, HPI Potsdam
     Marcus Denker, SCG Bern
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
Global Cache
• <target class, selector> Method
• Frequent collisions
• Flushed often
 • Any change in the class hierarchy
 • GC
• No information per send site
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
Interpreter PIC


• Why no PIC in Interpreters?
 • Performance?
 • Type feedback data!
Prototype


• Squeak Smalltalk
 • Very simple interpreter
 • Easy to modify
 • Uses global lookup cache
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
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
Status

• Image side code for PIC implemented
 • Compiler / method layout modifications
• First virtual machine experiments
• Future: use dynamic feedback for
  optimizations (AOStA)
Conclusion


• Experiment with PICs in the Interpreter
• PICs as Objects
• Implement as much as possible outside the
  VM
Conclusion


• Experiment with PICs in the Interpreter
• PICs as Objects
• Implement as much as possible outside the
  VM

                       Feedback?

More Related Content

PDF
New c sharp4_features_part_iv
PDF
Lock-free algorithms for Kotlin Coroutines
PPTX
Dynamic languages for .NET CLR
PDF
A Type-level Ruby Interpreter for Testing and Understanding
PPT
Intro dotnet
ODP
CORBA & RMI in java
New c sharp4_features_part_iv
Lock-free algorithms for Kotlin Coroutines
Dynamic languages for .NET CLR
A Type-level Ruby Interpreter for Testing and Understanding
Intro dotnet
CORBA & RMI in java

What's hot (7)

PDF
Lowcode: Extending Smalltalk with C Types to Improve Performance
PPTX
PPT
ASP.NET Session 1
PDF
TDC2016SP - Groovy como você nunca viu
PDF
Whats new in Java 7
PPTX
Trans coder
PPTX
Porting tometro
Lowcode: Extending Smalltalk with C Types to Improve Performance
ASP.NET Session 1
TDC2016SP - Groovy como você nunca viu
Whats new in Java 7
Trans coder
Porting tometro
Ad

Viewers also liked (7)

KEY
Talk: The Present and Future of Pharo
PDF
Reflection in Pharo5
PDF
Variables in Pharo5
PDF
Dynamically Composing Collection Operations through Collection Promises
PDF
Reflection in Pharo: Beyond Smalltak
PDF
Reflection in Pharo: Beyond Smalltak
PDF
Perfection & Feedback Loops or: why worse is better
Talk: The Present and Future of Pharo
Reflection in Pharo5
Variables in Pharo5
Dynamically Composing Collection Operations through Collection Promises
Reflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond Smalltak
Perfection & Feedback Loops or: why worse is better
Ad

Similar to Type Feedback for Bytecode Interpreters (20)

PPT
internet
KEY
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
PDF
VMs, Interpreters, JIT
ODP
I Know Kung Fu - Juggling Java Bytecode
PDF
My internship presentation at WSO2
PDF
Denker - Pharo: Present and Future - 2009-07-14
PPT
Profiler Instrumentation Using Metaprogramming Techniques
KEY
High Performance Ruby - Golden Gate RubyConf 2012
PDF
Sub-Method Reflection
PPT
A classification framework for component models
PDF
Ice mini guide
KEY
Cappuccino
PDF
Java Modifiers Matrix
PDF
Presentation about my Research
PDF
TCP/IP – Transmission Control Protocol/ Internet Protocol
PDF
COG Back to the Future, Part II
PPT
Behavioral Reflection
PDF
Undergrad Interfaces Lecture 2008
internet
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
VMs, Interpreters, JIT
I Know Kung Fu - Juggling Java Bytecode
My internship presentation at WSO2
Denker - Pharo: Present and Future - 2009-07-14
Profiler Instrumentation Using Metaprogramming Techniques
High Performance Ruby - Golden Gate RubyConf 2012
Sub-Method Reflection
A classification framework for component models
Ice mini guide
Cappuccino
Java Modifiers Matrix
Presentation about my Research
TCP/IP – Transmission Control Protocol/ Internet Protocol
COG Back to the Future, Part II
Behavioral Reflection
Undergrad Interfaces Lecture 2008

More from Marcus Denker (20)

PDF
Soil And Pharo
PDF
ConstantBlocks in Pharo11
PDF
Demo: Improved DoIt
PDF
First Class Variables as AST Annotations
PDF
Supporting Pharo / Getting Pharo Support
PDF
Lecture: "Advanced Reflection: MetaLinks"
PDF
thisContext in the Debugger
PDF
Variables in Pharo
PDF
Lecture. Advanced Reflection: MetaLinks
PDF
Improving code completion for Pharo
PDF
VUB Brussels Lecture 2019: Advanced Reflection: MetaLinks
PDF
Slot Composition
PDF
Lecture: Advanced Reflection. MetaLinks
PDF
PHARO IOT
PDF
Open-Source: An Infinite Game
PDF
Lecture: MetaLinks
PDF
PharoTechTalk: Contributing to Pharo
PDF
Feedback Loops in Practice
PDF
Pharo6 - ESUG17
PDF
Soil And Pharo
ConstantBlocks in Pharo11
Demo: Improved DoIt
First Class Variables as AST Annotations
Supporting Pharo / Getting Pharo Support
Lecture: "Advanced Reflection: MetaLinks"
thisContext in the Debugger
Variables in Pharo
Lecture. Advanced Reflection: MetaLinks
Improving code completion for Pharo
VUB Brussels Lecture 2019: Advanced Reflection: MetaLinks
Slot Composition
Lecture: Advanced Reflection. MetaLinks
PHARO IOT
Open-Source: An Infinite Game
Lecture: MetaLinks
PharoTechTalk: Contributing to Pharo
Feedback Loops in Practice
Pharo6 - ESUG17

Recently uploaded (20)

DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Electronic commerce courselecture one. Pdf
PDF
cuic standard and advanced reporting.pdf
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
Big Data Technologies - Introduction.pptx
PDF
Modernizing your data center with Dell and AMD
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPT
Teaching material agriculture food technology
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
MYSQL Presentation for SQL database connectivity
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
KodekX | Application Modernization Development
The AUB Centre for AI in Media Proposal.docx
Electronic commerce courselecture one. Pdf
cuic standard and advanced reporting.pdf
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Big Data Technologies - Introduction.pptx
Modernizing your data center with Dell and AMD
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Teaching material agriculture food technology
Dropbox Q2 2025 Financial Results & Investor Presentation
MYSQL Presentation for SQL database connectivity
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Unlocking AI with Model Context Protocol (MCP)
Per capita expenditure prediction using model stacking based on satellite ima...
Digital-Transformation-Roadmap-for-Companies.pptx
Encapsulation_ Review paper, used for researhc scholars
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
KodekX | Application Modernization Development

Type Feedback for Bytecode Interpreters

  • 1. Type Feedback for Bytecode Interpreters Position Paper, ICOOOLPS 2007 Michael Haupt, HPI Potsdam Robert Hirschfeld, HPI Potsdam Marcus Denker, SCG Bern
  • 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. Global Cache • <target class, selector> Method • Frequent collisions • Flushed often • Any change in the class hierarchy • GC • No information per send site
  • 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. Interpreter PIC • Why no PIC in Interpreters? • Performance? • Type feedback data!
  • 6. Prototype • Squeak Smalltalk • Very simple interpreter • Easy to modify • Uses global lookup cache
  • 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. 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. Status • Image side code for PIC implemented • Compiler / method layout modifications • First virtual machine experiments • Future: use dynamic feedback for optimizations (AOStA)
  • 10. Conclusion • Experiment with PICs in the Interpreter • PICs as Objects • Implement as much as possible outside the VM
  • 11. Conclusion • Experiment with PICs in the Interpreter • PICs as Objects • Implement as much as possible outside the VM Feedback?