Path: blob/master/src/hotspot/share/jfr/jni/jfrJavaCall.hpp
41149 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_JNI_JFRJAVACALL_HPP25#define SHARE_JFR_JNI_JFRJAVACALL_HPP2627#include "jni.h"28#include "jfr/utilities/jfrAllocation.hpp"29#include "utilities/exceptions.hpp"30#include "utilities/globalDefinitions.hpp"3132class JavaCallArguments;33class JavaThread;34class JavaValue;35class Klass;36class Symbol;3738class JfrJavaArguments : public StackObj {39friend class JfrJavaCall;40public:41JfrJavaArguments(JavaValue* result);42JfrJavaArguments(JavaValue* result, const char* klass_name, const char* name, const char* signature, TRAPS);43JfrJavaArguments(JavaValue* result, const Klass* klass, const Symbol* name, const Symbol* signature);4445Klass* klass() const;46void set_klass(const char* klass_name, TRAPS);47void set_klass(const Klass* klass);4849Symbol* name() const;50void set_name(const char* name);51void set_name(const Symbol* name);5253Symbol* signature() const;54void set_signature(const char* signature);55void set_signature(const Symbol* signature);5657int array_length() const;58void set_array_length(int length);5960JavaValue* result() const;6162bool has_receiver() const;63void set_receiver(const oop receiver);64void set_receiver(Handle receiver);65oop receiver() const;6667// parameters68void push_oop(const oop obj);69void push_oop(Handle h_obj);70void push_jobject(jobject h);71void push_int(jint i);72void push_double(jdouble d);73void push_long(jlong l);74void push_float(jfloat f);7576int length() const;77const JavaValue& param(int idx) const;7879private:80class Parameters {81friend class JfrJavaArguments;82private:83enum { SIZE = 16};84JavaValue _storage[SIZE];85int _storage_index;86int _java_stack_slots;8788Parameters();89NONCOPYABLE(Parameters);9091void push(const JavaValue& value);92void push_large(const JavaValue& value);9394void push_oop(const oop obj);95void push_oop(Handle h_obj);96void push_jobject(jobject h);97void push_jint(jint i);98void push_jdouble(jdouble d);99void push_jlong(jlong l);100void push_jfloat(jfloat f);101102bool has_receiver() const;103void set_receiver(const oop receiver);104void set_receiver(Handle receiver);105oop receiver() const;106107int length() const;108int java_stack_slots() const;109110void copy(JavaCallArguments& args, TRAPS) const;111const JavaValue& values(int idx) const;112};113114Parameters _params;115const JavaValue* const _result;116const Klass* _klass;117const Symbol* _name;118const Symbol* _signature;119int _array_length;120121int java_call_arg_slots() const;122void copy(JavaCallArguments& args, TRAPS);123};124125class JfrJavaCall : public AllStatic {126friend class JfrJavaSupport;127private:128static void call_static(JfrJavaArguments* args, TRAPS);129static void call_special(JfrJavaArguments* args, TRAPS);130static void call_virtual(JfrJavaArguments* args, TRAPS);131};132133#endif // SHARE_JFR_JNI_JFRJAVACALL_HPP134135136