8158228: C1 incorrectly folds mismatched loads from stable arrays

Disable constant folding for mismatched loads from stable arrays.

Reviewed-by: vlivanov
This commit is contained in:
Tobias Hartmann 2016-06-07 18:20:44 +02:00
parent e8ef37ca55
commit e45caa8cba
4 changed files with 63 additions and 11 deletions

View file

@ -4227,11 +4227,11 @@ void GraphBuilder::append_char_access(ciMethod* callee, bool is_store) {
Value index = args->at(1);
if (is_store) {
Value value = args->at(2);
Instruction* store = append(new StoreIndexed(array, index, NULL, T_CHAR, value, state_before, false));
Instruction* store = append(new StoreIndexed(array, index, NULL, T_CHAR, value, state_before, false, true));
store->set_flag(Instruction::NeedsRangeCheckFlag, false);
_memory->store_value(value);
} else {
Instruction* load = append(new LoadIndexed(array, index, NULL, T_CHAR, state_before));
Instruction* load = append(new LoadIndexed(array, index, NULL, T_CHAR, state_before, true));
load->set_flag(Instruction::NeedsRangeCheckFlag, false);
push(load->type(), load);
}