hotspot/src/share/vm/opto/connode.hpp
author roland
Tue, 09 Oct 2012 10:11:38 +0200
changeset 13969 d2a189b83b87
parent 13895 f6dfe4123709
child 13974 791cba24758f
permissions -rw-r--r--
7054512: Compress class pointers after perm gen removal Summary: support of compress class pointers in the compilers. Reviewed-by: kvn, twisti
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
     2
 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 2862
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 2862
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 2862
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    25
#ifndef SHARE_VM_OPTO_CONNODE_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    26
#define SHARE_VM_OPTO_CONNODE_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    28
#include "opto/node.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    29
#include "opto/opcodes.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    30
#include "opto/type.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    31
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
class PhaseTransform;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
class MachNode;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
//------------------------------ConNode----------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
// Simple constants
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
class ConNode : public TypeNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
  ConNode( const Type *t ) : TypeNode(t,1) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
    init_req(0, (Node*)Compile::current()->root());
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
    init_flags(Flag_is_Con);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
  virtual int  Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
  virtual uint hash() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
  virtual const RegMask &out_RegMask() const { return RegMask::Empty; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
  virtual const RegMask &in_RegMask(uint) const { return RegMask::Empty; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
  // Polymorphic factory method:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
  static ConNode* make( Compile* C, const Type *t );
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
//------------------------------ConINode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
// Simple integer constants
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
class ConINode : public ConNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
  ConINode( const TypeInt *t ) : ConNode(t) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
  // Factory method:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
  static ConINode* make( Compile* C, int con ) {
13895
f6dfe4123709 7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents: 10508
diff changeset
    61
    return new (C) ConINode( TypeInt::make(con) );
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
//------------------------------ConPNode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
// Simple pointer constants
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
class ConPNode : public ConNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
  ConPNode( const TypePtr *t ) : ConNode(t) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
  // Factory methods:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
  static ConPNode* make( Compile *C ,address con ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
    if (con == NULL)
13895
f6dfe4123709 7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents: 10508
diff changeset
    76
      return new (C) ConPNode( TypePtr::NULL_PTR ) ;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
    else
13895
f6dfe4123709 7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents: 10508
diff changeset
    78
      return new (C) ConPNode( TypeRawPtr::make(con) );
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    83
//------------------------------ConNNode--------------------------------------
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    84
// Simple narrow oop constants
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    85
class ConNNode : public ConNode {
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    86
public:
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    87
  ConNNode( const TypeNarrowOop *t ) : ConNode(t) {}
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    88
  virtual int Opcode() const;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    89
};
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    90
13969
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
    91
//------------------------------ConNKlassNode---------------------------------
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
    92
// Simple narrow klass constants
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
    93
class ConNKlassNode : public ConNode {
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
    94
public:
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
    95
  ConNKlassNode( const TypeNarrowKlass *t ) : ConNode(t) {}
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
    96
  virtual int Opcode() const;
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
    97
};
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
    98
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    99
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
//------------------------------ConLNode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
// Simple long constants
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
class ConLNode : public ConNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
  ConLNode( const TypeLong *t ) : ConNode(t) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
  // Factory method:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
  static ConLNode* make( Compile *C ,jlong con ) {
13895
f6dfe4123709 7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents: 10508
diff changeset
   109
    return new (C) ConLNode( TypeLong::make(con) );
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
//------------------------------ConFNode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
// Simple float constants
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
class ConFNode : public ConNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
  ConFNode( const TypeF *t ) : ConNode(t) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
  // Factory method:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
  static ConFNode* make( Compile *C, float con  ) {
13895
f6dfe4123709 7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents: 10508
diff changeset
   123
    return new (C) ConFNode( TypeF::make(con) );
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
//------------------------------ConDNode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
// Simple double constants
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
class ConDNode : public ConNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
  ConDNode( const TypeD *t ) : ConNode(t) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
  // Factory method:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
  static ConDNode* make( Compile *C, double con ) {
13895
f6dfe4123709 7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents: 10508
diff changeset
   137
    return new (C) ConDNode( TypeD::make(con) );
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
//------------------------------BinaryNode-------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
// Place holder for the 2 conditional inputs to a CMove.  CMove needs 4
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
// inputs: the Bool (for the lt/gt/eq/ne bits), the flags (result of some
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
// compare), and the 2 values to select between.  The Matcher requires a
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
// binary tree so we break it down like this:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
//     (CMove (Binary bol cmp) (Binary src1 src2))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
class BinaryNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
  BinaryNode( Node *n1, Node *n2 ) : Node(0,n1,n2) { }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
  virtual uint ideal_reg() const { return 0; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
//------------------------------CMoveNode--------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
// Conditional move
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
class CMoveNode : public TypeNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
  enum { Control,               // When is it safe to do this cmove?
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
         Condition,             // Condition controlling the cmove
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
         IfFalse,               // Value if condition is false
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
         IfTrue };              // Value if condition is true
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
  CMoveNode( Node *bol, Node *left, Node *right, const Type *t ) : TypeNode(t,4)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
  {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
    init_class_id(Class_CMove);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
    // all inputs are nullified in Node::Node(int)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
    // init_req(Control,NULL);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
    init_req(Condition,bol);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
    init_req(IfFalse,left);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
    init_req(IfTrue,right);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
  virtual Node *Identity( PhaseTransform *phase );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
  static CMoveNode *make( Compile *C, Node *c, Node *bol, Node *left, Node *right, const Type *t );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
  // Helper function to spot cmove graph shapes
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
  static Node *is_cmove_id( PhaseTransform *phase, Node *cmp, Node *t, Node *f, BoolNode *b );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
//------------------------------CMoveDNode-------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
class CMoveDNode : public CMoveNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
  CMoveDNode( Node *bol, Node *left, Node *right, const Type* t) : CMoveNode(bol,left,right,t){}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
//------------------------------CMoveFNode-------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
class CMoveFNode : public CMoveNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
  CMoveFNode( Node *bol, Node *left, Node *right, const Type* t ) : CMoveNode(bol,left,right,t) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
//------------------------------CMoveINode-------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
class CMoveINode : public CMoveNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
  CMoveINode( Node *bol, Node *left, Node *right, const TypeInt *ti ) : CMoveNode(bol,left,right,ti){}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
//------------------------------CMoveLNode-------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
class CMoveLNode : public CMoveNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
  CMoveLNode(Node *bol, Node *left, Node *right, const TypeLong *tl ) : CMoveNode(bol,left,right,tl){}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
//------------------------------CMovePNode-------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
class CMovePNode : public CMoveNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
  CMovePNode( Node *c, Node *bol, Node *left, Node *right, const TypePtr* t ) : CMoveNode(bol,left,right,t) { init_req(Control,c); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
590
2954744d7bba 6703890: Compressed Oops: add LoadNKlass node to generate narrow oops (32-bits) compare instructions
kvn
parents: 589
diff changeset
   218
//------------------------------CMoveNNode-------------------------------------
2954744d7bba 6703890: Compressed Oops: add LoadNKlass node to generate narrow oops (32-bits) compare instructions
kvn
parents: 589
diff changeset
   219
class CMoveNNode : public CMoveNode {
2954744d7bba 6703890: Compressed Oops: add LoadNKlass node to generate narrow oops (32-bits) compare instructions
kvn
parents: 589
diff changeset
   220
public:
2954744d7bba 6703890: Compressed Oops: add LoadNKlass node to generate narrow oops (32-bits) compare instructions
kvn
parents: 589
diff changeset
   221
  CMoveNNode( Node *c, Node *bol, Node *left, Node *right, const Type* t ) : CMoveNode(bol,left,right,t) { init_req(Control,c); }
2954744d7bba 6703890: Compressed Oops: add LoadNKlass node to generate narrow oops (32-bits) compare instructions
kvn
parents: 589
diff changeset
   222
  virtual int Opcode() const;
2954744d7bba 6703890: Compressed Oops: add LoadNKlass node to generate narrow oops (32-bits) compare instructions
kvn
parents: 589
diff changeset
   223
};
2954744d7bba 6703890: Compressed Oops: add LoadNKlass node to generate narrow oops (32-bits) compare instructions
kvn
parents: 589
diff changeset
   224
2954744d7bba 6703890: Compressed Oops: add LoadNKlass node to generate narrow oops (32-bits) compare instructions
kvn
parents: 589
diff changeset
   225
//------------------------------ConstraintCastNode-----------------------------
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
// cast to a different range
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
class ConstraintCastNode: public TypeNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
  ConstraintCastNode (Node *n, const Type *t ): TypeNode(t,2) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
    init_class_id(Class_ConstraintCast);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
    init_req(1, n);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
  virtual Node *Identity( PhaseTransform *phase );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
  virtual uint ideal_reg() const = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
  virtual Node *Ideal_DU_postCCP( PhaseCCP * );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
//------------------------------CastIINode-------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
// cast integer to integer (different range)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
class CastIINode: public ConstraintCastNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
  CastIINode (Node *n, const Type *t ): ConstraintCastNode(n,t) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
  virtual uint ideal_reg() const { return Op_RegI; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
//------------------------------CastPPNode-------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
// cast pointer to pointer (different type)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
class CastPPNode: public ConstraintCastNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
public:
373
427fb4ca6a1e 6625997: CastPP, CheckCastPP and Proj nodes are not dead loop safe
kvn
parents: 371
diff changeset
   254
  CastPPNode (Node *n, const Type *t ): ConstraintCastNode(n, t) {}
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
  virtual uint ideal_reg() const { return Op_RegP; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
  virtual Node *Ideal_DU_postCCP( PhaseCCP * );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
//------------------------------CheckCastPPNode--------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
// for _checkcast, cast pointer to pointer (different type), without JOIN,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
class CheckCastPPNode: public TypeNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   264
  CheckCastPPNode( Node *c, Node *n, const Type *t ) : TypeNode(t,2) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   265
    init_class_id(Class_CheckCastPP);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   266
    init_req(0, c);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   267
    init_req(1, n);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   268
  }
373
427fb4ca6a1e 6625997: CastPP, CheckCastPP and Proj nodes are not dead loop safe
kvn
parents: 371
diff changeset
   269
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   270
  virtual Node *Identity( PhaseTransform *phase );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   271
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   272
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   273
  virtual int   Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   274
  virtual uint  ideal_reg() const { return Op_RegP; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   275
  // No longer remove CheckCast after CCP as it gives me a place to hang
489c9b5090e2 Initial load
duke
parents:
diff changeset
   276
  // the proper address type - which is required to compute anti-deps.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   277
  //virtual Node *Ideal_DU_postCCP( PhaseCCP * );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   278
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   279
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   280
13969
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   281
//------------------------------EncodeNarrowPtr--------------------------------
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   282
class EncodeNarrowPtrNode : public TypeNode {
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   283
 protected:
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   284
  EncodeNarrowPtrNode(Node* value, const Type* type):
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   285
    TypeNode(type, 2) {
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   286
    init_class_id(Class_EncodeNarrowPtr);
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   287
    init_req(0, NULL);
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   288
    init_req(1, value);
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   289
  }
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   290
 public:
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   291
  virtual uint  ideal_reg() const { return Op_RegN; }
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   292
  virtual Node *Ideal_DU_postCCP( PhaseCCP *ccp );
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   293
};
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   294
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   295
//------------------------------EncodeP--------------------------------
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   296
// Encodes an oop pointers into its compressed form
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   297
// Takes an extra argument which is the real heap base as a long which
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   298
// may be useful for code generation in the backend.
13969
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   299
class EncodePNode : public EncodeNarrowPtrNode {
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   300
 public:
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   301
  EncodePNode(Node* value, const Type* type):
13969
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   302
    EncodeNarrowPtrNode(value, type) {
594
9f4474e5dbaf 6705887: Compressed Oops: generate x64 addressing and implicit null checks with narrow oops
kvn
parents: 590
diff changeset
   303
    init_class_id(Class_EncodeP);
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   304
  }
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   305
  virtual int Opcode() const;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   306
  virtual Node *Identity( PhaseTransform *phase );
371
1aacedc9db7c 6689060: Escape Analysis does not work with Compressed Oops
kvn
parents: 360
diff changeset
   307
  virtual const Type *Value( PhaseTransform *phase ) const;
13969
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   308
};
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   309
13969
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   310
//------------------------------EncodePKlass--------------------------------
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   311
// Encodes a klass pointer into its compressed form
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   312
// Takes an extra argument which is the real heap base as a long which
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   313
// may be useful for code generation in the backend.
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   314
class EncodePKlassNode : public EncodeNarrowPtrNode {
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   315
 public:
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   316
  EncodePKlassNode(Node* value, const Type* type):
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   317
    EncodeNarrowPtrNode(value, type) {
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   318
    init_class_id(Class_EncodePKlass);
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   319
  }
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   320
  virtual int Opcode() const;
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   321
  virtual Node *Identity( PhaseTransform *phase );
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   322
  virtual const Type *Value( PhaseTransform *phase ) const;
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   323
};
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   324
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   325
//------------------------------DecodeNarrowPtr--------------------------------
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   326
class DecodeNarrowPtrNode : public TypeNode {
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   327
 protected:
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   328
  DecodeNarrowPtrNode(Node* value, const Type* type):
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   329
    TypeNode(type, 2) {
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   330
    init_class_id(Class_DecodeNarrowPtr);
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   331
    init_req(0, NULL);
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   332
    init_req(1, value);
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   333
  }
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   334
 public:
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   335
  virtual uint  ideal_reg() const { return Op_RegP; }
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   336
};
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   337
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   338
//------------------------------DecodeN--------------------------------
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   339
// Converts a narrow oop into a real oop ptr.
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   340
// Takes an extra argument which is the real heap base as a long which
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   341
// may be useful for code generation in the backend.
13969
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   342
class DecodeNNode : public DecodeNarrowPtrNode {
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   343
 public:
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   344
  DecodeNNode(Node* value, const Type* type):
13969
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   345
    DecodeNarrowPtrNode(value, type) {
594
9f4474e5dbaf 6705887: Compressed Oops: generate x64 addressing and implicit null checks with narrow oops
kvn
parents: 590
diff changeset
   346
    init_class_id(Class_DecodeN);
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   347
  }
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   348
  virtual int Opcode() const;
371
1aacedc9db7c 6689060: Escape Analysis does not work with Compressed Oops
kvn
parents: 360
diff changeset
   349
  virtual const Type *Value( PhaseTransform *phase ) const;
13969
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   350
  virtual Node *Identity( PhaseTransform *phase );
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   351
};
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   352
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   353
//------------------------------DecodeNKlass--------------------------------
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   354
// Converts a narrow klass pointer into a real klass ptr.
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   355
// Takes an extra argument which is the real heap base as a long which
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   356
// may be useful for code generation in the backend.
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   357
class DecodeNKlassNode : public DecodeNarrowPtrNode {
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   358
 public:
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   359
  DecodeNKlassNode(Node* value, const Type* type):
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   360
    DecodeNarrowPtrNode(value, type) {
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   361
    init_class_id(Class_DecodeNKlass);
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   362
  }
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   363
  virtual int Opcode() const;
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   364
  virtual const Type *Value( PhaseTransform *phase ) const;
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13895
diff changeset
   365
  virtual Node *Identity( PhaseTransform *phase );
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   366
};
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   367
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   368
//------------------------------Conv2BNode-------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   369
// Convert int/pointer to a Boolean.  Map zero to zero, all else to 1.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   370
class Conv2BNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   371
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   372
  Conv2BNode( Node *i ) : Node(0,i) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   373
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   374
  virtual const Type *bottom_type() const { return TypeInt::BOOL; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   375
  virtual Node *Identity( PhaseTransform *phase );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   376
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   377
  virtual uint  ideal_reg() const { return Op_RegI; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   378
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   379
489c9b5090e2 Initial load
duke
parents:
diff changeset
   380
// The conversions operations are all Alpha sorted.  Please keep it that way!
489c9b5090e2 Initial load
duke
parents:
diff changeset
   381
//------------------------------ConvD2FNode------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   382
// Convert double to float
489c9b5090e2 Initial load
duke
parents:
diff changeset
   383
class ConvD2FNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   384
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   385
  ConvD2FNode( Node *in1 ) : Node(0,in1) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   386
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   387
  virtual const Type *bottom_type() const { return Type::FLOAT; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   388
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   389
  virtual Node *Identity( PhaseTransform *phase );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   390
  virtual uint  ideal_reg() const { return Op_RegF; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   391
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   392
489c9b5090e2 Initial load
duke
parents:
diff changeset
   393
//------------------------------ConvD2INode------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   394
// Convert Double to Integer
489c9b5090e2 Initial load
duke
parents:
diff changeset
   395
class ConvD2INode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   396
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   397
  ConvD2INode( Node *in1 ) : Node(0,in1) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   398
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   399
  virtual const Type *bottom_type() const { return TypeInt::INT; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   400
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   401
  virtual Node *Identity( PhaseTransform *phase );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   402
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   403
  virtual uint  ideal_reg() const { return Op_RegI; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   404
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   405
489c9b5090e2 Initial load
duke
parents:
diff changeset
   406
//------------------------------ConvD2LNode------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   407
// Convert Double to Long
489c9b5090e2 Initial load
duke
parents:
diff changeset
   408
class ConvD2LNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   409
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   410
  ConvD2LNode( Node *dbl ) : Node(0,dbl) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   411
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   412
  virtual const Type *bottom_type() const { return TypeLong::LONG; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   413
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   414
  virtual Node *Identity( PhaseTransform *phase );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   415
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   416
  virtual uint ideal_reg() const { return Op_RegL; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   417
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   418
489c9b5090e2 Initial load
duke
parents:
diff changeset
   419
//------------------------------ConvF2DNode------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   420
// Convert Float to a Double.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   421
class ConvF2DNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   422
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   423
  ConvF2DNode( Node *in1 ) : Node(0,in1) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   424
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   425
  virtual const Type *bottom_type() const { return Type::DOUBLE; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   426
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   427
  virtual uint  ideal_reg() const { return Op_RegD; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   428
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   429
489c9b5090e2 Initial load
duke
parents:
diff changeset
   430
//------------------------------ConvF2INode------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   431
// Convert float to integer
489c9b5090e2 Initial load
duke
parents:
diff changeset
   432
class ConvF2INode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   433
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   434
  ConvF2INode( Node *in1 ) : Node(0,in1) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   435
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   436
  virtual const Type *bottom_type() const { return TypeInt::INT; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   437
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   438
  virtual Node *Identity( PhaseTransform *phase );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   439
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   440
  virtual uint  ideal_reg() const { return Op_RegI; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   441
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   442
489c9b5090e2 Initial load
duke
parents:
diff changeset
   443
//------------------------------ConvF2LNode------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   444
// Convert float to long
489c9b5090e2 Initial load
duke
parents:
diff changeset
   445
class ConvF2LNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   446
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   447
  ConvF2LNode( Node *in1 ) : Node(0,in1) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   448
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   449
  virtual const Type *bottom_type() const { return TypeLong::LONG; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   450
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   451
  virtual Node *Identity( PhaseTransform *phase );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   452
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   453
  virtual uint  ideal_reg() const { return Op_RegL; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   454
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   455
489c9b5090e2 Initial load
duke
parents:
diff changeset
   456
//------------------------------ConvI2DNode------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   457
// Convert Integer to Double
489c9b5090e2 Initial load
duke
parents:
diff changeset
   458
class ConvI2DNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   459
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   460
  ConvI2DNode( Node *in1 ) : Node(0,in1) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   461
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   462
  virtual const Type *bottom_type() const { return Type::DOUBLE; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   463
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   464
  virtual uint  ideal_reg() const { return Op_RegD; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   465
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   466
489c9b5090e2 Initial load
duke
parents:
diff changeset
   467
//------------------------------ConvI2FNode------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   468
// Convert Integer to Float
489c9b5090e2 Initial load
duke
parents:
diff changeset
   469
class ConvI2FNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   470
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   471
  ConvI2FNode( Node *in1 ) : Node(0,in1) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   472
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   473
  virtual const Type *bottom_type() const { return Type::FLOAT; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   474
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   475
  virtual Node *Identity( PhaseTransform *phase );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   476
  virtual uint  ideal_reg() const { return Op_RegF; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   477
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   478
489c9b5090e2 Initial load
duke
parents:
diff changeset
   479
//------------------------------ConvI2LNode------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   480
// Convert integer to long
489c9b5090e2 Initial load
duke
parents:
diff changeset
   481
class ConvI2LNode : public TypeNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   482
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   483
  ConvI2LNode(Node *in1, const TypeLong* t = TypeLong::INT)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   484
    : TypeNode(t, 2)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   485
  { init_req(1, in1); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   486
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   487
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   488
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   489
  virtual uint  ideal_reg() const { return Op_RegL; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   490
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   491
489c9b5090e2 Initial load
duke
parents:
diff changeset
   492
//------------------------------ConvL2DNode------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   493
// Convert Long to Double
489c9b5090e2 Initial load
duke
parents:
diff changeset
   494
class ConvL2DNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   495
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   496
  ConvL2DNode( Node *in1 ) : Node(0,in1) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   497
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   498
  virtual const Type *bottom_type() const { return Type::DOUBLE; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   499
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   500
  virtual uint ideal_reg() const { return Op_RegD; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   501
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   502
489c9b5090e2 Initial load
duke
parents:
diff changeset
   503
//------------------------------ConvL2FNode------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   504
// Convert Long to Float
489c9b5090e2 Initial load
duke
parents:
diff changeset
   505
class ConvL2FNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   506
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   507
  ConvL2FNode( Node *in1 ) : Node(0,in1) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   508
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   509
  virtual const Type *bottom_type() const { return Type::FLOAT; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   510
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   511
  virtual uint  ideal_reg() const { return Op_RegF; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   512
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   513
489c9b5090e2 Initial load
duke
parents:
diff changeset
   514
//------------------------------ConvL2INode------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   515
// Convert long to integer
489c9b5090e2 Initial load
duke
parents:
diff changeset
   516
class ConvL2INode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   517
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   518
  ConvL2INode( Node *in1 ) : Node(0,in1) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   519
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   520
  virtual const Type *bottom_type() const { return TypeInt::INT; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   521
  virtual Node *Identity( PhaseTransform *phase );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   522
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   523
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   524
  virtual uint  ideal_reg() const { return Op_RegI; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   525
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   526
489c9b5090e2 Initial load
duke
parents:
diff changeset
   527
//------------------------------CastX2PNode-------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   528
// convert a machine-pointer-sized integer to a raw pointer
489c9b5090e2 Initial load
duke
parents:
diff changeset
   529
class CastX2PNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   530
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   531
  CastX2PNode( Node *n ) : Node(NULL, n) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   532
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   533
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   534
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   535
  virtual Node *Identity( PhaseTransform *phase );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   536
  virtual uint ideal_reg() const { return Op_RegP; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   537
  virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   538
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   539
489c9b5090e2 Initial load
duke
parents:
diff changeset
   540
//------------------------------CastP2XNode-------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   541
// Used in both 32-bit and 64-bit land.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   542
// Used for card-marks and unsafe pointer math.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   543
class CastP2XNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   544
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   545
  CastP2XNode( Node *ctrl, Node *n ) : Node(ctrl, n) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   546
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   547
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   548
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   549
  virtual Node *Identity( PhaseTransform *phase );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   550
  virtual uint ideal_reg() const { return Op_RegX; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   551
  virtual const Type *bottom_type() const { return TypeX_X; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   552
  // Return false to keep node from moving away from an associated card mark.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   553
  virtual bool depends_only_on_test() const { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   554
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   555
489c9b5090e2 Initial load
duke
parents:
diff changeset
   556
//------------------------------ThreadLocalNode--------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   557
// Ideal Node which returns the base of ThreadLocalStorage.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   558
class ThreadLocalNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   559
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   560
  ThreadLocalNode( ) : Node((Node*)Compile::current()->root()) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   561
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   562
  virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM;}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   563
  virtual uint ideal_reg() const { return Op_RegP; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   564
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   565
489c9b5090e2 Initial load
duke
parents:
diff changeset
   566
//------------------------------LoadReturnPCNode-------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   567
class LoadReturnPCNode: public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   568
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   569
  LoadReturnPCNode(Node *c) : Node(c) { }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   570
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   571
  virtual uint ideal_reg() const { return Op_RegP; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   572
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   573
489c9b5090e2 Initial load
duke
parents:
diff changeset
   574
489c9b5090e2 Initial load
duke
parents:
diff changeset
   575
//-----------------------------RoundFloatNode----------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   576
class RoundFloatNode: public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   577
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   578
  RoundFloatNode(Node* c, Node *in1): Node(c, in1) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   579
  virtual int   Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   580
  virtual const Type *bottom_type() const { return Type::FLOAT; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   581
  virtual uint  ideal_reg() const { return Op_RegF; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   582
  virtual Node *Identity( PhaseTransform *phase );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   583
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   584
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   585
489c9b5090e2 Initial load
duke
parents:
diff changeset
   586
489c9b5090e2 Initial load
duke
parents:
diff changeset
   587
//-----------------------------RoundDoubleNode---------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   588
class RoundDoubleNode: public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   589
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   590
  RoundDoubleNode(Node* c, Node *in1): Node(c, in1) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   591
  virtual int   Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   592
  virtual const Type *bottom_type() const { return Type::DOUBLE; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   593
  virtual uint  ideal_reg() const { return Op_RegD; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   594
  virtual Node *Identity( PhaseTransform *phase );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   595
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   596
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   597
489c9b5090e2 Initial load
duke
parents:
diff changeset
   598
//------------------------------Opaque1Node------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   599
// A node to prevent unwanted optimizations.  Allows constant folding.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   600
// Stops value-numbering, Ideal calls or Identity functions.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   601
class Opaque1Node : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   602
  virtual uint hash() const ;                  // { return NO_HASH; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   603
  virtual uint cmp( const Node &n ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   604
public:
762
1b26adb5fea1 6715633: when matching a memory node the adr_type should not change
kvn
parents: 594
diff changeset
   605
  Opaque1Node( Compile* C, Node *n ) : Node(0,n) {
1b26adb5fea1 6715633: when matching a memory node the adr_type should not change
kvn
parents: 594
diff changeset
   606
    // Put it on the Macro nodes list to removed during macro nodes expansion.
1b26adb5fea1 6715633: when matching a memory node the adr_type should not change
kvn
parents: 594
diff changeset
   607
    init_flags(Flag_is_macro);
1b26adb5fea1 6715633: when matching a memory node the adr_type should not change
kvn
parents: 594
diff changeset
   608
    C->add_macro_node(this);
1b26adb5fea1 6715633: when matching a memory node the adr_type should not change
kvn
parents: 594
diff changeset
   609
  }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   610
  // Special version for the pre-loop to hold the original loop limit
489c9b5090e2 Initial load
duke
parents:
diff changeset
   611
  // which is consumed by range check elimination.
762
1b26adb5fea1 6715633: when matching a memory node the adr_type should not change
kvn
parents: 594
diff changeset
   612
  Opaque1Node( Compile* C, Node *n, Node* orig_limit ) : Node(0,n,orig_limit) {
1b26adb5fea1 6715633: when matching a memory node the adr_type should not change
kvn
parents: 594
diff changeset
   613
    // Put it on the Macro nodes list to removed during macro nodes expansion.
1b26adb5fea1 6715633: when matching a memory node the adr_type should not change
kvn
parents: 594
diff changeset
   614
    init_flags(Flag_is_macro);
1b26adb5fea1 6715633: when matching a memory node the adr_type should not change
kvn
parents: 594
diff changeset
   615
    C->add_macro_node(this);
1b26adb5fea1 6715633: when matching a memory node the adr_type should not change
kvn
parents: 594
diff changeset
   616
  }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   617
  Node* original_loop_limit() { return req()==3 ? in(2) : NULL; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   618
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   619
  virtual const Type *bottom_type() const { return TypeInt::INT; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   620
  virtual Node *Identity( PhaseTransform *phase );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   621
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   622
489c9b5090e2 Initial load
duke
parents:
diff changeset
   623
//------------------------------Opaque2Node------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   624
// A node to prevent unwanted optimizations.  Allows constant folding.  Stops
489c9b5090e2 Initial load
duke
parents:
diff changeset
   625
// value-numbering, most Ideal calls or Identity functions.  This Node is
489c9b5090e2 Initial load
duke
parents:
diff changeset
   626
// specifically designed to prevent the pre-increment value of a loop trip
489c9b5090e2 Initial load
duke
parents:
diff changeset
   627
// counter from being live out of the bottom of the loop (hence causing the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   628
// pre- and post-increment values both being live and thus requiring an extra
489c9b5090e2 Initial load
duke
parents:
diff changeset
   629
// temp register and an extra move).  If we "accidentally" optimize through
489c9b5090e2 Initial load
duke
parents:
diff changeset
   630
// this kind of a Node, we'll get slightly pessimal, but correct, code.  Thus
489c9b5090e2 Initial load
duke
parents:
diff changeset
   631
// it's OK to be slightly sloppy on optimizations here.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   632
class Opaque2Node : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   633
  virtual uint hash() const ;                  // { return NO_HASH; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   634
  virtual uint cmp( const Node &n ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   635
public:
762
1b26adb5fea1 6715633: when matching a memory node the adr_type should not change
kvn
parents: 594
diff changeset
   636
  Opaque2Node( Compile* C, Node *n ) : Node(0,n) {
1b26adb5fea1 6715633: when matching a memory node the adr_type should not change
kvn
parents: 594
diff changeset
   637
    // Put it on the Macro nodes list to removed during macro nodes expansion.
1b26adb5fea1 6715633: when matching a memory node the adr_type should not change
kvn
parents: 594
diff changeset
   638
    init_flags(Flag_is_macro);
1b26adb5fea1 6715633: when matching a memory node the adr_type should not change
kvn
parents: 594
diff changeset
   639
    C->add_macro_node(this);
1b26adb5fea1 6715633: when matching a memory node the adr_type should not change
kvn
parents: 594
diff changeset
   640
  }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   641
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   642
  virtual const Type *bottom_type() const { return TypeInt::INT; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   643
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   644
489c9b5090e2 Initial load
duke
parents:
diff changeset
   645
//----------------------PartialSubtypeCheckNode--------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   646
// The 2nd slow-half of a subtype check.  Scan the subklass's 2ndary superklass
489c9b5090e2 Initial load
duke
parents:
diff changeset
   647
// array for an instance of the superklass.  Set a hidden internal cache on a
489c9b5090e2 Initial load
duke
parents:
diff changeset
   648
// hit (cache is checked with exposed code in gen_subtype_check()).  Return
489c9b5090e2 Initial load
duke
parents:
diff changeset
   649
// not zero for a miss or zero for a hit.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   650
class PartialSubtypeCheckNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   651
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   652
  PartialSubtypeCheckNode(Node* c, Node* sub, Node* super) : Node(c,sub,super) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   653
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   654
  virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   655
  virtual uint ideal_reg() const { return Op_RegP; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   656
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   657
489c9b5090e2 Initial load
duke
parents:
diff changeset
   658
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   659
class MoveI2FNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   660
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   661
  MoveI2FNode( Node *value ) : Node(0,value) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   662
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   663
  virtual const Type *bottom_type() const { return Type::FLOAT; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   664
  virtual uint ideal_reg() const { return Op_RegF; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   665
  virtual const Type* Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   666
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   667
489c9b5090e2 Initial load
duke
parents:
diff changeset
   668
class MoveL2DNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   669
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   670
  MoveL2DNode( Node *value ) : Node(0,value) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   671
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   672
  virtual const Type *bottom_type() const { return Type::DOUBLE; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   673
  virtual uint ideal_reg() const { return Op_RegD; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   674
  virtual const Type* Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   675
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   676
489c9b5090e2 Initial load
duke
parents:
diff changeset
   677
class MoveF2INode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   678
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   679
  MoveF2INode( Node *value ) : Node(0,value) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   680
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   681
  virtual const Type *bottom_type() const { return TypeInt::INT; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   682
  virtual uint ideal_reg() const { return Op_RegI; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   683
  virtual const Type* Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   684
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   685
489c9b5090e2 Initial load
duke
parents:
diff changeset
   686
class MoveD2LNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   687
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   688
  MoveD2LNode( Node *value ) : Node(0,value) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   689
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   690
  virtual const Type *bottom_type() const { return TypeLong::LONG; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   691
  virtual uint ideal_reg() const { return Op_RegL; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   692
  virtual const Type* Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   693
};
2255
54abdf3e1055 6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents: 781
diff changeset
   694
2862
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   695
//---------- CountBitsNode -----------------------------------------------------
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   696
class CountBitsNode : public Node {
2255
54abdf3e1055 6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents: 781
diff changeset
   697
public:
2862
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   698
  CountBitsNode(Node* in1) : Node(0, in1) {}
2255
54abdf3e1055 6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents: 781
diff changeset
   699
  const Type* bottom_type() const { return TypeInt::INT; }
54abdf3e1055 6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents: 781
diff changeset
   700
  virtual uint ideal_reg() const { return Op_RegI; }
54abdf3e1055 6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents: 781
diff changeset
   701
};
54abdf3e1055 6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents: 781
diff changeset
   702
2862
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   703
//---------- CountLeadingZerosINode --------------------------------------------
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   704
// Count leading zeros (0-bit count starting from MSB) of an integer.
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   705
class CountLeadingZerosINode : public CountBitsNode {
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   706
public:
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   707
  CountLeadingZerosINode(Node* in1) : CountBitsNode(in1) {}
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   708
  virtual int Opcode() const;
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   709
  virtual const Type* Value(PhaseTransform* phase) const;
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   710
};
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   711
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   712
//---------- CountLeadingZerosLNode --------------------------------------------
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   713
// Count leading zeros (0-bit count starting from MSB) of a long.
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   714
class CountLeadingZerosLNode : public CountBitsNode {
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   715
public:
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   716
  CountLeadingZerosLNode(Node* in1) : CountBitsNode(in1) {}
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   717
  virtual int Opcode() const;
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   718
  virtual const Type* Value(PhaseTransform* phase) const;
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   719
};
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   720
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   721
//---------- CountTrailingZerosINode -------------------------------------------
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   722
// Count trailing zeros (0-bit count starting from LSB) of an integer.
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   723
class CountTrailingZerosINode : public CountBitsNode {
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   724
public:
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   725
  CountTrailingZerosINode(Node* in1) : CountBitsNode(in1) {}
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   726
  virtual int Opcode() const;
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   727
  virtual const Type* Value(PhaseTransform* phase) const;
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   728
};
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   729
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   730
//---------- CountTrailingZerosLNode -------------------------------------------
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   731
// Count trailing zeros (0-bit count starting from LSB) of a long.
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   732
class CountTrailingZerosLNode : public CountBitsNode {
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   733
public:
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   734
  CountTrailingZerosLNode(Node* in1) : CountBitsNode(in1) {}
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   735
  virtual int Opcode() const;
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   736
  virtual const Type* Value(PhaseTransform* phase) const;
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   737
};
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   738
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   739
//---------- PopCountINode -----------------------------------------------------
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   740
// Population count (bit count) of an integer.
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   741
class PopCountINode : public CountBitsNode {
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   742
public:
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   743
  PopCountINode(Node* in1) : CountBitsNode(in1) {}
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   744
  virtual int Opcode() const;
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   745
};
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   746
2255
54abdf3e1055 6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents: 781
diff changeset
   747
//---------- PopCountLNode -----------------------------------------------------
54abdf3e1055 6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents: 781
diff changeset
   748
// Population count (bit count) of a long.
2862
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   749
class PopCountLNode : public CountBitsNode {
2255
54abdf3e1055 6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents: 781
diff changeset
   750
public:
2862
fad636edf18f 6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents: 2255
diff changeset
   751
  PopCountLNode(Node* in1) : CountBitsNode(in1) {}
2255
54abdf3e1055 6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents: 781
diff changeset
   752
  virtual int Opcode() const;
54abdf3e1055 6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents: 781
diff changeset
   753
};
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   754
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   755
#endif // SHARE_VM_OPTO_CONNODE_HPP