Mercurial > hg > truffle
comparison src/share/vm/c1/c1_LIR.hpp @ 6725:da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author | coleenp |
---|---|
date | Sat, 01 Sep 2012 13:25:18 -0400 |
parents | 1d7922586cf6 |
children | 8a02ca5e5576 |
comparison
equal
deleted
inserted
replaced
6724:36d1d483d5d6 | 6725:da91efe96a93 |
---|---|
24 | 24 |
25 #ifndef SHARE_VM_C1_C1_LIR_HPP | 25 #ifndef SHARE_VM_C1_C1_LIR_HPP |
26 #define SHARE_VM_C1_C1_LIR_HPP | 26 #define SHARE_VM_C1_C1_LIR_HPP |
27 | 27 |
28 #include "c1/c1_ValueType.hpp" | 28 #include "c1/c1_ValueType.hpp" |
29 #include "oops/methodOop.hpp" | 29 #include "oops/method.hpp" |
30 | 30 |
31 class BlockBegin; | 31 class BlockBegin; |
32 class BlockList; | 32 class BlockList; |
33 class LIR_Assembler; | 33 class LIR_Assembler; |
34 class CodeEmitInfo; | 34 class CodeEmitInfo; |
106 #else | 106 #else |
107 assert(sizeof(jint) >= sizeof(p), "too small");; | 107 assert(sizeof(jint) >= sizeof(p), "too small");; |
108 _value.set_type(T_INT); _value.set_jint((jint)p); | 108 _value.set_type(T_INT); _value.set_jint((jint)p); |
109 #endif | 109 #endif |
110 } | 110 } |
111 LIR_Const(Metadata* m) { | |
112 _value.set_type(T_METADATA); | |
113 #ifdef _LP64 | |
114 _value.set_jlong((jlong)m); | |
115 #else | |
116 _value.set_jint((jint)m); | |
117 #endif // _LP64 | |
118 } | |
111 | 119 |
112 virtual BasicType type() const { return _value.get_type(); } | 120 virtual BasicType type() const { return _value.get_type(); } |
113 virtual LIR_Const* as_constant() { return this; } | 121 virtual LIR_Const* as_constant() { return this; } |
114 | 122 |
115 jint as_jint() const { type_check(T_INT, T_ADDRESS); return _value.get_jint(); } | 123 jint as_jint() const { type_check(T_INT, T_ADDRESS); return _value.get_jint(); } |
120 jint as_jint_lo() const { type_check(T_LONG ); return low(_value.get_jlong()); } | 128 jint as_jint_lo() const { type_check(T_LONG ); return low(_value.get_jlong()); } |
121 jint as_jint_hi() const { type_check(T_LONG ); return high(_value.get_jlong()); } | 129 jint as_jint_hi() const { type_check(T_LONG ); return high(_value.get_jlong()); } |
122 | 130 |
123 #ifdef _LP64 | 131 #ifdef _LP64 |
124 address as_pointer() const { type_check(T_LONG ); return (address)_value.get_jlong(); } | 132 address as_pointer() const { type_check(T_LONG ); return (address)_value.get_jlong(); } |
133 Metadata* as_metadata() const { type_check(T_METADATA); return (Metadata*)_value.get_jlong(); } | |
125 #else | 134 #else |
126 address as_pointer() const { type_check(T_INT ); return (address)_value.get_jint(); } | 135 address as_pointer() const { type_check(T_INT ); return (address)_value.get_jint(); } |
136 Metadata* as_metadata() const { type_check(T_METADATA); return (Metadata*)_value.get_jint(); } | |
127 #endif | 137 #endif |
128 | 138 |
129 | 139 |
130 jint as_jint_bits() const { type_check(T_FLOAT, T_INT, T_ADDRESS); return _value.get_jint(); } | 140 jint as_jint_bits() const { type_check(T_FLOAT, T_INT, T_ADDRESS); return _value.get_jint(); } |
131 jint as_jint_lo_bits() const { | 141 jint as_jint_lo_bits() const { |
806 static LIR_Opr address(LIR_Address* a) { return (LIR_Opr)a; } | 816 static LIR_Opr address(LIR_Address* a) { return (LIR_Opr)a; } |
807 static LIR_Opr intptrConst(void* p) { return (LIR_Opr)(new LIR_Const(p)); } | 817 static LIR_Opr intptrConst(void* p) { return (LIR_Opr)(new LIR_Const(p)); } |
808 static LIR_Opr intptrConst(intptr_t v) { return (LIR_Opr)(new LIR_Const((void*)v)); } | 818 static LIR_Opr intptrConst(intptr_t v) { return (LIR_Opr)(new LIR_Const((void*)v)); } |
809 static LIR_Opr illegal() { return (LIR_Opr)-1; } | 819 static LIR_Opr illegal() { return (LIR_Opr)-1; } |
810 static LIR_Opr addressConst(jint i) { return (LIR_Opr)(new LIR_Const(i, true)); } | 820 static LIR_Opr addressConst(jint i) { return (LIR_Opr)(new LIR_Const(i, true)); } |
821 static LIR_Opr metadataConst(Metadata* m) { return (LIR_Opr)(new LIR_Const(m)); } | |
811 | 822 |
812 static LIR_Opr value_type(ValueType* type); | 823 static LIR_Opr value_type(ValueType* type); |
813 static LIR_Opr dummy_value_type(ValueType* type); | 824 static LIR_Opr dummy_value_type(ValueType* type); |
814 }; | 825 }; |
815 | 826 |
1539 bool fast_check() const { assert(code() == lir_instanceof || code() == lir_checkcast, "not valid"); return _fast_check; } | 1550 bool fast_check() const { assert(code() == lir_instanceof || code() == lir_checkcast, "not valid"); return _fast_check; } |
1540 CodeEmitInfo* info_for_patch() const { return _info_for_patch; } | 1551 CodeEmitInfo* info_for_patch() const { return _info_for_patch; } |
1541 CodeEmitInfo* info_for_exception() const { return _info_for_exception; } | 1552 CodeEmitInfo* info_for_exception() const { return _info_for_exception; } |
1542 CodeStub* stub() const { return _stub; } | 1553 CodeStub* stub() const { return _stub; } |
1543 | 1554 |
1544 // methodDataOop profiling | 1555 // MethodData* profiling |
1545 void set_profiled_method(ciMethod *method) { _profiled_method = method; } | 1556 void set_profiled_method(ciMethod *method) { _profiled_method = method; } |
1546 void set_profiled_bci(int bci) { _profiled_bci = bci; } | 1557 void set_profiled_bci(int bci) { _profiled_bci = bci; } |
1547 void set_should_profile(bool b) { _should_profile = b; } | 1558 void set_should_profile(bool b) { _should_profile = b; } |
1548 ciMethod* profiled_method() const { return _profiled_method; } | 1559 ciMethod* profiled_method() const { return _profiled_method; } |
1549 int profiled_bci() const { return _profiled_bci; } | 1560 int profiled_bci() const { return _profiled_bci; } |
1996 void volatile_move(LIR_Opr src, LIR_Opr dst, BasicType type, CodeEmitInfo* info = NULL, LIR_PatchCode patch_code = lir_patch_none) { append(new LIR_Op1(lir_move, src, dst, type, patch_code, info, lir_move_volatile)); } | 2007 void volatile_move(LIR_Opr src, LIR_Opr dst, BasicType type, CodeEmitInfo* info = NULL, LIR_PatchCode patch_code = lir_patch_none) { append(new LIR_Op1(lir_move, src, dst, type, patch_code, info, lir_move_volatile)); } |
1997 | 2008 |
1998 void oop2reg (jobject o, LIR_Opr reg) { append(new LIR_Op1(lir_move, LIR_OprFact::oopConst(o), reg)); } | 2009 void oop2reg (jobject o, LIR_Opr reg) { append(new LIR_Op1(lir_move, LIR_OprFact::oopConst(o), reg)); } |
1999 void oop2reg_patch(jobject o, LIR_Opr reg, CodeEmitInfo* info); | 2010 void oop2reg_patch(jobject o, LIR_Opr reg, CodeEmitInfo* info); |
2000 | 2011 |
2012 void oop2reg (Metadata* o, LIR_Opr reg) { append(new LIR_Op1(lir_move, LIR_OprFact::metadataConst(o), reg)); } | |
2013 void klass2reg_patch(Metadata* o, LIR_Opr reg, CodeEmitInfo* info); | |
2014 | |
2001 void return_op(LIR_Opr result) { append(new LIR_Op1(lir_return, result)); } | 2015 void return_op(LIR_Opr result) { append(new LIR_Op1(lir_return, result)); } |
2002 | 2016 |
2003 void safepoint(LIR_Opr tmp, CodeEmitInfo* info) { append(new LIR_Op1(lir_safepoint, tmp, info)); } | 2017 void safepoint(LIR_Opr tmp, CodeEmitInfo* info) { append(new LIR_Op1(lir_safepoint, tmp, info)); } |
2004 | 2018 |
2005 #ifdef PPC | 2019 #ifdef PPC |
2147 | 2161 |
2148 void checkcast (LIR_Opr result, LIR_Opr object, ciKlass* klass, | 2162 void checkcast (LIR_Opr result, LIR_Opr object, ciKlass* klass, |
2149 LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, bool fast_check, | 2163 LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, bool fast_check, |
2150 CodeEmitInfo* info_for_exception, CodeEmitInfo* info_for_patch, CodeStub* stub, | 2164 CodeEmitInfo* info_for_exception, CodeEmitInfo* info_for_patch, CodeStub* stub, |
2151 ciMethod* profiled_method, int profiled_bci); | 2165 ciMethod* profiled_method, int profiled_bci); |
2152 // methodDataOop profiling | 2166 // MethodData* profiling |
2153 void profile_call(ciMethod* method, int bci, ciMethod* callee, LIR_Opr mdo, LIR_Opr recv, LIR_Opr t1, ciKlass* cha_klass) { | 2167 void profile_call(ciMethod* method, int bci, ciMethod* callee, LIR_Opr mdo, LIR_Opr recv, LIR_Opr t1, ciKlass* cha_klass) { |
2154 append(new LIR_OpProfileCall(lir_profile_call, method, bci, callee, mdo, recv, t1, cha_klass)); | 2168 append(new LIR_OpProfileCall(lir_profile_call, method, bci, callee, mdo, recv, t1, cha_klass)); |
2155 } | 2169 } |
2156 }; | 2170 }; |
2157 | 2171 |