IssueRaiser

JIT: devirtualization next steps

dotnet/coreclr#9230 introduced some simple devirtualization. Some areas for future enhancements: - [x] Devirtualize interface calls. Logic for this is more complex than for virtual calls (see dotnet/coreclr#10192, dotnet/coreclr#10371). - [x] Devirtualize calls on struct types. Make sure the right method entry point in invoked; virtual struct methods come in "boxed" and "unboxed" flavors (see dotnet/coreclr#14698, which removes the box). - [x] After calling the unboxed entry point, try and remove the upstream box and copy too (likely requires [first-class structs](https://github.com/dotnet/coreclr/blob/master/Documentation/design-docs/first-class-structs.md). Some progress in dotnet/coreclr#14698 and dotnet/coreclr#17006). Resolved via https://github.com/dotnet/runtime/pull/52210. - [ ] If we can't call the unboxed entry point, we may still know that the method called won't allow the the `this` pointer in the call to escape. So we can perhaps stack-allocate the object in its boxed form and pass that. Here we'd be counting on the fact that methods on mutable GC value types should already be using checked write barriers for updates. - [ ] Likewise we can consider using "boxed on stack" for some boxed arguments to well known methods. - [ ] Refactor the jit to retain type information for a larger variety of tree nodes. Likely requires carefully breaking the widespread assumption in the jit that class handles are captured only for struct types. - [ ] Do some simplistic type propa

Posted by AndyAyersMS on Mar 2, 2017, 4:07 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.4,500 issues0 comments

github (Software)

JIT: devirtualization next steps

AndyAyersMSMar 2, 2017, 4:07 PM

dotnet/coreclr#9230 introduced some simple devirtualization. Some areas for future enhancements: - [x] Devirtualize interface calls. Logic for this is more complex than for virtual calls (see dotnet/coreclr#10192, dotnet/coreclr#10371). - [x] Devirtualize calls on struct types. Make sure the right method entry point in invoked; virtual struct methods come in "boxed" and "unboxed" flavors (see dotnet/coreclr#14698, which removes the box). - [x] After calling the unboxed entry point, try and remove the upstream box and copy too (likely requires [first-class structs](https://github.com/dotnet/coreclr/blob/master/Documentation/design-docs/first-class-structs.md). Some progress in dotnet/coreclr#14698 and dotnet/coreclr#17006). Resolved via https://github.com/dotnet/runtime/pull/52210. - [ ] If we can't call the unboxed entry point, we may still know that the method called won't allow the the `this` pointer in the call to escape. So we can perhaps stack-allocate the object in its boxed form and pass that. Here we'd be counting on the fact that methods on mutable GC value types should already be using checked write barriers for updates. - [ ] Likewise we can consider using "boxed on stack" for some boxed arguments to well known methods. - [ ] Refactor the jit to retain type information for a larger variety of tree nodes. Likely requires carefully breaking the widespread assumption in the jit that class handles are captured only for struct types. - [ ] Do some simplistic type propa

Comments (0)

No comments yet. Start the discussion.

Comment on this issue