< prev index next >

src/share/vm/opto/lcm.cpp

Print this page


   1 /*
   2  * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 207       continue;
 208     default:                    // Also check for embedded loads
 209       if( !mach->needs_anti_dependence_check() )
 210         continue;               // Not an memory op; skip it
 211       if( must_clone[iop] ) {
 212         // Do not move nodes which produce flags because
 213         // RA will try to clone it to place near branch and
 214         // it will cause recompilation, see clone_node().
 215         continue;
 216       }
 217       {
 218         // Check that value is used in memory address in
 219         // instructions with embedded load (CmpP val1,(val2+off)).
 220         Node* base;
 221         Node* index;
 222         const MachOper* oper = mach->memory_inputs(base, index);
 223         if (oper == NULL || oper == (MachOper*)-1) {
 224           continue;             // Not an memory op; skip it
 225         }
 226         if (val == base ||
 227             val == index && val->bottom_type()->isa_narrowoop()) {
 228           break;                // Found it
 229         } else {
 230           continue;             // Skip it
 231         }
 232       }
 233       break;
 234     }
 235 
 236     // On some OSes (AIX) the page at address 0 is only write protected.
 237     // If so, only Store operations will trap.
 238     // But a read accessing the base of a heap-based compressed heap will trap.
 239     if (!was_store && needs_explicit_null_check_for_read(val)) {
 240       continue;
 241     }
 242 
 243     // Check that node's control edge is not-null block's head or dominates it,
 244     // otherwise we can't hoist it because there are other control dependencies.
 245     Node* ctrl = mach->in(0);
 246     if (ctrl != NULL && !(ctrl == not_null_block->head() ||
 247         get_block_for_node(ctrl)->dominates(not_null_block))) {


   1 /*
   2  * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 207       continue;
 208     default:                    // Also check for embedded loads
 209       if( !mach->needs_anti_dependence_check() )
 210         continue;               // Not an memory op; skip it
 211       if( must_clone[iop] ) {
 212         // Do not move nodes which produce flags because
 213         // RA will try to clone it to place near branch and
 214         // it will cause recompilation, see clone_node().
 215         continue;
 216       }
 217       {
 218         // Check that value is used in memory address in
 219         // instructions with embedded load (CmpP val1,(val2+off)).
 220         Node* base;
 221         Node* index;
 222         const MachOper* oper = mach->memory_inputs(base, index);
 223         if (oper == NULL || oper == (MachOper*)-1) {
 224           continue;             // Not an memory op; skip it
 225         }
 226         if (val == base ||
 227             (val == index && val->bottom_type()->isa_narrowoop())) {
 228           break;                // Found it
 229         } else {
 230           continue;             // Skip it
 231         }
 232       }
 233       break;
 234     }
 235 
 236     // On some OSes (AIX) the page at address 0 is only write protected.
 237     // If so, only Store operations will trap.
 238     // But a read accessing the base of a heap-based compressed heap will trap.
 239     if (!was_store && needs_explicit_null_check_for_read(val)) {
 240       continue;
 241     }
 242 
 243     // Check that node's control edge is not-null block's head or dominates it,
 244     // otherwise we can't hoist it because there are other control dependencies.
 245     Node* ctrl = mach->in(0);
 246     if (ctrl != NULL && !(ctrl == not_null_block->head() ||
 247         get_block_for_node(ctrl)->dominates(not_null_block))) {


< prev index next >