News for hackers. Stuff that matters.
Re:Show HN: Cannoli – A compiler for a subset of Python writ... by tetha on Thursday May 17, 2018 @04:19PM (#17095259)
JIT'ers tend to be aggressive and disregard language semantics. As far as I know, the java hotspot compiler goes ahead and inlines implementations of calls on generic interfaces, as long as a couple of hundred calls to into the same implementation method. For large methods, it might not inline, but it'll remove the conditional jump based on the type with a direct jump.

That's obviously wrong, examples to show that are trivial. But that's why the direct call also contains a trap to check the type to perform de-optimization if the assertion appears to be wrong. But a simple 'assert type byte sequence is a known value' is still faster than a dynamic jump. A lot faster.

Re:Show HN: Cannoli – A compiler for a subset of Python writ... by RussianCow on Thursday May 17, 2018 @05:19PM (#17095982)
> That's obviously wrong, examples to show that are trivial.

Does that actually affect the behavior of the code, though? That seems to me like a private implementation detail, but I don't know much about the HotSpot JIT or the JVM in general.