[foreign-memaccess+abi] RFR: 8262118: Specialize upcalls [v2]

Maurizio Cimadamore mcimadamore at openjdk.java.net
Tue Feb 23 12:57:02 UTC 2021


On Tue, 23 Feb 2021 12:44:54 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Looks a very solid piece of work (I've mostly checked the Java side). I like how the code has been consolidated between upcall and downcall paths. I've added some minor comments around for your consideration.
>
> When trying this on my machine (Ubuntu 20.04) I get this:
> In file included from ../../src/hotspot/share/prims/foreign_globals.cpp:25:
> ../../src/hotspot/share/prims/foreign_globals.hpp:40:46: error: 'VMRegPair' has not been declared
>    40 |   void calling_convention(BasicType* sig_bt, VMRegPair *parm_regs, uint argcnt) const;
>       |                                              ^~~~~~~~~
> ../../src/hotspot/share/prims/foreign_globals.cpp:102:6: error: no declaration matches 'void CallRegs::calling_convention(BasicType*, VMRegPair*, uint) const'
>   102 | void CallRegs::calling_convention(BasicType* sig_bt, VMRegPair *parm_regs, uint argcnt) const {
>       |      ^~~~~~~~
> In file included from ../../src/hotspot/share/prims/foreign_globals.cpp:25:
> ../../src/hotspot/share/prims/foreign_globals.hpp:40:8: note: candidate is: 'void CallRegs::calling_convention(BasicType*, int*, uint) const'
>    40 |   void calling_convention(BasicType* sig_bt, VMRegPair *parm_regs, uint argcnt) const;
>       |        ^~~~~~~~~~~~~~~~~~
> ../../src/hotspot/share/prims/foreign_globals.hpp:33:8: note: 'struct CallRegs' defined here
>    33 | struct CallRegs {
>       |        ^~~~~~~~
> 
> I compile with disabled precompiled headers, which typically causes issues like this - is there some include missing somewhere?
> 
> It seems like I need to add this:
> 
> #include "code/vmreg.hpp"
> 
> In foreign_globals.hpp to get things working.

Other includes seem to be missing - here's the patch I needed to get it working:

+++ b/src/hotspot/cpu/x86/universalUpcallHandler_x86_64.cpp
@@ -31,6 +31,8 @@
 #include "memory/resourceArea.hpp"
 #include "prims/universalUpcallHandler.hpp"
 #include "runtime/sharedRuntime.hpp"
+#include "runtime/signature.hpp"
+#include "utilities/formatBuffer.hpp"
 #include "utilities/globalDefinitions.hpp"
 
 #define __ _masm->
diff --git a/src/hotspot/share/prims/foreign_globals.hpp b/src/hotspot/share/prims/foreign_globals.hpp
index 4f02ee625cb..44c65771e7c 100644
--- a/src/hotspot/share/prims/foreign_globals.hpp
+++ b/src/hotspot/share/prims/foreign_globals.hpp
@@ -27,6 +27,7 @@
 #include "oops/oopsHierarchy.hpp"
 #include "utilities/growableArray.hpp"
 #include "utilities/macros.hpp"
+#include "code/vmreg.hpp"
 
 #include CPU_HEADER(foreign_globals)

-------------

PR: https://git.openjdk.java.net/panama-foreign/pull/457


More information about the panama-dev mailing list