--- a/hotspot/make/linux/makefiles/gcc.make Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/make/linux/makefiles/gcc.make Sat Mar 14 16:13:48 2015 +0000
@@ -214,6 +214,11 @@
# 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
--- a/hotspot/src/cpu/aarch64/vm/aarch64.ad Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/cpu/aarch64/vm/aarch64.ad Sat Mar 14 16:13:48 2015 +0000
@@ -3735,12 +3735,12 @@
interface(CONST_INTER);
%}
-// constant 'double +0.0'.
+// Double Immediate: +0.0d
operand immD0()
%{
- predicate((n->getd() == 0) &&
- (fpclassify(n->getd()) == FP_ZERO) && (signbit(n->getd()) == 0));
+ predicate(jlong_cast(n->getd()) == 0);
match(ConD);
+
op_cost(0);
format %{ %}
interface(CONST_INTER);
@@ -3765,12 +3765,12 @@
interface(CONST_INTER);
%}
-// constant 'float +0.0'.
+// Float Immediate: +0.0f.
operand immF0()
%{
- predicate((n->getf() == 0) &&
- (fpclassify(n->getf()) == FP_ZERO) && (signbit(n->getf()) == 0));
+ predicate(jint_cast(n->getf()) == 0);
match(ConF);
+
op_cost(0);
format %{ %}
interface(CONST_INTER);
--- a/hotspot/src/cpu/ppc/vm/ppc.ad Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/cpu/ppc/vm/ppc.ad Sat Mar 14 16:13:48 2015 +0000
@@ -4416,11 +4416,11 @@
interface(CONST_INTER);
%}
-// constant 'float +0.0'.
+// Float Immediate: +0.0f.
operand immF_0() %{
- predicate((n->getf() == 0) &&
- (fpclassify(n->getf()) == FP_ZERO) && (signbit(n->getf()) == 0));
+ predicate(jint_cast(n->getf()) == 0);
match(ConF);
+
op_cost(0);
format %{ %}
interface(CONST_INTER);
--- a/hotspot/src/cpu/sparc/vm/sparc.ad Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/cpu/sparc/vm/sparc.ad Sat Mar 14 16:13:48 2015 +0000
@@ -3758,13 +3758,9 @@
interface(CONST_INTER);
%}
+// Double Immediate: +0.0d
operand immD0() %{
-#ifdef _LP64
- // on 64-bit architectures this comparision is faster
predicate(jlong_cast(n->getd()) == 0);
-#else
- predicate((n->getd() == 0) && (fpclass(n->getd()) == FP_PZERO));
-#endif
match(ConD);
op_cost(0);
@@ -3781,9 +3777,9 @@
interface(CONST_INTER);
%}
-// Float Immediate: 0
+// Float Immediate: +0.0f
operand immF0() %{
- predicate((n->getf() == 0) && (fpclass(n->getf()) == FP_PZERO));
+ predicate(jint_cast(n->getf()) == 0);
match(ConF);
op_cost(0);
--- a/hotspot/src/os/linux/vm/os_linux.cpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/os/linux/vm/os_linux.cpp Sat Mar 14 16:13:48 2015 +0000
@@ -3732,14 +3732,14 @@
// 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 @@
}
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 @@
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 @@
}
}
- 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 @@
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());
}
--- a/hotspot/src/share/vm/asm/codeBuffer.cpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/share/vm/asm/codeBuffer.cpp Sat Mar 14 16:13:48 2015 +0000
@@ -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::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.
--- a/hotspot/src/share/vm/classfile/systemDictionary.cpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp Sat Mar 14 16:13:48 2015 +0000
@@ -1368,8 +1368,6 @@
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
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp Sat Mar 14 16:13:48 2015 +0000
@@ -2170,12 +2170,13 @@
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");
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp Sat Mar 14 16:13:48 2015 +0000
@@ -853,7 +853,7 @@
// 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 @@
// 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");
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CardCounts.hpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CardCounts.hpp Sat Mar 14 16:13:48 2015 +0000
@@ -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 @@
"_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);
}
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Sat Mar 14 16:13:48 2015 +0000
@@ -5425,7 +5425,7 @@
// 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)
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp Sat Mar 14 16:13:48 2015 +0000
@@ -324,9 +324,8 @@
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;
}
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.cpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.cpp Sat Mar 14 16:13:48 2015 +0000
@@ -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 @@
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;
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp Sat Mar 14 16:13:48 2015 +0000
@@ -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 @@
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();
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.cpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.cpp Sat Mar 14 16:13:48 2015 +0000
@@ -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 @@
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"));
}
--- a/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp Sat Mar 14 16:13:48 2015 +0000
@@ -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::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 @@
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 @@
_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) {
--- a/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp Sat Mar 14 16:13:48 2015 +0000
@@ -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 @@
// 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 @@
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;
--- a/hotspot/src/share/vm/gc_implementation/shared/gcUtil.hpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/share/vm/gc_implementation/shared/gcUtil.hpp Sat Mar 14 16:13:48 2015 +0000
@@ -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 @@
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,
--- a/hotspot/src/share/vm/gc_implementation/shared/liveRange.hpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/share/vm/gc_implementation/shared/liveRange.hpp Sat Mar 14 16:13:48 2015 +0000
@@ -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 @@
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);
}
--- a/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.cpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.cpp Sat Mar 14 16:13:48 2015 +0000
@@ -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);
}
--- a/hotspot/src/share/vm/memory/allocation.cpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/share/vm/memory/allocation.cpp Sat Mar 14 16:13:48 2015 +0000
@@ -562,7 +562,6 @@
// 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) {
--- a/hotspot/src/share/vm/memory/blockOffsetTable.cpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/share/vm/memory/blockOffsetTable.cpp Sat Mar 14 16:13:48 2015 +0000
@@ -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 @@
}
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;
}
--- a/hotspot/src/share/vm/memory/heap.cpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/share/vm/memory/heap.cpp Sat Mar 14 16:13:48 2015 +0000
@@ -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 @@
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_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;
--- a/hotspot/src/share/vm/memory/referenceProcessor.cpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/share/vm/memory/referenceProcessor.cpp Sat Mar 14 16:13:48 2015 +0000
@@ -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 @@
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 @@
}
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;
--- a/hotspot/src/share/vm/opto/chaitin.cpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/share/vm/opto/chaitin.cpp Sat Mar 14 16:13:48 2015 +0000
@@ -602,7 +602,7 @@
// 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) {
--- a/hotspot/src/share/vm/opto/graphKit.cpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/share/vm/opto/graphKit.cpp Sat Mar 14 16:13:48 2015 +0000
@@ -3027,12 +3027,7 @@
// 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
--- a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp Sat Mar 14 16:13:48 2015 +0000
@@ -2902,18 +2902,13 @@
// }
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
}
--- a/hotspot/src/share/vm/runtime/virtualspace.cpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/share/vm/runtime/virtualspace.cpp Sat Mar 14 16:13:48 2015 +0000
@@ -519,12 +519,13 @@
// 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);
--- a/hotspot/src/share/vm/utilities/bitMap.cpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/share/vm/utilities/bitMap.cpp Sat Mar 14 16:13:48 2015 +0000
@@ -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 @@
_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 @@
}
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();
--- a/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp Sat Mar 14 16:13:48 2015 +0000
@@ -44,14 +44,6 @@
#endif // SOLARIS
#include <math.h>
-#ifndef FP_PZERO
-// Linux doesn't have positive/negative zero
-#define FP_PZERO FP_ZERO
-#endif
-#if (!defined fpclass) && ((!defined SPARC) || (!defined SOLARIS))
-#define fpclass fpclassify
-#endif
-
#include <time.h>
#include <fcntl.h>
#include <dlfcn.h>
--- a/hotspot/src/share/vm/utilities/globalDefinitions_sparcWorks.hpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/share/vm/utilities/globalDefinitions_sparcWorks.hpp Sat Mar 14 16:13:48 2015 +0000
@@ -48,15 +48,6 @@
# include <ieeefp.h>
#endif
# include <math.h>
-#ifdef LINUX
-#ifndef FP_PZERO
- // Linux doesn't have positive/negative zero
- #define FP_PZERO FP_ZERO
-#endif
-#ifndef fpclass
- #define fpclass fpclassify
-#endif
-#endif
# include <time.h>
# include <fcntl.h>
# include <dlfcn.h>
--- a/hotspot/src/share/vm/utilities/globalDefinitions_xlc.hpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/share/vm/utilities/globalDefinitions_xlc.hpp Sat Mar 14 16:13:48 2015 +0000
@@ -41,14 +41,6 @@
#include <wchar.h>
#include <math.h>
-#ifndef FP_PZERO
-// Linux doesn't have positive/negative zero
-#define FP_PZERO FP_ZERO
-#endif
-#if (!defined fpclass)
-#define fpclass fpclassify
-#endif
-
#include <time.h>
#include <fcntl.h>
#include <dlfcn.h>
--- a/hotspot/src/share/vm/utilities/workgroup.cpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/share/vm/utilities/workgroup.cpp Sat Mar 14 16:13:48 2015 +0000
@@ -124,7 +124,7 @@
// 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 @@
}
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);
--- a/hotspot/src/share/vm/utilities/yieldingWorkgroup.cpp Fri Mar 13 21:53:13 2015 +0300
+++ b/hotspot/src/share/vm/utilities/yieldingWorkgroup.cpp Sat Mar 14 16:13:48 2015 +0000
@@ -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 @@
_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 {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/loopopts/ConstFPVectorization.java Sat Mar 14 16:13:48 2015 +0000
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8074869
+ * @summary C2 code generator can replace -0.0f with +0.0f on Linux
+ * @run main ConstFPVectorization 8
+ * @author volker.simonis@gmail.com
+ *
+ */
+
+public class ConstFPVectorization {
+
+ static float[] f = new float[16];
+ static double[] d = new double[16];
+
+ static void floatLoop(int count) {
+ for (int i = 0; i < count; i++) {
+ f[i] = -0.0f;
+ }
+ }
+
+ static void doubleLoop(int count) {
+ for (int i = 0; i < count; i++) {
+ d[i] = -0.0d;
+ }
+ }
+
+ public static void main(String args[]) {
+ for (int i = 0; i < 10_000; i++) {
+ floatLoop(Integer.parseInt(args[0]));
+ doubleLoop(Integer.parseInt(args[0]));
+ }
+ for (int i = 0; i < Integer.parseInt(args[0]); i++) {
+ if (Float.floatToRawIntBits(f[i]) != Float.floatToRawIntBits(-0.0f))
+ throw new Error("Float error at index " + i);
+ if (Double.doubleToRawLongBits(d[i]) != Double.doubleToRawLongBits(-0.0d))
+ throw new Error("Double error at index " + i);
+ }
+ }
+}