Mercurial > hg > graal-compiler
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 14350:990d7aa2f325
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 | 06dfb0e4dcb8 |
children | 2cff20331ca2 |
comparison
equal
deleted
inserted
replaced
14349:06dfb0e4dcb8 | 14350:990d7aa2f325 |
---|---|
5200 int _strings_removed; | 5200 int _strings_removed; |
5201 | 5201 |
5202 bool _process_symbols; | 5202 bool _process_symbols; |
5203 int _symbols_processed; | 5203 int _symbols_processed; |
5204 int _symbols_removed; | 5204 int _symbols_removed; |
5205 | |
5206 bool _do_in_parallel; | |
5205 public: | 5207 public: |
5206 G1StringSymbolTableUnlinkTask(BoolObjectClosure* is_alive, bool process_strings, bool process_symbols) : | 5208 G1StringSymbolTableUnlinkTask(BoolObjectClosure* is_alive, bool process_strings, bool process_symbols) : |
5207 AbstractGangTask("Par String/Symbol table unlink"), _is_alive(is_alive), | 5209 AbstractGangTask("Par String/Symbol table unlink"), _is_alive(is_alive), |
5210 _do_in_parallel(G1CollectedHeap::use_parallel_gc_threads()), | |
5208 _process_strings(process_strings), _strings_processed(0), _strings_removed(0), | 5211 _process_strings(process_strings), _strings_processed(0), _strings_removed(0), |
5209 _process_symbols(process_symbols), _symbols_processed(0), _symbols_removed(0) { | 5212 _process_symbols(process_symbols), _symbols_processed(0), _symbols_removed(0) { |
5210 | 5213 |
5211 _initial_string_table_size = StringTable::the_table()->table_size(); | 5214 _initial_string_table_size = StringTable::the_table()->table_size(); |
5212 _initial_symbol_table_size = SymbolTable::the_table()->table_size(); | 5215 _initial_symbol_table_size = SymbolTable::the_table()->table_size(); |
5217 SymbolTable::clear_parallel_claimed_index(); | 5220 SymbolTable::clear_parallel_claimed_index(); |
5218 } | 5221 } |
5219 } | 5222 } |
5220 | 5223 |
5221 ~G1StringSymbolTableUnlinkTask() { | 5224 ~G1StringSymbolTableUnlinkTask() { |
5222 guarantee(!_process_strings || StringTable::parallel_claimed_index() >= _initial_string_table_size, | 5225 guarantee(!_process_strings || !_do_in_parallel || StringTable::parallel_claimed_index() >= _initial_string_table_size, |
5223 err_msg("claim value "INT32_FORMAT" after unlink less than initial string table size "INT32_FORMAT, | 5226 err_msg("claim value "INT32_FORMAT" after unlink less than initial string table size "INT32_FORMAT, |
5224 StringTable::parallel_claimed_index(), _initial_string_table_size)); | 5227 StringTable::parallel_claimed_index(), _initial_string_table_size)); |
5225 guarantee(!_process_symbols || SymbolTable::parallel_claimed_index() >= _initial_symbol_table_size, | 5228 guarantee(!_process_symbols || !_do_in_parallel || SymbolTable::parallel_claimed_index() >= _initial_symbol_table_size, |
5226 err_msg("claim value "INT32_FORMAT" after unlink less than initial symbol table size "INT32_FORMAT, | 5229 err_msg("claim value "INT32_FORMAT" after unlink less than initial symbol table size "INT32_FORMAT, |
5227 SymbolTable::parallel_claimed_index(), _initial_symbol_table_size)); | 5230 SymbolTable::parallel_claimed_index(), _initial_symbol_table_size)); |
5228 } | 5231 } |
5229 | 5232 |
5230 void work(uint worker_id) { | 5233 void work(uint worker_id) { |
5231 if (G1CollectedHeap::use_parallel_gc_threads()) { | 5234 if (_do_in_parallel) { |
5232 int strings_processed = 0; | 5235 int strings_processed = 0; |
5233 int strings_removed = 0; | 5236 int strings_removed = 0; |
5234 int symbols_processed = 0; | 5237 int symbols_processed = 0; |
5235 int symbols_removed = 0; | 5238 int symbols_removed = 0; |
5236 if (_process_strings) { | 5239 if (_process_strings) { |