1.1 --- a/src/share/vm/c1/c1_LIR.hpp Wed Oct 09 11:05:17 2013 -0700 1.2 +++ b/src/share/vm/c1/c1_LIR.hpp Wed Oct 09 16:32:21 2013 +0200 1.3 @@ -882,6 +882,7 @@ 1.4 class LIR_OpTypeCheck; 1.5 class LIR_OpCompareAndSwap; 1.6 class LIR_OpProfileCall; 1.7 +class LIR_OpProfileType; 1.8 #ifdef ASSERT 1.9 class LIR_OpAssert; 1.10 #endif 1.11 @@ -1005,6 +1006,7 @@ 1.12 , end_opCompareAndSwap 1.13 , begin_opMDOProfile 1.14 , lir_profile_call 1.15 + , lir_profile_type 1.16 , end_opMDOProfile 1.17 , begin_opAssert 1.18 , lir_assert 1.19 @@ -1145,6 +1147,7 @@ 1.20 virtual LIR_OpTypeCheck* as_OpTypeCheck() { return NULL; } 1.21 virtual LIR_OpCompareAndSwap* as_OpCompareAndSwap() { return NULL; } 1.22 virtual LIR_OpProfileCall* as_OpProfileCall() { return NULL; } 1.23 + virtual LIR_OpProfileType* as_OpProfileType() { return NULL; } 1.24 #ifdef ASSERT 1.25 virtual LIR_OpAssert* as_OpAssert() { return NULL; } 1.26 #endif 1.27 @@ -1925,8 +1928,8 @@ 1.28 1.29 public: 1.30 // Destroys recv 1.31 - LIR_OpProfileCall(LIR_Code code, ciMethod* profiled_method, int profiled_bci, ciMethod* profiled_callee, LIR_Opr mdo, LIR_Opr recv, LIR_Opr t1, ciKlass* known_holder) 1.32 - : LIR_Op(code, LIR_OprFact::illegalOpr, NULL) // no result, no info 1.33 + LIR_OpProfileCall(ciMethod* profiled_method, int profiled_bci, ciMethod* profiled_callee, LIR_Opr mdo, LIR_Opr recv, LIR_Opr t1, ciKlass* known_holder) 1.34 + : LIR_Op(lir_profile_call, LIR_OprFact::illegalOpr, NULL) // no result, no info 1.35 , _profiled_method(profiled_method) 1.36 , _profiled_bci(profiled_bci) 1.37 , _profiled_callee(profiled_callee) 1.38 @@ -1948,6 +1951,45 @@ 1.39 virtual void print_instr(outputStream* out) const PRODUCT_RETURN; 1.40 }; 1.41 1.42 +// LIR_OpProfileType 1.43 +class LIR_OpProfileType : public LIR_Op { 1.44 + friend class LIR_OpVisitState; 1.45 + 1.46 + private: 1.47 + LIR_Opr _mdp; 1.48 + LIR_Opr _obj; 1.49 + LIR_Opr _tmp; 1.50 + ciKlass* _exact_klass; // non NULL if we know the klass statically (no need to load it from _obj) 1.51 + intptr_t _current_klass; // what the profiling currently reports 1.52 + bool _not_null; // true if we know statically that _obj cannot be null 1.53 + bool _no_conflict; // true if we're profling parameters, _exact_klass is not NULL and we know 1.54 + // _exact_klass it the only possible type for this parameter in any context. 1.55 + 1.56 + public: 1.57 + // Destroys recv 1.58 + LIR_OpProfileType(LIR_Opr mdp, LIR_Opr obj, ciKlass* exact_klass, intptr_t current_klass, LIR_Opr tmp, bool not_null, bool no_conflict) 1.59 + : LIR_Op(lir_profile_type, LIR_OprFact::illegalOpr, NULL) // no result, no info 1.60 + , _mdp(mdp) 1.61 + , _obj(obj) 1.62 + , _exact_klass(exact_klass) 1.63 + , _current_klass(current_klass) 1.64 + , _tmp(tmp) 1.65 + , _not_null(not_null) 1.66 + , _no_conflict(no_conflict) { } 1.67 + 1.68 + LIR_Opr mdp() const { return _mdp; } 1.69 + LIR_Opr obj() const { return _obj; } 1.70 + LIR_Opr tmp() const { return _tmp; } 1.71 + ciKlass* exact_klass() const { return _exact_klass; } 1.72 + intptr_t current_klass() const { return _current_klass; } 1.73 + bool not_null() const { return _not_null; } 1.74 + bool no_conflict() const { return _no_conflict; } 1.75 + 1.76 + virtual void emit_code(LIR_Assembler* masm); 1.77 + virtual LIR_OpProfileType* as_OpProfileType() { return this; } 1.78 + virtual void print_instr(outputStream* out) const PRODUCT_RETURN; 1.79 +}; 1.80 + 1.81 class LIR_InsertionBuffer; 1.82 1.83 //--------------------------------LIR_List--------------------------------------------------- 1.84 @@ -2247,7 +2289,10 @@ 1.85 ciMethod* profiled_method, int profiled_bci); 1.86 // MethodData* profiling 1.87 void profile_call(ciMethod* method, int bci, ciMethod* callee, LIR_Opr mdo, LIR_Opr recv, LIR_Opr t1, ciKlass* cha_klass) { 1.88 - append(new LIR_OpProfileCall(lir_profile_call, method, bci, callee, mdo, recv, t1, cha_klass)); 1.89 + append(new LIR_OpProfileCall(method, bci, callee, mdo, recv, t1, cha_klass)); 1.90 + } 1.91 + void profile_type(LIR_Address* mdp, LIR_Opr obj, ciKlass* exact_klass, intptr_t current_klass, LIR_Opr tmp, bool not_null, bool no_conflict) { 1.92 + append(new LIR_OpProfileType(LIR_OprFact::address(mdp), obj, exact_klass, current_klass, tmp, not_null, no_conflict)); 1.93 } 1.94 1.95 void xadd(LIR_Opr src, LIR_Opr add, LIR_Opr res, LIR_Opr tmp) { append(new LIR_Op2(lir_xadd, src, add, res, tmp)); }