# HG changeset patch # User redestad # Date 1546941240 -3600 # Node ID a257992e1e4d51babf668e3c765bf4616a3b98d7 # Parent 8cc938aa8f74ca94a0868ca2876fc770eb0b9798 8216285: Enable inlining of CollectedHeap::obj-/array-/class_allocate Reviewed-by: ehelin diff -r 8cc938aa8f74 -r a257992e1e4d src/hotspot/share/gc/shared/collectedHeap.cpp --- a/src/hotspot/share/gc/shared/collectedHeap.cpp Tue Jan 08 13:40:57 2019 +0530 +++ b/src/hotspot/share/gc/shared/collectedHeap.cpp Tue Jan 08 10:54:00 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2019, 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 @@ -461,21 +461,6 @@ return NULL; } -oop CollectedHeap::obj_allocate(Klass* klass, int size, TRAPS) { - ObjAllocator allocator(klass, size, THREAD); - return allocator.allocate(); -} - -oop CollectedHeap::array_allocate(Klass* klass, int size, int length, bool do_zero, TRAPS) { - ObjArrayAllocator allocator(klass, size, length, do_zero, THREAD); - return allocator.allocate(); -} - -oop CollectedHeap::class_allocate(Klass* klass, int size, TRAPS) { - ClassAllocator allocator(klass, size, THREAD); - return allocator.allocate(); -} - void CollectedHeap::ensure_parsability(bool retire_tlabs) { assert(SafepointSynchronize::is_at_safepoint() || !is_init_completed(), "Should only be called at a safepoint or at start-up"); diff -r 8cc938aa8f74 -r a257992e1e4d src/hotspot/share/gc/shared/collectedHeap.inline.hpp --- a/src/hotspot/share/gc/shared/collectedHeap.inline.hpp Tue Jan 08 13:40:57 2019 +0530 +++ b/src/hotspot/share/gc/shared/collectedHeap.inline.hpp Tue Jan 08 10:54:00 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2019, 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 @@ -26,6 +26,7 @@ #define SHARE_VM_GC_SHARED_COLLECTEDHEAP_INLINE_HPP #include "gc/shared/collectedHeap.hpp" +#include "gc/shared/memAllocator.hpp" #include "oops/oop.inline.hpp" #include "utilities/align.hpp" @@ -66,4 +67,19 @@ } } +inline oop CollectedHeap::obj_allocate(Klass* klass, int size, TRAPS) { + ObjAllocator allocator(klass, size, THREAD); + return allocator.allocate(); +} + +inline oop CollectedHeap::array_allocate(Klass* klass, int size, int length, bool do_zero, TRAPS) { + ObjArrayAllocator allocator(klass, size, length, do_zero, THREAD); + return allocator.allocate(); +} + +inline oop CollectedHeap::class_allocate(Klass* klass, int size, TRAPS) { + ClassAllocator allocator(klass, size, THREAD); + return allocator.allocate(); +} + #endif // SHARE_VM_GC_SHARED_COLLECTEDHEAP_INLINE_HPP