These are chat archives for dropbox/pyston

Jul 2015
Rudi Chen
Jul 31 2015 01:00
Wow CPython has so much near-duplicate code. list_item and PyList_GetItem are almost the same for example.
Marius Wachtler
Jul 31 2015 15:08

I think currently we sometimes generate megamorphic ICs for cases which I think we can avoid. E.g. this stupid example:

for v in (1, 1L, 1.0, "str", u"uni"):
    x = id(v)

We will generate a megamorphic IC for the id runtime call because the arg type changes while I think we could avoid guarding on the arg type in some cases.
Do you guys think we could stop guarding arg classes if the dest function is the only version and has no source code?

And we would need some mechanism to remove the gurding....
Travis Hance
Jul 31 2015 15:56
Yah sounds reasonable
Marius Wachtler
Jul 31 2015 19:57
@kmod concerning #785. I understand the None != NULL issue but else I'm not sure what you are exactly suggesting. I changed it too: undingen/pyston@616d399 is this what you are suggesting? can the inst ever be NULL currently?
Sorry I'm not familiar with all this wrapper and desc lookup etc...
Kevin Modzelewski
Jul 31 2015 22:24
oh, yeah that's probably good enough for now
but I think in general we might have to switch here from python attributes (__get__) to c slots (tp_descr_get)
since the python attribute has no way of knowing whether it is a class-level binding (inst = None) or if it is an instance binding on None
looks like there's only one place we call __get__ over tp_descr_get
in getattrInternalGeneric, around line 1781
and we should probably just change that to a rewritten call to tp_descr_get
which is what the non-rewritten version does anyway