[Bug 162] New: GDC unable to de-virtualise method calls

via D.gnu d.gnu at puremagic.com
Sun Oct 26 03:37:29 PDT 2014


http://bugzilla.gdcproject.org/show_bug.cgi?id=162

            Bug ID: 162
           Summary: GDC unable to de-virtualise method calls
           Product: GDC
           Version: development
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: Normal
         Component: gdc
          Assignee: ibuclaw at gdcproject.org
          Reporter: ibuclaw at gdcproject.org

Currently we emit method calls as the following:

  *(c->__vptr + 40) (c, 1, 2, 3);

Which translate directly into the following trees:

  indirect_ref(pointer_plus(component_ref(c, __vptr), 40))


GCC provides a more simplistic tree code called obj_type_ref, which represents
a virtual method lookup, and given the binfo structure we already pass to the
backed, this would give a chance for the optimiser passes to statically
determine the dynamic type of the object and devirtualise the call.

  obj_type_ref(component_ref(c, __vptr), c, 40)

-- 
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/d.gnu/attachments/20141026/f5a6d6f3/attachment.html>


More information about the D.gnu mailing list