1 /*
2 * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_SHARED_COLLECTEDHEAP_INLINE_HPP
26 #define SHARE_VM_GC_SHARED_COLLECTEDHEAP_INLINE_HPP
27
28 #include "gc/shared/allocTracer.hpp"
29 #include "gc/shared/collectedHeap.hpp"
30 #include "gc/shared/threadLocalAllocBuffer.inline.hpp"
31 #include "memory/universe.hpp"
32 #include "oops/arrayOop.hpp"
33 #include "prims/jvmtiExport.hpp"
34 #include "runtime/sharedRuntime.hpp"
35 #include "runtime/thread.inline.hpp"
36 #include "services/lowMemoryDetector.hpp"
37 #include "utilities/copy.hpp"
38
39 // Inline allocation implementations.
40
41 void CollectedHeap::post_allocation_setup_common(KlassHandle klass,
42 HeapWord* obj) {
43 post_allocation_setup_no_klass_install(klass, obj);
44 post_allocation_install_obj_klass(klass, oop(obj));
45 }
46
47 void CollectedHeap::post_allocation_setup_no_klass_install(KlassHandle klass,
48 HeapWord* objPtr) {
49 oop obj = (oop)objPtr;
50
51 assert(obj != NULL, "NULL object pointer");
52 if (UseBiasedLocking && (klass() != NULL)) {
|
1 /*
2 * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_SHARED_COLLECTEDHEAP_INLINE_HPP
26 #define SHARE_VM_GC_SHARED_COLLECTEDHEAP_INLINE_HPP
27
28 #include "gc/shared/allocTracer.hpp"
29 #include "gc/shared/collectedHeap.hpp"
30 #include "gc/shared/threadLocalAllocBuffer.inline.hpp"
31 #include "memory/universe.hpp"
32 #include "oops/arrayOop.hpp"
33 #include "oops/oop.inline.hpp"
34 #include "prims/jvmtiExport.hpp"
35 #include "runtime/sharedRuntime.hpp"
36 #include "runtime/thread.inline.hpp"
37 #include "services/lowMemoryDetector.hpp"
38 #include "utilities/copy.hpp"
39
40 // Inline allocation implementations.
41
42 void CollectedHeap::post_allocation_setup_common(KlassHandle klass,
43 HeapWord* obj) {
44 post_allocation_setup_no_klass_install(klass, obj);
45 post_allocation_install_obj_klass(klass, oop(obj));
46 }
47
48 void CollectedHeap::post_allocation_setup_no_klass_install(KlassHandle klass,
49 HeapWord* objPtr) {
50 oop obj = (oop)objPtr;
51
52 assert(obj != NULL, "NULL object pointer");
53 if (UseBiasedLocking && (klass() != NULL)) {
|