comparison src/share/vm/ci/ciMethodData.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 fabcf26ee72f
children bd7a7ce2e264
comparison
equal deleted inserted replaced
6724:36d1d483d5d6 6725:da91efe96a93
1 /* 1 /*
2 * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
27 27
28 #include "ci/ciClassList.hpp" 28 #include "ci/ciClassList.hpp"
29 #include "ci/ciKlass.hpp" 29 #include "ci/ciKlass.hpp"
30 #include "ci/ciObject.hpp" 30 #include "ci/ciObject.hpp"
31 #include "ci/ciUtilities.hpp" 31 #include "ci/ciUtilities.hpp"
32 #include "oops/methodDataOop.hpp" 32 #include "oops/methodData.hpp"
33 #include "oops/oop.inline.hpp" 33 #include "oops/oop.inline.hpp"
34 34
35 class ciBitData; 35 class ciBitData;
36 class ciCounterData; 36 class ciCounterData;
37 class ciJumpData; 37 class ciJumpData;
69 (intptr_t) recv); 69 (intptr_t) recv);
70 } 70 }
71 71
72 ciKlass* receiver(uint row) { 72 ciKlass* receiver(uint row) {
73 assert((uint)row < row_limit(), "oob"); 73 assert((uint)row < row_limit(), "oob");
74 ciObject* recv = (ciObject*)intptr_at(receiver0_offset + row * receiver_type_row_cell_count); 74 ciKlass* recv = (ciKlass*)intptr_at(receiver0_offset + row * receiver_type_row_cell_count);
75 assert(recv == NULL || recv->is_klass(), "wrong type"); 75 assert(recv == NULL || recv->is_klass(), "wrong type");
76 return (ciKlass*)recv; 76 return recv;
77 } 77 }
78 78
79 // Copy & translate from oop based ReceiverTypeData 79 // Copy & translate from oop based ReceiverTypeData
80 virtual void translate_from(ProfileData* data) { 80 virtual void translate_from(ProfileData* data) {
81 translate_receiver_data_from(data); 81 translate_receiver_data_from(data);
137 ciArgInfoData(DataLayout* layout) : ArgInfoData(layout) {}; 137 ciArgInfoData(DataLayout* layout) : ArgInfoData(layout) {};
138 }; 138 };
139 139
140 // ciMethodData 140 // ciMethodData
141 // 141 //
142 // This class represents a methodDataOop in the HotSpot virtual 142 // This class represents a MethodData* in the HotSpot virtual
143 // machine. 143 // machine.
144 144
145 class ciMethodData : public ciObject { 145 class ciMethodData : public ciMetadata {
146 CI_PACKAGE_ACCESS 146 CI_PACKAGE_ACCESS
147 147
148 private: 148 private:
149 // Size in bytes 149 // Size in bytes
150 int _data_size; 150 int _data_size;
177 // its maturity we need separate counters. 177 // its maturity we need separate counters.
178 int _invocation_counter; 178 int _invocation_counter;
179 int _backedge_counter; 179 int _backedge_counter;
180 180
181 // Coherent snapshot of original header. 181 // Coherent snapshot of original header.
182 methodDataOopDesc _orig; 182 MethodData _orig;
183 183
184 ciMethodData(methodDataHandle h_md); 184 ciMethodData(MethodData* md);
185 ciMethodData(); 185 ciMethodData();
186 186
187 // Accessors 187 // Accessors
188 int data_size() const { return _data_size; } 188 int data_size() const { return _data_size; }
189 int extra_data_size() const { return _extra_data_size; } 189 int extra_data_size() const { return _extra_data_size; }
190 intptr_t * data() const { return _data; } 190 intptr_t * data() const { return _data; }
191 191
192 methodDataOop get_methodDataOop() const { 192 MethodData* get_MethodData() const {
193 if (handle() == NULL) return NULL; 193 return (MethodData*)_metadata;
194 methodDataOop mdo = (methodDataOop)get_oop();
195 assert(mdo != NULL, "illegal use of unloaded method data");
196 return mdo;
197 } 194 }
198 195
199 const char* type_string() { return "ciMethodData"; } 196 const char* type_string() { return "ciMethodData"; }
200 197
201 void print_impl(outputStream* st); 198 void print_impl(outputStream* st);
230 int first_di() { return 0; } 227 int first_di() { return 0; }
231 228
232 ciArgInfoData *arg_info() const; 229 ciArgInfoData *arg_info() const;
233 230
234 public: 231 public:
235 bool is_method_data() { return true; } 232 bool is_method_data() const { return true; }
236 233
237 void set_mature() { _state = mature_state; } 234 void set_mature() { _state = mature_state; }
238 235
239 bool is_empty() { return _state == empty_state; } 236 bool is_empty() { return _state == empty_state; }
240 bool is_mature() { return _state == mature_state; } 237 bool is_mature() { return _state == mature_state; }
242 int creation_mileage() { return _orig.creation_mileage(); } 239 int creation_mileage() { return _orig.creation_mileage(); }
243 int current_mileage() { return _current_mileage; } 240 int current_mileage() { return _current_mileage; }
244 241
245 int invocation_count() { return _invocation_counter; } 242 int invocation_count() { return _invocation_counter; }
246 int backedge_count() { return _backedge_counter; } 243 int backedge_count() { return _backedge_counter; }
247 // Transfer information about the method to methodDataOop. 244 // Transfer information about the method to MethodData*.
248 // would_profile means we would like to profile this method, 245 // would_profile means we would like to profile this method,
249 // meaning it's not trivial. 246 // meaning it's not trivial.
250 void set_would_profile(bool p); 247 void set_would_profile(bool p);
251 // Also set the numer of loops and blocks in the method. 248 // Also set the numer of loops and blocks in the method.
252 // Again, this is used to determine if a method is trivial. 249 // Again, this is used to determine if a method is trivial.
298 295
299 void clear_escape_info(); 296 void clear_escape_info();
300 bool has_escape_info(); 297 bool has_escape_info();
301 void update_escape_info(); 298 void update_escape_info();
302 299
303 void set_eflag(methodDataOopDesc::EscapeFlag f); 300 void set_eflag(MethodData::EscapeFlag f);
304 void clear_eflag(methodDataOopDesc::EscapeFlag f); 301 void clear_eflag(MethodData::EscapeFlag f);
305 bool eflag_set(methodDataOopDesc::EscapeFlag f) const; 302 bool eflag_set(MethodData::EscapeFlag f) const;
306 303
307 void set_arg_local(int i); 304 void set_arg_local(int i);
308 void set_arg_stack(int i); 305 void set_arg_stack(int i);
309 void set_arg_returned(int i); 306 void set_arg_returned(int i);
310 void set_arg_modified(int arg, uint val); 307 void set_arg_modified(int arg, uint val);