< prev index next >

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

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 22,64 **** */ package jdk.internal.foreign.abi; import java.foreign.layout.Layout; ! public class Argument { private final int argumentIndex; // index of argument (in argument list) ! private final Layout type; ! // for testing/debugging, also serves as indicator that argument is named (as opposed to elipsis/varargs arg) ! private final String name; ! ! public Argument(int argumentIndex, Layout type, String name) { this.argumentIndex = argumentIndex; ! this.type = type; ! this.name = name; ! } ! ! public Argument(int index, Layout type) { ! this(index, type, null); } ! public int getArgumentIndex() { return argumentIndex; } ! public Layout getType() { ! return type; } ! public String getName() { ! return name != null ? name : "<anonymous>"; } ! public boolean isNamed() { ! return name != null; ! } @Override public String toString() { ! return "[" + type.toString() + " " + getName() + "]"; } } --- 22,56 ---- */ package jdk.internal.foreign.abi; import java.foreign.layout.Layout; ! public abstract class Argument { private final int argumentIndex; // index of argument (in argument list) ! private final Layout layout; ! private final String debugName; //optional debug name ! protected Argument(Layout layout, int argumentIndex, String debugName) { this.argumentIndex = argumentIndex; ! this.layout = layout; ! this.debugName = debugName; } ! public int argumentIndex() { return argumentIndex; } ! public Layout layout() { ! return layout; } ! public String name() { ! return debugName != null ? debugName : "<anonymous>"; } ! public abstract boolean inMemory(); @Override public String toString() { ! return "[" + layout.toString() + " " + name() + "]"; } }
< prev index next >