Path: blob/master/src/hotspot/share/prims/foreign_globals.hpp
41144 views
/*1* Copyright (c) 2020, 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*/2223#ifndef SHARE_PRIMS_FOREIGN_GLOBALS24#define SHARE_PRIMS_FOREIGN_GLOBALS2526#include "code/vmreg.hpp"27#include "oops/oopsHierarchy.hpp"28#include "utilities/growableArray.hpp"29#include "utilities/macros.hpp"3031#include CPU_HEADER(foreign_globals)3233struct CallRegs {34VMReg* _arg_regs;35int _args_length;3637VMReg* _ret_regs;38int _rets_length;3940void calling_convention(BasicType* sig_bt, VMRegPair *parm_regs, uint argcnt) const;41};4243class ForeignGlobals {44private:45struct {46int inputStorage_offset;47int outputStorage_offset;48int volatileStorage_offset;49int stackAlignment_offset;50int shadowSpace_offset;51} ABI;5253struct {54int index_offset;55int type_offset;56} VMS;5758struct {59int size_offset;60int arguments_next_pc_offset;61int stack_args_bytes_offset;62int stack_args_offset;63int input_type_offsets_offset;64int output_type_offsets_offset;65} BL;6667struct {68int arg_regs_offset;69int ret_regs_offset;70} CallConvOffsets;7172ForeignGlobals();7374static const ForeignGlobals& instance();7576template<typename R>77static R cast(oop theOop);7879template<typename T, typename Func>80void loadArray(objArrayOop jarray, int type_index, GrowableArray<T>& array, Func converter) const;8182const ABIDescriptor parse_abi_descriptor_impl(jobject jabi) const;83const BufferLayout parse_buffer_layout_impl(jobject jlayout) const;84const CallRegs parse_call_regs_impl(jobject jconv) const;85public:86static const ABIDescriptor parse_abi_descriptor(jobject jabi);87static const BufferLayout parse_buffer_layout(jobject jlayout);88static const CallRegs parse_call_regs(jobject jconv);89};9091#endif // SHARE_PRIMS_FOREIGN_GLOBALS929394