From b683d2934cf155a609554660d975366536bc138c Mon Sep 17 00:00:00 2001 From: brutisso Date: Tue, 27 Mar 2012 10:29:59 +0200 Subject: [PATCH] 7156764: Remove unused size parameter from some CollectedHeap methods Summary: Some minor cleanups Reviewed-by: tonyp, jwilhelm --- .../g1/g1CollectorPolicy.hpp | 7 ++-- src/share/vm/gc_interface/collectedHeap.cpp | 7 ++-- src/share/vm/gc_interface/collectedHeap.hpp | 19 +++------- .../vm/gc_interface/collectedHeap.inline.hpp | 35 ++++++++----------- src/share/vm/oops/klass.cpp | 7 ++-- src/share/vm/oops/klass.hpp | 6 ++-- 6 files changed, 32 insertions(+), 49 deletions(-) diff --git a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp index 213e0aaec..743859b1d 100644 --- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp +++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp @@ -940,10 +940,9 @@ public: return _bytes_copied_during_gc; } - // Determine whether the next GC should be mixed. Called to determine - // whether to start mixed GCs or whether to carry on doing mixed - // GCs. The two action strings are used in the ergo output when the - // method returns true or false. + // Determine whether there are candidate regions so that the + // next GC should be mixed. The two action strings are used + // in the ergo output when the method returns true or false. bool next_gc_should_be_mixed(const char* true_action_str, const char* false_action_str); diff --git a/src/share/vm/gc_interface/collectedHeap.cpp b/src/share/vm/gc_interface/collectedHeap.cpp index 21dd6c53c..d986d76ad 100644 --- a/src/share/vm/gc_interface/collectedHeap.cpp +++ b/src/share/vm/gc_interface/collectedHeap.cpp @@ -333,7 +333,7 @@ CollectedHeap::fill_with_array(HeapWord* start, size_t words, bool zap) // Set the length first for concurrent GC. ((arrayOop)start)->set_length((int)len); - post_allocation_setup_common(Universe::intArrayKlassObj(), start, words); + post_allocation_setup_common(Universe::intArrayKlassObj(), start); DEBUG_ONLY(zap_filler_array(start, words, zap);) } @@ -346,8 +346,7 @@ CollectedHeap::fill_with_object_impl(HeapWord* start, size_t words, bool zap) fill_with_array(start, words, zap); } else if (words > 0) { assert(words == min_fill_size(), "unaligned size"); - post_allocation_setup_common(SystemDictionary::Object_klass(), start, - words); + post_allocation_setup_common(SystemDictionary::Object_klass(), start); } } @@ -477,7 +476,7 @@ oop CollectedHeap::Class_obj_allocate(KlassHandle klass, int size, KlassHandle r assert(ScavengeRootsInCode > 0, "must be"); obj = common_mem_allocate_init(size, CHECK_NULL); } - post_allocation_setup_common(klass, obj, size); + post_allocation_setup_common(klass, obj); assert(Universe::is_bootstrapping() || !((oop)obj)->blueprint()->oop_is_array(), "must not be an array"); NOT_PRODUCT(Universe::heap()->check_for_bad_heap_word_value(obj, size)); diff --git a/src/share/vm/gc_interface/collectedHeap.hpp b/src/share/vm/gc_interface/collectedHeap.hpp index 8fe701439..2ae92076e 100644 --- a/src/share/vm/gc_interface/collectedHeap.hpp +++ b/src/share/vm/gc_interface/collectedHeap.hpp @@ -149,18 +149,14 @@ class CollectedHeap : public CHeapObj { inline static HeapWord* common_permanent_mem_allocate_init(size_t size, TRAPS); // Helper functions for (VM) allocation. - inline static void post_allocation_setup_common(KlassHandle klass, - HeapWord* obj, size_t size); + inline static void post_allocation_setup_common(KlassHandle klass, HeapWord* obj); inline static void post_allocation_setup_no_klass_install(KlassHandle klass, - HeapWord* objPtr, - size_t size); + HeapWord* objPtr); - inline static void post_allocation_setup_obj(KlassHandle klass, - HeapWord* obj, size_t size); + inline static void post_allocation_setup_obj(KlassHandle klass, HeapWord* obj); inline static void post_allocation_setup_array(KlassHandle klass, - HeapWord* obj, size_t size, - int length); + HeapWord* obj, int length); // Clears an allocated object. inline static void init_obj(HeapWord* obj, size_t size); @@ -368,9 +364,7 @@ class CollectedHeap : public CHeapObj { inline static oop permanent_obj_allocate_no_klass_install(KlassHandle klass, int size, TRAPS); - inline static void post_allocation_install_obj_klass(KlassHandle klass, - oop obj, - int size); + inline static void post_allocation_install_obj_klass(KlassHandle klass, oop obj); inline static oop permanent_array_allocate(KlassHandle klass, int size, int length, TRAPS); // Raw memory allocation facilities @@ -664,9 +658,6 @@ class CollectedHeap : public CHeapObj { } } - // Allocate GCHeapLog during VM startup - static void initialize_heap_log(); - // Heap verification virtual void verify(bool allow_dirty, bool silent, VerifyOption option) = 0; diff --git a/src/share/vm/gc_interface/collectedHeap.inline.hpp b/src/share/vm/gc_interface/collectedHeap.inline.hpp index adced061d..4ac71858e 100644 --- a/src/share/vm/gc_interface/collectedHeap.inline.hpp +++ b/src/share/vm/gc_interface/collectedHeap.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -50,15 +50,13 @@ // Inline allocation implementations. void CollectedHeap::post_allocation_setup_common(KlassHandle klass, - HeapWord* obj, - size_t size) { - post_allocation_setup_no_klass_install(klass, obj, size); - post_allocation_install_obj_klass(klass, oop(obj), (int) size); + HeapWord* obj) { + post_allocation_setup_no_klass_install(klass, obj); + post_allocation_install_obj_klass(klass, oop(obj)); } void CollectedHeap::post_allocation_setup_no_klass_install(KlassHandle klass, - HeapWord* objPtr, - size_t size) { + HeapWord* objPtr) { oop obj = (oop)objPtr; assert(obj != NULL, "NULL object pointer"); @@ -71,8 +69,7 @@ void CollectedHeap::post_allocation_setup_no_klass_install(KlassHandle klass, } void CollectedHeap::post_allocation_install_obj_klass(KlassHandle klass, - oop obj, - int size) { + oop obj) { // These asserts are kind of complicated because of klassKlass // and the beginning of the world. assert(klass() != NULL || !Universe::is_fully_initialized(), "NULL klass"); @@ -101,9 +98,8 @@ inline void post_allocation_notify(KlassHandle klass, oop obj) { } void CollectedHeap::post_allocation_setup_obj(KlassHandle klass, - HeapWord* obj, - size_t size) { - post_allocation_setup_common(klass, obj, size); + HeapWord* obj) { + post_allocation_setup_common(klass, obj); assert(Universe::is_bootstrapping() || !((oop)obj)->blueprint()->oop_is_array(), "must not be an array"); // notify jvmti and dtrace @@ -112,14 +108,13 @@ void CollectedHeap::post_allocation_setup_obj(KlassHandle klass, void CollectedHeap::post_allocation_setup_array(KlassHandle klass, HeapWord* obj, - size_t size, int length) { // Set array length before setting the _klass field // in post_allocation_setup_common() because the klass field // indicates that the object is parsable by concurrent GC. assert(length >= 0, "length should be non-negative"); ((arrayOop)obj)->set_length(length); - post_allocation_setup_common(klass, obj, size); + post_allocation_setup_common(klass, obj); assert(((oop)obj)->blueprint()->oop_is_array(), "must be an array"); // notify jvmti and dtrace (must be after length is set for dtrace) post_allocation_notify(klass, (oop)obj); @@ -256,7 +251,7 @@ oop CollectedHeap::obj_allocate(KlassHandle klass, int size, TRAPS) { assert(!Universe::heap()->is_gc_active(), "Allocation during gc not allowed"); assert(size >= 0, "int won't convert to size_t"); HeapWord* obj = common_mem_allocate_init(size, CHECK_NULL); - post_allocation_setup_obj(klass, obj, size); + post_allocation_setup_obj(klass, obj); NOT_PRODUCT(Universe::heap()->check_for_bad_heap_word_value(obj, size)); return (oop)obj; } @@ -269,7 +264,7 @@ oop CollectedHeap::array_allocate(KlassHandle klass, assert(!Universe::heap()->is_gc_active(), "Allocation during gc not allowed"); assert(size >= 0, "int won't convert to size_t"); HeapWord* obj = common_mem_allocate_init(size, CHECK_NULL); - post_allocation_setup_array(klass, obj, size, length); + post_allocation_setup_array(klass, obj, length); NOT_PRODUCT(Universe::heap()->check_for_bad_heap_word_value(obj, size)); return (oop)obj; } @@ -283,7 +278,7 @@ oop CollectedHeap::array_allocate_nozero(KlassHandle klass, assert(size >= 0, "int won't convert to size_t"); HeapWord* obj = common_mem_allocate_noinit(size, CHECK_NULL); ((oop)obj)->set_klass_gap(0); - post_allocation_setup_array(klass, obj, size, length); + post_allocation_setup_array(klass, obj, length); #ifndef PRODUCT const size_t hs = oopDesc::header_size()+1; Universe::heap()->check_for_non_bad_heap_word_value(obj+hs, size-hs); @@ -293,7 +288,7 @@ oop CollectedHeap::array_allocate_nozero(KlassHandle klass, oop CollectedHeap::permanent_obj_allocate(KlassHandle klass, int size, TRAPS) { oop obj = permanent_obj_allocate_no_klass_install(klass, size, CHECK_NULL); - post_allocation_install_obj_klass(klass, obj, size); + post_allocation_install_obj_klass(klass, obj); NOT_PRODUCT(Universe::heap()->check_for_bad_heap_word_value((HeapWord*) obj, size)); return obj; @@ -306,7 +301,7 @@ oop CollectedHeap::permanent_obj_allocate_no_klass_install(KlassHandle klass, assert(!Universe::heap()->is_gc_active(), "Allocation during gc not allowed"); assert(size >= 0, "int won't convert to size_t"); HeapWord* obj = common_permanent_mem_allocate_init(size, CHECK_NULL); - post_allocation_setup_no_klass_install(klass, obj, size); + post_allocation_setup_no_klass_install(klass, obj); #ifndef PRODUCT const size_t hs = oopDesc::header_size(); Universe::heap()->check_for_bad_heap_word_value(obj+hs, size-hs); @@ -322,7 +317,7 @@ oop CollectedHeap::permanent_array_allocate(KlassHandle klass, assert(!Universe::heap()->is_gc_active(), "Allocation during gc not allowed"); assert(size >= 0, "int won't convert to size_t"); HeapWord* obj = common_permanent_mem_allocate_init(size, CHECK_NULL); - post_allocation_setup_array(klass, obj, size, length); + post_allocation_setup_array(klass, obj, length); NOT_PRODUCT(Universe::heap()->check_for_bad_heap_word_value(obj, size)); return (oop)obj; } diff --git a/src/share/vm/oops/klass.cpp b/src/share/vm/oops/klass.cpp index 345d0b224..84abea68a 100644 --- a/src/share/vm/oops/klass.cpp +++ b/src/share/vm/oops/klass.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -174,10 +174,9 @@ KlassHandle Klass::base_create_klass(KlassHandle& klass, int size, } void Klass_vtbl::post_new_init_klass(KlassHandle& klass, - klassOop new_klass, - int size) const { + klassOop new_klass) const { assert(!new_klass->klass_part()->null_vtbl(), "Not a complete klass"); - CollectedHeap::post_allocation_install_obj_klass(klass, new_klass, size); + CollectedHeap::post_allocation_install_obj_klass(klass, new_klass); } void* Klass_vtbl::operator new(size_t ignored, KlassHandle& klass, diff --git a/src/share/vm/oops/klass.hpp b/src/share/vm/oops/klass.hpp index 035f44c9d..1b26932e8 100644 --- a/src/share/vm/oops/klass.hpp +++ b/src/share/vm/oops/klass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -149,7 +149,7 @@ class Klass_vtbl { // by the shared "base_create" subroutines. // virtual void* allocate_permanent(KlassHandle& klass, int size, TRAPS) const = 0; - void post_new_init_klass(KlassHandle& klass, klassOop obj, int size) const; + void post_new_init_klass(KlassHandle& klass, klassOop obj) const; // Every subclass on which vtbl_value is called must include this macro. // Delay the installation of the klassKlass pointer until after the @@ -160,7 +160,7 @@ class Klass_vtbl { if (HAS_PENDING_EXCEPTION) return NULL; \ klassOop new_klass = ((Klass*) result)->as_klassOop(); \ OrderAccess::storestore(); \ - post_new_init_klass(klass_klass, new_klass, size); \ + post_new_init_klass(klass_klass, new_klass); \ return result; \ } -- GitLab