8216285: Enable inlining of CollectedHeap::obj-/array-/class_allocate

Reviewed-by: ehelin
This commit is contained in:
Claes Redestad 2019-01-08 10:54:00 +01:00
parent c9ae7d367f
commit 32b18201e8
2 changed files with 18 additions and 17 deletions

View File

@ -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 @@ HeapWord* CollectedHeap::allocate_new_tlab(size_t min_size,
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");

View File

@ -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 HeapWord* CollectedHeap::align_allocation_or_fail(HeapWord* addr,
}
}
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