1.1 --- a/src/share/vm/shark/sharkContext.hpp Mon Nov 26 17:25:11 2012 -0800 1.2 +++ b/src/share/vm/shark/sharkContext.hpp Tue Nov 27 12:48:52 2012 -0800 1.3 @@ -42,11 +42,7 @@ 1.4 private: 1.5 llvm::Module* _module; 1.6 1.7 -#if SHARK_LLVM_VERSION >= 27 1.8 public: 1.9 -#else 1.10 - private: 1.11 -#endif 1.12 llvm::Module* module() const { 1.13 return _module; 1.14 } 1.15 @@ -59,127 +55,126 @@ 1.16 1.17 // Module accessors 1.18 public: 1.19 -#if SHARK_LLVM_VERSION < 27 1.20 - llvm::ModuleProvider* module_provider() const { 1.21 - return new llvm::ExistingModuleProvider(module()); 1.22 - } 1.23 -#endif 1.24 void add_function(llvm::Function* function) const { 1.25 module()->getFunctionList().push_back(function); 1.26 } 1.27 llvm::Constant* get_external(const char* name, 1.28 - const llvm::FunctionType* sig) { 1.29 + llvm::FunctionType* sig) { 1.30 return module()->getOrInsertFunction(name, sig); 1.31 } 1.32 1.33 // Basic types 1.34 private: 1.35 - const llvm::Type* _void_type; 1.36 - const llvm::IntegerType* _bit_type; 1.37 - const llvm::IntegerType* _jbyte_type; 1.38 - const llvm::IntegerType* _jshort_type; 1.39 - const llvm::IntegerType* _jint_type; 1.40 - const llvm::IntegerType* _jlong_type; 1.41 - const llvm::Type* _jfloat_type; 1.42 - const llvm::Type* _jdouble_type; 1.43 + llvm::Type* _void_type; 1.44 + llvm::IntegerType* _bit_type; 1.45 + llvm::IntegerType* _jbyte_type; 1.46 + llvm::IntegerType* _jshort_type; 1.47 + llvm::IntegerType* _jint_type; 1.48 + llvm::IntegerType* _jlong_type; 1.49 + llvm::Type* _jfloat_type; 1.50 + llvm::Type* _jdouble_type; 1.51 1.52 public: 1.53 - const llvm::Type* void_type() const { 1.54 + llvm::Type* void_type() const { 1.55 return _void_type; 1.56 } 1.57 - const llvm::IntegerType* bit_type() const { 1.58 + llvm::IntegerType* bit_type() const { 1.59 return _bit_type; 1.60 } 1.61 - const llvm::IntegerType* jbyte_type() const { 1.62 + llvm::IntegerType* jbyte_type() const { 1.63 return _jbyte_type; 1.64 } 1.65 - const llvm::IntegerType* jshort_type() const { 1.66 + llvm::IntegerType* jshort_type() const { 1.67 return _jshort_type; 1.68 } 1.69 - const llvm::IntegerType* jint_type() const { 1.70 + llvm::IntegerType* jint_type() const { 1.71 return _jint_type; 1.72 } 1.73 - const llvm::IntegerType* jlong_type() const { 1.74 + llvm::IntegerType* jlong_type() const { 1.75 return _jlong_type; 1.76 } 1.77 - const llvm::Type* jfloat_type() const { 1.78 + llvm::Type* jfloat_type() const { 1.79 return _jfloat_type; 1.80 } 1.81 - const llvm::Type* jdouble_type() const { 1.82 + llvm::Type* jdouble_type() const { 1.83 return _jdouble_type; 1.84 } 1.85 - const llvm::IntegerType* intptr_type() const { 1.86 + llvm::IntegerType* intptr_type() const { 1.87 return LP64_ONLY(jlong_type()) NOT_LP64(jint_type()); 1.88 } 1.89 1.90 // Compound types 1.91 private: 1.92 - const llvm::PointerType* _itableOffsetEntry_type; 1.93 - const llvm::PointerType* _jniEnv_type; 1.94 - const llvm::PointerType* _jniHandleBlock_type; 1.95 - const llvm::PointerType* _klass_type; 1.96 - const llvm::PointerType* _Method*_type; 1.97 - const llvm::ArrayType* _monitor_type; 1.98 - const llvm::PointerType* _oop_type; 1.99 - const llvm::PointerType* _thread_type; 1.100 - const llvm::PointerType* _zeroStack_type; 1.101 - const llvm::FunctionType* _entry_point_type; 1.102 - const llvm::FunctionType* _osr_entry_point_type; 1.103 + llvm::PointerType* _itableOffsetEntry_type; 1.104 + llvm::PointerType* _jniEnv_type; 1.105 + llvm::PointerType* _jniHandleBlock_type; 1.106 + llvm::PointerType* _Metadata_type; 1.107 + llvm::PointerType* _klass_type; 1.108 + llvm::PointerType* _Method_type; 1.109 + llvm::ArrayType* _monitor_type; 1.110 + llvm::PointerType* _oop_type; 1.111 + llvm::PointerType* _thread_type; 1.112 + llvm::PointerType* _zeroStack_type; 1.113 + llvm::FunctionType* _entry_point_type; 1.114 + llvm::FunctionType* _osr_entry_point_type; 1.115 1.116 public: 1.117 - const llvm::PointerType* itableOffsetEntry_type() const { 1.118 + llvm::PointerType* itableOffsetEntry_type() const { 1.119 return _itableOffsetEntry_type; 1.120 } 1.121 - const llvm::PointerType* jniEnv_type() const { 1.122 + llvm::PointerType* jniEnv_type() const { 1.123 return _jniEnv_type; 1.124 } 1.125 - const llvm::PointerType* jniHandleBlock_type() const { 1.126 + llvm::PointerType* jniHandleBlock_type() const { 1.127 return _jniHandleBlock_type; 1.128 } 1.129 - const llvm::PointerType* klass_type() const { 1.130 + llvm::PointerType* Metadata_type() const { 1.131 + return _Metadata_type; 1.132 + } 1.133 + llvm::PointerType* klass_type() const { 1.134 return _klass_type; 1.135 } 1.136 - const llvm::PointerType* Method*_type() const { 1.137 - return _Method*_type; 1.138 + llvm::PointerType* Method_type() const { 1.139 + return _Method_type; 1.140 } 1.141 - const llvm::ArrayType* monitor_type() const { 1.142 + llvm::ArrayType* monitor_type() const { 1.143 return _monitor_type; 1.144 } 1.145 - const llvm::PointerType* oop_type() const { 1.146 + llvm::PointerType* oop_type() const { 1.147 return _oop_type; 1.148 } 1.149 - const llvm::PointerType* thread_type() const { 1.150 + llvm::PointerType* thread_type() const { 1.151 return _thread_type; 1.152 } 1.153 - const llvm::PointerType* zeroStack_type() const { 1.154 + llvm::PointerType* zeroStack_type() const { 1.155 return _zeroStack_type; 1.156 } 1.157 - const llvm::FunctionType* entry_point_type() const { 1.158 + llvm::FunctionType* entry_point_type() const { 1.159 return _entry_point_type; 1.160 } 1.161 - const llvm::FunctionType* osr_entry_point_type() const { 1.162 + llvm::FunctionType* osr_entry_point_type() const { 1.163 return _osr_entry_point_type; 1.164 } 1.165 1.166 // Mappings 1.167 private: 1.168 - const llvm::Type* _to_stackType[T_CONFLICT]; 1.169 - const llvm::Type* _to_arrayType[T_CONFLICT]; 1.170 + llvm::Type* _to_stackType[T_CONFLICT]; 1.171 + llvm::Type* _to_arrayType[T_CONFLICT]; 1.172 1.173 private: 1.174 - const llvm::Type* map_type(const llvm::Type* const* table, 1.175 + llvm::Type* map_type(llvm::Type* const* table, 1.176 BasicType type) const { 1.177 assert(type >= 0 && type < T_CONFLICT, "unhandled type"); 1.178 - const llvm::Type* result = table[type]; 1.179 + llvm::Type* result = table[type]; 1.180 assert(result != NULL, "unhandled type"); 1.181 return result; 1.182 } 1.183 1.184 public: 1.185 - const llvm::Type* to_stackType(BasicType type) const { 1.186 + llvm::Type* to_stackType(BasicType type) const { 1.187 return map_type(_to_stackType, type); 1.188 } 1.189 - const llvm::Type* to_arrayType(BasicType type) const { 1.190 + llvm::Type* to_arrayType(BasicType type) const { 1.191 return map_type(_to_arrayType, type); 1.192 } 1.193