hotspot/src/share/vm/c1/c1_Canonicalizer.cpp
changeset 39263 d139a133ba27
parent 38060 954c9575f653
child 43673 bf2f6d3f8f5e
equal deleted inserted replaced
39262:ec2d5ec5571c 39263:d139a133ba27
     1 /*
     1 /*
     2  * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   262   IntConstant* index = x->index()->type()->as_IntConstant();
   262   IntConstant* index = x->index()->type()->as_IntConstant();
   263 
   263 
   264   assert(array == NULL || FoldStableValues, "not enabled");
   264   assert(array == NULL || FoldStableValues, "not enabled");
   265 
   265 
   266   // Constant fold loads from stable arrays.
   266   // Constant fold loads from stable arrays.
   267   if (array != NULL && index != NULL) {
   267   if (!x->mismatched() && array != NULL && index != NULL) {
   268     jint idx = index->value();
   268     jint idx = index->value();
   269     if (idx < 0 || idx >= array->value()->length()) {
   269     if (idx < 0 || idx >= array->value()->length()) {
   270       // Leave the load as is. The range check will handle it.
   270       // Leave the load as is. The range check will handle it.
   271       return;
   271       return;
   272     }
   272     }
   308                                      x->elt_type(), value, x->state_before(),
   308                                      x->elt_type(), value, x->state_before(),
   309                                      x->check_boolean()));
   309                                      x->check_boolean()));
   310       return;
   310       return;
   311     }
   311     }
   312   }
   312   }
   313 
       
   314 
       
   315 }
   313 }
   316 
   314 
   317 
   315 
   318 void Canonicalizer::do_NegateOp(NegateOp* x) {
   316 void Canonicalizer::do_NegateOp(NegateOp* x) {
   319   ValueType* t = x->x()->type();
   317   ValueType* t = x->x()->type();