GP-5262 Adjustments to auto killbycall attribute

This commit is contained in:
caheckman 2025-01-13 23:45:08 +00:00
parent 2138250644
commit eba4fc7803
5 changed files with 49 additions and 38 deletions

View file

@ -42,6 +42,7 @@ public class ParamListStandard implements ParamList {
protected int numgroup; // Number of "groups" in this parameter convention
// protected int maxdelay;
protected boolean thisbeforeret; // Do hidden return pointers usurp the storage of the this pointer
protected boolean autoKilledByCall; // Is storage in this list automatically "killed by call"
protected boolean splitMetatype; // Are metatyped entries in separate resource sections
// protected int[] resourceStart; // The starting group for each resource section
protected ParamEntry[] entry;
@ -235,6 +236,7 @@ public class ParamListStandard implements ParamList {
if (thisbeforeret) {
encoder.writeBool(ATTRIB_THISBEFORERETPOINTER, true);
}
encoder.writeBool(ATTRIB_KILLEDBYCALL, autoKilledByCall);
if (isInput && !splitMetatype) {
encoder.writeBool(ATTRIB_SEPARATEFLOAT, false);
}
@ -298,7 +300,7 @@ public class ParamListStandard implements ParamList {
private void parseGroup(XmlPullParser parser, CompilerSpec cspec, ArrayList<ParamEntry> pe,
int groupid, boolean splitFloat) throws XmlParseException {
XmlElement el = parser.start("group");
XmlElement el = parser.start(ELEM_GROUP.name());
int basegroup = numgroup;
int count = 0;
while (parser.peek().isStart()) {
@ -327,17 +329,22 @@ public class ParamListStandard implements ParamList {
spacebase = null;
int pointermax = 0;
thisbeforeret = false;
autoKilledByCall = false;
splitMetatype = true;
XmlElement mainel = parser.start();
String attribute = mainel.getAttribute("pointermax");
String attribute = mainel.getAttribute(ATTRIB_POINTERMAX.name());
if (attribute != null) {
pointermax = SpecXmlUtils.decodeInt(attribute);
}
attribute = mainel.getAttribute("thisbeforeretpointer");
attribute = mainel.getAttribute(ATTRIB_THISBEFORERETPOINTER.name());
if (attribute != null) {
thisbeforeret = SpecXmlUtils.decodeBoolean(attribute);
}
attribute = mainel.getAttribute("separatefloat");
attribute = mainel.getAttribute(ATTRIB_KILLEDBYCALL.name());
if (attribute != null) {
autoKilledByCall = SpecXmlUtils.decodeBoolean(attribute);
}
attribute = mainel.getAttribute(ATTRIB_SEPARATEFLOAT.name());
if (attribute != null) {
splitMetatype = SpecXmlUtils.decodeBoolean(attribute);
}
@ -347,13 +354,13 @@ public class ParamListStandard implements ParamList {
if (!el.isStart()) {
break;
}
if (el.getName().equals("pentry")) {
if (el.getName().equals(ELEM_PENTRY.name())) {
parsePentry(parser, cspec, pe, numgroup, splitMetatype, false);
}
else if (el.getName().equals("group")) {
else if (el.getName().equals(ELEM_GROUP.name())) {
parseGroup(parser, cspec, pe, numgroup, splitMetatype);
}
else if (el.getName().equals("rule")) {
else if (el.getName().equals(ELEM_RULE.name())) {
break;
}
}
@ -366,7 +373,7 @@ public class ParamListStandard implements ParamList {
if (!subId.isStart()) {
break;
}
if (subId.getName().equals("rule")) {
if (subId.getName().equals(ELEM_RULE.name())) {
ModelRule rule = new ModelRule();
rule.restoreXml(parser, this);
rules.add(rule);
@ -482,6 +489,9 @@ public class ParamListStandard implements ParamList {
if (thisbeforeret != op2.thisbeforeret) {
return false;
}
if (autoKilledByCall != op2.autoKilledByCall) {
return false;
}
return true;
}