Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 17652:0eb64cfc0b76
8033443: Test8000311 fails after latest changes to parallelize string and symbol table unlink
Summary: When string and symbol table unlink are not performed in parallel, the claim index we check is not updated, and so a guarantee fails. Take this into account when checking the guarantee.
Reviewed-by: brutisso, jwilhelm
author | tschatzl |
---|---|
date | Wed, 05 Feb 2014 14:29:34 +0100 |
parents | 7a860525e91e |
children | 86b64209f715 |
comparison
equal
deleted
inserted
replaced
17651:7a860525e91e | 17652:0eb64cfc0b76 |
---|---|
5208 int _strings_removed; | 5208 int _strings_removed; |
5209 | 5209 |
5210 bool _process_symbols; | 5210 bool _process_symbols; |
5211 int _symbols_processed; | 5211 int _symbols_processed; |
5212 int _symbols_removed; | 5212 int _symbols_removed; |
5213 | |
5214 bool _do_in_parallel; | |
5213 public: | 5215 public: |
5214 G1StringSymbolTableUnlinkTask(BoolObjectClosure* is_alive, bool process_strings, bool process_symbols) : | 5216 G1StringSymbolTableUnlinkTask(BoolObjectClosure* is_alive, bool process_strings, bool process_symbols) : |
5215 AbstractGangTask("Par String/Symbol table unlink"), _is_alive(is_alive), | 5217 AbstractGangTask("Par String/Symbol table unlink"), _is_alive(is_alive), |
5218 _do_in_parallel(G1CollectedHeap::use_parallel_gc_threads()), | |
5216 _process_strings(process_strings), _strings_processed(0), _strings_removed(0), | 5219 _process_strings(process_strings), _strings_processed(0), _strings_removed(0), |
5217 _process_symbols(process_symbols), _symbols_processed(0), _symbols_removed(0) { | 5220 _process_symbols(process_symbols), _symbols_processed(0), _symbols_removed(0) { |
5218 | 5221 |
5219 _initial_string_table_size = StringTable::the_table()->table_size(); | 5222 _initial_string_table_size = StringTable::the_table()->table_size(); |
5220 _initial_symbol_table_size = SymbolTable::the_table()->table_size(); | 5223 _initial_symbol_table_size = SymbolTable::the_table()->table_size(); |
5225 SymbolTable::clear_parallel_claimed_index(); | 5228 SymbolTable::clear_parallel_claimed_index(); |
5226 } | 5229 } |
5227 } | 5230 } |
5228 | 5231 |
5229 ~G1StringSymbolTableUnlinkTask() { | 5232 ~G1StringSymbolTableUnlinkTask() { |
5230 guarantee(!_process_strings || StringTable::parallel_claimed_index() >= _initial_string_table_size, | 5233 guarantee(!_process_strings || !_do_in_parallel || StringTable::parallel_claimed_index() >= _initial_string_table_size, |
5231 err_msg("claim value "INT32_FORMAT" after unlink less than initial string table size "INT32_FORMAT, | 5234 err_msg("claim value "INT32_FORMAT" after unlink less than initial string table size "INT32_FORMAT, |
5232 StringTable::parallel_claimed_index(), _initial_string_table_size)); | 5235 StringTable::parallel_claimed_index(), _initial_string_table_size)); |
5233 guarantee(!_process_symbols || SymbolTable::parallel_claimed_index() >= _initial_symbol_table_size, | 5236 guarantee(!_process_symbols || !_do_in_parallel || SymbolTable::parallel_claimed_index() >= _initial_symbol_table_size, |
5234 err_msg("claim value "INT32_FORMAT" after unlink less than initial symbol table size "INT32_FORMAT, | 5237 err_msg("claim value "INT32_FORMAT" after unlink less than initial symbol table size "INT32_FORMAT, |
5235 SymbolTable::parallel_claimed_index(), _initial_symbol_table_size)); | 5238 SymbolTable::parallel_claimed_index(), _initial_symbol_table_size)); |
5236 } | 5239 } |
5237 | 5240 |
5238 void work(uint worker_id) { | 5241 void work(uint worker_id) { |
5239 if (G1CollectedHeap::use_parallel_gc_threads()) { | 5242 if (_do_in_parallel) { |
5240 int strings_processed = 0; | 5243 int strings_processed = 0; |
5241 int strings_removed = 0; | 5244 int strings_removed = 0; |
5242 int symbols_processed = 0; | 5245 int symbols_processed = 0; |
5243 int symbols_removed = 0; | 5246 int symbols_removed = 0; |
5244 if (_process_strings) { | 5247 if (_process_strings) { |