> Ok, I agree that cache misses with this policy is not that
> important although `if (sm != null)' produces less code which
> means shorter load time.
Well, you mileage may vary. In our VM, the load time hasn't been an issue
for any of the benchmarks we looked at. Our VM has two JIT compilers and
initially all methods are compiled with a "fast code generator", a JIT which
produces code very quickly, although the code quality is not as good as that
of our second JIT. We have used VTune (a performance analysis tool
available from Intel) to profile our VM and the loader doesn't show up as a
bottleneck.
> And still, what about branch
> prediction? Does it good enough to make `if (sm != null)
> code' run as fast as `code' when `sm != null' is always true
> thus nullifying ANY reason to use try/catch hack?
That is probably highly dependent on the processor architecture and the
compiler you use. We haven't performed an extensive analysis of that issue
in our system, so I can't give you a real answer.
The thread started with the discussion of inserting this "if (sm != null)"
check in the Java source. IMHO software engineering issues should outweigh
any performance considerations in this case.
Regards,
Michal