aboutsummaryrefslogtreecommitdiff
path: root/src/share/vm
diff options
context:
space:
mode:
authorjiangli <none@none>2013-07-08 14:53:52 -0700
committerjiangli <none@none>2013-07-08 14:53:52 -0700
commit6147890c92cb7db787d322c1b33f57567775d0d4 (patch)
tree498a8ea705551d12243db115d5b702975f49e2ed /src/share/vm
parent4967a00efe0273d3b77400f7db2b43724dcc84be (diff)
parent6c661492e2327d8901989b770b7b38b2754dbe4a (diff)
Merge
Diffstat (limited to 'src/share/vm')
-rw-r--r--src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp6
-rw-r--r--src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp1
-rw-r--r--src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp20
-rw-r--r--src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp1
-rw-r--r--src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp8
-rw-r--r--src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp5
-rw-r--r--src/share/vm/gc_implementation/g1/g1MarkSweep.cpp1
-rw-r--r--src/share/vm/memory/defNewGeneration.cpp5
-rw-r--r--src/share/vm/memory/defNewGeneration.hpp1
-rw-r--r--src/share/vm/memory/genCollectedHeap.cpp9
-rw-r--r--src/share/vm/memory/genCollectedHeap.hpp1
-rw-r--r--src/share/vm/memory/generation.cpp10
-rw-r--r--src/share/vm/memory/generation.hpp7
-rw-r--r--src/share/vm/memory/sharedHeap.hpp5
-rw-r--r--src/share/vm/memory/universe.cpp1
-rw-r--r--src/share/vm/oops/arrayKlass.cpp7
-rw-r--r--src/share/vm/oops/arrayKlass.hpp6
-rw-r--r--src/share/vm/oops/instanceKlass.cpp6
-rw-r--r--src/share/vm/oops/instanceKlass.hpp5
-rw-r--r--src/share/vm/oops/klass.cpp7
-rw-r--r--src/share/vm/oops/klass.hpp9
-rw-r--r--src/share/vm/runtime/aprofiler.cpp143
-rw-r--r--src/share/vm/runtime/aprofiler.hpp71
-rw-r--r--src/share/vm/runtime/arguments.cpp21
-rw-r--r--src/share/vm/runtime/arguments.hpp4
-rw-r--r--src/share/vm/runtime/java.cpp11
-rw-r--r--src/share/vm/runtime/thread.cpp2
-rw-r--r--src/share/vm/runtime/vmStructs.cpp14
28 files changed, 7 insertions, 380 deletions
diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
index d91f907a2..b87efd7bc 100644
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
@@ -2017,12 +2017,6 @@ oop_since_save_marks_iterate##nv_suffix(OopClosureType* blk) { \
ALL_SINCE_SAVE_MARKS_CLOSURES(CFLS_OOP_SINCE_SAVE_MARKS_DEFN)
-
-void CompactibleFreeListSpace::object_iterate_since_last_GC(ObjectClosure* cl) {
- // ugghh... how would one do this efficiently for a non-contiguous space?
- guarantee(false, "NYI");
-}
-
bool CompactibleFreeListSpace::linearAllocationWouldFail() const {
return _smallLinearAllocBlock._word_size == 0;
}
diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp
index 23c95897c..74c97e8df 100644
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp
@@ -396,7 +396,6 @@ class CompactibleFreeListSpace: public CompactibleSpace {
// iteration support for promotion
void save_marks();
bool no_allocs_since_save_marks();
- void object_iterate_since_last_GC(ObjectClosure* cl);
// iteration support for sweeping
void save_sweep_limit() {
diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
index 85c7b7317..ced79cbcf 100644
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
@@ -3130,26 +3130,6 @@ oop_since_save_marks_iterate##nv_suffix(OopClosureType* cl) { \
ALL_SINCE_SAVE_MARKS_CLOSURES(CMS_SINCE_SAVE_MARKS_DEFN)
void
-ConcurrentMarkSweepGeneration::object_iterate_since_last_GC(ObjectClosure* blk)
-{
- // Not currently implemented; need to do the following. -- ysr.
- // dld -- I think that is used for some sort of allocation profiler. So it
- // really means the objects allocated by the mutator since the last
- // GC. We could potentially implement this cheaply by recording only
- // the direct allocations in a side data structure.
- //
- // I think we probably ought not to be required to support these
- // iterations at any arbitrary point; I think there ought to be some
- // call to enable/disable allocation profiling in a generation/space,
- // and the iterator ought to return the objects allocated in the
- // gen/space since the enable call, or the last iterator call (which
- // will probably be at a GC.) That way, for gens like CM&S that would
- // require some extra data structure to support this, we only pay the
- // cost when it's in use...
- cmsSpace()->object_iterate_since_last_GC(blk);
-}
-
-void
ConcurrentMarkSweepGeneration::younger_refs_iterate(OopsInGenClosure* cl) {
cl->set_generation(this);
younger_refs_in_space_iterate(_cmsSpace, cl);
diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
index bb485f4a8..3806b896d 100644
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
@@ -1273,7 +1273,6 @@ class ConcurrentMarkSweepGeneration: public CardGeneration {
// Iteration support and related enquiries
void save_marks();
bool no_allocs_since_save_marks();
- void object_iterate_since_last_GC(ObjectClosure* cl);
void younger_refs_iterate(OopsInGenClosure* cl);
// Iteration support specific to CMS generations
diff --git a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
index db8f863ad..bdd3027b9 100644
--- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
+++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
@@ -54,7 +54,6 @@
#include "memory/referenceProcessor.hpp"
#include "oops/oop.inline.hpp"
#include "oops/oop.pcgc.inline.hpp"
-#include "runtime/aprofiler.hpp"
#include "runtime/vmThread.hpp"
size_t G1CollectedHeap::_humongous_object_threshold_in_words = 0;
@@ -2665,11 +2664,6 @@ void G1CollectedHeap::object_iterate(ObjectClosure* cl) {
heap_region_iterate(&blk);
}
-void G1CollectedHeap::object_iterate_since_last_GC(ObjectClosure* cl) {
- // FIXME: is this right?
- guarantee(false, "object_iterate_since_last_GC not supported by G1 heap");
-}
-
// Calls a SpaceClosure on a HeapRegion.
class SpaceClosureRegionClosure: public HeapRegionClosure {
@@ -3598,8 +3592,6 @@ G1CollectedHeap* G1CollectedHeap::heap() {
void G1CollectedHeap::gc_prologue(bool full /* Ignored */) {
// always_do_update_barrier = false;
assert(InlineCacheBuffer::is_empty(), "should have cleaned up ICBuffer");
- // Call allocation profiler
- AllocationProfiler::iterate_since_last_gc();
// Fill TLAB's and such
ensure_parsability(true);
}
diff --git a/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp b/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
index 6843d13f7..9b52304c9 100644
--- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
+++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
@@ -1360,11 +1360,6 @@ public:
object_iterate(cl);
}
- // Iterate over all objects allocated since the last collection, calling
- // "cl.do_object" on each. The heap must have been initialized properly
- // to support this function, or else this call will fail.
- virtual void object_iterate_since_last_GC(ObjectClosure* cl);
-
// Iterate over all spaces in use in the heap, in ascending address order.
virtual void space_iterate(SpaceClosure* cl);
diff --git a/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp b/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp
index adde08f21..74aabc129 100644
--- a/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp
+++ b/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp
@@ -43,7 +43,6 @@
#include "oops/instanceRefKlass.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvmtiExport.hpp"
-#include "runtime/aprofiler.hpp"
#include "runtime/biasedLocking.hpp"
#include "runtime/fprofiler.hpp"
#include "runtime/synchronizer.hpp"
diff --git a/src/share/vm/memory/defNewGeneration.cpp b/src/share/vm/memory/defNewGeneration.cpp
index 88afd70a7..177569294 100644
--- a/src/share/vm/memory/defNewGeneration.cpp
+++ b/src/share/vm/memory/defNewGeneration.cpp
@@ -450,11 +450,6 @@ void DefNewGeneration::compute_new_size() {
}
}
-void DefNewGeneration::object_iterate_since_last_GC(ObjectClosure* cl) {
- // $$$ This may be wrong in case of "scavenge failure"?
- eden()->object_iterate(cl);
-}
-
void DefNewGeneration::younger_refs_iterate(OopsInGenClosure* cl) {
assert(false, "NYI -- are you sure you want to call this?");
}
diff --git a/src/share/vm/memory/defNewGeneration.hpp b/src/share/vm/memory/defNewGeneration.hpp
index c538e0a4f..0623d446a 100644
--- a/src/share/vm/memory/defNewGeneration.hpp
+++ b/src/share/vm/memory/defNewGeneration.hpp
@@ -252,7 +252,6 @@ protected:
// Iteration
void object_iterate(ObjectClosure* blk);
- void object_iterate_since_last_GC(ObjectClosure* cl);
void younger_refs_iterate(OopsInGenClosure* cl);
diff --git a/src/share/vm/memory/genCollectedHeap.cpp b/src/share/vm/memory/genCollectedHeap.cpp
index a74533d43..ebdb77f67 100644
--- a/src/share/vm/memory/genCollectedHeap.cpp
+++ b/src/share/vm/memory/genCollectedHeap.cpp
@@ -42,7 +42,6 @@
#include "memory/space.hpp"
#include "oops/oop.inline.hpp"
#include "oops/oop.inline2.hpp"
-#include "runtime/aprofiler.hpp"
#include "runtime/biasedLocking.hpp"
#include "runtime/fprofiler.hpp"
#include "runtime/handles.hpp"
@@ -873,12 +872,6 @@ void GenCollectedHeap::safe_object_iterate(ObjectClosure* cl) {
}
}
-void GenCollectedHeap::object_iterate_since_last_GC(ObjectClosure* cl) {
- for (int i = 0; i < _n_gens; i++) {
- _gens[i]->object_iterate_since_last_GC(cl);
- }
-}
-
Space* GenCollectedHeap::space_containing(const void* addr) const {
for (int i = 0; i < _n_gens; i++) {
Space* res = _gens[i]->space_containing(addr);
@@ -1186,8 +1179,6 @@ void GenCollectedHeap::gc_prologue(bool full) {
CollectedHeap::accumulate_statistics_all_tlabs();
ensure_parsability(true); // retire TLABs
- // Call allocation profiler
- AllocationProfiler::iterate_since_last_gc();
// Walk generations
GenGCPrologueClosure blk(full);
generation_iterate(&blk, false); // not old-to-young.
diff --git a/src/share/vm/memory/genCollectedHeap.hpp b/src/share/vm/memory/genCollectedHeap.hpp
index 783cd372d..43338c4da 100644
--- a/src/share/vm/memory/genCollectedHeap.hpp
+++ b/src/share/vm/memory/genCollectedHeap.hpp
@@ -222,7 +222,6 @@ public:
void oop_iterate(MemRegion mr, ExtendedOopClosure* cl);
void object_iterate(ObjectClosure* cl);
void safe_object_iterate(ObjectClosure* cl);
- void object_iterate_since_last_GC(ObjectClosure* cl);
Space* space_containing(const void* addr) const;
// A CollectedHeap is divided into a dense sequence of "blocks"; that is,
diff --git a/src/share/vm/memory/generation.cpp b/src/share/vm/memory/generation.cpp
index 9fa46b34a..f9c986fa7 100644
--- a/src/share/vm/memory/generation.cpp
+++ b/src/share/vm/memory/generation.cpp
@@ -811,16 +811,6 @@ void OneContigSpaceCardGeneration::space_iterate(SpaceClosure* blk,
blk->do_space(_the_space);
}
-void OneContigSpaceCardGeneration::object_iterate_since_last_GC(ObjectClosure* blk) {
- // Deal with delayed initialization of _the_space,
- // and lack of initialization of _last_gc.
- if (_last_gc.space() == NULL) {
- assert(the_space() != NULL, "shouldn't be NULL");
- _last_gc = the_space()->bottom_mark();
- }
- the_space()->object_iterate_from(_last_gc, blk);
-}
-
void OneContigSpaceCardGeneration::younger_refs_iterate(OopsInGenClosure* blk) {
blk->set_generation(this);
younger_refs_in_space_iterate(_the_space, blk);
diff --git a/src/share/vm/memory/generation.hpp b/src/share/vm/memory/generation.hpp
index feb4fde18..44d641fee 100644
--- a/src/share/vm/memory/generation.hpp
+++ b/src/share/vm/memory/generation.hpp
@@ -551,12 +551,6 @@ class Generation: public CHeapObj<mtGC> {
// the heap. This defaults to object_iterate() unless overridden.
virtual void safe_object_iterate(ObjectClosure* cl);
- // Iterate over all objects allocated in the generation since the last
- // collection, calling "cl.do_object" on each. The generation must have
- // been initialized properly to support this function, or else this call
- // will fail.
- virtual void object_iterate_since_last_GC(ObjectClosure* cl) = 0;
-
// Apply "cl->do_oop" to (the address of) all and only all the ref fields
// in the current generation that contain pointers to objects in younger
// generations. Objects allocated since the last "save_marks" call are
@@ -724,7 +718,6 @@ class OneContigSpaceCardGeneration: public CardGeneration {
// Iteration
void object_iterate(ObjectClosure* blk);
void space_iterate(SpaceClosure* blk, bool usedOnly = false);
- void object_iterate_since_last_GC(ObjectClosure* cl);
void younger_refs_iterate(OopsInGenClosure* blk);
diff --git a/src/share/vm/memory/sharedHeap.hpp b/src/share/vm/memory/sharedHeap.hpp
index b13bf15b8..cd810c036 100644
--- a/src/share/vm/memory/sharedHeap.hpp
+++ b/src/share/vm/memory/sharedHeap.hpp
@@ -166,11 +166,6 @@ public:
// Same as above, restricted to a memory region.
virtual void oop_iterate(MemRegion mr, ExtendedOopClosure* cl) = 0;
- // Iterate over all objects allocated since the last collection, calling
- // "cl->do_object" on each. The heap must have been initialized properly
- // to support this function, or else this call will fail.
- virtual void object_iterate_since_last_GC(ObjectClosure* cl) = 0;
-
// Iterate over all spaces in use in the heap, in an undefined order.
virtual void space_iterate(SpaceClosure* cl) = 0;
diff --git a/src/share/vm/memory/universe.cpp b/src/share/vm/memory/universe.cpp
index 3514886d0..511610bd3 100644
--- a/src/share/vm/memory/universe.cpp
+++ b/src/share/vm/memory/universe.cpp
@@ -52,7 +52,6 @@
#include "oops/oop.inline.hpp"
#include "oops/typeArrayKlass.hpp"
#include "prims/jvmtiRedefineClassesTrace.hpp"
-#include "runtime/aprofiler.hpp"
#include "runtime/arguments.hpp"
#include "runtime/deoptimization.hpp"
#include "runtime/fprofiler.hpp"
diff --git a/src/share/vm/oops/arrayKlass.cpp b/src/share/vm/oops/arrayKlass.cpp
index ef1c20e97..6e04c3ac1 100644
--- a/src/share/vm/oops/arrayKlass.cpp
+++ b/src/share/vm/oops/arrayKlass.cpp
@@ -71,7 +71,6 @@ Method* ArrayKlass::uncached_lookup_method(Symbol* name, Symbol* signature) cons
}
ArrayKlass::ArrayKlass(Symbol* name) {
- set_alloc_size(0);
set_name(name);
set_super(Universe::is_bootstrapping() ? (Klass*)NULL : SystemDictionary::Object_klass());
@@ -161,12 +160,6 @@ void ArrayKlass::array_klasses_do(void f(Klass* k)) {
}
}
-
-void ArrayKlass::with_array_klasses_do(void f(Klass* k)) {
- array_klasses_do(f);
-}
-
-
// GC support
void ArrayKlass::oops_do(OopClosure* cl) {
diff --git a/src/share/vm/oops/arrayKlass.hpp b/src/share/vm/oops/arrayKlass.hpp
index acf920e16..4b06f1c0e 100644
--- a/src/share/vm/oops/arrayKlass.hpp
+++ b/src/share/vm/oops/arrayKlass.hpp
@@ -39,7 +39,6 @@ class ArrayKlass: public Klass {
Klass* volatile _higher_dimension; // Refers the (n+1)'th-dimensional array (if present).
Klass* volatile _lower_dimension; // Refers the (n-1)'th-dimensional array (if present).
int _vtable_len; // size of vtable for this klass
- juint _alloc_size; // allocation profiling support
oop _component_mirror; // component type, as a java/lang/Class
protected:
@@ -65,10 +64,6 @@ class ArrayKlass: public Klass {
void set_lower_dimension(Klass* k) { _lower_dimension = k; }
Klass** adr_lower_dimension() { return (Klass**)&this->_lower_dimension;}
- // Allocation profiling support
- juint alloc_size() const { return _alloc_size; }
- void set_alloc_size(juint n) { _alloc_size = n; }
-
// offset of first element, including any padding for the sake of alignment
int array_header_in_bytes() const { return layout_helper_header_size(layout_helper()); }
int log2_element_size() const { return layout_helper_log2_element_size(layout_helper()); }
@@ -126,7 +121,6 @@ class ArrayKlass: public Klass {
// Iterators
void array_klasses_do(void f(Klass* k));
void array_klasses_do(void f(Klass* k, TRAPS), TRAPS);
- void with_array_klasses_do(void f(Klass* k));
// GC support
virtual void oops_do(OopClosure* cl);
diff --git a/src/share/vm/oops/instanceKlass.cpp b/src/share/vm/oops/instanceKlass.cpp
index 886746d6b..55348bf8b 100644
--- a/src/share/vm/oops/instanceKlass.cpp
+++ b/src/share/vm/oops/instanceKlass.cpp
@@ -1321,12 +1321,6 @@ void InstanceKlass::array_klasses_do(void f(Klass* k)) {
ArrayKlass::cast(array_klasses())->array_klasses_do(f);
}
-
-void InstanceKlass::with_array_klasses_do(void f(Klass* k)) {
- f(this);
- array_klasses_do(f);
-}
-
#ifdef ASSERT
static int linear_search(Array<Method*>* methods, Symbol* name, Symbol* signature) {
int len = methods->length();
diff --git a/src/share/vm/oops/instanceKlass.hpp b/src/share/vm/oops/instanceKlass.hpp
index 6c56a5195..b658f3a03 100644
--- a/src/share/vm/oops/instanceKlass.hpp
+++ b/src/share/vm/oops/instanceKlass.hpp
@@ -794,7 +794,6 @@ class InstanceKlass: public Klass {
void methods_do(void f(Method* method));
void array_klasses_do(void f(Klass* k));
void array_klasses_do(void f(Klass* k, TRAPS), TRAPS);
- void with_array_klasses_do(void f(Klass* k));
bool super_types_do(SuperTypeClosure* blk);
// Casting from Klass*
@@ -874,10 +873,6 @@ class InstanceKlass: public Klass {
}
}
- // Allocation profiling support
- juint alloc_size() const { return _alloc_count * size_helper(); }
- void set_alloc_size(juint n) {}
-
// Use this to return the size of an instance in heap words:
int size_helper() const {
return layout_helper_to_size_helper(layout_helper());
diff --git a/src/share/vm/oops/klass.cpp b/src/share/vm/oops/klass.cpp
index a719b88bb..41d5ec31c 100644
--- a/src/share/vm/oops/klass.cpp
+++ b/src/share/vm/oops/klass.cpp
@@ -168,7 +168,6 @@ Klass::Klass() {
set_subklass(NULL);
set_next_sibling(NULL);
set_next_link(NULL);
- set_alloc_count(0);
TRACE_INIT_ID(this);
set_prototype_header(markOopDesc::prototype());
@@ -543,12 +542,6 @@ Klass* Klass::array_klass_impl(bool or_null, TRAPS) {
return NULL;
}
-
-void Klass::with_array_klasses_do(void f(Klass* k)) {
- f(this);
-}
-
-
oop Klass::class_loader() const { return class_loader_data()->class_loader(); }
const char* Klass::external_name() const {
diff --git a/src/share/vm/oops/klass.hpp b/src/share/vm/oops/klass.hpp
index 5f4094d4f..1ca027a37 100644
--- a/src/share/vm/oops/klass.hpp
+++ b/src/share/vm/oops/klass.hpp
@@ -79,7 +79,6 @@
// [last_biased_lock_bulk_revocation_time] (64 bits)
// [prototype_header]
// [biased_lock_revocation_count]
-// [alloc_count ]
// [_modified_oops]
// [_accumulated_modified_oops]
// [trace_id]
@@ -171,8 +170,6 @@ class Klass : public Metadata {
markOop _prototype_header; // Used when biased locking is both enabled and disabled for this type
jint _biased_lock_revocation_count;
- juint _alloc_count; // allocation profiling support
-
TRACE_DEFINE_KLASS_TRACE_ID;
// Remembered sets support for the oops in the klasses.
@@ -290,11 +287,6 @@ class Klass : public Metadata {
void set_next_sibling(Klass* s);
public:
- // Allocation profiling support
- juint alloc_count() const { return _alloc_count; }
- void set_alloc_count(juint n) { _alloc_count = n; }
- virtual juint alloc_size() const = 0;
- virtual void set_alloc_size(juint n) = 0;
// Compiler support
static ByteSize super_offset() { return in_ByteSize(offset_of(Klass, _super)); }
@@ -677,7 +669,6 @@ class Klass : public Metadata {
#endif // INCLUDE_ALL_GCS
virtual void array_klasses_do(void f(Klass* k)) {}
- virtual void with_array_klasses_do(void f(Klass* k));
// Return self, except for abstract classes with exactly 1
// implementor. Then return the 1 concrete implementation.
diff --git a/src/share/vm/runtime/aprofiler.cpp b/src/share/vm/runtime/aprofiler.cpp
deleted file mode 100644
index e71bfb587..000000000
--- a/src/share/vm/runtime/aprofiler.cpp
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright (c) 1997, 2013, 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.
- *
- */
-
-#include "precompiled.hpp"
-#include "classfile/systemDictionary.hpp"
-#include "gc_interface/collectedHeap.inline.hpp"
-#include "memory/resourceArea.hpp"
-#include "memory/space.hpp"
-#include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
-#include "runtime/aprofiler.hpp"
-
-
-bool AllocationProfiler::_active = false;
-GrowableArray<Klass*>* AllocationProfiler::_print_array = NULL;
-
-
-class AllocProfClosure : public ObjectClosure {
- public:
- void do_object(oop obj) {
- Klass* k = obj->klass();
- k->set_alloc_count(k->alloc_count() + 1);
- k->set_alloc_size(k->alloc_size() + obj->size());
- }
-};
-
-
-void AllocationProfiler::iterate_since_last_gc() {
- if (is_active()) {
- AllocProfClosure blk;
- GenCollectedHeap* heap = GenCollectedHeap::heap();
- heap->object_iterate_since_last_GC(&blk);
- }
-}
-
-
-void AllocationProfiler::engage() {
- _active = true;
-}
-
-
-void AllocationProfiler::disengage() {
- _active = false;
-}
-
-
-void AllocationProfiler::add_class_to_array(Klass* k) {
- _print_array->append(k);
-}
-
-
-void AllocationProfiler::add_classes_to_array(Klass* k) {
- // Iterate over klass and all array klasses for klass
- k->with_array_klasses_do(&AllocationProfiler::add_class_to_array);
-}
-
-
-int AllocationProfiler::compare_classes(Klass** k1, Klass** k2) {
- // Sort by total allocation size
- return (*k2)->alloc_size() - (*k1)->alloc_size();
-}
-
-
-int AllocationProfiler::average(size_t alloc_size, int alloc_count) {
- return (int) ((double) (alloc_size * BytesPerWord) / MAX2(alloc_count, 1) + 0.5);
-}
-
-
-void AllocationProfiler::sort_and_print_array(size_t cutoff) {
- _print_array->sort(&AllocationProfiler::compare_classes);
- tty->print_cr("________________Size"
- "__Instances"
- "__Average"
- "__Class________________");
- size_t total_alloc_size = 0;
- int total_alloc_count = 0;
- for (int index = 0; index < _print_array->length(); index++) {
- Klass* k = _print_array->at(index);
- size_t alloc_size = k->alloc_size();
- if (alloc_size > cutoff) {
- int alloc_count = k->alloc_count();
-#ifdef PRODUCT
- const char* name = k->external_name();
-#else
- const char* name = k->internal_name();
-#endif
- tty->print_cr("%20u %10u %8u %s",
- alloc_size * BytesPerWord,
- alloc_count,
- average(alloc_size, alloc_count),
- name);
- total_alloc_size += alloc_size;
- total_alloc_count += alloc_count;
- }
- k->set_alloc_count(0);
- k->set_alloc_size(0);
- }
- tty->print_cr("%20u %10u %8u --total--",
- total_alloc_size * BytesPerWord,
- total_alloc_count,
- average(total_alloc_size, total_alloc_count));
- tty->cr();
-}
-
-
-void AllocationProfiler::print(size_t cutoff) {
- ResourceMark rm;
- assert(!is_active(), "AllocationProfiler cannot be active while printing profile");
-
- tty->cr();
- tty->print_cr("Allocation profile (sizes in bytes, cutoff = " SIZE_FORMAT " bytes):", cutoff * BytesPerWord);
- tty->cr();
-
- // Print regular instance klasses and basic type array klasses
- _print_array = new GrowableArray<Klass*>(SystemDictionary::number_of_classes()*2);
- SystemDictionary::classes_do(&add_classes_to_array);
- Universe::basic_type_classes_do(&add_classes_to_array);
- sort_and_print_array(cutoff);
-
- // This used to print metadata in the permgen but since there isn't a permgen
- // anymore, it is not yet implemented.
-}
diff --git a/src/share/vm/runtime/aprofiler.hpp b/src/share/vm/runtime/aprofiler.hpp
deleted file mode 100644
index ba4dd7aa5..000000000
--- a/src/share/vm/runtime/aprofiler.hpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 1997, 2012, 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.
- *
- */
-
-#ifndef SHARE_VM_RUNTIME_APROFILER_HPP
-#define SHARE_VM_RUNTIME_APROFILER_HPP
-
-#include "memory/allocation.hpp"
-#include "memory/universe.hpp"
-#include "oops/klass.hpp"
-#include "utilities/top.hpp"
-
-// A simple allocation profiler for Java. The profiler collects and prints
-// the number and total size of instances allocated per class, including
-// array classes.
-//
-// The profiler is currently global for all threads. It can be changed to a
-// per threads profiler by keeping a more elaborate data structure and calling
-// iterate_since_last_scavenge at thread switches.
-
-
-class AllocationProfiler: AllStatic {
- friend class GenCollectedHeap;
- friend class G1CollectedHeap;
- friend class MarkSweep;
- private:
- static bool _active; // tells whether profiler is active
- static GrowableArray<Klass*>* _print_array; // temporary array for printing
-
- // Utility printing functions
- static void add_class_to_array(Klass* k);
- static void add_classes_to_array(Klass* k);
- static int compare_classes(Klass** k1, Klass** k2);
- static int average(size_t alloc_size, int alloc_count);
- static void sort_and_print_array(size_t cutoff);
-
- // Call for collecting allocation information. Called at scavenge, mark-sweep and disengage.
- static void iterate_since_last_gc();
-
- public:
- // Start profiler
- static void engage();
- // Stop profiler
- static void disengage();
- // Tells whether profiler is active
- static bool is_active() { return _active; }
- // Print profile
- static void print(size_t cutoff); // Cutoff in total allocation size (in words)
-};
-
-#endif // SHARE_VM_RUNTIME_APROFILER_HPP
diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments.cpp
index c52959d69..dee8e7bcd 100644
--- a/src/share/vm/runtime/arguments.cpp
+++ b/src/share/vm/runtime/arguments.cpp
@@ -68,7 +68,6 @@ char* Arguments::_java_command = NULL;
SystemProperty* Arguments::_system_properties = NULL;
const char* Arguments::_gc_log_filename = NULL;
bool Arguments::_has_profile = false;
-bool Arguments::_has_alloc_profile = false;
uintx Arguments::_min_heap_size = 0;
Arguments::Mode Arguments::_mode = _mixed;
bool Arguments::_java_compiler = false;
@@ -1986,23 +1985,6 @@ bool Arguments::check_vm_args_consistency() {
status = status && check_gc_consistency();
status = status && check_stack_pages();
- if (_has_alloc_profile) {
- if (UseParallelGC || UseParallelOldGC) {
- jio_fprintf(defaultStream::error_stream(),
- "error: invalid argument combination.\n"
- "Allocation profiling (-Xaprof) cannot be used together with "
- "Parallel GC (-XX:+UseParallelGC or -XX:+UseParallelOldGC).\n");
- status = false;
- }
- if (UseConcMarkSweepGC) {
- jio_fprintf(defaultStream::error_stream(),
- "error: invalid argument combination.\n"
- "Allocation profiling (-Xaprof) cannot be used together with "
- "the CMS collector (-XX:+UseConcMarkSweepGC).\n");
- status = false;
- }
- }
-
if (CMSIncrementalMode) {
if (!UseConcMarkSweepGC) {
jio_fprintf(defaultStream::error_stream(),
@@ -2700,9 +2682,6 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
"Flat profiling is not supported in this VM.\n");
return JNI_ERR;
#endif // INCLUDE_FPROF
- // -Xaprof
- } else if (match_option(option, "-Xaprof", &tail)) {
- _has_alloc_profile = true;
// -Xconcurrentio
} else if (match_option(option, "-Xconcurrentio", &tail)) {
FLAG_SET_CMDLINE(bool, UseLWPSynchronization, true);
diff --git a/src/share/vm/runtime/arguments.hpp b/src/share/vm/runtime/arguments.hpp
index 0e84208a2..89b171f0d 100644
--- a/src/share/vm/runtime/arguments.hpp
+++ b/src/share/vm/runtime/arguments.hpp
@@ -262,7 +262,6 @@ class Arguments : AllStatic {
// Option flags
static bool _has_profile;
- static bool _has_alloc_profile;
static const char* _gc_log_filename;
static uintx _min_heap_size;
@@ -464,9 +463,8 @@ class Arguments : AllStatic {
// -Xloggc:<file>, if not specified will be NULL
static const char* gc_log_filename() { return _gc_log_filename; }
- // -Xprof/-Xaprof
+ // -Xprof
static bool has_profile() { return _has_profile; }
- static bool has_alloc_profile() { return _has_alloc_profile; }
// -Xms, -Xmx
static uintx min_heap_size() { return _min_heap_size; }
diff --git a/src/share/vm/runtime/java.cpp b/src/share/vm/runtime/java.cpp
index 7795fb92a..ebc4e0875 100644
--- a/src/share/vm/runtime/java.cpp
+++ b/src/share/vm/runtime/java.cpp
@@ -42,7 +42,6 @@
#include "oops/oop.inline.hpp"
#include "oops/symbol.hpp"
#include "prims/jvmtiExport.hpp"
-#include "runtime/aprofiler.hpp"
#include "runtime/arguments.hpp"
#include "runtime/biasedLocking.hpp"
#include "runtime/compilationPolicy.hpp"
@@ -509,16 +508,6 @@ void before_exit(JavaThread * thread) {
}
}
-
- if (Arguments::has_alloc_profile()) {
- HandleMark hm;
- // Do one last collection to enumerate all the objects
- // allocated since the last one.
- Universe::heap()->collect(GCCause::_allocation_profiler);
- AllocationProfiler::disengage();
- AllocationProfiler::print(0);
- }
-
if (PrintBytecodeHistogram) {
BytecodeHistogram::print();
}
diff --git a/src/share/vm/runtime/thread.cpp b/src/share/vm/runtime/thread.cpp
index eb2e256b1..ef862012f 100644
--- a/src/share/vm/runtime/thread.cpp
+++ b/src/share/vm/runtime/thread.cpp
@@ -45,7 +45,6 @@
#include "prims/jvmtiExport.hpp"
#include "prims/jvmtiThreadState.hpp"
#include "prims/privilegedStack.hpp"
-#include "runtime/aprofiler.hpp"
#include "runtime/arguments.hpp"
#include "runtime/biasedLocking.hpp"
#include "runtime/deoptimization.hpp"
@@ -3677,7 +3676,6 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
}
if (Arguments::has_profile()) FlatProfiler::engage(main_thread, true);
- if (Arguments::has_alloc_profile()) AllocationProfiler::engage();
if (MemProfiling) MemProfiler::engage();
StatSampler::engage();
if (CheckJNICalls) JniPeriodicChecker::engage();
diff --git a/src/share/vm/runtime/vmStructs.cpp b/src/share/vm/runtime/vmStructs.cpp
index 94b24eec8..e7de9601c 100644
--- a/src/share/vm/runtime/vmStructs.cpp
+++ b/src/share/vm/runtime/vmStructs.cpp
@@ -263,7 +263,7 @@ typedef BinaryTreeDictionary<Metablock, FreeList> MetablockTreeDictionary;
unchecked_c2_static_field) \
\
/******************************************************************/ \
- /* OopDesc and Klass hierarchies (NOTE: MethodData* incomplete) */ \
+ /* OopDesc and Klass hierarchies (NOTE: MethodData* incomplete) */ \
/******************************************************************/ \
\
volatile_nonstatic_field(oopDesc, _mark, markOop) \
@@ -274,21 +274,20 @@ typedef BinaryTreeDictionary<Metablock, FreeList> MetablockTreeDictionary;
volatile_nonstatic_field(ArrayKlass, _higher_dimension, Klass*) \
volatile_nonstatic_field(ArrayKlass, _lower_dimension, Klass*) \
nonstatic_field(ArrayKlass, _vtable_len, int) \
- nonstatic_field(ArrayKlass, _alloc_size, juint) \
nonstatic_field(ArrayKlass, _component_mirror, oop) \
- nonstatic_field(CompiledICHolder, _holder_method, Method*) \
+ nonstatic_field(CompiledICHolder, _holder_method, Method*) \
nonstatic_field(CompiledICHolder, _holder_klass, Klass*) \
nonstatic_field(ConstantPool, _tags, Array<u1>*) \
- nonstatic_field(ConstantPool, _cache, ConstantPoolCache*) \
+ nonstatic_field(ConstantPool, _cache, ConstantPoolCache*) \
nonstatic_field(ConstantPool, _pool_holder, InstanceKlass*) \
nonstatic_field(ConstantPool, _operands, Array<u2>*) \
nonstatic_field(ConstantPool, _length, int) \
nonstatic_field(ConstantPool, _resolved_references, jobject) \
nonstatic_field(ConstantPool, _reference_map, Array<u2>*) \
nonstatic_field(ConstantPoolCache, _length, int) \
- nonstatic_field(ConstantPoolCache, _constant_pool, ConstantPool*) \
+ nonstatic_field(ConstantPoolCache, _constant_pool, ConstantPool*) \
nonstatic_field(InstanceKlass, _array_klasses, Klass*) \
- nonstatic_field(InstanceKlass, _methods, Array<Method*>*) \
+ nonstatic_field(InstanceKlass, _methods, Array<Method*>*) \
nonstatic_field(InstanceKlass, _local_interfaces, Array<Klass*>*) \
nonstatic_field(InstanceKlass, _transitive_interfaces, Array<Klass*>*) \
nonstatic_field(InstanceKlass, _fields, Array<u2>*) \
@@ -336,9 +335,8 @@ typedef BinaryTreeDictionary<Metablock, FreeList> MetablockTreeDictionary;
nonstatic_field(Klass, _access_flags, AccessFlags) \
nonstatic_field(Klass, _subklass, Klass*) \
nonstatic_field(Klass, _next_sibling, Klass*) \
- nonstatic_field(Klass, _alloc_count, juint) \
nonstatic_field(MethodData, _size, int) \
- nonstatic_field(MethodData, _method, Method*) \
+ nonstatic_field(MethodData, _method, Method*) \
nonstatic_field(MethodData, _data_size, int) \
nonstatic_field(MethodData, _data[0], intptr_t) \
nonstatic_field(MethodData, _nof_decompiles, uint) \