2317 public:
2318 static int header_size() {
2319 return sizeof(MethodData)/wordSize;
2320 }
2321
2322 // Compute the size of a MethodData* before it is created.
2323 static int compute_allocation_size_in_bytes(const methodHandle& method);
2324 static int compute_allocation_size_in_words(const methodHandle& method);
2325 static int compute_extra_data_count(int data_size, int empty_bc_count, bool needs_speculative_traps);
2326
2327 // Determine if a given bytecode can have profile information.
2328 static bool bytecode_has_profile(Bytecodes::Code code) {
2329 return bytecode_cell_count(code) != no_profile_data;
2330 }
2331
2332 // reset into original state
2333 void init();
2334
2335 // My size
2336 int size_in_bytes() const { return _size; }
2337 int size() const { return align_object_size(align_size_up(_size, BytesPerWord)/BytesPerWord); }
2338 #if INCLUDE_SERVICES
2339 void collect_statistics(KlassSizeStats *sz) const;
2340 #endif
2341
2342 int creation_mileage() const { return _creation_mileage; }
2343 void set_creation_mileage(int x) { _creation_mileage = x; }
2344
2345 int invocation_count() {
2346 if (invocation_counter()->carry()) {
2347 return InvocationCounter::count_limit;
2348 }
2349 return invocation_counter()->count();
2350 }
2351 int backedge_count() {
2352 if (backedge_counter()->carry()) {
2353 return InvocationCounter::count_limit;
2354 }
2355 return backedge_counter()->count();
2356 }
2357
|
2317 public:
2318 static int header_size() {
2319 return sizeof(MethodData)/wordSize;
2320 }
2321
2322 // Compute the size of a MethodData* before it is created.
2323 static int compute_allocation_size_in_bytes(const methodHandle& method);
2324 static int compute_allocation_size_in_words(const methodHandle& method);
2325 static int compute_extra_data_count(int data_size, int empty_bc_count, bool needs_speculative_traps);
2326
2327 // Determine if a given bytecode can have profile information.
2328 static bool bytecode_has_profile(Bytecodes::Code code) {
2329 return bytecode_cell_count(code) != no_profile_data;
2330 }
2331
2332 // reset into original state
2333 void init();
2334
2335 // My size
2336 int size_in_bytes() const { return _size; }
2337 int size() const { return align_metadata_size(align_size_up(_size, BytesPerWord)/BytesPerWord); }
2338 #if INCLUDE_SERVICES
2339 void collect_statistics(KlassSizeStats *sz) const;
2340 #endif
2341
2342 int creation_mileage() const { return _creation_mileage; }
2343 void set_creation_mileage(int x) { _creation_mileage = x; }
2344
2345 int invocation_count() {
2346 if (invocation_counter()->carry()) {
2347 return InvocationCounter::count_limit;
2348 }
2349 return invocation_counter()->count();
2350 }
2351 int backedge_count() {
2352 if (backedge_counter()->carry()) {
2353 return InvocationCounter::count_limit;
2354 }
2355 return backedge_counter()->count();
2356 }
2357
|