8139750: [BACKOUT] Elide more final field's write memory barrier with escape analysis result
authorroland
Fri, 16 Oct 2015 15:48:18 +0200
changeset 33196 3d84eedbd82c
parent 33194 1af73c83efae
child 33197 ad4d16358294
8139750: [BACKOUT] Elide more final field's write memory barrier with escape analysis result Reviewed-by: kvn
hotspot/src/share/vm/opto/parse.hpp
hotspot/src/share/vm/opto/parse1.cpp
hotspot/src/share/vm/opto/parse3.cpp
--- a/hotspot/src/share/vm/opto/parse.hpp	Fri Oct 16 11:47:04 2015 +0000
+++ b/hotspot/src/share/vm/opto/parse.hpp	Fri Oct 16 15:48:18 2015 +0200
@@ -343,7 +343,6 @@
   bool          _count_invocations;  // update and test invocation counter
   bool          _method_data_update; // update method data oop
   Node*         _alloc_with_final;   // An allocation node with final field
-  Node*         _alloc_with_stable;  // An allocation node with stable field
 
   // Variables which track Java semantics during bytecode parsing:
 
@@ -399,25 +398,6 @@
     _alloc_with_final = n;
   }
 
-  Node*    alloc_with_stable() const  {
-    if (_alloc_with_stable == NodeSentinel) {
-      return NULL;
-    }
-    return _alloc_with_stable;
-  }
-
-  void set_alloc_with_stable(Node* n)  {
-    if (_alloc_with_stable == NodeSentinel) {
-      // uninitialized status, initialize with current input, can be
-      // null or valid node.
-      _alloc_with_stable = n;
-    } else if (_alloc_with_stable != n) {
-      // _alloc_with_stable isn't equal to n
-      _alloc_with_stable = NULL;
-    }
-    // _alloc_with_stable is equal with n, do nothing
-  }
-
   Block*             block()    const { return _block; }
   ciBytecodeStream&  iter()           { return _iter; }
   Bytecodes::Code    bc()       const { return _iter.cur_bc(); }
--- a/hotspot/src/share/vm/opto/parse1.cpp	Fri Oct 16 11:47:04 2015 +0000
+++ b/hotspot/src/share/vm/opto/parse1.cpp	Fri Oct 16 15:48:18 2015 +0200
@@ -397,7 +397,6 @@
   _wrote_stable = false;
   _wrote_fields = false;
   _alloc_with_final = NULL;
-  _alloc_with_stable = NodeSentinel;
   _entry_bci = InvocationEntryBci;
   _tf = NULL;
   _block = NULL;
@@ -971,7 +970,7 @@
   // those also. If there is a predecessor allocation node, bind the
   // barrier there.
   if (wrote_stable()) {
-    _exits.insert_mem_bar(Op_MemBarRelease, alloc_with_stable());
+    _exits.insert_mem_bar(Op_MemBarRelease, alloc_with_final());
 #ifndef PRODUCT
     if (PrintOpto && (Verbose || WizardMode)) {
       method()->print_name();
--- a/hotspot/src/share/vm/opto/parse3.cpp	Fri Oct 16 11:47:04 2015 +0000
+++ b/hotspot/src/share/vm/opto/parse3.cpp	Fri Oct 16 15:48:18 2015 +0200
@@ -313,19 +313,10 @@
 
     // Preserve allocation ptr to create precedent edge to it in membar
     // generated on exit from constructor.
-    if (AllocateNode::Ideal_allocation(obj, &_gvn) != NULL) {
-      if (field->is_final()) {
-        set_alloc_with_final(obj);
-      }
-      if (field->is_stable()) {
-        set_alloc_with_stable(obj);
-      }
-    } else if (field->is_stable()) {
-      // This stable field doesn't have an allocation, set
-      // alloc_with_stable as NULL: its initial value is NodeSentinel,
-      // if it is not set to NULL here, next set_alloc_with_stable
-      // call might set none-NULL value successfully.
-      set_alloc_with_stable(NULL);
+    if (C->eliminate_boxing() &&
+        adr_type->isa_oopptr() && adr_type->is_oopptr()->is_ptr_to_boxed_value() &&
+        AllocateNode::Ideal_allocation(obj, &_gvn) != NULL) {
+      set_alloc_with_final(obj);
     }
   }
 }