Mining Inline Cache Data to Order Inferred Types in Dynamic Languages

Milojković, Nevena; Béra, Clément; Ghafari, Mohammad; Nierstrasz, Oscar Marius (2018). Mining Inline Cache Data to Order Inferred Types in Dynamic Languages. Science of computer programming, 161, pp. 105-121. Elsevier 10.1016/j.scico.2017.11.003

[img] Text
1-s2.0-S0167642317302411-main.pdf - Published Version
Restricted to registered users only
Available under License Publisher holds Copyright.

Download (1MB) | Request a copy
[img] Text
Milo17e.pdf - Accepted Version
Restricted to registered users only until 22 November 2019.
Available under License Publisher holds Copyright.

Download (485kB) | Request a copy

The lack of static type information in dynamically-typed languages often poses obstacles for developers. Type inference algorithms can help, but inferring precise type information requires complex algorithms that are often slow. A simple approach that considers only the locally used interface of variables can identify potential classes for variables, but popular interfaces can generate a large number of false positives. We propose an approach called inline-cache type inference (ICTI) to augment the precision of fast and simple type inference algorithms. ICTI uses type information available in the inline caches during multiple software runs, to provide a ranked list of possible classes that most likely represent a variable's type. We evaluate ICTI through a proof-of-concept that we implement in Pharo Smalltalk. The analysis of the top-n+2 inferred types (where n is the number of recorded run-time types for a variable) for 5486 variables from four different software systems shows that ICTI produces promising results for about 75 of the variables. For more than 90 of variables, the correct run-time type is present among first six inferred types. Our ordering shows a twofold improvement when compared with the unordered basic approach, i.e., for a significant number of variables for which the basic approach offered ambiguous results, ICTI was able to promote the correct type to the top of the list.

Item Type:

Journal Article (Original Article)

Division/Institute:

08 Faculty of Science > Institute of Computer Science (INF)
08 Faculty of Science > Institute of Computer Science (INF) > Software Composition Group (SCG)

UniBE Contributor:

Ghafari, Mohammad and Nierstrasz, Oscar Marius

Subjects:

000 Computer science, knowledge & systems
500 Science > 510 Mathematics

ISSN:

0167-6423

Publisher:

Elsevier

Language:

English

Submitter:

Oscar Marius Nierstrasz-Margiotta

Date Deposited:

11 Apr 2018 12:32

Last Modified:

25 May 2018 01:31

Publisher DOI:

10.1016/j.scico.2017.11.003

BORIS DOI:

10.7892/boris.113139

URI:

https://boris.unibe.ch/id/eprint/113139

Actions (login required)

Edit item Edit item
Provide Feedback