annotate src/share/vm/oops/objArrayKlass.inline.hpp @ 7745:6dc8db7164d2

Added tag jdk9-b49 for changeset 360cd1fc42f1
author katleman
date Thu, 05 Feb 2015 11:43:29 -0800
parents db9981fd3124
children e641ea5c503b
rev   line source
jcoomes@1311 1 /*
mikael@5776 2 * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
jcoomes@1311 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
jcoomes@1311 4 *
jcoomes@1311 5 * This code is free software; you can redistribute it and/or modify it
jcoomes@1311 6 * under the terms of the GNU General Public License version 2 only, as
jcoomes@1311 7 * published by the Free Software Foundation.
jcoomes@1311 8 *
jcoomes@1311 9 * This code is distributed in the hope that it will be useful, but WITHOUT
jcoomes@1311 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
jcoomes@1311 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
jcoomes@1311 12 * version 2 for more details (a copy is included in the LICENSE file that
jcoomes@1311 13 * accompanied this code).
jcoomes@1311 14 *
jcoomes@1311 15 * You should have received a copy of the GNU General Public License version
jcoomes@1311 16 * 2 along with this work; if not, write to the Free Software Foundation,
jcoomes@1311 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
jcoomes@1311 18 *
trims@1472 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1472 20 * or visit www.oracle.com if you need additional information or have any
trims@1472 21 * questions.
jcoomes@1311 22 *
jcoomes@1311 23 */
jcoomes@1311 24
stefank@1879 25 #ifndef SHARE_VM_OOPS_OBJARRAYKLASS_INLINE_HPP
stefank@1879 26 #define SHARE_VM_OOPS_OBJARRAYKLASS_INLINE_HPP
stefank@1879 27
coleenp@3602 28 #include "gc_implementation/shared/markSweep.inline.hpp"
stefank@1879 29 #include "oops/objArrayKlass.hpp"
jprovino@4107 30 #include "utilities/macros.hpp"
jprovino@4107 31 #if INCLUDE_ALL_GCS
stefank@1879 32 #include "gc_implementation/parallelScavenge/psCompactionManager.inline.hpp"
stefank@1879 33 #include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
jprovino@4107 34 #endif // INCLUDE_ALL_GCS
stefank@1879 35
coleenp@3707 36 void ObjArrayKlass::oop_follow_contents(oop obj, int index) {
jcoomes@1311 37 if (UseCompressedOops) {
jcoomes@1311 38 objarray_follow_contents<narrowOop>(obj, index);
jcoomes@1311 39 } else {
jcoomes@1311 40 objarray_follow_contents<oop>(obj, index);
jcoomes@1311 41 }
jcoomes@1311 42 }
jcoomes@1311 43
jcoomes@1311 44 template <class T>
coleenp@3707 45 void ObjArrayKlass::objarray_follow_contents(oop obj, int index) {
jcoomes@1311 46 objArrayOop a = objArrayOop(obj);
jcoomes@1311 47 const size_t len = size_t(a->length());
jcoomes@1311 48 const size_t beg_index = size_t(index);
jcoomes@1311 49 assert(beg_index < len || len == 0, "index too large");
jcoomes@1311 50
jcoomes@1311 51 const size_t stride = MIN2(len - beg_index, ObjArrayMarkingStride);
jcoomes@1311 52 const size_t end_index = beg_index + stride;
jcoomes@1311 53 T* const base = (T*)a->base();
jcoomes@1311 54 T* const beg = base + beg_index;
jcoomes@1311 55 T* const end = base + end_index;
jcoomes@1311 56
jcoomes@1311 57 // Push the non-NULL elements of the next stride on the marking stack.
jcoomes@1311 58 for (T* e = beg; e < end; e++) {
jcoomes@1311 59 MarkSweep::mark_and_push<T>(e);
jcoomes@1311 60 }
jcoomes@1311 61
jcoomes@1311 62 if (end_index < len) {
jcoomes@1311 63 MarkSweep::push_objarray(a, end_index); // Push the continuation.
jcoomes@1311 64 }
jcoomes@1311 65 }
jcoomes@1311 66
jprovino@4107 67 #if INCLUDE_ALL_GCS
coleenp@3707 68 void ObjArrayKlass::oop_follow_contents(ParCompactionManager* cm, oop obj,
jcoomes@1311 69 int index) {
jcoomes@1311 70 if (UseCompressedOops) {
jcoomes@1311 71 objarray_follow_contents<narrowOop>(cm, obj, index);
jcoomes@1311 72 } else {
jcoomes@1311 73 objarray_follow_contents<oop>(cm, obj, index);
jcoomes@1311 74 }
jcoomes@1311 75 }
jcoomes@1311 76
jcoomes@1311 77 template <class T>
coleenp@3707 78 void ObjArrayKlass::objarray_follow_contents(ParCompactionManager* cm, oop obj,
jcoomes@1311 79 int index) {
jcoomes@1311 80 objArrayOop a = objArrayOop(obj);
jcoomes@1311 81 const size_t len = size_t(a->length());
jcoomes@1311 82 const size_t beg_index = size_t(index);
jcoomes@1311 83 assert(beg_index < len || len == 0, "index too large");
jcoomes@1311 84
jcoomes@1311 85 const size_t stride = MIN2(len - beg_index, ObjArrayMarkingStride);
jcoomes@1311 86 const size_t end_index = beg_index + stride;
jcoomes@1311 87 T* const base = (T*)a->base();
jcoomes@1311 88 T* const beg = base + beg_index;
jcoomes@1311 89 T* const end = base + end_index;
jcoomes@1311 90
jcoomes@1311 91 // Push the non-NULL elements of the next stride on the marking stack.
jcoomes@1311 92 for (T* e = beg; e < end; e++) {
jcoomes@1311 93 PSParallelCompact::mark_and_push<T>(cm, e);
jcoomes@1311 94 }
jcoomes@1311 95
jcoomes@1311 96 if (end_index < len) {
jcoomes@1311 97 cm->push_objarray(a, end_index); // Push the continuation.
jcoomes@1311 98 }
jcoomes@1311 99 }
jprovino@4107 100 #endif // INCLUDE_ALL_GCS
stefank@1879 101
stefank@1879 102 #endif // SHARE_VM_OOPS_OBJARRAYKLASS_INLINE_HPP