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