Path: blob/master/src/hotspot/share/gc/epsilon/epsilonThreadLocalData.hpp
41149 views
/*1* Copyright (c) 2018, Red Hat, Inc. 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_GC_EPSILON_EPSILONTHREADLOCALDATA_HPP25#define SHARE_GC_EPSILON_EPSILONTHREADLOCALDATA_HPP2627#include "gc/shared/gc_globals.hpp"28#include "runtime/thread.hpp"29#include "utilities/debug.hpp"3031class EpsilonThreadLocalData {32private:33size_t _ergo_tlab_size;34int64_t _last_tlab_time;3536EpsilonThreadLocalData() :37_ergo_tlab_size(0),38_last_tlab_time(0) {}3940static EpsilonThreadLocalData* data(Thread* thread) {41assert(UseEpsilonGC, "Sanity");42return thread->gc_data<EpsilonThreadLocalData>();43}4445public:46static void create(Thread* thread) {47new (data(thread)) EpsilonThreadLocalData();48}4950static void destroy(Thread* thread) {51data(thread)->~EpsilonThreadLocalData();52}5354static size_t ergo_tlab_size(Thread *thread) {55return data(thread)->_ergo_tlab_size;56}5758static int64_t last_tlab_time(Thread *thread) {59return data(thread)->_last_tlab_time;60}6162static void set_ergo_tlab_size(Thread *thread, size_t val) {63data(thread)->_ergo_tlab_size = val;64}6566static void set_last_tlab_time(Thread *thread, int64_t time) {67data(thread)->_last_tlab_time = time;68}69};7071#endif // SHARE_GC_EPSILON_EPSILONTHREADLOCALDATA_HPP727374