8209852: Counters in StringCleaningTask should be type of size_t
Converted counters to size_t type to avoid casting Reviewed-by: coleenp
This commit is contained in:
parent
f71d1cb124
commit
083110efa9
@ -395,7 +395,7 @@ class StringTableIsAliveCounter : public BoolObjectClosure {
|
||||
};
|
||||
|
||||
void StringTable::unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f,
|
||||
int* processed, int* removed) {
|
||||
size_t* processed, size_t* removed) {
|
||||
DoNothingClosure dnc;
|
||||
assert(is_alive != NULL, "No closure");
|
||||
StringTableIsAliveCounter stiac(is_alive);
|
||||
@ -409,10 +409,10 @@ void StringTable::unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f,
|
||||
StringTable::the_table()->check_concurrent_work();
|
||||
|
||||
if (processed != NULL) {
|
||||
*processed = (int) stiac._count_total;
|
||||
*processed = stiac._count_total;
|
||||
}
|
||||
if (removed != NULL) {
|
||||
*removed = (int) stiac._count;
|
||||
*removed = stiac._count;
|
||||
}
|
||||
}
|
||||
|
||||
@ -423,7 +423,7 @@ void StringTable::oops_do(OopClosure* f) {
|
||||
|
||||
void StringTable::possibly_parallel_unlink(
|
||||
OopStorage::ParState<false, false>* _par_state_string, BoolObjectClosure* cl,
|
||||
int* processed, int* removed)
|
||||
size_t* processed, size_t* removed)
|
||||
{
|
||||
DoNothingClosure dnc;
|
||||
assert(cl != NULL, "No closure");
|
||||
@ -434,8 +434,8 @@ void StringTable::possibly_parallel_unlink(
|
||||
// Accumulate the dead strings.
|
||||
the_table()->add_items_count_to_clean(stiac._count);
|
||||
|
||||
*processed = (int) stiac._count_total;
|
||||
*removed = (int) stiac._count;
|
||||
*processed = stiac._count_total;
|
||||
*removed = stiac._count;
|
||||
}
|
||||
|
||||
void StringTable::possibly_parallel_oops_do(
|
||||
|
@ -136,7 +136,7 @@ private:
|
||||
unlink_or_oops_do(cl);
|
||||
}
|
||||
static void unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f = NULL,
|
||||
int* processed = NULL, int* removed = NULL);
|
||||
size_t* processed = NULL, size_t* removed = NULL);
|
||||
|
||||
// Serially invoke "f->do_oop" on the locations of all oops in the table.
|
||||
static void oops_do(OopClosure* f);
|
||||
@ -144,7 +144,7 @@ private:
|
||||
// Possibly parallel versions of the above
|
||||
static void possibly_parallel_unlink(
|
||||
OopStorage::ParState<false /* concurrent */, false /* const*/>* par_state_string,
|
||||
BoolObjectClosure* cl, int* processed, int* removed);
|
||||
BoolObjectClosure* cl, size_t* processed, size_t* removed);
|
||||
static void possibly_parallel_oops_do(
|
||||
OopStorage::ParState<false /* concurrent */, false /* const*/>* par_state_string,
|
||||
OopClosure* f);
|
||||
|
@ -54,8 +54,8 @@ StringCleaningTask::~StringCleaningTask() {
|
||||
}
|
||||
|
||||
void StringCleaningTask::work(uint worker_id) {
|
||||
int strings_processed = 0;
|
||||
int strings_removed = 0;
|
||||
size_t strings_processed = 0;
|
||||
size_t strings_removed = 0;
|
||||
if (_process_strings) {
|
||||
StringTable::possibly_parallel_unlink(&_par_state_string, _is_alive, &strings_processed, &strings_removed);
|
||||
Atomic::add(strings_processed, &_strings_processed);
|
||||
|
@ -40,9 +40,9 @@ private:
|
||||
|
||||
int _initial_string_table_size;
|
||||
|
||||
bool _process_strings;
|
||||
int _strings_processed;
|
||||
int _strings_removed;
|
||||
bool _process_strings;
|
||||
volatile size_t _strings_processed;
|
||||
volatile size_t _strings_removed;
|
||||
|
||||
public:
|
||||
StringCleaningTask(BoolObjectClosure* is_alive, StringDedupUnlinkOrOopsDoClosure* dedup_closure, bool process_strings);
|
||||
@ -50,8 +50,8 @@ public:
|
||||
|
||||
void work(uint worker_id);
|
||||
|
||||
size_t strings_processed() const { return (size_t)_strings_processed; }
|
||||
size_t strings_removed() const { return (size_t)_strings_removed; }
|
||||
size_t strings_processed() const { return _strings_processed; }
|
||||
size_t strings_removed() const { return _strings_removed; }
|
||||
};
|
||||
|
||||
class CodeCacheUnloadingTask {
|
||||
|
Loading…
Reference in New Issue
Block a user