< prev index next >
src/share/vm/c1/c1_LIRGenerator.hpp
Print this page
rev 12906 : [mq]: gc_interface
@@ -23,10 +23,12 @@
*/
#ifndef SHARE_VM_C1_C1_LIRGENERATOR_HPP
#define SHARE_VM_C1_C1_LIRGENERATOR_HPP
+#include "gc/shared/c1BarrierSetCodeGen.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 C1BarrierSetCodeGen;
+ friend class C1ModRefBSCodeGen;
+ friend class C1CardTableModRefBSCodeGen;
+ friend class C1G1BSCodeGen;
// 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(C1DecoratorSet decorators, BasicType type,
+ LIRItem& base, LIR_Opr offset, LIR_Opr value,
+ CodeEmitInfo* patch_info, CodeEmitInfo* store_emit_info);
+
+ LIR_Opr access_load_at(C1DecoratorSet decorators, BasicType type,
+ LIRItem& base, LIR_Opr offset,
+ CodeEmitInfo* patch_info, CodeEmitInfo* load_emit_info);
+
+ LIR_Opr access_cas_at(C1DecoratorSet decorators, BasicType type,
+ LIRItem& base, LIRItem& offset, LIRItem& cmp_value, LIRItem& new_value);
+
+ LIR_Opr access_swap_at(C1DecoratorSet decorators, BasicType type,
+ LIRItem& base, LIRItem& offset, LIRItem& value);
+
+ LIR_Opr access_add_at(C1DecoratorSet 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 cas(BasicType type, LIR_Opr addr, LIRItem& cmp_value, LIRItem& new_value);
+ LIR_Opr swap(BasicType type, LIR_Opr addr, LIRItem& new_value);
+ LIR_Opr add(BasicType type, LIR_Opr addr, LIRItem& new_value);
+ void array_store_check(LIR_Opr value, LIR_Opr array, CodeEmitInfo* store_check_info, ciMethod* profiled_method, int profiled_bci);
// specific implementations
- // pre barriers
-
- void G1SATBCardTableModRef_pre_barrier(LIR_Opr addr_opr, LIR_Opr pre_val,
- bool do_load, bool patch, CodeEmitInfo* info);
-
- // post barriers
-
- void G1SATBCardTableModRef_post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val);
- void CardTableModRef_post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val);
-#ifdef CARDTABLEMODREF_POST_BARRIER_HELPER
- void CardTableModRef_post_barrier_helper(LIR_OprDesc* addr, LIR_Const* card_table_base);
-#endif
-
static LIR_Opr result_register_for(ValueType* type, bool callee = false);
ciObject* get_jobject_constant(Value value);
@@ -432,12 +445,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
@@ -451,10 +462,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(); }
@@ -478,11 +490,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 >