src/share/vm/c1/c1_LIR.hpp

changeset 4037
da91efe96a93
parent 3969
1d7922586cf6
child 4051
8a02ca5e5576
     1.1 --- a/src/share/vm/c1/c1_LIR.hpp	Fri Aug 31 16:39:35 2012 -0700
     1.2 +++ b/src/share/vm/c1/c1_LIR.hpp	Sat Sep 01 13:25:18 2012 -0400
     1.3 @@ -26,7 +26,7 @@
     1.4  #define SHARE_VM_C1_C1_LIR_HPP
     1.5  
     1.6  #include "c1/c1_ValueType.hpp"
     1.7 -#include "oops/methodOop.hpp"
     1.8 +#include "oops/method.hpp"
     1.9  
    1.10  class BlockBegin;
    1.11  class BlockList;
    1.12 @@ -108,6 +108,14 @@
    1.13      _value.set_type(T_INT);     _value.set_jint((jint)p);
    1.14  #endif
    1.15    }
    1.16 +  LIR_Const(Metadata* m) {
    1.17 +    _value.set_type(T_METADATA);
    1.18 +#ifdef _LP64
    1.19 +    _value.set_jlong((jlong)m);
    1.20 +#else
    1.21 +    _value.set_jint((jint)m);
    1.22 +#endif // _LP64
    1.23 +  }
    1.24  
    1.25    virtual BasicType type()       const { return _value.get_type(); }
    1.26    virtual LIR_Const* as_constant()     { return this; }
    1.27 @@ -122,8 +130,10 @@
    1.28  
    1.29  #ifdef _LP64
    1.30    address   as_pointer() const         { type_check(T_LONG  ); return (address)_value.get_jlong(); }
    1.31 +  Metadata* as_metadata() const        { type_check(T_METADATA); return (Metadata*)_value.get_jlong(); }
    1.32  #else
    1.33    address   as_pointer() const         { type_check(T_INT   ); return (address)_value.get_jint(); }
    1.34 +  Metadata* as_metadata() const        { type_check(T_METADATA); return (Metadata*)_value.get_jint(); }
    1.35  #endif
    1.36  
    1.37  
    1.38 @@ -808,6 +818,7 @@
    1.39    static LIR_Opr intptrConst(intptr_t v)         { return (LIR_Opr)(new LIR_Const((void*)v)); }
    1.40    static LIR_Opr illegal()                       { return (LIR_Opr)-1; }
    1.41    static LIR_Opr addressConst(jint i)            { return (LIR_Opr)(new LIR_Const(i, true)); }
    1.42 +  static LIR_Opr metadataConst(Metadata* m)      { return (LIR_Opr)(new LIR_Const(m)); }
    1.43  
    1.44    static LIR_Opr value_type(ValueType* type);
    1.45    static LIR_Opr dummy_value_type(ValueType* type);
    1.46 @@ -1541,7 +1552,7 @@
    1.47    CodeEmitInfo* info_for_exception() const       { return _info_for_exception; }
    1.48    CodeStub* stub() const                         { return _stub;           }
    1.49  
    1.50 -  // methodDataOop profiling
    1.51 +  // MethodData* profiling
    1.52    void set_profiled_method(ciMethod *method)     { _profiled_method = method; }
    1.53    void set_profiled_bci(int bci)                 { _profiled_bci = bci;       }
    1.54    void set_should_profile(bool b)                { _should_profile = b;       }
    1.55 @@ -1998,6 +2009,9 @@
    1.56    void oop2reg  (jobject o, LIR_Opr reg)         { append(new LIR_Op1(lir_move, LIR_OprFact::oopConst(o),    reg));   }
    1.57    void oop2reg_patch(jobject o, LIR_Opr reg, CodeEmitInfo* info);
    1.58  
    1.59 +  void oop2reg  (Metadata* o, LIR_Opr reg)       { append(new LIR_Op1(lir_move, LIR_OprFact::metadataConst(o), reg));   }
    1.60 +  void klass2reg_patch(Metadata* o, LIR_Opr reg, CodeEmitInfo* info);
    1.61 +
    1.62    void return_op(LIR_Opr result)                 { append(new LIR_Op1(lir_return, result)); }
    1.63  
    1.64    void safepoint(LIR_Opr tmp, CodeEmitInfo* info)  { append(new LIR_Op1(lir_safepoint, tmp, info)); }
    1.65 @@ -2149,7 +2163,7 @@
    1.66                    LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, bool fast_check,
    1.67                    CodeEmitInfo* info_for_exception, CodeEmitInfo* info_for_patch, CodeStub* stub,
    1.68                    ciMethod* profiled_method, int profiled_bci);
    1.69 -  // methodDataOop profiling
    1.70 +  // MethodData* profiling
    1.71    void profile_call(ciMethod* method, int bci, ciMethod* callee, LIR_Opr mdo, LIR_Opr recv, LIR_Opr t1, ciKlass* cha_klass) {
    1.72      append(new LIR_OpProfileCall(lir_profile_call, method, bci, callee, mdo, recv, t1, cha_klass));
    1.73    }

mercurial