ponyc icon indicating copy to clipboard operation
ponyc copied to clipboard

Avoid allocating multiple vtable indices to subordinate methods

Open Praetonus opened this issue 7 years ago • 6 comments

This reduces vtable sizes.

Praetonus avatar Apr 25 '18 18:04 Praetonus

@Praetonus - if you don't have time to finish this, can you talk about what concerns led you to add the "DO NOT MERGE" label?

jemc avatar Feb 12 '19 17:02 jemc

@jemc thoughts on merging this? perhaps testing with master and then merging?

SeanTAllen avatar Sep 25 '20 02:09 SeanTAllen

I'm going to open a new PR for this and if it passes CI against our latest, I'll add @jemc as a review to make sure I didn't mess anything up.

SeanTAllen avatar Sep 29 '20 18:09 SeanTAllen

Discussed in the sync call today, and this looks good. Basically this means that method calls with different receiver caps that direct to the same underlying method (i.e. are "subordinate" to it) will not get their own separate color in the vtable - they will copy the color of that method which it is subordinate to.

jemc avatar Sep 29 '20 18:09 jemc

@jemc I believe we ran into issues with this going boom, yes? Should we close? Should I open another because neither of us remembers?

SeanTAllen avatar Feb 03 '21 03:02 SeanTAllen

@jemc i finally brought this back to life for new testing.

at the moment there's an assertion failure on line 301 of gendesc.c in make_vtable:

      pony_assert(vtable[index] == NULL);

Any thoughts?

The new branch is subordinate-vtable-back-to-life

SeanTAllen avatar Jan 30 '22 19:01 SeanTAllen