src/share/vm/gc_implementation/shared/gcTrace.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
hsx24-atomic Cdiff src/share/vm/gc_implementation/shared/gcTrace.cpp
src/share/vm/gc_implementation/shared/gcTrace.cpp
Print this page
rev 4213 : 8008382: Remove redundant use of Atomic::add(jlong, jlong *) in create_new_gc_id()
Summary: There is no need to use atomics in create_new_gc_id() since it is not called by multiple threads in parallel. Also, Atomic::add(jlong, jlong *) is broken for ARM.
Reviewed-by:
*** 25,43 ****
#include "precompiled.hpp"
#include "gc_implementation/shared/gcHeapSummary.hpp"
#include "gc_implementation/shared/gcTimer.hpp"
#include "gc_implementation/shared/gcTrace.hpp"
#include "memory/referenceProcessorStats.hpp"
- #include "runtime/atomic.hpp"
#include "utilities/globalDefinitions.hpp"
#define assert_unset_gc_id() assert(_shared_gc_info.id() == SharedGCInfo::UNSET_GCID, "GC already started?")
#define assert_set_gc_id() assert(_shared_gc_info.id() != SharedGCInfo::UNSET_GCID, "GC not started?")
! static volatile jlong GCTracer_next_gc_id = 0;
static GCId create_new_gc_id() {
! return Atomic::add((jlong)1, &GCTracer_next_gc_id);
}
void GCTracer::report_gc_start_impl(GCCause::Cause cause, jlong timestamp) {
assert_unset_gc_id();
--- 25,42 ----
#include "precompiled.hpp"
#include "gc_implementation/shared/gcHeapSummary.hpp"
#include "gc_implementation/shared/gcTimer.hpp"
#include "gc_implementation/shared/gcTrace.hpp"
#include "memory/referenceProcessorStats.hpp"
#include "utilities/globalDefinitions.hpp"
#define assert_unset_gc_id() assert(_shared_gc_info.id() == SharedGCInfo::UNSET_GCID, "GC already started?")
#define assert_set_gc_id() assert(_shared_gc_info.id() != SharedGCInfo::UNSET_GCID, "GC not started?")
! static jlong GCTracer_next_gc_id = 0;
static GCId create_new_gc_id() {
! return GCTracer_next_gc_id++;
}
void GCTracer::report_gc_start_impl(GCCause::Cause cause, jlong timestamp) {
assert_unset_gc_id();
src/share/vm/gc_implementation/shared/gcTrace.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File