src/share/vm/opto/opaquenode.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/opto

src/share/vm/opto/opaquenode.hpp

Print this page
rev 7345 : 8054478: C2: Incorrectly compiled char[] array access crashes JVM
Summary: propagate node replacements along control flow edges to callers
Reviewed-by: dead backbranch in main loop results in erroneous array access


  33 // Stops value-numbering, Ideal calls or Identity functions.
  34 class Opaque1Node : public Node {
  35   virtual uint hash() const ;                  // { return NO_HASH; }
  36   virtual uint cmp( const Node &n ) const;
  37   public:
  38   Opaque1Node( Compile* C, Node *n ) : Node(0,n) {
  39     // Put it on the Macro nodes list to removed during macro nodes expansion.
  40     init_flags(Flag_is_macro);
  41     C->add_macro_node(this);
  42   }
  43   // Special version for the pre-loop to hold the original loop limit
  44   // which is consumed by range check elimination.
  45   Opaque1Node( Compile* C, Node *n, Node* orig_limit ) : Node(0,n,orig_limit) {
  46     // Put it on the Macro nodes list to removed during macro nodes expansion.
  47     init_flags(Flag_is_macro);
  48     C->add_macro_node(this);
  49   }
  50   Node* original_loop_limit() { return req()==3 ? in(2) : NULL; }
  51   virtual int Opcode() const;
  52   virtual const Type *bottom_type() const { return TypeInt::INT; }
  53   virtual Node *Identity( PhaseTransform *phase );

  54 };
  55 
  56 //------------------------------Opaque2Node------------------------------------
  57 // A node to prevent unwanted optimizations.  Allows constant folding.  Stops
  58 // value-numbering, most Ideal calls or Identity functions.  This Node is
  59 // specifically designed to prevent the pre-increment value of a loop trip
  60 // counter from being live out of the bottom of the loop (hence causing the
  61 // pre- and post-increment values both being live and thus requiring an extra
  62 // temp register and an extra move).  If we "accidentally" optimize through
  63 // this kind of a Node, we'll get slightly pessimal, but correct, code.  Thus
  64 // it's OK to be slightly sloppy on optimizations here.
  65 class Opaque2Node : public Node {
  66   virtual uint hash() const ;                  // { return NO_HASH; }
  67   virtual uint cmp( const Node &n ) const;
  68   public:
  69   Opaque2Node( Compile* C, Node *n ) : Node(0,n) {
  70     // Put it on the Macro nodes list to removed during macro nodes expansion.
  71     init_flags(Flag_is_macro);
  72     C->add_macro_node(this);
  73   }


  33 // Stops value-numbering, Ideal calls or Identity functions.
  34 class Opaque1Node : public Node {
  35   virtual uint hash() const ;                  // { return NO_HASH; }
  36   virtual uint cmp( const Node &n ) const;
  37   public:
  38   Opaque1Node( Compile* C, Node *n ) : Node(0,n) {
  39     // Put it on the Macro nodes list to removed during macro nodes expansion.
  40     init_flags(Flag_is_macro);
  41     C->add_macro_node(this);
  42   }
  43   // Special version for the pre-loop to hold the original loop limit
  44   // which is consumed by range check elimination.
  45   Opaque1Node( Compile* C, Node *n, Node* orig_limit ) : Node(0,n,orig_limit) {
  46     // Put it on the Macro nodes list to removed during macro nodes expansion.
  47     init_flags(Flag_is_macro);
  48     C->add_macro_node(this);
  49   }
  50   Node* original_loop_limit() { return req()==3 ? in(2) : NULL; }
  51   virtual int Opcode() const;
  52   virtual const Type *bottom_type() const { return TypeInt::INT; }
  53   virtual Node *Identity(PhaseTransform *phase);
  54   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
  55 };
  56 
  57 //------------------------------Opaque2Node------------------------------------
  58 // A node to prevent unwanted optimizations.  Allows constant folding.  Stops
  59 // value-numbering, most Ideal calls or Identity functions.  This Node is
  60 // specifically designed to prevent the pre-increment value of a loop trip
  61 // counter from being live out of the bottom of the loop (hence causing the
  62 // pre- and post-increment values both being live and thus requiring an extra
  63 // temp register and an extra move).  If we "accidentally" optimize through
  64 // this kind of a Node, we'll get slightly pessimal, but correct, code.  Thus
  65 // it's OK to be slightly sloppy on optimizations here.
  66 class Opaque2Node : public Node {
  67   virtual uint hash() const ;                  // { return NO_HASH; }
  68   virtual uint cmp( const Node &n ) const;
  69   public:
  70   Opaque2Node( Compile* C, Node *n ) : Node(0,n) {
  71     // Put it on the Macro nodes list to removed during macro nodes expansion.
  72     init_flags(Flag_is_macro);
  73     C->add_macro_node(this);
  74   }
src/share/vm/opto/opaquenode.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File