< prev index next >

src/java.base/share/classes/jdk/internal/foreign/abi/CallingSequence.java

Print this page

175      *
176      * Includes the return buffer size as well as space for any buffer copies in the recipes.
177      *
178      * @return the allocation size
179      */
180     public long allocationSize() {
181         return allocationSize;
182     }
183 
184     public boolean hasReturnBindings() {
185         return !returnBindings.isEmpty();
186     }
187 
188     public int capturedStateMask() {
189         return linkerOptions.capturedCallState()
190                 .mapToInt(CapturableState::mask)
191                 .reduce(0, (a, b) -> a | b);
192     }
193 
194     public boolean needsTransition() {
195         return !linkerOptions.isTrivial();
196     }
197 
198     public int numLeadingParams() {
199         return 2 + (linkerOptions.hasCapturedCallState() ? 1 : 0); // 2 for addr, allocator
200     }
201 
202     public String asString() {
203         StringBuilder sb = new StringBuilder();
204 
205         sb.append("CallingSequence: {\n");
206         sb.append("  callerMethodType: ").append(callerMethodType);
207         sb.append("  calleeMethodType: ").append(calleeMethodType);
208         sb.append("  FunctionDescriptor: ").append(desc);
209         sb.append("  Argument Bindings:\n");
210         for (int i = 0; i < argumentBindingsCount(); i++) {
211             sb.append("    ").append(i).append(": ").append(argumentBindings.get(i)).append("\n");
212         }
213         if (!returnBindings.isEmpty()) {
214             sb.append("    ").append("Return: ").append(returnBindings).append("\n");
215         }

175      *
176      * Includes the return buffer size as well as space for any buffer copies in the recipes.
177      *
178      * @return the allocation size
179      */
180     public long allocationSize() {
181         return allocationSize;
182     }
183 
184     public boolean hasReturnBindings() {
185         return !returnBindings.isEmpty();
186     }
187 
188     public int capturedStateMask() {
189         return linkerOptions.capturedCallState()
190                 .mapToInt(CapturableState::mask)
191                 .reduce(0, (a, b) -> a | b);
192     }
193 
194     public boolean needsTransition() {
195         return !linkerOptions.isCritical();
196     }
197 
198     public int numLeadingParams() {
199         return 2 + (linkerOptions.hasCapturedCallState() ? 1 : 0); // 2 for addr, allocator
200     }
201 
202     public String asString() {
203         StringBuilder sb = new StringBuilder();
204 
205         sb.append("CallingSequence: {\n");
206         sb.append("  callerMethodType: ").append(callerMethodType);
207         sb.append("  calleeMethodType: ").append(calleeMethodType);
208         sb.append("  FunctionDescriptor: ").append(desc);
209         sb.append("  Argument Bindings:\n");
210         for (int i = 0; i < argumentBindingsCount(); i++) {
211             sb.append("    ").append(i).append(": ").append(argumentBindings.get(i)).append("\n");
212         }
213         if (!returnBindings.isEmpty()) {
214             sb.append("    ").append("Return: ").append(returnBindings).append("\n");
215         }
< prev index next >