mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 23:34:52 +02:00
8263707: C1 RangeCheckEliminator support constant array and NewMultiArray
Reviewed-by: thartmann, neliasso
This commit is contained in:
parent
2ad6f2d9bc
commit
21e7402b04
3 changed files with 164 additions and 3 deletions
|
@ -984,8 +984,10 @@ void GraphBuilder::load_indexed(BasicType type) {
|
|||
Value array = apop();
|
||||
Value length = NULL;
|
||||
if (CSEArrayLength ||
|
||||
(array->as_Constant() != NULL) ||
|
||||
(array->as_AccessField() && array->as_AccessField()->field()->is_constant()) ||
|
||||
(array->as_NewArray() && array->as_NewArray()->length() && array->as_NewArray()->length()->type()->is_constant())) {
|
||||
(array->as_NewArray() && array->as_NewArray()->length() && array->as_NewArray()->length()->type()->is_constant()) ||
|
||||
(array->as_NewMultiArray() && array->as_NewMultiArray()->dims()->at(0)->type()->is_constant())) {
|
||||
length = append(new ArrayLength(array, state_before));
|
||||
}
|
||||
push(as_ValueType(type), append(new LoadIndexed(array, index, length, type, state_before)));
|
||||
|
@ -1001,8 +1003,10 @@ void GraphBuilder::store_indexed(BasicType type) {
|
|||
Value array = apop();
|
||||
Value length = NULL;
|
||||
if (CSEArrayLength ||
|
||||
(array->as_Constant() != NULL) ||
|
||||
(array->as_AccessField() && array->as_AccessField()->field()->is_constant()) ||
|
||||
(array->as_NewArray() && array->as_NewArray()->length() && array->as_NewArray()->length()->type()->is_constant())) {
|
||||
(array->as_NewArray() && array->as_NewArray()->length() && array->as_NewArray()->length()->type()->is_constant()) ||
|
||||
(array->as_NewMultiArray() && array->as_NewMultiArray()->dims()->at(0)->type()->is_constant())) {
|
||||
length = append(new ArrayLength(array, state_before));
|
||||
}
|
||||
ciType* array_type = array->declared_type();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue