Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/gc_implementation/g1/g1ConcurrentMarkObjArrayProcessor.hpp
38921 views
/*1* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef SHARE_VM_GC_G1_G1CONCURRENTMARKOBJARRAYPROCESSOR_HPP25#define SHARE_VM_GC_G1_G1CONCURRENTMARKOBJARRAYPROCESSOR_HPP2627#include "oops/oopsHierarchy.hpp"28#include "memory/allocation.hpp"2930class CMTask;3132// Helper class to mark through large objArrays during marking in an efficient way.33// Instead of pushing large object arrays, we push continuations onto the34// mark stack. These continuations are identified by having their LSB set.35// This allows incremental processing of large objects.36class G1CMObjArrayProcessor VALUE_OBJ_CLASS_SPEC {37private:38// The bit mask for the continuation indicator of elements on the mark stack.39static const size_t ArraySliceBit = 1;4041// Reference to the task for doing the actual work.42CMTask* _task;4344// Encodes the given address as a continuation "oop".45oop encode_array_slice(HeapWord* addr);46// Remove the continuation marker from the given oop from the mark stack.47HeapWord* decode_array_slice(oop value);4849// Push the continuation at the given address onto the mark stack.50void push_array_slice(HeapWord* addr);5152// Process (apply the closure) on the given continuation of the given objArray.53size_t process_array_slice(objArrayOop const obj, HeapWord* start_from, size_t remaining);54public:55static bool is_array_slice(void* obj) { return ((uintptr_t)obj & ArraySliceBit) != 0; }5657static bool should_be_sliced(oop obj);5859G1CMObjArrayProcessor(CMTask* task) : _task(task) {60}6162// Process the given continuation "oop". Returns the number of words scanned.63size_t process_slice(oop obj);64// Start processing the given objArrayOop by scanning the header and pushing its65// continuation.66size_t process_obj(oop obj);67};6869#endif /* SHARE_VM_GC_G1_G1CONCURRENTMARKOBJARRAYPROCESSOR_HPP */707172