[foreign] RFR: Debug code for ShuffleRecipe translation

Sundararajan Athijegannathan sundararajan.athijegannathan at oracle.com
Tue Dec 18 03:05:46 UTC 2018


ShuffleRecipe:

+    private static final boolean DEBUG = Boolean.getBoolean("jdk.internal.foreign.abi.ShuffleRecipe.DEBUG");


should use

         sun.security.action.GetBooleanAction.privilegedGetProperty

Or else, SecurityException will be thrown if there was any untrusted 
caller in the stack.

-Sundar

On 17/12/18, 11:41 PM, Jorn Vernee wrote:
> Hi,
>
> This is another piece of debugging code I wrote while porting the 
> binder to Windows that might be useful to have in the future.
>
> This prints info on how a CallingSequence is translated into a 
> ShuffleRecipe, e.g.:
>
> Translating CallingSequence:
>   CallingSequence: {
>     Flags:
>     STACK_ARGUMENT_SLOT
>     VECTOR_ARGUMENT_REGISTER
>     INTEGER_ARGUMENT_REGISTER
>       Storage { INTEGER_ARGUMENT_REGISTER[0] (size=8) } : arg0 @ 0x0
>       Storage { INTEGER_ARGUMENT_REGISTER[1] (size=8) } : arg1 @ 0x0
>     VECTOR_RETURN_REGISTER
>     INTEGER_RETURN_REGISTER
>       Storage { INTEGER_RETURN_REGISTER[0] (size=8) } : __retval @ 0x0
>     X87_RETURN_REGISTER
>   }
>
> into:
>   ShuffleRecipe: {
>     Arguments: {
>       BUFFER: []
>       STACK: []
>       VECTOR: []
>       INTEGER: [PULL, PULL]
>       X87: []
>     }
>     Returns: {
>       BUFFER: []
>       STACK: []
>       VECTOR: []
>       INTEGER: [PULL]
>       X87: []
>     }
>   }
>
> This is guarded by the flag 
> `-Djdk.internal.foreign.abi.ShuffleRecipe.DEBUG=true`.
>
> Webrev: 
> http://cr.openjdk.java.net/~jvernee/panama/webrevs/shuffledebug/webrev.01/
>
> Please let me know what you think.
>
> Thanks,
> Jorn
>


More information about the panama-dev mailing list