Skip to content

Finding specific method/class usages during compilation #719

Answered by Ihromant
Ihromant asked this question in Q&A
Discussion options

You must be logged in to vote

First part is easy with finding methods. Look through patterns like lj_String_valueOf in non-minified JS code. Sometimes it's in method pool, so find corresponging string in method pool and find what invokes such function.

Second part was more complicated. Still, I managed to find possible sources of long usage.

Example 1.

private record RGBAColor(int r, int g, int b, double a) {}

Yes, here long is used. Because autogenerated hashCode uses Double.hashCode and therefore

public static int hashCode(double d) {
        long h = doubleToLongBits(d);
        return (int) (h >>> 32) ^ (int) h;
    }

There could be microoptimization with avoiding intermediate Long by the way.
We can get rid of lo…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Ihromant
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants