| 1 | /* | 
|---|
| 2 | * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. | 
|---|
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 
|---|
| 4 | * | 
|---|
| 5 | * This code is free software; you can redistribute it and/or modify it | 
|---|
| 6 | * under the terms of the GNU General Public License version 2 only, as | 
|---|
| 7 | * published by the Free Software Foundation. | 
|---|
| 8 | * | 
|---|
| 9 | * This code is distributed in the hope that it will be useful, but WITHOUT | 
|---|
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | 
|---|
| 11 | * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License | 
|---|
| 12 | * version 2 for more details (a copy is included in the LICENSE file that | 
|---|
| 13 | * accompanied this code). | 
|---|
| 14 | * | 
|---|
| 15 | * You should have received a copy of the GNU General Public License version | 
|---|
| 16 | * 2 along with this work; if not, write to the Free Software Foundation, | 
|---|
| 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | 
|---|
| 18 | * | 
|---|
| 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | 
|---|
| 20 | * or visit www.oracle.com if you need additional information or have any | 
|---|
| 21 | * questions. | 
|---|
| 22 | * | 
|---|
| 23 | */ | 
|---|
| 24 |  | 
|---|
| 25 | #ifndef SHARE_JFR_SUPPORT_JFREVENTCLASS_HPP | 
|---|
| 26 | #define SHARE_JFR_SUPPORT_JFREVENTCLASS_HPP | 
|---|
| 27 |  | 
|---|
| 28 | #include "jni.h" | 
|---|
| 29 | #include "memory/allocation.hpp" | 
|---|
| 30 |  | 
|---|
| 31 | class Klass; | 
|---|
| 32 |  | 
|---|
| 33 | // | 
|---|
| 34 | // For convenient access to the jdk.jfr.Event klass hierarchy. | 
|---|
| 35 | // | 
|---|
| 36 | class JdkJfrEvent : AllStatic { | 
|---|
| 37 | public: | 
|---|
| 38 | // jdk.jfr.Event | 
|---|
| 39 | static bool is(const Klass* k); | 
|---|
| 40 | static bool is(const jclass jc); | 
|---|
| 41 | static void tag_as(const Klass* k); | 
|---|
| 42 |  | 
|---|
| 43 | // jdk.jfr.Event subklasses | 
|---|
| 44 | static bool is_subklass(const Klass* k); | 
|---|
| 45 | static bool is_subklass(const jclass jc); | 
|---|
| 46 | static void tag_as_subklass(const Klass* k); | 
|---|
| 47 | static void tag_as_subklass(const jclass jc); | 
|---|
| 48 |  | 
|---|
| 49 | // jdk.jfr.Event hierarchy | 
|---|
| 50 | static bool is_a(const Klass* k); | 
|---|
| 51 | static bool is_a(const jclass jc); | 
|---|
| 52 |  | 
|---|
| 53 | // klasses that host a jdk.jfr.Event | 
|---|
| 54 | static bool is_host(const Klass* k); | 
|---|
| 55 | static bool is_host(const jclass jc); | 
|---|
| 56 | static void tag_as_host(const Klass* k); | 
|---|
| 57 | static void tag_as_host(const jclass jc); | 
|---|
| 58 |  | 
|---|
| 59 | // in the set of classes made visible to java | 
|---|
| 60 | static bool is_visible(const Klass* k); | 
|---|
| 61 | static bool is_visible(const jclass jc); | 
|---|
| 62 | }; | 
|---|
| 63 |  | 
|---|
| 64 | #endif // SHARE_JFR_SUPPORT_JFREVENTCLASS_HPP | 
|---|
| 65 |  | 
|---|