thautwarm / diojit

Fully compatible CPython jit compiler. Optimising Dynamic, Interpreted, and Object-oriented(DIO) programs.
BSD 2-Clause "Simplified" License
117 stars 2 forks source link

specialized object initialization #17

Open thautwarm opened 3 years ago

thautwarm commented 3 years ago

dynjit can only specialize user defined functions and builtin functions, so that when constructing class objects, __init__ is invoked in the fixed pure python way and won't use the specialized code.

In order to solve this, after some investigation, it is now deemed safe to use


o = _PyObject_New(typeobj)
specialized_init(o, args...)
··· 
thautwarm commented 3 years ago

It's simple in current design.