src/share/vm/opto/compile.cpp

Print this page




   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  *
  23  */
  24 
  25 #include "incls/_precompiled.incl"
  26 #include "incls/_compile.cpp.incl"


















































  27 
  28 /// Support for intrinsics.
  29 
  30 // Return the index at which m must be inserted (or already exists).
  31 // The sort order is by the address of the ciMethod, with is_virtual as minor key.
  32 int Compile::intrinsic_insertion_index(ciMethod* m, bool is_virtual) {
  33 #ifdef ASSERT
  34   for (int i = 1; i < _intrinsics->length(); i++) {
  35     CallGenerator* cg1 = _intrinsics->at(i-1);
  36     CallGenerator* cg2 = _intrinsics->at(i);
  37     assert(cg1->method() != cg2->method()
  38            ? cg1->method()     < cg2->method()
  39            : cg1->is_virtual() < cg2->is_virtual(),
  40            "compiler intrinsics list must stay sorted");
  41   }
  42 #endif
  43   // Binary search sorted list, in decreasing intervals [lo, hi].
  44   int lo = 0, hi = _intrinsics->length()-1;
  45   while (lo <= hi) {
  46     int mid = (uint)(hi + lo) / 2;




   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  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "asm/assembler.hpp"
  27 #include "classfile/systemDictionary.hpp"
  28 #include "code/exceptionHandlerTable.hpp"
  29 #include "code/nmethod.hpp"
  30 #include "compiler/compileLog.hpp"
  31 #include "compiler/oopMap.hpp"
  32 #include "opto/addnode.hpp"
  33 #include "opto/block.hpp"
  34 #include "opto/c2compiler.hpp"
  35 #include "opto/callGenerator.hpp"
  36 #include "opto/callnode.hpp"
  37 #include "opto/cfgnode.hpp"
  38 #include "opto/chaitin.hpp"
  39 #include "opto/compile.hpp"
  40 #include "opto/connode.hpp"
  41 #include "opto/divnode.hpp"
  42 #include "opto/escape.hpp"
  43 #include "opto/idealGraphPrinter.hpp"
  44 #include "opto/loopnode.hpp"
  45 #include "opto/machnode.hpp"
  46 #include "opto/macro.hpp"
  47 #include "opto/matcher.hpp"
  48 #include "opto/memnode.hpp"
  49 #include "opto/mulnode.hpp"
  50 #include "opto/node.hpp"
  51 #include "opto/opcodes.hpp"
  52 #include "opto/output.hpp"
  53 #include "opto/parse.hpp"
  54 #include "opto/phaseX.hpp"
  55 #include "opto/rootnode.hpp"
  56 #include "opto/runtime.hpp"
  57 #include "opto/stringopts.hpp"
  58 #include "opto/type.hpp"
  59 #include "opto/vectornode.hpp"
  60 #include "runtime/arguments.hpp"
  61 #include "runtime/signature.hpp"
  62 #include "runtime/stubRoutines.hpp"
  63 #include "runtime/timer.hpp"
  64 #include "utilities/copy.hpp"
  65 #ifdef TARGET_ARCH_MODEL_x86_32
  66 # include "adfiles/ad_x86_32.hpp"
  67 #endif
  68 #ifdef TARGET_ARCH_MODEL_x86_64
  69 # include "adfiles/ad_x86_64.hpp"
  70 #endif
  71 #ifdef TARGET_ARCH_MODEL_sparc
  72 # include "adfiles/ad_sparc.hpp"
  73 #endif
  74 #ifdef TARGET_ARCH_MODEL_zero
  75 # include "adfiles/ad_zero.hpp"
  76 #endif
  77 
  78 /// Support for intrinsics.
  79 
  80 // Return the index at which m must be inserted (or already exists).
  81 // The sort order is by the address of the ciMethod, with is_virtual as minor key.
  82 int Compile::intrinsic_insertion_index(ciMethod* m, bool is_virtual) {
  83 #ifdef ASSERT
  84   for (int i = 1; i < _intrinsics->length(); i++) {
  85     CallGenerator* cg1 = _intrinsics->at(i-1);
  86     CallGenerator* cg2 = _intrinsics->at(i);
  87     assert(cg1->method() != cg2->method()
  88            ? cg1->method()     < cg2->method()
  89            : cg1->is_virtual() < cg2->is_virtual(),
  90            "compiler intrinsics list must stay sorted");
  91   }
  92 #endif
  93   // Binary search sorted list, in decreasing intervals [lo, hi].
  94   int lo = 0, hi = _intrinsics->length()-1;
  95   while (lo <= hi) {
  96     int mid = (uint)(hi + lo) / 2;