51 void set(uint32_t loc, VMStorage storage);
52 void set_frame_data(uint32_t loc, int offset);
53 VMStorage get(uint32_t loc) const;
54 VMStorage get(VMStorage placeholder) const;
55 int data_offset(uint32_t loc) const;
56 };
57
58 // C++ 'mirror' of jdk.internal.foreign.abi.UpcallLinker.CallRegs
59 struct CallRegs {
60 GrowableArray<VMStorage> _arg_regs;
61 GrowableArray<VMStorage> _ret_regs;
62
63 CallRegs(int num_args, int num_rets)
64 : _arg_regs(num_args), _ret_regs(num_rets) {}
65 };
66
67
68 class ForeignGlobals {
69 private:
70 template<typename T>
71 static void parse_register_array(objArrayOop jarray, StorageType type_index, GrowableArray<T>& array, T (*converter)(int));
72
73 public:
74 static bool is_foreign_linker_supported();
75
76 // Helpers for translating from the Java to C++ representation
77 static const ABIDescriptor parse_abi_descriptor(jobject jabi);
78 static const CallRegs parse_call_regs(jobject jconv);
79 static VMStorage parse_vmstorage(oop storage);
80
81 // Adapter from SharedRuntime::java_calling_convention to a 'single VMStorage per value' form.
82 // Doesn't assign (invalid) storage for T_VOID entries in the signature, which are instead ignored.
83 static int java_calling_convention(const BasicType* signature, int num_args, GrowableArray<VMStorage>& out_regs);
84
85 // Computes the space (in bytes) that is taken up by stack arguments
86 static int compute_out_arg_bytes(const GrowableArray<VMStorage>& out_regs);
87
88 // Replace placeholders (see class StubLocations above) with actual locations in a stub frame
89 static GrowableArray<VMStorage> replace_place_holders(const GrowableArray<VMStorage>& regs, const StubLocations& locs);
90
91 // The receiver method handle for upcalls is injected manually into the argument list by the upcall stub. We need a
|
51 void set(uint32_t loc, VMStorage storage);
52 void set_frame_data(uint32_t loc, int offset);
53 VMStorage get(uint32_t loc) const;
54 VMStorage get(VMStorage placeholder) const;
55 int data_offset(uint32_t loc) const;
56 };
57
58 // C++ 'mirror' of jdk.internal.foreign.abi.UpcallLinker.CallRegs
59 struct CallRegs {
60 GrowableArray<VMStorage> _arg_regs;
61 GrowableArray<VMStorage> _ret_regs;
62
63 CallRegs(int num_args, int num_rets)
64 : _arg_regs(num_args), _ret_regs(num_rets) {}
65 };
66
67
68 class ForeignGlobals {
69 private:
70 template<typename T>
71 static void parse_register_array(refArrayOop jarray, StorageType type_index, GrowableArray<T>& array, T (*converter)(int));
72
73 public:
74 static bool is_foreign_linker_supported();
75
76 // Helpers for translating from the Java to C++ representation
77 static const ABIDescriptor parse_abi_descriptor(jobject jabi);
78 static const CallRegs parse_call_regs(jobject jconv);
79 static VMStorage parse_vmstorage(oop storage);
80
81 // Adapter from SharedRuntime::java_calling_convention to a 'single VMStorage per value' form.
82 // Doesn't assign (invalid) storage for T_VOID entries in the signature, which are instead ignored.
83 static int java_calling_convention(const BasicType* signature, int num_args, GrowableArray<VMStorage>& out_regs);
84
85 // Computes the space (in bytes) that is taken up by stack arguments
86 static int compute_out_arg_bytes(const GrowableArray<VMStorage>& out_regs);
87
88 // Replace placeholders (see class StubLocations above) with actual locations in a stub frame
89 static GrowableArray<VMStorage> replace_place_holders(const GrowableArray<VMStorage>& regs, const StubLocations& locs);
90
91 // The receiver method handle for upcalls is injected manually into the argument list by the upcall stub. We need a
|