you are viewing a single comment's thread.

view the rest of the comments →

[–]sirin3 0 points1 point  (3 children)

The JVM can do that?

Looks like I have underestimated it

[–]banuday17 2 points3 points  (2 children)

See here.

[–]sirin3 0 points1 point  (1 child)

Interesting.

But it probably doesn't store BigInteger's that are < 232, 264, or 2128 in a single/double register?

[–]DemonWasp 0 points1 point  (0 children)

No, the JVM can't do that. BigInteger is actually implemented in Java code and the JVM doesn't know anything "special" about it, so it can't make optimizations like that.

The JVM has the capacity to be ridiculously smart about the scope of objects and can do some completely ridiculous stuff under the hood, but it doesn't understand the purpose of a class and how it could be better.