< prev index next >
src/hotspot/share/c1/c1_LIRGenerator.cpp
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
@@ -1716,11 +1716,15 @@
CodeEmitInfo* store_check_info = new CodeEmitInfo(range_check_info);
array_store_check(value.result(), array.result(), store_check_info, x->profiled_method(), x->profiled_bci());
}
if (is_loaded_flattened_array) {
- index.load_item();
+ if (!x->is_exact_flattened_array_store()) {
+ CodeEmitInfo* info = new CodeEmitInfo(range_check_info);
+ ciKlass* element_klass = x->array()->declared_type()->as_value_array_klass()->element_klass();
+ flattened_array_store_check(value.result(), element_klass, info);
+ }
access_flattened_array(false, array, index, value);
} else {
StoreFlattenedArrayStub* slow_path = NULL;
if (x->array()->maybe_flattened_array()) {
@@ -1989,12 +1993,11 @@
length.set_instruction(x->length());
length.load_item();
}
array.load_item();
- if (index.is_constant() && can_inline_as_constant(x->index())
- && !x->array()->maybe_flattened_array()) {
+ if (index.is_constant() && can_inline_as_constant(x->index())) {
// let it be a constant
index.dont_load_item();
} else {
index.load_item();
}
@@ -2040,10 +2043,11 @@
} else {
LIR_Opr result = rlock_result(x, x->elt_type());
LoadFlattenedArrayStub* slow_path = NULL;
if (x->array()->maybe_flattened_array()) {
+ index.load_item();
// Check if we indeed have a flattened array
slow_path = new LoadFlattenedArrayStub(array.result(), index.result(), result, state_for(x));
check_flattened_array(array, slow_path);
}
< prev index next >