< prev index next >

src/share/vm/opto/macro.cpp

Print this page


   1 /*
   2  * Copyright (c) 2005, 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  *


1342   // We need a Region and corresponding Phi's to merge the slow-path and fast-path results.
1343   // they will not be used if "always_slow" is set
1344   enum { slow_result_path = 1, fast_result_path = 2 };
1345   Node *result_region = NULL;
1346   Node *result_phi_rawmem = NULL;
1347   Node *result_phi_rawoop = NULL;
1348   Node *result_phi_i_o = NULL;
1349 
1350   // The initial slow comparison is a size check, the comparison
1351   // we want to do is a BoolTest::gt
1352   bool always_slow = false;
1353   int tv = _igvn.find_int_con(initial_slow_test, -1);
1354   if (tv >= 0) {
1355     always_slow = (tv == 1);
1356     initial_slow_test = NULL;
1357   } else {
1358     initial_slow_test = BoolNode::make_predicate(initial_slow_test, &_igvn);
1359   }
1360 
1361   if (C->env()->dtrace_alloc_probes() ||
1362       !UseTLAB && (!Universe::heap()->supports_inline_contig_alloc())) {
1363     // Force slow-path allocation
1364     always_slow = true;
1365     initial_slow_test = NULL;
1366   }
1367 
1368 
1369   enum { too_big_or_final_path = 1, need_gc_path = 2 };
1370   Node *slow_region = NULL;
1371   Node *toobig_false = ctrl;
1372 
1373   assert (initial_slow_test == NULL || !always_slow, "arguments must be consistent");
1374   // generate the initial test if necessary
1375   if (initial_slow_test != NULL ) {
1376     slow_region = new RegionNode(3);
1377 
1378     // Now make the initial failure test.  Usually a too-big test but
1379     // might be a TRUE for finalizers or a fancy class check for
1380     // newInstance0.
1381     IfNode *toobig_iff = new IfNode(ctrl, initial_slow_test, PROB_MIN, COUNT_UNKNOWN);
1382     transform_later(toobig_iff);


   1 /*
   2  * Copyright (c) 2005, 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  *


1342   // We need a Region and corresponding Phi's to merge the slow-path and fast-path results.
1343   // they will not be used if "always_slow" is set
1344   enum { slow_result_path = 1, fast_result_path = 2 };
1345   Node *result_region = NULL;
1346   Node *result_phi_rawmem = NULL;
1347   Node *result_phi_rawoop = NULL;
1348   Node *result_phi_i_o = NULL;
1349 
1350   // The initial slow comparison is a size check, the comparison
1351   // we want to do is a BoolTest::gt
1352   bool always_slow = false;
1353   int tv = _igvn.find_int_con(initial_slow_test, -1);
1354   if (tv >= 0) {
1355     always_slow = (tv == 1);
1356     initial_slow_test = NULL;
1357   } else {
1358     initial_slow_test = BoolNode::make_predicate(initial_slow_test, &_igvn);
1359   }
1360 
1361   if (C->env()->dtrace_alloc_probes() ||
1362       (!UseTLAB && !Universe::heap()->supports_inline_contig_alloc())) {
1363     // Force slow-path allocation
1364     always_slow = true;
1365     initial_slow_test = NULL;
1366   }
1367 
1368 
1369   enum { too_big_or_final_path = 1, need_gc_path = 2 };
1370   Node *slow_region = NULL;
1371   Node *toobig_false = ctrl;
1372 
1373   assert (initial_slow_test == NULL || !always_slow, "arguments must be consistent");
1374   // generate the initial test if necessary
1375   if (initial_slow_test != NULL ) {
1376     slow_region = new RegionNode(3);
1377 
1378     // Now make the initial failure test.  Usually a too-big test but
1379     // might be a TRUE for finalizers or a fancy class check for
1380     // newInstance0.
1381     IfNode *toobig_iff = new IfNode(ctrl, initial_slow_test, PROB_MIN, COUNT_UNKNOWN);
1382     transform_later(toobig_iff);


< prev index next >