< prev index next >

src/hotspot/share/c1/c1_LIRGenerator.hpp

BarrierSetC1
  */
 
 #ifndef SHARE_VM_C1_C1_LIRGENERATOR_HPP
 #define SHARE_VM_C1_C1_LIRGENERATOR_HPP
 
+#include "gc/shared/c1/barrierSetC1.hpp"
+#include "c1/c1_Decorators.hpp"
 #include "c1/c1_Instruction.hpp"
 #include "c1/c1_LIR.hpp"
 #include "ci/ciMethodData.hpp"
 #include "utilities/macros.hpp"
 #include "utilities/sizes.hpp"

@@ -148,10 +150,14 }; // only the classes below belong in the same file class LIRGenerator: public InstructionVisitor, public BlockClosure { + friend class BarrierSetC1; + friend class ModRefBarrierSetC1; + friend class CardTableBarrierSetC1; + friend class G1BarrierSetC1; // LIRGenerator should never get instatiated on the heap. private: void* operator new(size_t size) throw(); void* operator new[](size_t size) throw(); void operator delete(void* p) { ShouldNotReachHere(); }
@@ -163,11 +169,10 BlockBegin* _block; int _virtual_register_number; Values _instruction_for_operand; BitMap2D _vreg_flags; // flags which can be set on a per-vreg basis LIR_List* _lir; - BarrierSet* _bs; LIRGenerator* gen() { return this; }
@@ -267,27 +272,35 // GC Barriers // generic interface - void pre_barrier(LIR_Opr addr_opr, LIR_Opr pre_val, bool do_load, bool patch, CodeEmitInfo* info); - void post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val); + void access_store_at(DecoratorSet decorators, BasicType type, + LIRItem& base, LIR_Opr offset, LIR_Opr value, + CodeEmitInfo* patch_info, CodeEmitInfo* store_emit_info); + + void access_load_at(DecoratorSet decorators, BasicType type, + LIRItem& base, LIR_Opr offset, LIR_Opr result, + CodeEmitInfo* patch_info, CodeEmitInfo* load_emit_info); + + LIR_Opr access_atomic_cmpxchg_at(DecoratorSet decorators, BasicType type, + LIRItem& base, LIRItem& offset, LIRItem& cmp_value, LIRItem& new_value); + + LIR_Opr access_atomic_xchg_at(DecoratorSet decorators, BasicType type, + LIRItem& base, LIRItem& offset, LIRItem& value); + + LIR_Opr access_atomic_add_at(DecoratorSet decorators, BasicType type, + LIRItem& base, LIRItem& offset, LIRItem& value); + + // These need to guarantee JMM volatile semantics are preserved on each platform + // and requires one implementation per architecture. + LIR_Opr atomic_cmpxchg(BasicType type, LIR_Opr addr, LIRItem& cmp_value, LIRItem& new_value); + LIR_Opr atomic_xchg(BasicType type, LIR_Opr addr, LIRItem& new_value); + LIR_Opr atomic_add(BasicType type, LIR_Opr addr, LIRItem& new_value); // specific implementations - // pre barriers - - void G1BarrierSet_pre_barrier(LIR_Opr addr_opr, LIR_Opr pre_val, - bool do_load, bool patch, CodeEmitInfo* info); - - // post barriers - - void G1BarrierSet_post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val); - void CardTableBarrierSet_post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val); -#ifdef CARDTABLEBARRIERSET_POST_BARRIER_HELPER - void CardTableBarrierSet_post_barrier_helper(LIR_OprDesc* addr, LIR_Const* card_table_base); -#endif - + void array_store_check(LIR_Opr value, LIR_Opr array, CodeEmitInfo* store_check_info, ciMethod* profiled_method, int profiled_bci); static LIR_Opr result_register_for(ValueType* type, bool callee = false); ciObject* get_jobject_constant(Value value);
@@ -352,11 +365,11 int disp, BasicType type); LIR_Address* generate_address(LIR_Opr base, int disp, BasicType type) { return generate_address(base, LIR_OprFact::illegalOpr, 0, disp, type); } - LIR_Address* emit_array_address(LIR_Opr array_opr, LIR_Opr index_opr, BasicType type, bool needs_card_mark); + LIR_Address* emit_array_address(LIR_Opr array_opr, LIR_Opr index_opr, BasicType type); // the helper for generate_address void add_large_constant(LIR_Opr src, int c, LIR_Opr dest); // machine preferences and characteristics
@@ -431,12 +444,10 #ifdef __SOFTFP__ void do_soft_float_compare(If *x); #endif // __SOFTFP__ - void init(); - SwitchRangeArray* create_lookup_ranges(TableSwitch* x); SwitchRangeArray* create_lookup_ranges(LookupSwitch* x); void do_SwitchRanges(SwitchRangeArray* x, LIR_Opr value, BlockBegin* default_sux); #ifdef TRACE_HAVE_INTRINSICS
@@ -450,10 +461,11 Value arg, LIR_Opr& mdp, bool not_null, ciKlass* signature_at_call_k, ciKlass* callee_signature_k); void profile_arguments(ProfileCall* x); void profile_parameters(Base* x); void profile_parameters_at_call(ProfileCall* x); + LIR_Opr mask_boolean(LIR_Opr array, LIR_Opr value, CodeEmitInfo*& null_check_info); LIR_Opr maybe_mask_boolean(StoreIndexed* x, LIR_Opr array, LIR_Opr value, CodeEmitInfo*& null_check_info); public: Compilation* compilation() const { return _compilation; } FrameMap* frame_map() const { return _compilation->frame_map(); }
@@ -477,11 +489,10 LIRGenerator(Compilation* compilation, ciMethod* method) : _compilation(compilation) , _method(method) , _virtual_register_number(LIR_OprDesc::vreg_base) , _vreg_flags(num_vreg_flags) { - init(); } // for virtual registers, maps them back to Phi's or Local's Instruction* instruction_for_opr(LIR_Opr opr); Instruction* instruction_for_vreg(int reg_num);
< prev index next >