8073315: Enable gcc -Wtype-limits and fix upcoming issues

Relevant fixes in blockOffsetTable.cpp, os_linux.cpp, parCardTableModRefBS.cpp.

Reviewed-by: jwilhelm, kbarrett, simonis
This commit is contained in:
Goetz Lindenmaier 2015-02-16 14:07:36 +01:00
parent 2632925f9f
commit a7edf52a02
28 changed files with 71 additions and 86 deletions

View File

@ -214,6 +214,11 @@ ifeq ($(USE_CLANG),)
# conversions which might affect the values. Only enable it in earlier versions.
ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
WARNING_FLAGS += -Wconversion
endif
ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
# This flag is only known since GCC 4.3. Gcc 4.8 contains a fix so that with templates no
# warnings are issued: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=11856
WARNING_FLAGS += -Wtype-limits
endif
endif

View File

@ -3732,14 +3732,14 @@ char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
// Does this overlap the block we wanted? Give back the overlapped
// parts and try again.
size_t top_overlap = requested_addr + (bytes + gap) - base[i];
if (top_overlap >= 0 && top_overlap < bytes) {
ptrdiff_t top_overlap = requested_addr + (bytes + gap) - base[i];
if (top_overlap >= 0 && (size_t)top_overlap < bytes) {
unmap_memory(base[i], top_overlap);
base[i] += top_overlap;
size[i] = bytes - top_overlap;
} else {
size_t bottom_overlap = base[i] + bytes - requested_addr;
if (bottom_overlap >= 0 && bottom_overlap < bytes) {
ptrdiff_t bottom_overlap = base[i] + bytes - requested_addr;
if (bottom_overlap >= 0 && (size_t)bottom_overlap < bytes) {
unmap_memory(requested_addr, bottom_overlap);
size[i] = bytes - bottom_overlap;
} else {
@ -6003,11 +6003,11 @@ int os::get_core_path(char* buffer, size_t bufferSize) {
}
if (strlen(core_pattern) == 0) {
return 0;
return -1;
}
char *pid_pos = strstr(core_pattern, "%p");
size_t written;
int written;
if (core_pattern[0] == '/') {
written = jio_snprintf(buffer, bufferSize, core_pattern);
@ -6016,8 +6016,7 @@ int os::get_core_path(char* buffer, size_t bufferSize) {
const char* p = get_current_directory(cwd, PATH_MAX);
if (p == NULL) {
assert(p != NULL, "failed to get current directory");
return 0;
return -1;
}
if (core_pattern[0] == '|') {
@ -6029,8 +6028,11 @@ int os::get_core_path(char* buffer, size_t bufferSize) {
}
}
if ((written >= 0) && (written < bufferSize)
&& (pid_pos == NULL) && (core_pattern[0] != '|')) {
if (written < 0) {
return -1;
}
if (((size_t)written < bufferSize) && (pid_pos == NULL) && (core_pattern[0] != '|')) {
int core_uses_pid_file = ::open("/proc/sys/kernel/core_uses_pid", O_RDONLY);
if (core_uses_pid_file != -1) {
@ -6038,7 +6040,7 @@ int os::get_core_path(char* buffer, size_t bufferSize) {
ssize_t ret = ::read(core_uses_pid_file, &core_uses_pid, 1);
::close(core_uses_pid_file);
if (core_uses_pid == '1'){
if (core_uses_pid == '1') {
jio_snprintf(buffer + written, bufferSize - written,
".%d", current_process_id());
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -926,9 +926,6 @@ void CodeBuffer::expand(CodeSection* which_cs, csize_t amount) {
void CodeBuffer::take_over_code_from(CodeBuffer* cb) {
// Must already have disposed of the old blob somehow.
assert(blob() == NULL, "must be empty");
#ifdef ASSERT
#endif
// Take the new blob away from cb.
set_blob(cb->blob());
// Take over all the section pointers.

View File

@ -1368,8 +1368,6 @@ void SystemDictionary::define_instance_class(instanceKlassHandle k, TRAPS) {
ClassLoaderData* loader_data = k->class_loader_data();
Handle class_loader_h(THREAD, loader_data->class_loader());
for (uintx it = 0; it < GCExpandToAllocateDelayMillis; it++){}
// for bootstrap and other parallel classloaders don't acquire lock,
// use placeholder token
// If a parallelCapable class loader calls define_instance_class instead of

View File

@ -2170,12 +2170,13 @@ void ConcurrentMark::completeCleanup() {
g1h->secondary_free_list_add(&tmp_free_list);
SecondaryFreeList_lock->notify_all();
}
#ifndef PRODUCT
if (G1StressConcRegionFreeing) {
for (uintx i = 0; i < G1StressConcRegionFreeingDelayMillis; ++i) {
os::sleep(Thread::current(), (jlong) 1, false);
}
}
#endif
}
}
assert(tmp_free_list.is_empty(), "post-condition");

View File

@ -853,7 +853,7 @@ public:
// Returns the card bitmap for a given task or worker id.
BitMap* count_card_bitmap_for(uint worker_id) {
assert(0 <= worker_id && worker_id < _max_worker_id, "oob");
assert(worker_id < _max_worker_id, "oob");
assert(_count_card_bitmaps != NULL, "uninitialized");
BitMap* task_card_bm = &_count_card_bitmaps[worker_id];
assert(task_card_bm->size() == _card_bm.size(), "size mismatch");
@ -863,7 +863,7 @@ public:
// Returns the array containing the marked bytes for each region,
// for the given worker or task id.
size_t* count_marked_bytes_array_for(uint worker_id) {
assert(0 <= worker_id && worker_id < _max_worker_id, "oob");
assert(worker_id < _max_worker_id, "oob");
assert(_count_marked_bytes != NULL, "uninitialized");
size_t* marked_bytes_array = _count_marked_bytes[worker_id];
assert(marked_bytes_array != NULL, "uninitialized");

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -84,13 +84,13 @@ class G1CardCounts: public CHeapObj<mtGC> {
"_ct_bot: " PTR_FORMAT,
p2i(card_ptr), p2i(_ct_bot)));
size_t card_num = pointer_delta(card_ptr, _ct_bot, sizeof(jbyte));
assert(card_num >= 0 && card_num < _reserved_max_card_num,
assert(card_num < _reserved_max_card_num,
err_msg("card pointer out of range: " PTR_FORMAT, p2i(card_ptr)));
return card_num;
}
jbyte* card_num_2_ptr(size_t card_num) {
assert(card_num >= 0 && card_num < _reserved_max_card_num,
assert(card_num < _reserved_max_card_num,
err_msg("card num out of range: "SIZE_FORMAT, card_num));
return (jbyte*) (_ct_bot + card_num);
}

View File

@ -5425,7 +5425,7 @@ public:
// limit is set using max_num_q() - which was set using ParallelGCThreads.
// So this must be true - but assert just in case someone decides to
// change the worker ids.
assert(0 <= worker_id && worker_id < limit, "sanity");
assert(worker_id < limit, "sanity");
assert(!rp->discovery_is_atomic(), "check this code");
// Select discovered lists [i, i+stride, i+2*stride,...,limit)

View File

@ -324,9 +324,8 @@ void HeapRegion::note_self_forwarding_removal_start(bool during_initial_mark,
void HeapRegion::note_self_forwarding_removal_end(bool during_initial_mark,
bool during_conc_mark,
size_t marked_bytes) {
assert(0 <= marked_bytes && marked_bytes <= used(),
err_msg("marked: "SIZE_FORMAT" used: "SIZE_FORMAT,
marked_bytes, used()));
assert(marked_bytes <= used(),
err_msg("marked: "SIZE_FORMAT" used: "SIZE_FORMAT, marked_bytes, used()));
_prev_top_at_mark_start = top();
_prev_marked_bytes = marked_bytes;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -270,7 +270,7 @@ void HeapRegionManager::par_iterate(HeapRegionClosure* blk, uint worker_id, Heap
const uint n_regions = hrclaimer->n_regions();
for (uint count = 0; count < n_regions; count++) {
const uint index = (start_index + count) % n_regions;
assert(0 <= index && index < n_regions, "sanity");
assert(index < n_regions, "sanity");
// Skip over unavailable regions
if (!is_available(index)) {
continue;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -541,7 +541,7 @@ void OtherRegionsTable::add_reference(OopOrNarrowOopStar from, uint tid) {
PerRegionTable*
OtherRegionsTable::find_region_table(size_t ind, HeapRegion* hr) const {
assert(0 <= ind && ind < _max_fine_entries, "Preconditions.");
assert(ind < _max_fine_entries, "Preconditions.");
PerRegionTable* prt = _fine_grain_regions[ind];
while (prt != NULL && prt->hr() != hr) {
prt = prt->collision_list_next();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -57,7 +57,7 @@ void HeapRegionSetBase::verify() {
check_mt_safety();
guarantee(( is_empty() && length() == 0 && total_capacity_bytes() == 0) ||
(!is_empty() && length() >= 0 && total_capacity_bytes() >= 0),
(!is_empty() && length() > 0 && total_capacity_bytes() > 0) ,
hrs_ext_msg(this, "invariant"));
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -58,7 +58,7 @@ void PtrQueue::flush_impl() {
void PtrQueue::enqueue_known_active(void* ptr) {
assert(0 <= _index && _index <= _sz, "Invariant.");
assert(_index <= _sz, "Invariant.");
assert(_index == 0 || _buf != NULL, "invariant");
while (_index == 0) {
@ -68,7 +68,7 @@ void PtrQueue::enqueue_known_active(void* ptr) {
assert(_index > 0, "postcondition");
_index -= oopSize;
_buf[byte_index_to_index((int)_index)] = ptr;
assert(0 <= _index && _index <= _sz, "Invariant.");
assert(_index <= _sz, "Invariant.");
}
void PtrQueue::locking_enqueue_completed_buffer(void** buf) {
@ -194,7 +194,6 @@ void PtrQueue::handle_zero_index() {
_buf = qset()->allocate_buffer();
_sz = qset()->buffer_size();
_index = _sz;
assert(0 <= _index && _index <= _sz, "Invariant.");
}
bool PtrQueueSet::process_or_enqueue_complete_buffer(void** buf) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -195,8 +195,9 @@ process_chunk_boundaries(Space* sp,
// our closures depend on this property and do not protect against
// double scans.
uintptr_t cur_chunk_index = addr_to_chunk_index(chunk_mr.start());
cur_chunk_index = cur_chunk_index - lowest_non_clean_base_chunk_index;
uintptr_t start_chunk_index = addr_to_chunk_index(chunk_mr.start());
assert(start_chunk_index >= lowest_non_clean_base_chunk_index, "Bounds error.");
uintptr_t cur_chunk_index = start_chunk_index - lowest_non_clean_base_chunk_index;
NOISY(tty->print_cr("===========================================================================");)
NOISY(tty->print_cr(" process_chunk_boundary: Called with [" PTR_FORMAT "," PTR_FORMAT ")",
@ -242,8 +243,7 @@ process_chunk_boundaries(Space* sp,
if (first_dirty_card != NULL) {
NOISY(tty->print_cr(" LNC: Found a dirty card at " PTR_FORMAT " in current chunk",
first_dirty_card);)
assert(0 <= cur_chunk_index && cur_chunk_index < lowest_non_clean_chunk_size,
"Bounds error.");
assert(cur_chunk_index < lowest_non_clean_chunk_size, "Bounds error.");
assert(lowest_non_clean[cur_chunk_index] == NULL,
"Write exactly once : value should be stable hereafter for this round");
lowest_non_clean[cur_chunk_index] = first_dirty_card;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -103,7 +103,7 @@ class AdaptiveWeightedAverage : public CHeapObj<mtGC> {
static inline float exp_avg(float avg, float sample,
unsigned int weight) {
assert(0 <= weight && weight <= 100, "weight must be a percent");
assert(weight <= 100, "weight must be a percent");
return (100.0F - weight) * avg / 100.0F + weight * sample / 100.0F;
}
static inline size_t exp_avg(size_t avg, size_t sample,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -42,7 +42,6 @@ public:
MemRegion::set_end(e);
}
void set_word_size(size_t ws) {
assert(ws >= 0, "should be a non-zero range");
MemRegion::set_word_size(ws);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -36,8 +36,7 @@
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
MutableSpace::MutableSpace(size_t alignment): ImmutableSpace(), _top(NULL), _alignment(alignment) {
assert(MutableSpace::alignment() >= 0 &&
MutableSpace::alignment() % os::vm_page_size() == 0,
assert(MutableSpace::alignment() % os::vm_page_size() == 0,
"Space should be aligned");
_mangler = new MutableSpaceMangler(this);
}

View File

@ -562,7 +562,6 @@ void* Arena::grow(size_t x, AllocFailType alloc_failmode) {
// Reallocate storage in Arena.
void *Arena::Arealloc(void* old_ptr, size_t old_size, size_t new_size, AllocFailType alloc_failmode) {
assert(new_size >= 0, "bad size");
if (new_size == 0) return NULL;
#ifdef ASSERT
if (UseMallocOnly) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -792,6 +792,5 @@ void BlockOffsetArrayContigSpace::zero_bottom_entry() {
}
size_t BlockOffsetArrayContigSpace::last_active_index() const {
size_t result = _next_offset_index - 1;
return result >= 0 ? result : 0;
return _next_offset_index == 0 ? 0 : _next_offset_index - 1;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -52,7 +52,7 @@ CodeHeap::CodeHeap(const char* name, const int code_blob_type)
void CodeHeap::mark_segmap_as_free(size_t beg, size_t end) {
assert(0 <= beg && beg < _number_of_committed_segments, "interval begin out of bounds");
assert( beg < _number_of_committed_segments, "interval begin out of bounds");
assert(beg < end && end <= _number_of_committed_segments, "interval end out of bounds");
// setup _segmap pointers for faster indexing
address p = (address)_segmap.low() + beg;
@ -63,7 +63,7 @@ void CodeHeap::mark_segmap_as_free(size_t beg, size_t end) {
void CodeHeap::mark_segmap_as_used(size_t beg, size_t end) {
assert(0 <= beg && beg < _number_of_committed_segments, "interval begin out of bounds");
assert( beg < _number_of_committed_segments, "interval begin out of bounds");
assert(beg < end && end <= _number_of_committed_segments, "interval end out of bounds");
// setup _segmap pointers for faster indexing
address p = (address)_segmap.low() + beg;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -987,7 +987,7 @@ inline DiscoveredList* ReferenceProcessor::get_discovered_list(ReferenceType rt)
id = next_id();
}
}
assert(0 <= id && id < _max_num_q, "Id is out-of-bounds (call Freud?)");
assert(id < _max_num_q, "Id is out-of-bounds (call Freud?)");
// Get the discovered queue to which we will add
DiscoveredList* list = NULL;
@ -1345,7 +1345,7 @@ ReferenceProcessor::preclean_discovered_reflist(DiscoveredList& refs_list,
}
const char* ReferenceProcessor::list_name(uint i) {
assert(i >= 0 && i <= _max_num_q * number_of_subclasses_of_ref(),
assert(i <= _max_num_q * number_of_subclasses_of_ref(),
"Out of bounds index");
int j = i / _max_num_q;

View File

@ -602,7 +602,7 @@ void PhaseChaitin::Register_Allocate() {
// This frame must preserve the required fp alignment
_framesize = round_to(_framesize, Matcher::stack_alignment_in_slots());
assert( _framesize >= 0 && _framesize <= 1000000, "sanity check" );
assert(_framesize <= 1000000, "sanity check");
#ifndef PRODUCT
_total_framesize += _framesize;
if ((int)_framesize > _max_framesize) {

View File

@ -3027,12 +3027,7 @@ Node* GraphKit::gen_checkcast(Node *obj, Node* superklass,
// We may not have profiling here or it may not help us. If we have
// a speculative type use it to perform an exact cast.
ciKlass* spec_obj_type = obj_type->speculative_type();
if (spec_obj_type != NULL ||
(data != NULL &&
// Counter has never been decremented (due to cast failure).
// ...This is a reasonable thing to expect. It is true of
// all casts inserted by javac to implement generic types.
data->as_CounterData()->count() >= 0)) {
if (spec_obj_type != NULL || data != NULL) {
cast_obj = maybe_cast_profiled_receiver(not_null_obj, tk->klass(), spec_obj_type, safe_for_replace);
if (cast_obj != NULL) {
if (failure_control != NULL) // failure is now impossible

View File

@ -2902,18 +2902,13 @@ void VM_RedefineClasses::rewrite_cp_refs_in_stack_map_table(
// }
assert(stackmap_p + 1 <= stackmap_end, "no room for frame_type");
// The Linux compiler does not like frame_type to be u1 or u2. It
// issues the following warning for the first if-statement below:
//
// "warning: comparison is always true due to limited range of data type"
//
u4 frame_type = *stackmap_p;
u1 frame_type = *stackmap_p;
stackmap_p++;
// same_frame {
// u1 frame_type = SAME; /* 0-63 */
// }
if (frame_type >= 0 && frame_type <= 63) {
if (frame_type <= 63) {
// nothing more to do for same_frame
}

View File

@ -519,12 +519,13 @@ void ReservedHeapSpace::initialize_compressed_heap(const size_t size, size_t ali
// Calc address range within we try to attach (range of possible start addresses).
char *const highest_start = (char *)align_ptr_down(zerobased_max - size, attach_point_alignment);
// SS10 and SS12u1 cannot compile "(char *)UnscaledOopHeapMax - size" on solaris sparc 32-bit:
// "Cannot use int to initialize char*." Introduce aux variable.
char *unscaled_end = (char *)UnscaledOopHeapMax;
unscaled_end -= size;
char *lowest_start = (size < UnscaledOopHeapMax) ?
MAX2(unscaled_end, aligned_heap_base_min_address) : aligned_heap_base_min_address;
// Need to be careful about size being guaranteed to be less
// than UnscaledOopHeapMax due to type constraints.
char *lowest_start = aligned_heap_base_min_address;
uint64_t unscaled_end = UnscaledOopHeapMax - size;
if (unscaled_end < UnscaledOopHeapMax) { // unscaled_end wrapped if size is large
lowest_start = MAX2(lowest_start, (char*)unscaled_end);
}
lowest_start = (char *)align_ptr_up(lowest_start, attach_point_alignment);
try_reserve_range(highest_start, lowest_start, attach_point_alignment,
aligned_heap_base_min_address, zerobased_max, size, alignment, large);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -33,7 +33,6 @@ BitMap::BitMap(bm_word_t* map, idx_t size_in_bits) :
_map(map), _size(size_in_bits), _map_allocator(false)
{
assert(sizeof(bm_word_t) == BytesPerWord, "Implementation assumption.");
assert(size_in_bits >= 0, "just checking");
}
@ -45,7 +44,6 @@ BitMap::BitMap(idx_t size_in_bits, bool in_resource_area) :
}
void BitMap::resize(idx_t size_in_bits, bool in_resource_area) {
assert(size_in_bits >= 0, "just checking");
idx_t old_size_in_words = size_in_words();
bm_word_t* old_map = map();

View File

@ -124,7 +124,7 @@ GangWorker* AbstractWorkGang::gang_worker(uint i) const {
// Array index bounds checking.
GangWorker* result = NULL;
assert(gang_workers() != NULL, "No workers for indexing");
assert(((i >= 0) && (i < total_workers())), "Worker index out of bounds");
assert(i < total_workers(), "Worker index out of bounds");
result = _gang_workers[i];
assert(result != NULL, "Indexing to null worker");
return result;
@ -463,7 +463,7 @@ void SubTasksDone::clear() {
}
bool SubTasksDone::is_task_claimed(uint t) {
assert(0 <= t && t < _n_tasks, "bad task id.");
assert(t < _n_tasks, "bad task id.");
uint old = _tasks[t];
if (old == 0) {
old = Atomic::cmpxchg(1, &_tasks[t], 0);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -120,7 +120,6 @@ void YieldingFlexibleWorkGang::start_task(YieldingFlexibleGangTask* new_task) {
_sequence_number++;
uint requested_size = new_task->requested_size();
assert(requested_size >= 0, "Should be non-negative");
if (requested_size != 0) {
_active_workers = MIN2(requested_size, total_workers());
} else {