Method Type Specialisation in Dotty
T
Implementing Method Type Specialisation In Dotty
Author Alexandre Sikiaridis Masters Student - EPFL Supervised by Dmitry Petrashko Martin Odersky
Implementing Method Type Specialisation In Dotty T Outline What - - PowerPoint PPT Presentation
Author Alexandre Sikiaridis Masters Student - EPFL Supervised by Dmitry Petrashko Martin Odersky Method Type Specialisation in Dotty Implementing Method Type Specialisation In Dotty T Outline What is specialisation? Method
Method Type Specialisation in Dotty
T
Author Alexandre Sikiaridis Masters Student - EPFL Supervised by Dmitry Petrashko Martin Odersky
1/15
Method Type Specialisation in Dotty
2/15
boxing
Method Type Specialisation in Dotty
2/15
boxing
Method Type Specialisation in Dotty
Method Type Specialisation in Dotty
2/15
Compiled with scalac
3/15
and classes
Method Type Specialisation in Dotty
3/15
and classes
Method Type Specialisation in Dotty
@specialised(Int)
Method Type Specialisation in Dotty
3/15
Compiled with scalac
4/15
1’000 clones of methods like Function3
understand the exponential function.” ~ Albert A. Bartlett
Method Type Specialisation in Dotty
4/15
1’000 clones of methods like Function3
understand the exponential function.” ~ Albert A. Bartlett
Method Type Specialisation in Dotty
5/15
Method Type Specialisation in Dotty
6/15
Method Type Specialisation in Dotty
6/15
Method Type Specialisation in Dotty
PreSpecializer TypeSpecializer DenotTransformer
7/15
Method Type Specialisation in Dotty
demand
requested by an earlier phase (e.g. Linker) or triggered with ‘’-Yspecialize:all’’
7/15
Method Type Specialisation in Dotty
demand
requested by an earlier phase (e.g. Linker) or triggered with ‘’-Yspecialize:all’’
trigger the optimisation
can be Types or
Specializable Groups
7/15
Method Type Specialisation in Dotty
demand
requested by an earlier phase (e.g. Linker) or triggered with ‘’-Yspecialize:all’’
trigger the optimisation
can be Types or
Specializable Groups
upfront
8/15
Method Type Specialisation in Dotty
concerned method’s symbol, through a PhaseCache
types list
9/15
Method Type Specialisation in Dotty
symbols when appropriate
PreSpecializer
10/15
Method Type Specialisation in Dotty
to subtypes
denotation of the owner
without those precautions
11/15
Method Type Specialisation in Dotty
through all DefDef’s
requested for specialisation:
remembering TypeBounds
TreeTypeMap handling
recursive translation of the RHS
12/15
Method Type Specialisation in Dotty
TypeMismatch errors
(Refers to issue #592 | www.github.com/lampepfl/dotty/issues/592)
12/15
Method Type Specialisation in Dotty
by comparing argument types at call site and those of the specialised variant
13/15
Method Type Specialisation in Dotty
14/15
Method Type Specialisation in Dotty
Type Specialization in Scala 2.8
[http://www.scala-lang.org/old/sites/default/files/sids/dragos/Thu,%202010-05- 06,%2017:56/sid-spec.pdf]
15/15
Method Type Specialisation in Dotty