Perfect Hashing for Method Dispatch with Dynamic Typing and Dynamic Compilation

Roland Ducournau 1
1 MAREL - Models And Reuse Engineering, Languages
LIRMM - Laboratoire d'Informatique de Robotique et de Microélectronique de Montpellier
Abstract : In static typing, the receiver's static type is the key to efficient implementation of method invocation, and a recently proposed technique, based on perfect hashing of classes, cannot apply to dynamic typing because of the lack of static types. In this article, we propose a new application of perfect hashing to method dispatch in a dynamic typing, dynamic loading and single inheritance setting. The approach involves hashing method selectors instead of classes. However, as hashing all methods revealed itself to be space-inefficient, only overloaded methods, ie methods introduced by several classes, are hashed. The dispatch of non-overloaded methods is done as in single-subtyping, ie static typing and single inheritance. An adaptive-compilation protocol and an algorithm for hashing overloaded methods are proposed, and the approach is tested on Smalltalk benchmarks by simulating class loading at random.
Document type :
Reports
Complete list of metadatas

https://hal-lirmm.ccsd.cnrs.fr/lirmm-00684484
Contributor : Roland Ducournau <>
Submitted on : Monday, April 2, 2012 - 11:27:00 AM
Last modification on : Thursday, May 24, 2018 - 3:59:22 PM

Identifiers

  • HAL Id : lirmm-00684484, version 1

Collections

Citation

Roland Ducournau. Perfect Hashing for Method Dispatch with Dynamic Typing and Dynamic Compilation. RR-12010, 2012, pp.28. ⟨lirmm-00684484⟩

Share

Metrics

Record views

208