<method type="instance" name="hashCode" sig="()I" access="public"> <override name="GetHashCode" /> <invokespecial> <call class="System.Object name="GetHashCode" /> </invokespecial> <invokevirtual> <dup /> <isinst class="System.String" /> <brfalse name="skip" /> <call class="StringHelper" name="hashCode" /> <br name="end" /> <label name="skip" /> <callvirt class="System.Object name="GetHashCode" /> <label name="end" /> </invokevirtual></method>
Every virtual call (the invokevirtual bytecode) is converted into a test to see if the call is being done on a string, if so it calls StringHelper.hashCode(), if not, it calls System.Object.GetHashCode(). This isn't yet how it should be, because when it is known at compile time that the reference that hashCode() is called on isn't a string, then this test shouldn't be emitted. I still have to figure out a way to support this optimization.
Updated the binaries and source snaphots.
I apologize for the lameness of this, but the comment spam was driving me nuts.
In order to be able to post a comment, you need to answer a simple question. Hopefully this question
is easy enough not to annoy serious commenters, but hard enough to keep the spammers away.
Anti-Spam Question: What method on java.lang.System returns an object's original hashcode (i.e. the
one that would be returned by java.lang.Object.hashCode() if it wasn't overridden)? (case is significant)
Powered by: newtelligence dasBlog 2.3.12105.0
© Copyright 2017, Jeroen Frijters