Skip to content

Commit bffe284

Browse files
martinuygnu-andrew
authored andcommitted
8323231: Improve array management
Reviewed-by: andrew Backport-of: cf20364d0cb3f182880ee91c7fb023615e27becf
1 parent 172214b commit bffe284

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

hotspot/src/share/vm/c1/c1_RangeCheckElimination.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* 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
441441

442442
if (c) {
443443
jint value = c->type()->as_IntConstant()->value();
444-
if (value != min_jint) {
445-
if (ao->op() == Bytecodes::_isub) {
446-
value = -value;
447-
}
444+
if (ao->op() == Bytecodes::_iadd) {
448445
base = java_add(base, value);
449-
last_integer = base;
450-
last_instruction = other;
446+
} else {
447+
assert(ao->op() == Bytecodes::_isub, "unexpected bytecode");
448+
base = java_subtract(base, value);
451449
}
450+
last_integer = base;
451+
last_instruction = other;
452452
index = other;
453453
} else {
454454
break;

0 commit comments

Comments
 (0)