8136820: Generate better code for some Unsafe addressing patterns

Reshape address computation to move invariant part out of loops

Reviewed-by: kvn
This commit is contained in:
Roland Westrelin 2015-09-17 16:53:42 +02:00
parent 4af470b866
commit f8abd0e843
4 changed files with 79 additions and 37 deletions

View file

@ -3055,6 +3055,9 @@ bool SWPointer::offset_plus_k(Node* n, bool negate) {
}
}
if (invariant(n)) {
if (opc == Op_ConvI2L) {
n = n->in(1);
}
_negate_invar = negate;
_invar = n;
NOT_PRODUCT(_tracer.offset_plus_k_10(n, _invar, _negate_invar, _offset);)