src/share/vm/opto/connode.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 // Optimization - Graph Style










  26 
  27 #include "incls/_precompiled.incl"
  28 #include "incls/_connode.cpp.incl"
  29 
  30 //=============================================================================
  31 //------------------------------hash-------------------------------------------
  32 uint ConNode::hash() const {
  33   return (uintptr_t)in(TypeFunc::Control) + _type->hash();
  34 }
  35 
  36 //------------------------------make-------------------------------------------
  37 ConNode *ConNode::make( Compile* C, const Type *t ) {
  38   switch( t->basic_type() ) {
  39   case T_INT:       return new (C, 1) ConINode( t->is_int() );
  40   case T_LONG:      return new (C, 1) ConLNode( t->is_long() );
  41   case T_FLOAT:     return new (C, 1) ConFNode( t->is_float_constant() );
  42   case T_DOUBLE:    return new (C, 1) ConDNode( t->is_double_constant() );
  43   case T_VOID:      return new (C, 1) ConNode ( Type::TOP );
  44   case T_OBJECT:    return new (C, 1) ConPNode( t->is_oopptr() );
  45   case T_ARRAY:     return new (C, 1) ConPNode( t->is_aryptr() );
  46   case T_ADDRESS:   return new (C, 1) ConPNode( t->is_ptr() );
  47   case T_NARROWOOP: return new (C, 1) ConNNode( t->is_narrowoop() );
  48     // Expected cases:  TypePtr::NULL_PTR, any is_rawptr()


   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 "memory/allocation.inline.hpp"
  27 #include "opto/addnode.hpp"
  28 #include "opto/compile.hpp"
  29 #include "opto/connode.hpp"
  30 #include "opto/machnode.hpp"
  31 #include "opto/matcher.hpp"
  32 #include "opto/memnode.hpp"
  33 #include "opto/phaseX.hpp"
  34 #include "opto/subnode.hpp"
  35 #include "runtime/sharedRuntime.hpp"
  36 
  37 // Optimization - Graph Style

  38 
  39 //=============================================================================
  40 //------------------------------hash-------------------------------------------
  41 uint ConNode::hash() const {
  42   return (uintptr_t)in(TypeFunc::Control) + _type->hash();
  43 }
  44 
  45 //------------------------------make-------------------------------------------
  46 ConNode *ConNode::make( Compile* C, const Type *t ) {
  47   switch( t->basic_type() ) {
  48   case T_INT:       return new (C, 1) ConINode( t->is_int() );
  49   case T_LONG:      return new (C, 1) ConLNode( t->is_long() );
  50   case T_FLOAT:     return new (C, 1) ConFNode( t->is_float_constant() );
  51   case T_DOUBLE:    return new (C, 1) ConDNode( t->is_double_constant() );
  52   case T_VOID:      return new (C, 1) ConNode ( Type::TOP );
  53   case T_OBJECT:    return new (C, 1) ConPNode( t->is_oopptr() );
  54   case T_ARRAY:     return new (C, 1) ConPNode( t->is_aryptr() );
  55   case T_ADDRESS:   return new (C, 1) ConPNode( t->is_ptr() );
  56   case T_NARROWOOP: return new (C, 1) ConNNode( t->is_narrowoop() );
  57     // Expected cases:  TypePtr::NULL_PTR, any is_rawptr()