# HG changeset patch # User brutisso # Date 1332836999 -7200 # Node ID 9a9bb0010c91ea35b2318b499d9ea3669b1913be # Parent cc74fa5a91a9c3d31ef0a26ef60d9c1c172a1165 7156764: Remove unused size parameter from some CollectedHeap methods Summary: Some minor cleanups Reviewed-by: tonyp, jwilhelm diff -r cc74fa5a91a9 -r 9a9bb0010c91 src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp --- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp Fri Mar 23 15:28:24 2012 +0100 +++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp Tue Mar 27 10:29:59 2012 +0200 @@ -940,10 +940,9 @@ 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 -r cc74fa5a91a9 -r 9a9bb0010c91 src/share/vm/gc_interface/collectedHeap.cpp --- a/src/share/vm/gc_interface/collectedHeap.cpp Fri Mar 23 15:28:24 2012 +0100 +++ b/src/share/vm/gc_interface/collectedHeap.cpp Tue Mar 27 10:29:59 2012 +0200 @@ -333,7 +333,7 @@ // 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 @@ 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 @@ 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 -r cc74fa5a91a9 -r 9a9bb0010c91 src/share/vm/gc_interface/collectedHeap.hpp --- a/src/share/vm/gc_interface/collectedHeap.hpp Fri Mar 23 15:28:24 2012 +0100 +++ b/src/share/vm/gc_interface/collectedHeap.hpp Tue Mar 27 10:29:59 2012 +0200 @@ -149,18 +149,14 @@ 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 @@ 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 @@ } } - // Allocate GCHeapLog during VM startup - static void initialize_heap_log(); - // Heap verification virtual void verify(bool allow_dirty, bool silent, VerifyOption option) = 0; diff -r cc74fa5a91a9 -r 9a9bb0010c91 src/share/vm/gc_interface/collectedHeap.inline.hpp --- a/src/share/vm/gc_interface/collectedHeap.inline.hpp Fri Mar 23 15:28:24 2012 +0100 +++ b/src/share/vm/gc_interface/collectedHeap.inline.hpp Tue Mar 27 10:29:59 2012 +0200 @@ -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_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 @@ } 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_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 @@ 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 @@ 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 @@ 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::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 @@ 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 @@ 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 -r cc74fa5a91a9 -r 9a9bb0010c91 src/share/vm/oops/klass.cpp --- a/src/share/vm/oops/klass.cpp Fri Mar 23 15:28:24 2012 +0100 +++ b/src/share/vm/oops/klass.cpp Tue Mar 27 10:29:59 2012 +0200 @@ -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 @@ } 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 -r cc74fa5a91a9 -r 9a9bb0010c91 src/share/vm/oops/klass.hpp --- a/src/share/vm/oops/klass.hpp Fri Mar 23 15:28:24 2012 +0100 +++ b/src/share/vm/oops/klass.hpp Tue Mar 27 10:29:59 2012 +0200 @@ -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 @@ // 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 @@ 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; \ }