src/hotspot/share/opto/opaquenode.hpp
changeset 49487 bde392011cd8
parent 47216 71c04702a3d5
child 51333 f6641fcf7b7e
--- a/src/hotspot/share/opto/opaquenode.hpp	Thu Mar 22 16:39:02 2018 -0700
+++ b/src/hotspot/share/opto/opaquenode.hpp	Thu Mar 22 20:21:19 2018 -0700
@@ -35,14 +35,14 @@
   virtual uint hash() const ;                  // { return NO_HASH; }
   virtual uint cmp( const Node &n ) const;
   public:
-  Opaque1Node( Compile* C, Node *n ) : Node(0,n) {
+  Opaque1Node(Compile* C, Node *n) : Node(NULL, n) {
     // Put it on the Macro nodes list to removed during macro nodes expansion.
     init_flags(Flag_is_macro);
     C->add_macro_node(this);
   }
   // Special version for the pre-loop to hold the original loop limit
   // which is consumed by range check elimination.
-  Opaque1Node( Compile* C, Node *n, Node* orig_limit ) : Node(0,n,orig_limit) {
+  Opaque1Node(Compile* C, Node *n, Node* orig_limit) : Node(NULL, n, orig_limit) {
     // Put it on the Macro nodes list to removed during macro nodes expansion.
     init_flags(Flag_is_macro);
     C->add_macro_node(this);
@@ -87,25 +87,23 @@
   bool rtm_opt() const { return (_opt == RTM_OPT); }
 };
 
-// Used by GraphKit::must_be_not_null(): input 1 is a check that we
-// know implicitly is always true or false but the compiler has no way
-// to prove. If during optimizations, that check becomes true or
-// false, the Opaque4 node is replaced by that constant true or
-// false. Input 2 is the constant value we know the test takes. After
-// loop optimizations, we replace input 1 by input 2 so the control
-// that depends on that test can be removed and there's no overhead at
-// runtime.
+// Input 1 is a check that we know implicitly is always true or false
+// but the compiler has no way to prove. If during optimizations, that
+// check becomes true or false, the Opaque4 node is replaced by that
+// constant true or false. Input 2 is the constant value we know the
+// test takes. After loop optimizations, we replace input 1 by input 2
+// so the control that depends on that test can be removed and there's
+// no overhead at runtime. Used for instance by
+// GraphKit::must_be_not_null().
 class Opaque4Node : public Node {
   public:
-  Opaque4Node(Compile* C, Node *tst, Node* final_tst) : Node(0, tst, final_tst) {
-    // Put it on the Macro nodes list to removed during macro nodes expansion.
-    init_flags(Flag_is_macro);
-    C->add_macro_node(this);
+  Opaque4Node(Compile* C, Node *tst, Node* final_tst) : Node(NULL, tst, final_tst) {
+    // Put it on the Opaque4 nodes list to be removed after all optimizations
+    C->add_opaque4_node(this);
   }
   virtual int Opcode() const;
   virtual const Type *bottom_type() const { return TypeInt::BOOL; }
   virtual const Type* Value(PhaseGVN* phase) const;
-  virtual Node* Identity(PhaseGVN* phase);
 };