8323231: Improve array management

Reviewed-by: andrew
Backport-of: cf20364d0cb3f182880ee91c7fb023615e27becf
This commit is contained in:
Martin Balao 2024-01-24 06:21:44 +00:00 committed by Andrew John Hughes
parent 172214bbc8
commit bffe2842ea

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -441,14 +441,14 @@ void RangeCheckEliminator::in_block_motion(BlockBegin *block, AccessIndexedList
if (c) { if (c) {
jint value = c->type()->as_IntConstant()->value(); jint value = c->type()->as_IntConstant()->value();
if (value != min_jint) { if (ao->op() == Bytecodes::_iadd) {
if (ao->op() == Bytecodes::_isub) {
value = -value;
}
base = java_add(base, value); base = java_add(base, value);
last_integer = base; } else {
last_instruction = other; assert(ao->op() == Bytecodes::_isub, "unexpected bytecode");
base = java_subtract(base, value);
} }
last_integer = base;
last_instruction = other;
index = other; index = other;
} else { } else {
break; break;