Tue, 04 Oct 2011 14:30:04 -0700
6865265: JVM crashes with "missing exception handler" error
Summary: Retry the call to fast_exception_handler_bci_for() after it returned with a pending exception. Don't cache the exception handler pc computed by compute_compiled_exc_handler() if the handler is for another (nested) exception.
Reviewed-by: kamg, kvn
Contributed-by: volker.simonis@gmail.com
duke@435 | 1 | /* |
stefank@2314 | 2 | * Copyright (c) 1997, 2010, 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: |
duke@435 | 39 | ConNode( const Type *t ) : TypeNode(t,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 ) { |
duke@435 | 61 | return new (C, 1) 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) |
duke@435 | 76 | return new (C, 1) ConPNode( TypePtr::NULL_PTR ) ; |
duke@435 | 77 | else |
duke@435 | 78 | return new (C, 1) 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 | |
coleenp@548 | 91 | |
duke@435 | 92 | //------------------------------ConLNode--------------------------------------- |
duke@435 | 93 | // Simple long constants |
duke@435 | 94 | class ConLNode : public ConNode { |
duke@435 | 95 | public: |
duke@435 | 96 | ConLNode( const TypeLong *t ) : ConNode(t) {} |
duke@435 | 97 | virtual int Opcode() const; |
duke@435 | 98 | |
duke@435 | 99 | // Factory method: |
duke@435 | 100 | static ConLNode* make( Compile *C ,jlong con ) { |
duke@435 | 101 | return new (C, 1) ConLNode( TypeLong::make(con) ); |
duke@435 | 102 | } |
duke@435 | 103 | |
duke@435 | 104 | }; |
duke@435 | 105 | |
duke@435 | 106 | //------------------------------ConFNode--------------------------------------- |
duke@435 | 107 | // Simple float constants |
duke@435 | 108 | class ConFNode : public ConNode { |
duke@435 | 109 | public: |
duke@435 | 110 | ConFNode( const TypeF *t ) : ConNode(t) {} |
duke@435 | 111 | virtual int Opcode() const; |
duke@435 | 112 | |
duke@435 | 113 | // Factory method: |
duke@435 | 114 | static ConFNode* make( Compile *C, float con ) { |
duke@435 | 115 | return new (C, 1) ConFNode( TypeF::make(con) ); |
duke@435 | 116 | } |
duke@435 | 117 | |
duke@435 | 118 | }; |
duke@435 | 119 | |
duke@435 | 120 | //------------------------------ConDNode--------------------------------------- |
duke@435 | 121 | // Simple double constants |
duke@435 | 122 | class ConDNode : public ConNode { |
duke@435 | 123 | public: |
duke@435 | 124 | ConDNode( const TypeD *t ) : ConNode(t) {} |
duke@435 | 125 | virtual int Opcode() const; |
duke@435 | 126 | |
duke@435 | 127 | // Factory method: |
duke@435 | 128 | static ConDNode* make( Compile *C, double con ) { |
duke@435 | 129 | return new (C, 1) ConDNode( TypeD::make(con) ); |
duke@435 | 130 | } |
duke@435 | 131 | |
duke@435 | 132 | }; |
duke@435 | 133 | |
duke@435 | 134 | //------------------------------BinaryNode------------------------------------- |
duke@435 | 135 | // Place holder for the 2 conditional inputs to a CMove. CMove needs 4 |
duke@435 | 136 | // inputs: the Bool (for the lt/gt/eq/ne bits), the flags (result of some |
duke@435 | 137 | // compare), and the 2 values to select between. The Matcher requires a |
duke@435 | 138 | // binary tree so we break it down like this: |
duke@435 | 139 | // (CMove (Binary bol cmp) (Binary src1 src2)) |
duke@435 | 140 | class BinaryNode : public Node { |
duke@435 | 141 | public: |
duke@435 | 142 | BinaryNode( Node *n1, Node *n2 ) : Node(0,n1,n2) { } |
duke@435 | 143 | virtual int Opcode() const; |
duke@435 | 144 | virtual uint ideal_reg() const { return 0; } |
duke@435 | 145 | }; |
duke@435 | 146 | |
duke@435 | 147 | //------------------------------CMoveNode-------------------------------------- |
duke@435 | 148 | // Conditional move |
duke@435 | 149 | class CMoveNode : public TypeNode { |
duke@435 | 150 | public: |
duke@435 | 151 | enum { Control, // When is it safe to do this cmove? |
duke@435 | 152 | Condition, // Condition controlling the cmove |
duke@435 | 153 | IfFalse, // Value if condition is false |
duke@435 | 154 | IfTrue }; // Value if condition is true |
duke@435 | 155 | CMoveNode( Node *bol, Node *left, Node *right, const Type *t ) : TypeNode(t,4) |
duke@435 | 156 | { |
duke@435 | 157 | init_class_id(Class_CMove); |
duke@435 | 158 | // all inputs are nullified in Node::Node(int) |
duke@435 | 159 | // init_req(Control,NULL); |
duke@435 | 160 | init_req(Condition,bol); |
duke@435 | 161 | init_req(IfFalse,left); |
duke@435 | 162 | init_req(IfTrue,right); |
duke@435 | 163 | } |
duke@435 | 164 | virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
duke@435 | 165 | virtual const Type *Value( PhaseTransform *phase ) const; |
duke@435 | 166 | virtual Node *Identity( PhaseTransform *phase ); |
duke@435 | 167 | static CMoveNode *make( Compile *C, Node *c, Node *bol, Node *left, Node *right, const Type *t ); |
duke@435 | 168 | // Helper function to spot cmove graph shapes |
duke@435 | 169 | static Node *is_cmove_id( PhaseTransform *phase, Node *cmp, Node *t, Node *f, BoolNode *b ); |
duke@435 | 170 | }; |
duke@435 | 171 | |
duke@435 | 172 | //------------------------------CMoveDNode------------------------------------- |
duke@435 | 173 | class CMoveDNode : public CMoveNode { |
duke@435 | 174 | public: |
duke@435 | 175 | CMoveDNode( Node *bol, Node *left, Node *right, const Type* t) : CMoveNode(bol,left,right,t){} |
duke@435 | 176 | virtual int Opcode() const; |
duke@435 | 177 | virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
duke@435 | 178 | }; |
duke@435 | 179 | |
duke@435 | 180 | //------------------------------CMoveFNode------------------------------------- |
duke@435 | 181 | class CMoveFNode : public CMoveNode { |
duke@435 | 182 | public: |
duke@435 | 183 | CMoveFNode( 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 | //------------------------------CMoveINode------------------------------------- |
duke@435 | 189 | class CMoveINode : public CMoveNode { |
duke@435 | 190 | public: |
duke@435 | 191 | CMoveINode( Node *bol, Node *left, Node *right, const TypeInt *ti ) : CMoveNode(bol,left,right,ti){} |
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 | //------------------------------CMoveLNode------------------------------------- |
duke@435 | 197 | class CMoveLNode : public CMoveNode { |
duke@435 | 198 | public: |
duke@435 | 199 | CMoveLNode(Node *bol, Node *left, Node *right, const TypeLong *tl ) : CMoveNode(bol,left,right,tl){} |
duke@435 | 200 | virtual int Opcode() const; |
duke@435 | 201 | }; |
duke@435 | 202 | |
duke@435 | 203 | //------------------------------CMovePNode------------------------------------- |
duke@435 | 204 | class CMovePNode : public CMoveNode { |
duke@435 | 205 | public: |
duke@435 | 206 | CMovePNode( Node *c, Node *bol, Node *left, Node *right, const TypePtr* t ) : CMoveNode(bol,left,right,t) { init_req(Control,c); } |
duke@435 | 207 | virtual int Opcode() const; |
duke@435 | 208 | }; |
duke@435 | 209 | |
kvn@599 | 210 | //------------------------------CMoveNNode------------------------------------- |
kvn@599 | 211 | class CMoveNNode : public CMoveNode { |
kvn@599 | 212 | public: |
kvn@599 | 213 | CMoveNNode( Node *c, Node *bol, Node *left, Node *right, const Type* t ) : CMoveNode(bol,left,right,t) { init_req(Control,c); } |
kvn@599 | 214 | virtual int Opcode() const; |
kvn@599 | 215 | }; |
kvn@599 | 216 | |
kvn@599 | 217 | //------------------------------ConstraintCastNode----------------------------- |
duke@435 | 218 | // cast to a different range |
duke@435 | 219 | class ConstraintCastNode: public TypeNode { |
duke@435 | 220 | public: |
duke@435 | 221 | ConstraintCastNode (Node *n, const Type *t ): TypeNode(t,2) { |
duke@435 | 222 | init_class_id(Class_ConstraintCast); |
duke@435 | 223 | init_req(1, n); |
duke@435 | 224 | } |
duke@435 | 225 | virtual Node *Identity( PhaseTransform *phase ); |
duke@435 | 226 | virtual const Type *Value( PhaseTransform *phase ) const; |
duke@435 | 227 | virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
duke@435 | 228 | virtual int Opcode() const; |
duke@435 | 229 | virtual uint ideal_reg() const = 0; |
duke@435 | 230 | virtual Node *Ideal_DU_postCCP( PhaseCCP * ); |
duke@435 | 231 | }; |
duke@435 | 232 | |
duke@435 | 233 | //------------------------------CastIINode------------------------------------- |
duke@435 | 234 | // cast integer to integer (different range) |
duke@435 | 235 | class CastIINode: public ConstraintCastNode { |
duke@435 | 236 | public: |
duke@435 | 237 | CastIINode (Node *n, const Type *t ): ConstraintCastNode(n,t) {} |
duke@435 | 238 | virtual int Opcode() const; |
duke@435 | 239 | virtual uint ideal_reg() const { return Op_RegI; } |
duke@435 | 240 | }; |
duke@435 | 241 | |
duke@435 | 242 | //------------------------------CastPPNode------------------------------------- |
duke@435 | 243 | // cast pointer to pointer (different type) |
duke@435 | 244 | class CastPPNode: public ConstraintCastNode { |
duke@435 | 245 | public: |
kvn@561 | 246 | CastPPNode (Node *n, const Type *t ): ConstraintCastNode(n, t) {} |
duke@435 | 247 | virtual int Opcode() const; |
duke@435 | 248 | virtual uint ideal_reg() const { return Op_RegP; } |
duke@435 | 249 | virtual Node *Ideal_DU_postCCP( PhaseCCP * ); |
duke@435 | 250 | }; |
duke@435 | 251 | |
duke@435 | 252 | //------------------------------CheckCastPPNode-------------------------------- |
duke@435 | 253 | // for _checkcast, cast pointer to pointer (different type), without JOIN, |
duke@435 | 254 | class CheckCastPPNode: public TypeNode { |
duke@435 | 255 | public: |
duke@435 | 256 | CheckCastPPNode( Node *c, Node *n, const Type *t ) : TypeNode(t,2) { |
duke@435 | 257 | init_class_id(Class_CheckCastPP); |
duke@435 | 258 | init_req(0, c); |
duke@435 | 259 | init_req(1, n); |
duke@435 | 260 | } |
kvn@561 | 261 | |
duke@435 | 262 | virtual Node *Identity( PhaseTransform *phase ); |
duke@435 | 263 | virtual const Type *Value( PhaseTransform *phase ) const; |
duke@435 | 264 | virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
duke@435 | 265 | virtual int Opcode() const; |
duke@435 | 266 | virtual uint ideal_reg() const { return Op_RegP; } |
duke@435 | 267 | // No longer remove CheckCast after CCP as it gives me a place to hang |
duke@435 | 268 | // the proper address type - which is required to compute anti-deps. |
duke@435 | 269 | //virtual Node *Ideal_DU_postCCP( PhaseCCP * ); |
duke@435 | 270 | }; |
duke@435 | 271 | |
coleenp@548 | 272 | |
coleenp@548 | 273 | //------------------------------EncodeP-------------------------------- |
coleenp@548 | 274 | // Encodes an oop pointers into its compressed form |
coleenp@548 | 275 | // Takes an extra argument which is the real heap base as a long which |
coleenp@548 | 276 | // may be useful for code generation in the backend. |
coleenp@548 | 277 | class EncodePNode : public TypeNode { |
coleenp@548 | 278 | public: |
coleenp@548 | 279 | EncodePNode(Node* value, const Type* type): |
coleenp@548 | 280 | TypeNode(type, 2) { |
kvn@603 | 281 | init_class_id(Class_EncodeP); |
coleenp@548 | 282 | init_req(0, NULL); |
coleenp@548 | 283 | init_req(1, value); |
coleenp@548 | 284 | } |
coleenp@548 | 285 | virtual int Opcode() const; |
coleenp@548 | 286 | virtual Node *Identity( PhaseTransform *phase ); |
kvn@559 | 287 | virtual const Type *Value( PhaseTransform *phase ) const; |
coleenp@548 | 288 | virtual uint ideal_reg() const { return Op_RegN; } |
coleenp@548 | 289 | |
kvn@598 | 290 | virtual Node *Ideal_DU_postCCP( PhaseCCP *ccp ); |
coleenp@548 | 291 | }; |
coleenp@548 | 292 | |
coleenp@548 | 293 | //------------------------------DecodeN-------------------------------- |
coleenp@548 | 294 | // Converts a narrow oop into a real oop ptr. |
coleenp@548 | 295 | // Takes an extra argument which is the real heap base as a long which |
coleenp@548 | 296 | // may be useful for code generation in the backend. |
coleenp@548 | 297 | class DecodeNNode : public TypeNode { |
coleenp@548 | 298 | public: |
coleenp@548 | 299 | DecodeNNode(Node* value, const Type* type): |
coleenp@548 | 300 | TypeNode(type, 2) { |
kvn@603 | 301 | init_class_id(Class_DecodeN); |
coleenp@548 | 302 | init_req(0, NULL); |
coleenp@548 | 303 | init_req(1, value); |
coleenp@548 | 304 | } |
coleenp@548 | 305 | virtual int Opcode() const; |
coleenp@548 | 306 | virtual Node *Identity( PhaseTransform *phase ); |
kvn@559 | 307 | virtual const Type *Value( PhaseTransform *phase ) const; |
coleenp@548 | 308 | virtual uint ideal_reg() const { return Op_RegP; } |
coleenp@548 | 309 | }; |
coleenp@548 | 310 | |
duke@435 | 311 | //------------------------------Conv2BNode------------------------------------- |
duke@435 | 312 | // Convert int/pointer to a Boolean. Map zero to zero, all else to 1. |
duke@435 | 313 | class Conv2BNode : public Node { |
duke@435 | 314 | public: |
duke@435 | 315 | Conv2BNode( Node *i ) : Node(0,i) {} |
duke@435 | 316 | virtual int Opcode() const; |
duke@435 | 317 | virtual const Type *bottom_type() const { return TypeInt::BOOL; } |
duke@435 | 318 | virtual Node *Identity( PhaseTransform *phase ); |
duke@435 | 319 | virtual const Type *Value( PhaseTransform *phase ) const; |
duke@435 | 320 | virtual uint ideal_reg() const { return Op_RegI; } |
duke@435 | 321 | }; |
duke@435 | 322 | |
duke@435 | 323 | // The conversions operations are all Alpha sorted. Please keep it that way! |
duke@435 | 324 | //------------------------------ConvD2FNode------------------------------------ |
duke@435 | 325 | // Convert double to float |
duke@435 | 326 | class ConvD2FNode : public Node { |
duke@435 | 327 | public: |
duke@435 | 328 | ConvD2FNode( Node *in1 ) : Node(0,in1) {} |
duke@435 | 329 | virtual int Opcode() const; |
duke@435 | 330 | virtual const Type *bottom_type() const { return Type::FLOAT; } |
duke@435 | 331 | virtual const Type *Value( PhaseTransform *phase ) const; |
duke@435 | 332 | virtual Node *Identity( PhaseTransform *phase ); |
duke@435 | 333 | virtual uint ideal_reg() const { return Op_RegF; } |
duke@435 | 334 | }; |
duke@435 | 335 | |
duke@435 | 336 | //------------------------------ConvD2INode------------------------------------ |
duke@435 | 337 | // Convert Double to Integer |
duke@435 | 338 | class ConvD2INode : public Node { |
duke@435 | 339 | public: |
duke@435 | 340 | ConvD2INode( Node *in1 ) : Node(0,in1) {} |
duke@435 | 341 | virtual int Opcode() const; |
duke@435 | 342 | virtual const Type *bottom_type() const { return TypeInt::INT; } |
duke@435 | 343 | virtual const Type *Value( PhaseTransform *phase ) const; |
duke@435 | 344 | virtual Node *Identity( PhaseTransform *phase ); |
duke@435 | 345 | virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
duke@435 | 346 | virtual uint ideal_reg() const { return Op_RegI; } |
duke@435 | 347 | }; |
duke@435 | 348 | |
duke@435 | 349 | //------------------------------ConvD2LNode------------------------------------ |
duke@435 | 350 | // Convert Double to Long |
duke@435 | 351 | class ConvD2LNode : public Node { |
duke@435 | 352 | public: |
duke@435 | 353 | ConvD2LNode( Node *dbl ) : Node(0,dbl) {} |
duke@435 | 354 | virtual int Opcode() const; |
duke@435 | 355 | virtual const Type *bottom_type() const { return TypeLong::LONG; } |
duke@435 | 356 | virtual const Type *Value( PhaseTransform *phase ) const; |
duke@435 | 357 | virtual Node *Identity( PhaseTransform *phase ); |
duke@435 | 358 | virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
duke@435 | 359 | virtual uint ideal_reg() const { return Op_RegL; } |
duke@435 | 360 | }; |
duke@435 | 361 | |
duke@435 | 362 | //------------------------------ConvF2DNode------------------------------------ |
duke@435 | 363 | // Convert Float to a Double. |
duke@435 | 364 | class ConvF2DNode : public Node { |
duke@435 | 365 | public: |
duke@435 | 366 | ConvF2DNode( Node *in1 ) : Node(0,in1) {} |
duke@435 | 367 | virtual int Opcode() const; |
duke@435 | 368 | virtual const Type *bottom_type() const { return Type::DOUBLE; } |
duke@435 | 369 | virtual const Type *Value( PhaseTransform *phase ) const; |
duke@435 | 370 | virtual uint ideal_reg() const { return Op_RegD; } |
duke@435 | 371 | }; |
duke@435 | 372 | |
duke@435 | 373 | //------------------------------ConvF2INode------------------------------------ |
duke@435 | 374 | // Convert float to integer |
duke@435 | 375 | class ConvF2INode : public Node { |
duke@435 | 376 | public: |
duke@435 | 377 | ConvF2INode( Node *in1 ) : Node(0,in1) {} |
duke@435 | 378 | virtual int Opcode() const; |
duke@435 | 379 | virtual const Type *bottom_type() const { return TypeInt::INT; } |
duke@435 | 380 | virtual const Type *Value( PhaseTransform *phase ) const; |
duke@435 | 381 | virtual Node *Identity( PhaseTransform *phase ); |
duke@435 | 382 | virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
duke@435 | 383 | virtual uint ideal_reg() const { return Op_RegI; } |
duke@435 | 384 | }; |
duke@435 | 385 | |
duke@435 | 386 | //------------------------------ConvF2LNode------------------------------------ |
duke@435 | 387 | // Convert float to long |
duke@435 | 388 | class ConvF2LNode : public Node { |
duke@435 | 389 | public: |
duke@435 | 390 | ConvF2LNode( Node *in1 ) : Node(0,in1) {} |
duke@435 | 391 | virtual int Opcode() const; |
duke@435 | 392 | virtual const Type *bottom_type() const { return TypeLong::LONG; } |
duke@435 | 393 | virtual const Type *Value( PhaseTransform *phase ) const; |
duke@435 | 394 | virtual Node *Identity( PhaseTransform *phase ); |
duke@435 | 395 | virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
duke@435 | 396 | virtual uint ideal_reg() const { return Op_RegL; } |
duke@435 | 397 | }; |
duke@435 | 398 | |
duke@435 | 399 | //------------------------------ConvI2DNode------------------------------------ |
duke@435 | 400 | // Convert Integer to Double |
duke@435 | 401 | class ConvI2DNode : public Node { |
duke@435 | 402 | public: |
duke@435 | 403 | ConvI2DNode( Node *in1 ) : Node(0,in1) {} |
duke@435 | 404 | virtual int Opcode() const; |
duke@435 | 405 | virtual const Type *bottom_type() const { return Type::DOUBLE; } |
duke@435 | 406 | virtual const Type *Value( PhaseTransform *phase ) const; |
duke@435 | 407 | virtual uint ideal_reg() const { return Op_RegD; } |
duke@435 | 408 | }; |
duke@435 | 409 | |
duke@435 | 410 | //------------------------------ConvI2FNode------------------------------------ |
duke@435 | 411 | // Convert Integer to Float |
duke@435 | 412 | class ConvI2FNode : public Node { |
duke@435 | 413 | public: |
duke@435 | 414 | ConvI2FNode( Node *in1 ) : Node(0,in1) {} |
duke@435 | 415 | virtual int Opcode() const; |
duke@435 | 416 | virtual const Type *bottom_type() const { return Type::FLOAT; } |
duke@435 | 417 | virtual const Type *Value( PhaseTransform *phase ) const; |
duke@435 | 418 | virtual Node *Identity( PhaseTransform *phase ); |
duke@435 | 419 | virtual uint ideal_reg() const { return Op_RegF; } |
duke@435 | 420 | }; |
duke@435 | 421 | |
duke@435 | 422 | //------------------------------ConvI2LNode------------------------------------ |
duke@435 | 423 | // Convert integer to long |
duke@435 | 424 | class ConvI2LNode : public TypeNode { |
duke@435 | 425 | public: |
duke@435 | 426 | ConvI2LNode(Node *in1, const TypeLong* t = TypeLong::INT) |
duke@435 | 427 | : TypeNode(t, 2) |
duke@435 | 428 | { init_req(1, in1); } |
duke@435 | 429 | virtual int Opcode() const; |
duke@435 | 430 | virtual const Type *Value( PhaseTransform *phase ) const; |
duke@435 | 431 | virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
duke@435 | 432 | virtual uint ideal_reg() const { return Op_RegL; } |
duke@435 | 433 | }; |
duke@435 | 434 | |
duke@435 | 435 | //------------------------------ConvL2DNode------------------------------------ |
duke@435 | 436 | // Convert Long to Double |
duke@435 | 437 | class ConvL2DNode : public Node { |
duke@435 | 438 | public: |
duke@435 | 439 | ConvL2DNode( Node *in1 ) : Node(0,in1) {} |
duke@435 | 440 | virtual int Opcode() const; |
duke@435 | 441 | virtual const Type *bottom_type() const { return Type::DOUBLE; } |
duke@435 | 442 | virtual const Type *Value( PhaseTransform *phase ) const; |
duke@435 | 443 | virtual uint ideal_reg() const { return Op_RegD; } |
duke@435 | 444 | }; |
duke@435 | 445 | |
duke@435 | 446 | //------------------------------ConvL2FNode------------------------------------ |
duke@435 | 447 | // Convert Long to Float |
duke@435 | 448 | class ConvL2FNode : public Node { |
duke@435 | 449 | public: |
duke@435 | 450 | ConvL2FNode( Node *in1 ) : Node(0,in1) {} |
duke@435 | 451 | virtual int Opcode() const; |
duke@435 | 452 | virtual const Type *bottom_type() const { return Type::FLOAT; } |
duke@435 | 453 | virtual const Type *Value( PhaseTransform *phase ) const; |
duke@435 | 454 | virtual uint ideal_reg() const { return Op_RegF; } |
duke@435 | 455 | }; |
duke@435 | 456 | |
duke@435 | 457 | //------------------------------ConvL2INode------------------------------------ |
duke@435 | 458 | // Convert long to integer |
duke@435 | 459 | class ConvL2INode : public Node { |
duke@435 | 460 | public: |
duke@435 | 461 | ConvL2INode( 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 Node *Identity( PhaseTransform *phase ); |
duke@435 | 465 | virtual const Type *Value( PhaseTransform *phase ) const; |
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 | //------------------------------CastX2PNode------------------------------------- |
duke@435 | 471 | // convert a machine-pointer-sized integer to a raw pointer |
duke@435 | 472 | class CastX2PNode : public Node { |
duke@435 | 473 | public: |
duke@435 | 474 | CastX2PNode( Node *n ) : Node(NULL, n) {} |
duke@435 | 475 | virtual int Opcode() const; |
duke@435 | 476 | virtual const Type *Value( PhaseTransform *phase ) const; |
duke@435 | 477 | virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
duke@435 | 478 | virtual Node *Identity( PhaseTransform *phase ); |
duke@435 | 479 | virtual uint ideal_reg() const { return Op_RegP; } |
duke@435 | 480 | virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM; } |
duke@435 | 481 | }; |
duke@435 | 482 | |
duke@435 | 483 | //------------------------------CastP2XNode------------------------------------- |
duke@435 | 484 | // Used in both 32-bit and 64-bit land. |
duke@435 | 485 | // Used for card-marks and unsafe pointer math. |
duke@435 | 486 | class CastP2XNode : public Node { |
duke@435 | 487 | public: |
duke@435 | 488 | CastP2XNode( Node *ctrl, Node *n ) : Node(ctrl, n) {} |
duke@435 | 489 | virtual int Opcode() const; |
duke@435 | 490 | virtual const Type *Value( PhaseTransform *phase ) const; |
duke@435 | 491 | virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
duke@435 | 492 | virtual Node *Identity( PhaseTransform *phase ); |
duke@435 | 493 | virtual uint ideal_reg() const { return Op_RegX; } |
duke@435 | 494 | virtual const Type *bottom_type() const { return TypeX_X; } |
duke@435 | 495 | // Return false to keep node from moving away from an associated card mark. |
duke@435 | 496 | virtual bool depends_only_on_test() const { return false; } |
duke@435 | 497 | }; |
duke@435 | 498 | |
duke@435 | 499 | //------------------------------ThreadLocalNode-------------------------------- |
duke@435 | 500 | // Ideal Node which returns the base of ThreadLocalStorage. |
duke@435 | 501 | class ThreadLocalNode : public Node { |
duke@435 | 502 | public: |
duke@435 | 503 | ThreadLocalNode( ) : Node((Node*)Compile::current()->root()) {} |
duke@435 | 504 | virtual int Opcode() const; |
duke@435 | 505 | virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM;} |
duke@435 | 506 | virtual uint ideal_reg() const { return Op_RegP; } |
duke@435 | 507 | }; |
duke@435 | 508 | |
duke@435 | 509 | //------------------------------LoadReturnPCNode------------------------------- |
duke@435 | 510 | class LoadReturnPCNode: public Node { |
duke@435 | 511 | public: |
duke@435 | 512 | LoadReturnPCNode(Node *c) : Node(c) { } |
duke@435 | 513 | virtual int Opcode() const; |
duke@435 | 514 | virtual uint ideal_reg() const { return Op_RegP; } |
duke@435 | 515 | }; |
duke@435 | 516 | |
duke@435 | 517 | |
duke@435 | 518 | //-----------------------------RoundFloatNode---------------------------------- |
duke@435 | 519 | class RoundFloatNode: public Node { |
duke@435 | 520 | public: |
duke@435 | 521 | RoundFloatNode(Node* c, Node *in1): Node(c, in1) {} |
duke@435 | 522 | virtual int Opcode() const; |
duke@435 | 523 | virtual const Type *bottom_type() const { return Type::FLOAT; } |
duke@435 | 524 | virtual uint ideal_reg() const { return Op_RegF; } |
duke@435 | 525 | virtual Node *Identity( PhaseTransform *phase ); |
duke@435 | 526 | virtual const Type *Value( PhaseTransform *phase ) const; |
duke@435 | 527 | }; |
duke@435 | 528 | |
duke@435 | 529 | |
duke@435 | 530 | //-----------------------------RoundDoubleNode--------------------------------- |
duke@435 | 531 | class RoundDoubleNode: public Node { |
duke@435 | 532 | public: |
duke@435 | 533 | RoundDoubleNode(Node* c, Node *in1): Node(c, in1) {} |
duke@435 | 534 | virtual int Opcode() const; |
duke@435 | 535 | virtual const Type *bottom_type() const { return Type::DOUBLE; } |
duke@435 | 536 | virtual uint ideal_reg() const { return Op_RegD; } |
duke@435 | 537 | virtual Node *Identity( PhaseTransform *phase ); |
duke@435 | 538 | virtual const Type *Value( PhaseTransform *phase ) const; |
duke@435 | 539 | }; |
duke@435 | 540 | |
duke@435 | 541 | //------------------------------Opaque1Node------------------------------------ |
duke@435 | 542 | // A node to prevent unwanted optimizations. Allows constant folding. |
duke@435 | 543 | // Stops value-numbering, Ideal calls or Identity functions. |
duke@435 | 544 | class Opaque1Node : public Node { |
duke@435 | 545 | virtual uint hash() const ; // { return NO_HASH; } |
duke@435 | 546 | virtual uint cmp( const Node &n ) const; |
duke@435 | 547 | public: |
kvn@651 | 548 | Opaque1Node( Compile* C, Node *n ) : Node(0,n) { |
kvn@651 | 549 | // Put it on the Macro nodes list to removed during macro nodes expansion. |
kvn@651 | 550 | init_flags(Flag_is_macro); |
kvn@651 | 551 | C->add_macro_node(this); |
kvn@651 | 552 | } |
duke@435 | 553 | // Special version for the pre-loop to hold the original loop limit |
duke@435 | 554 | // which is consumed by range check elimination. |
kvn@651 | 555 | Opaque1Node( Compile* C, Node *n, Node* orig_limit ) : Node(0,n,orig_limit) { |
kvn@651 | 556 | // Put it on the Macro nodes list to removed during macro nodes expansion. |
kvn@651 | 557 | init_flags(Flag_is_macro); |
kvn@651 | 558 | C->add_macro_node(this); |
kvn@651 | 559 | } |
duke@435 | 560 | Node* original_loop_limit() { return req()==3 ? in(2) : NULL; } |
duke@435 | 561 | virtual int Opcode() const; |
duke@435 | 562 | virtual const Type *bottom_type() const { return TypeInt::INT; } |
duke@435 | 563 | virtual Node *Identity( PhaseTransform *phase ); |
duke@435 | 564 | }; |
duke@435 | 565 | |
duke@435 | 566 | //------------------------------Opaque2Node------------------------------------ |
duke@435 | 567 | // A node to prevent unwanted optimizations. Allows constant folding. Stops |
duke@435 | 568 | // value-numbering, most Ideal calls or Identity functions. This Node is |
duke@435 | 569 | // specifically designed to prevent the pre-increment value of a loop trip |
duke@435 | 570 | // counter from being live out of the bottom of the loop (hence causing the |
duke@435 | 571 | // pre- and post-increment values both being live and thus requiring an extra |
duke@435 | 572 | // temp register and an extra move). If we "accidentally" optimize through |
duke@435 | 573 | // this kind of a Node, we'll get slightly pessimal, but correct, code. Thus |
duke@435 | 574 | // it's OK to be slightly sloppy on optimizations here. |
duke@435 | 575 | class Opaque2Node : public Node { |
duke@435 | 576 | virtual uint hash() const ; // { return NO_HASH; } |
duke@435 | 577 | virtual uint cmp( const Node &n ) const; |
duke@435 | 578 | public: |
kvn@651 | 579 | Opaque2Node( Compile* C, Node *n ) : Node(0,n) { |
kvn@651 | 580 | // Put it on the Macro nodes list to removed during macro nodes expansion. |
kvn@651 | 581 | init_flags(Flag_is_macro); |
kvn@651 | 582 | C->add_macro_node(this); |
kvn@651 | 583 | } |
duke@435 | 584 | virtual int Opcode() const; |
duke@435 | 585 | virtual const Type *bottom_type() const { return TypeInt::INT; } |
duke@435 | 586 | }; |
duke@435 | 587 | |
duke@435 | 588 | //----------------------PartialSubtypeCheckNode-------------------------------- |
duke@435 | 589 | // The 2nd slow-half of a subtype check. Scan the subklass's 2ndary superklass |
duke@435 | 590 | // array for an instance of the superklass. Set a hidden internal cache on a |
duke@435 | 591 | // hit (cache is checked with exposed code in gen_subtype_check()). Return |
duke@435 | 592 | // not zero for a miss or zero for a hit. |
duke@435 | 593 | class PartialSubtypeCheckNode : public Node { |
duke@435 | 594 | public: |
duke@435 | 595 | PartialSubtypeCheckNode(Node* c, Node* sub, Node* super) : Node(c,sub,super) {} |
duke@435 | 596 | virtual int Opcode() const; |
duke@435 | 597 | virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM; } |
duke@435 | 598 | virtual uint ideal_reg() const { return Op_RegP; } |
duke@435 | 599 | }; |
duke@435 | 600 | |
duke@435 | 601 | // |
duke@435 | 602 | class MoveI2FNode : public Node { |
duke@435 | 603 | public: |
duke@435 | 604 | MoveI2FNode( Node *value ) : Node(0,value) {} |
duke@435 | 605 | virtual int Opcode() const; |
duke@435 | 606 | virtual const Type *bottom_type() const { return Type::FLOAT; } |
duke@435 | 607 | virtual uint ideal_reg() const { return Op_RegF; } |
duke@435 | 608 | virtual const Type* Value( PhaseTransform *phase ) const; |
duke@435 | 609 | }; |
duke@435 | 610 | |
duke@435 | 611 | class MoveL2DNode : public Node { |
duke@435 | 612 | public: |
duke@435 | 613 | MoveL2DNode( Node *value ) : Node(0,value) {} |
duke@435 | 614 | virtual int Opcode() const; |
duke@435 | 615 | virtual const Type *bottom_type() const { return Type::DOUBLE; } |
duke@435 | 616 | virtual uint ideal_reg() const { return Op_RegD; } |
duke@435 | 617 | virtual const Type* Value( PhaseTransform *phase ) const; |
duke@435 | 618 | }; |
duke@435 | 619 | |
duke@435 | 620 | class MoveF2INode : public Node { |
duke@435 | 621 | public: |
duke@435 | 622 | MoveF2INode( Node *value ) : Node(0,value) {} |
duke@435 | 623 | virtual int Opcode() const; |
duke@435 | 624 | virtual const Type *bottom_type() const { return TypeInt::INT; } |
duke@435 | 625 | virtual uint ideal_reg() const { return Op_RegI; } |
duke@435 | 626 | virtual const Type* Value( PhaseTransform *phase ) const; |
duke@435 | 627 | }; |
duke@435 | 628 | |
duke@435 | 629 | class MoveD2LNode : public Node { |
duke@435 | 630 | public: |
duke@435 | 631 | MoveD2LNode( Node *value ) : Node(0,value) {} |
duke@435 | 632 | virtual int Opcode() const; |
duke@435 | 633 | virtual const Type *bottom_type() const { return TypeLong::LONG; } |
duke@435 | 634 | virtual uint ideal_reg() const { return Op_RegL; } |
duke@435 | 635 | virtual const Type* Value( PhaseTransform *phase ) const; |
duke@435 | 636 | }; |
twisti@1078 | 637 | |
twisti@1210 | 638 | //---------- CountBitsNode ----------------------------------------------------- |
twisti@1210 | 639 | class CountBitsNode : public Node { |
twisti@1078 | 640 | public: |
twisti@1210 | 641 | CountBitsNode(Node* in1) : Node(0, in1) {} |
twisti@1078 | 642 | const Type* bottom_type() const { return TypeInt::INT; } |
twisti@1078 | 643 | virtual uint ideal_reg() const { return Op_RegI; } |
twisti@1078 | 644 | }; |
twisti@1078 | 645 | |
twisti@1210 | 646 | //---------- CountLeadingZerosINode -------------------------------------------- |
twisti@1210 | 647 | // Count leading zeros (0-bit count starting from MSB) of an integer. |
twisti@1210 | 648 | class CountLeadingZerosINode : public CountBitsNode { |
twisti@1210 | 649 | public: |
twisti@1210 | 650 | CountLeadingZerosINode(Node* in1) : CountBitsNode(in1) {} |
twisti@1210 | 651 | virtual int Opcode() const; |
twisti@1210 | 652 | virtual const Type* Value(PhaseTransform* phase) const; |
twisti@1210 | 653 | }; |
twisti@1210 | 654 | |
twisti@1210 | 655 | //---------- CountLeadingZerosLNode -------------------------------------------- |
twisti@1210 | 656 | // Count leading zeros (0-bit count starting from MSB) of a long. |
twisti@1210 | 657 | class CountLeadingZerosLNode : public CountBitsNode { |
twisti@1210 | 658 | public: |
twisti@1210 | 659 | CountLeadingZerosLNode(Node* in1) : CountBitsNode(in1) {} |
twisti@1210 | 660 | virtual int Opcode() const; |
twisti@1210 | 661 | virtual const Type* Value(PhaseTransform* phase) const; |
twisti@1210 | 662 | }; |
twisti@1210 | 663 | |
twisti@1210 | 664 | //---------- CountTrailingZerosINode ------------------------------------------- |
twisti@1210 | 665 | // Count trailing zeros (0-bit count starting from LSB) of an integer. |
twisti@1210 | 666 | class CountTrailingZerosINode : public CountBitsNode { |
twisti@1210 | 667 | public: |
twisti@1210 | 668 | CountTrailingZerosINode(Node* in1) : CountBitsNode(in1) {} |
twisti@1210 | 669 | virtual int Opcode() const; |
twisti@1210 | 670 | virtual const Type* Value(PhaseTransform* phase) const; |
twisti@1210 | 671 | }; |
twisti@1210 | 672 | |
twisti@1210 | 673 | //---------- CountTrailingZerosLNode ------------------------------------------- |
twisti@1210 | 674 | // Count trailing zeros (0-bit count starting from LSB) of a long. |
twisti@1210 | 675 | class CountTrailingZerosLNode : public CountBitsNode { |
twisti@1210 | 676 | public: |
twisti@1210 | 677 | CountTrailingZerosLNode(Node* in1) : CountBitsNode(in1) {} |
twisti@1210 | 678 | virtual int Opcode() const; |
twisti@1210 | 679 | virtual const Type* Value(PhaseTransform* phase) const; |
twisti@1210 | 680 | }; |
twisti@1210 | 681 | |
twisti@1210 | 682 | //---------- PopCountINode ----------------------------------------------------- |
twisti@1210 | 683 | // Population count (bit count) of an integer. |
twisti@1210 | 684 | class PopCountINode : public CountBitsNode { |
twisti@1210 | 685 | public: |
twisti@1210 | 686 | PopCountINode(Node* in1) : CountBitsNode(in1) {} |
twisti@1210 | 687 | virtual int Opcode() const; |
twisti@1210 | 688 | }; |
twisti@1210 | 689 | |
twisti@1078 | 690 | //---------- PopCountLNode ----------------------------------------------------- |
twisti@1078 | 691 | // Population count (bit count) of a long. |
twisti@1210 | 692 | class PopCountLNode : public CountBitsNode { |
twisti@1078 | 693 | public: |
twisti@1210 | 694 | PopCountLNode(Node* in1) : CountBitsNode(in1) {} |
twisti@1078 | 695 | virtual int Opcode() const; |
twisti@1078 | 696 | }; |
stefank@2314 | 697 | |
stefank@2314 | 698 | #endif // SHARE_VM_OPTO_CONNODE_HPP |