[Pharo-dev] Opal, custom compilers and class-side methods

Tudor Girba tudor at tudorgirba.com
Fri Aug 29 05:22:40 EDT 2014


+1

Objects are always better than classes :)

Doru


On Thu, Aug 28, 2014 at 2:58 PM, Marcus Denker <marcus.denker at inria.fr>
wrote:

>
> On 28 Aug 2014, at 15:54, Yuriy Tymchuk <yuriy.tymchuk at me.com> wrote:
>
>
> On 27 Aug 2014, at 17:53, Camille Teruel <camille.teruel at gmail.com> wrote:
>
> Hi all,
>
> With Opal, if you want to customize how methods are compiled into a class
> you can override #compilerClass on class-side:
> MyClass class>>#compilerClass
> ^ MySpecialCompiler
>
>
> I’ve missed this feature. This is super cool!
>
>
> There is now in addition #compiler, an instance, not the class.
>
> This is useful as you can set compiler options this way. e.g.
> InstructionStream does not need to use a subclass but can  do
>
> compiler
> "The JIT compiler needs to trap all reads to instance variables of
> contexts. As this check is costly, it is only done
> in the long form of the bytecodes, which are not used often. In this
> hierarchy we force the compiler to always generate
> long bytecodes"
> ^super compiler options: #(+ optionLongIvarAccessBytecodes)
>
>


-- 
www.tudorgirba.com

"Every thing has its own flow"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20140829/873bb5bf/attachment-0002.html>


More information about the Pharo-dev mailing list