mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 10:34:38 +02:00
8155638: Resource allocated BitMaps are often cleared twice
Reviewed-by: neliasso, kvn
This commit is contained in:
parent
47309c3715
commit
23e05cabc5
9 changed files with 9 additions and 40 deletions
|
@ -68,7 +68,6 @@ void LinearScan::allocate_fpu_stack() {
|
|||
if (b->number_of_preds() > 1) {
|
||||
int id = b->first_lir_instruction_id();
|
||||
ResourceBitMap regs(FrameMap::nof_fpu_regs);
|
||||
regs.clear();
|
||||
|
||||
iw.walk_to(id); // walk after the first instruction (always a label) of the block
|
||||
assert(iw.current_position() == id, "did not walk completely to id");
|
||||
|
|
|
@ -147,10 +147,8 @@ IRScope::IRScope(Compilation* compilation, IRScope* caller, int caller_bci, ciMe
|
|||
_wrote_volatile = false;
|
||||
_start = NULL;
|
||||
|
||||
if (osr_bci == -1) {
|
||||
_requires_phi_function.clear();
|
||||
} else {
|
||||
// selective creation of phi functions is not possibel in osr-methods
|
||||
if (osr_bci != -1) {
|
||||
// selective creation of phi functions is not possibel in osr-methods
|
||||
_requires_phi_function.set_range(0, method->max_locals());
|
||||
}
|
||||
|
||||
|
@ -540,7 +538,6 @@ ComputeLinearScanOrder::ComputeLinearScanOrder(Compilation* c, BlockBegin* start
|
|||
{
|
||||
TRACE_LINEAR_SCAN(2, tty->print_cr("***** computing linear-scan block order"));
|
||||
|
||||
init_visited();
|
||||
count_edges(start_block, NULL);
|
||||
|
||||
if (compilation()->is_profiling()) {
|
||||
|
@ -646,7 +643,6 @@ void ComputeLinearScanOrder::mark_loops() {
|
|||
TRACE_LINEAR_SCAN(3, tty->print_cr("----- marking loops"));
|
||||
|
||||
_loop_map = BitMap2D(_num_loops, _max_block_id);
|
||||
_loop_map.clear();
|
||||
|
||||
for (int i = _loop_end_blocks.length() - 1; i >= 0; i--) {
|
||||
BlockBegin* loop_end = _loop_end_blocks.at(i);
|
||||
|
|
|
@ -1387,7 +1387,6 @@ Instruction* LIRGenerator::instruction_for_vreg(int reg_num) {
|
|||
void LIRGenerator::set_vreg_flag(int vreg_num, VregFlag f) {
|
||||
if (_vreg_flags.size_in_bits() == 0) {
|
||||
BitMap2D temp(100, num_vreg_flags);
|
||||
temp.clear();
|
||||
_vreg_flags = temp;
|
||||
}
|
||||
_vreg_flags.at_put_grow(vreg_num, f, true);
|
||||
|
|
|
@ -562,14 +562,13 @@ void LinearScan::compute_local_live_sets() {
|
|||
LIR_OpVisitState visitor;
|
||||
|
||||
BitMap2D local_interval_in_loop = BitMap2D(_num_virtual_regs, num_loops());
|
||||
local_interval_in_loop.clear();
|
||||
|
||||
// iterate all blocks
|
||||
for (int i = 0; i < num_blocks; i++) {
|
||||
BlockBegin* block = block_at(i);
|
||||
|
||||
ResourceBitMap live_gen(live_size); live_gen.clear();
|
||||
ResourceBitMap live_kill(live_size); live_kill.clear();
|
||||
ResourceBitMap live_gen(live_size);
|
||||
ResourceBitMap live_kill(live_size);
|
||||
|
||||
if (block->is_set(BlockBegin::exception_entry_flag)) {
|
||||
// Phi functions at the begin of an exception handler are
|
||||
|
@ -715,8 +714,8 @@ void LinearScan::compute_local_live_sets() {
|
|||
|
||||
block->set_live_gen (live_gen);
|
||||
block->set_live_kill(live_kill);
|
||||
block->set_live_in (ResourceBitMap(live_size)); block->live_in().clear();
|
||||
block->set_live_out (ResourceBitMap(live_size)); block->live_out().clear();
|
||||
block->set_live_in (ResourceBitMap(live_size));
|
||||
block->set_live_out (ResourceBitMap(live_size));
|
||||
|
||||
TRACE_LINEAR_SCAN(4, tty->print("live_gen B%d ", block->block_id()); print_bitmap(block->live_gen()));
|
||||
TRACE_LINEAR_SCAN(4, tty->print("live_kill B%d ", block->block_id()); print_bitmap(block->live_kill()));
|
||||
|
@ -741,7 +740,7 @@ void LinearScan::compute_global_live_sets() {
|
|||
bool change_occurred;
|
||||
bool change_occurred_in_block;
|
||||
int iteration_count = 0;
|
||||
ResourceBitMap live_out(live_set_size()); live_out.clear(); // scratch set for calculations
|
||||
ResourceBitMap live_out(live_set_size()); // scratch set for calculations
|
||||
|
||||
// Perform a backward dataflow analysis to compute live_out and live_in for each block.
|
||||
// The loop is executed until a fixpoint is reached (no changes in an iteration)
|
||||
|
@ -827,7 +826,6 @@ void LinearScan::compute_global_live_sets() {
|
|||
|
||||
// check that the live_in set of the first block is empty
|
||||
ResourceBitMap live_in_args(ir()->start()->live_in().size());
|
||||
live_in_args.clear();
|
||||
if (!ir()->start()->live_in().is_same(live_in_args)) {
|
||||
#ifdef ASSERT
|
||||
tty->print_cr("Error: live_in set of first block must be empty (when this fails, virtual registers are used before they are defined)");
|
||||
|
@ -1774,8 +1772,8 @@ void LinearScan::resolve_data_flow() {
|
|||
|
||||
int num_blocks = block_count();
|
||||
MoveResolver move_resolver(this);
|
||||
ResourceBitMap block_completed(num_blocks); block_completed.clear();
|
||||
ResourceBitMap already_resolved(num_blocks); already_resolved.clear();
|
||||
ResourceBitMap block_completed(num_blocks);
|
||||
ResourceBitMap already_resolved(num_blocks);
|
||||
|
||||
int i;
|
||||
for (i = 0; i < num_blocks; i++) {
|
||||
|
@ -3750,7 +3748,6 @@ void MoveResolver::verify_before_resolve() {
|
|||
|
||||
|
||||
ResourceBitMap used_regs(LinearScan::nof_regs + allocator()->frame_map()->argcount() + allocator()->max_spills());
|
||||
used_regs.clear();
|
||||
if (!_multiple_reads_allowed) {
|
||||
for (i = 0; i < _mapping_from.length(); i++) {
|
||||
Interval* it = _mapping_from.at(i);
|
||||
|
@ -6319,7 +6316,6 @@ void ControlFlowOptimizer::delete_unnecessary_jumps(BlockList* code) {
|
|||
void ControlFlowOptimizer::delete_jumps_to_return(BlockList* code) {
|
||||
#ifdef ASSERT
|
||||
ResourceBitMap return_converted(BlockBegin::number_of_blocks());
|
||||
return_converted.clear();
|
||||
#endif
|
||||
|
||||
for (int i = code->length() - 1; i >= 0; i--) {
|
||||
|
|
|
@ -53,7 +53,6 @@ class ValueSet: public CompilationResourceObj {
|
|||
};
|
||||
|
||||
inline ValueSet::ValueSet() : _map(Instruction::number_of_instructions()) {
|
||||
_map.clear();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -449,7 +449,6 @@ ResourceBitMap ciMethod::live_local_oops_at_bci(int bci) {
|
|||
OopMapCache::compute_one_oop_map(get_Method(), bci, &mask);
|
||||
int mask_size = max_locals();
|
||||
ResourceBitMap result(mask_size);
|
||||
result.clear();
|
||||
int i;
|
||||
for (i = 0; i < mask_size ; i++ ) {
|
||||
if (mask.is_oop(i)) result.set_bit(i);
|
||||
|
|
|
@ -137,11 +137,6 @@ MethodLiveness::MethodLiveness(Arena* arena, ciMethod* method)
|
|||
_arena = arena;
|
||||
_method = method;
|
||||
_bit_map_size_bits = method->max_locals();
|
||||
|
||||
|
||||
#ifdef COMPILER1
|
||||
_bci_block_start.clear();
|
||||
#endif
|
||||
}
|
||||
|
||||
void MethodLiveness::compute_liveness() {
|
||||
|
@ -587,14 +582,6 @@ MethodLiveness::BasicBlock::BasicBlock(MethodLiveness *analyzer, int start, int
|
|||
new (analyzer->arena()) GrowableArray<MethodLiveness::BasicBlock*>(analyzer->arena(), 5, 0, NULL);
|
||||
_exception_predecessors =
|
||||
new (analyzer->arena()) GrowableArray<MethodLiveness::BasicBlock*>(analyzer->arena(), 5, 0, NULL);
|
||||
_normal_exit.clear();
|
||||
_exception_exit.clear();
|
||||
_entry.clear();
|
||||
|
||||
// this initialization is not strictly necessary.
|
||||
// _gen and _kill are cleared at the beginning of compute_gen_kill_range()
|
||||
_gen.clear();
|
||||
_kill.clear();
|
||||
}
|
||||
|
||||
|
||||
|
@ -1020,7 +1007,6 @@ MethodLivenessResult MethodLiveness::BasicBlock::get_liveness_at(ciMethod* metho
|
|||
_last_bci = bci;
|
||||
}
|
||||
|
||||
answer.clear();
|
||||
answer.set_union(_normal_exit);
|
||||
answer.set_difference(_kill);
|
||||
answer.set_union(_gen);
|
||||
|
|
|
@ -435,7 +435,6 @@ class BitMap2D VALUE_OBJ_CLASS_SPEC {
|
|||
void clear_bit(idx_t slot_index, idx_t bit_within_slot_index);
|
||||
void at_put(idx_t slot_index, idx_t bit_within_slot_index, bool value);
|
||||
void at_put_grow(idx_t slot_index, idx_t bit_within_slot_index, bool value);
|
||||
void clear();
|
||||
};
|
||||
|
||||
// Closure for iterating over BitMaps
|
||||
|
|
|
@ -367,8 +367,4 @@ inline void BitMap2D::at_put_grow(idx_t slot_index, idx_t bit_within_slot_index,
|
|||
_map.at_put(bit, value);
|
||||
}
|
||||
|
||||
inline void BitMap2D::clear() {
|
||||
_map.clear();
|
||||
}
|
||||
|
||||
#endif // SHARE_VM_UTILITIES_BITMAP_INLINE_HPP
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue