< prev index next >

src/share/vm/c1/c1_Canonicalizer.cpp

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1999, 2015, 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. --- 1,7 ---- /* ! * Copyright (c) 1999, 2016, 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.
*** 269,285 **** if (idx < 0 || idx >= array->value()->length()) { // Leave the load as is. The range check will handle it. return; } ! ciConstant field_val = array->value()->element_value(idx); if (!field_val.is_null_or_zero()) { jint dimension = array->dimension(); assert(dimension <= array->value()->array_type()->dimension(), "inconsistent info"); ValueType* value = NULL; if (dimension > 1) { // Preserve information about the dimension for the element. assert(field_val.as_object()->is_array(), "not an array"); value = new StableArrayConstant(field_val.as_object()->as_array(), dimension - 1); } else { assert(dimension == 1, "sanity"); value = as_ValueType(field_val); --- 269,288 ---- if (idx < 0 || idx >= array->value()->length()) { // Leave the load as is. The range check will handle it. return; } ! // Use load type for mismatched accesses ! BasicType bt = x->mismatched() ? x->elt_type() : array->value()->element_basic_type(); ! ciConstant field_val = array->value()->element_value(idx, bt); if (!field_val.is_null_or_zero()) { jint dimension = array->dimension(); assert(dimension <= array->value()->array_type()->dimension(), "inconsistent info"); ValueType* value = NULL; if (dimension > 1) { // Preserve information about the dimension for the element. + assert(!x->mismatched(), "should not be mismatched"); assert(field_val.as_object()->is_array(), "not an array"); value = new StableArrayConstant(field_val.as_object()->as_array(), dimension - 1); } else { assert(dimension == 1, "sanity"); value = as_ValueType(field_val);
*** 308,319 **** x->elt_type(), value, x->state_before(), x->check_boolean())); return; } } - - } void Canonicalizer::do_NegateOp(NegateOp* x) { ValueType* t = x->x()->type(); --- 311,320 ----
< prev index next >