src/share/vm/opto/type.cpp

Print this page


   1 /*
   2  * Copyright (c) 1997, 2009, 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  *
  23  */
  24 


















  25 // Portions of code courtesy of Clifford Click
  26 
  27 // Optimization - Graph Style
  28 
  29 #include "incls/_precompiled.incl"
  30 #include "incls/_type.cpp.incl"
  31 
  32 // Dictionary of types shared among compilations.
  33 Dict* Type::_shared_type_dict = NULL;
  34 
  35 // Array which maps compiler types to Basic Types
  36 const BasicType Type::_basic_type[Type::lastype] = {
  37   T_ILLEGAL,    // Bad
  38   T_ILLEGAL,    // Control
  39   T_VOID,       // Top
  40   T_INT,        // Int
  41   T_LONG,       // Long
  42   T_VOID,       // Half
  43   T_NARROWOOP,  // NarrowOop
  44 
  45   T_ILLEGAL,    // Tuple
  46   T_ARRAY,      // Array
  47 
  48   T_ADDRESS,    // AnyPtr   // shows up in factory methods for NULL_PTR
  49   T_ADDRESS,    // RawPtr
  50   T_OBJECT,     // OopPtr
  51   T_OBJECT,     // InstPtr


   1 /*
   2  * Copyright (c) 1997, 2010, 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  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "ci/ciTypeFlow.hpp"
  27 #include "classfile/symbolTable.hpp"
  28 #include "classfile/systemDictionary.hpp"
  29 #include "compiler/compileLog.hpp"
  30 #include "libadt/dict.hpp"
  31 #include "memory/gcLocker.hpp"
  32 #include "memory/oopFactory.hpp"
  33 #include "memory/resourceArea.hpp"
  34 #include "oops/instanceKlass.hpp"
  35 #include "oops/klassKlass.hpp"
  36 #include "oops/objArrayKlass.hpp"
  37 #include "oops/typeArrayKlass.hpp"
  38 #include "opto/matcher.hpp"
  39 #include "opto/node.hpp"
  40 #include "opto/opcodes.hpp"
  41 #include "opto/type.hpp"
  42 
  43 // Portions of code courtesy of Clifford Click
  44 
  45 // Optimization - Graph Style
  46 



  47 // Dictionary of types shared among compilations.
  48 Dict* Type::_shared_type_dict = NULL;
  49 
  50 // Array which maps compiler types to Basic Types
  51 const BasicType Type::_basic_type[Type::lastype] = {
  52   T_ILLEGAL,    // Bad
  53   T_ILLEGAL,    // Control
  54   T_VOID,       // Top
  55   T_INT,        // Int
  56   T_LONG,       // Long
  57   T_VOID,       // Half
  58   T_NARROWOOP,  // NarrowOop
  59 
  60   T_ILLEGAL,    // Tuple
  61   T_ARRAY,      // Array
  62 
  63   T_ADDRESS,    // AnyPtr   // shows up in factory methods for NULL_PTR
  64   T_ADDRESS,    // RawPtr
  65   T_OBJECT,     // OopPtr
  66   T_OBJECT,     // InstPtr