< prev index next >

src/hotspot/share/gc/shared/c2/barrierSetC2.hpp

Print this page
rev 52491 : 8213746: GC/C2 abstraction for C2 matcher


  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_GC_SHARED_C2_BARRIERSETC2_HPP
  26 #define SHARE_GC_SHARED_C2_BARRIERSETC2_HPP
  27 
  28 #include "memory/allocation.hpp"
  29 #include "oops/accessDecorators.hpp"
  30 #include "opto/loopnode.hpp"

  31 #include "opto/memnode.hpp"
  32 #include "utilities/globalDefinitions.hpp"
  33 
  34 // This means the access is mismatched. This means the value of an access
  35 // is not equivalent to the value pointed to by the address.
  36 const DecoratorSet C2_MISMATCHED             = DECORATOR_LAST << 1;
  37 // The access may not be aligned to its natural size.
  38 const DecoratorSet C2_UNALIGNED              = DECORATOR_LAST << 2;
  39 // The atomic cmpxchg is weak, meaning that spurious false negatives are allowed,
  40 // but never false positives.
  41 const DecoratorSet C2_WEAK_CMPXCHG           = DECORATOR_LAST << 3;
  42 // This denotes that a load has control dependency.
  43 const DecoratorSet C2_CONTROL_DEPENDENT_LOAD = DECORATOR_LAST << 4;
  44 // This denotes that a load that must be pinned.
  45 const DecoratorSet C2_PINNED_LOAD            = DECORATOR_LAST << 5;
  46 // This denotes that the access is produced from the sun.misc.Unsafe intrinsics.
  47 const DecoratorSet C2_UNSAFE_ACCESS          = DECORATOR_LAST << 6;
  48 // This denotes that the access mutates state.
  49 const DecoratorSet C2_WRITE_ACCESS           = DECORATOR_LAST << 7;
  50 // This denotes that the access reads state.


 274   // This could for example comprise macro nodes to be expanded during macro expansion.
 275   virtual void* create_barrier_state(Arena* comp_arena) const { return NULL; }
 276   // If the BarrierSetC2 state has kept macro nodes in its compilation unit state to be
 277   // expanded later, then now is the time to do so.
 278   virtual bool expand_macro_nodes(PhaseMacroExpand* macro) const { return false; }
 279 
 280   enum CompilePhase {
 281     BeforeOptimize, /* post_parse = true */
 282     BeforeExpand, /* post_parse = false */
 283     BeforeCodeGen
 284   };
 285   virtual void verify_gc_barriers(Compile* compile, CompilePhase phase) const {}
 286 
 287   virtual bool flatten_gc_alias_type(const TypePtr*& adr_type) const { return false; }
 288 #ifdef ASSERT
 289   virtual bool verify_gc_alias_type(const TypePtr* adr_type, int offset) const { return false; }
 290 #endif
 291 
 292   virtual bool final_graph_reshaping(Compile* compile, Node* n, uint opcode) const { return false; }
 293 



 294 };
 295 
 296 #endif // SHARE_GC_SHARED_C2_BARRIERSETC2_HPP


  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_GC_SHARED_C2_BARRIERSETC2_HPP
  26 #define SHARE_GC_SHARED_C2_BARRIERSETC2_HPP
  27 
  28 #include "memory/allocation.hpp"
  29 #include "oops/accessDecorators.hpp"
  30 #include "opto/loopnode.hpp"
  31 #include "opto/matcher.hpp"
  32 #include "opto/memnode.hpp"
  33 #include "utilities/globalDefinitions.hpp"
  34 
  35 // This means the access is mismatched. This means the value of an access
  36 // is not equivalent to the value pointed to by the address.
  37 const DecoratorSet C2_MISMATCHED             = DECORATOR_LAST << 1;
  38 // The access may not be aligned to its natural size.
  39 const DecoratorSet C2_UNALIGNED              = DECORATOR_LAST << 2;
  40 // The atomic cmpxchg is weak, meaning that spurious false negatives are allowed,
  41 // but never false positives.
  42 const DecoratorSet C2_WEAK_CMPXCHG           = DECORATOR_LAST << 3;
  43 // This denotes that a load has control dependency.
  44 const DecoratorSet C2_CONTROL_DEPENDENT_LOAD = DECORATOR_LAST << 4;
  45 // This denotes that a load that must be pinned.
  46 const DecoratorSet C2_PINNED_LOAD            = DECORATOR_LAST << 5;
  47 // This denotes that the access is produced from the sun.misc.Unsafe intrinsics.
  48 const DecoratorSet C2_UNSAFE_ACCESS          = DECORATOR_LAST << 6;
  49 // This denotes that the access mutates state.
  50 const DecoratorSet C2_WRITE_ACCESS           = DECORATOR_LAST << 7;
  51 // This denotes that the access reads state.


 275   // This could for example comprise macro nodes to be expanded during macro expansion.
 276   virtual void* create_barrier_state(Arena* comp_arena) const { return NULL; }
 277   // If the BarrierSetC2 state has kept macro nodes in its compilation unit state to be
 278   // expanded later, then now is the time to do so.
 279   virtual bool expand_macro_nodes(PhaseMacroExpand* macro) const { return false; }
 280 
 281   enum CompilePhase {
 282     BeforeOptimize, /* post_parse = true */
 283     BeforeExpand, /* post_parse = false */
 284     BeforeCodeGen
 285   };
 286   virtual void verify_gc_barriers(Compile* compile, CompilePhase phase) const {}
 287 
 288   virtual bool flatten_gc_alias_type(const TypePtr*& adr_type) const { return false; }
 289 #ifdef ASSERT
 290   virtual bool verify_gc_alias_type(const TypePtr* adr_type, int offset) const { return false; }
 291 #endif
 292 
 293   virtual bool final_graph_reshaping(Compile* compile, Node* n, uint opcode) const { return false; }
 294 
 295   virtual bool matcher_find_shared_visit(Matcher* matcher, Matcher::MStack& mstack, Node* n, uint opcode, bool& mem_op, int& mem_addr_idx) const { return false; };
 296   virtual bool matcher_find_shared_post_visit(Matcher* matcher, Node* n, uint opcode) const { return false; };
 297   virtual bool matcher_is_store_load_barrier(Node* x, uint xop) const { return false; }
 298 };
 299 
 300 #endif // SHARE_GC_SHARED_C2_BARRIERSETC2_HPP
< prev index next >