Path: blob/master/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleDescription.hpp
41155 views
/*1* Copyright (c) 2017, 2019, 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_JFR_LEAKPROFILER_CHECKPOINT_OBJECTSAMPLEDESCRIPTION_HPP25#define SHARE_JFR_LEAKPROFILER_CHECKPOINT_OBJECTSAMPLEDESCRIPTION_HPP2627#define OBJECT_SAMPLE_DESCRIPTION_BUFFER_SIZE 1002829#include "memory/allocation.hpp"3031class outputStream;3233class ObjectDescriptionBuilder : public StackObj {34private:35char _buffer[OBJECT_SAMPLE_DESCRIPTION_BUFFER_SIZE];36size_t _index;3738public:39ObjectDescriptionBuilder();4041void write_text(const char* text);42void write_int(jint value);43void reset();4445void print_description(outputStream* out);46const char* description();47};4849class ObjectSampleDescription : public StackObj {50private:51ObjectDescriptionBuilder _description;52oop _object;5354void write_text(const char* text);55void write_int(jint value);5657void write_object_details();58void write_size(jint size);59void write_thread_name();60void write_thread_group_name();61void write_class_name();62void write_object_to_buffer();63bool is_class(Symbol* s1, const char* s2);64void ensure_initialized();65bool read_int_size(jint* result);6667public:68ObjectSampleDescription(oop object);69void print_description(outputStream* out);70const char* description();71};7273#endif // SHARE_JFR_LEAKPROFILER_CHECKPOINT_OBJECTSAMPLEDESCRIPTION_HPP747576