Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/jfr/writers/jfrWriterHost.hpp
38920 views
/*1* Copyright (c) 2016, 2018, 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_JFR_WRITERS_JFRWRITERHOST_HPP25#define SHARE_VM_JFR_WRITERS_JFRWRITERHOST_HPP2627#include "jni.h"28#include "utilities/globalDefinitions.hpp"29#include "jfr/utilities/jfrTime.hpp"3031class ClassLoaderData;32class Klass;33class Method;34class Symbol;35class Thread;3637// BE == Base Encoder38// IE == Integer Encoder39template <typename BE, typename IE, typename WriterPolicyImpl >40class WriterHost : public WriterPolicyImpl {41private:42const bool _compressed_integers;4344template <typename T>45void write_padded(T value);46template <typename T>47void write_padded(const T* value, size_t len);48template <typename T>49u1* write_padded(const T* value, size_t len, u1* pos);50template <typename T>51void write(const T* value, size_t len);52template <typename T>53u1* write(const T* value, size_t len, u1* pos);54void write_utf8(const char* value);55void write_utf16(const jchar* value, jint len);5657protected:58template <typename T>59void be_write(T value);60template <typename T>61void be_write(const T* value, size_t len);62template <typename StorageType>63WriterHost(StorageType* storage, Thread* thread);64template <typename StorageType>65WriterHost(StorageType* storage, size_t size);66WriterHost(Thread* thread);67u1* ensure_size(size_t requested_size);6869public:70template <typename T>71void write(T value);72void write(bool value);73void write(float value);74void write(double value);75void write(const char* value);76void write(char* value);77void write(jstring value);78void write(const ClassLoaderData* cld);79void write(const Klass* klass);80void write(const Method* method);81void write(const Symbol* symbol);82void write(const Ticks& time);83void write(const Tickspan& time);84void write(const JfrTicks& time);85void write(const JfrTickspan& time);86void bytes(const void* buf, size_t len);87void write_utf8_u2_len(const char* value);88template <typename T>89void write_padded_at_offset(T value, int64_t offset);90template <typename T>91void write_at_offset(T value, int64_t offset);92template <typename T>93void write_be_at_offset(T value, int64_t offset);94int64_t reserve(size_t size);95};9697#endif // SHARE_VM_JFR_WRITERS_JFRWRITERHOST_HPP9899100