Skip to content

Commit 82d6abc

Browse files
Use methodReturn***: instead of pop: + push***: in FilePlugin
1 parent 48101cd commit 82d6abc

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

src/plugins/FilePlugin/FilePlugin.c

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* Automatically generated by
2-
VMPluginCodeGenerator VMMaker.oscog-VB.2382 uuid: da8a5d36-0cd4-b641-865f-a139b3914245
2+
VMPluginCodeGenerator VMMaker.oscog-VB.2383 uuid: a0681b83-7110-3d47-9214-f4bcf9d4982a
33
from
4-
FilePlugin VMMaker.oscog-VB.2382 uuid: da8a5d36-0cd4-b641-865f-a139b3914245
4+
FilePlugin VMMaker.oscog-VB.2383 uuid: a0681b83-7110-3d47-9214-f4bcf9d4982a
55
*/
6-
static char __buildInfo[] = "FilePlugin VMMaker.oscog-VB.2382 uuid: da8a5d36-0cd4-b641-865f-a139b3914245 " __DATE__ ;
6+
static char __buildInfo[] = "FilePlugin VMMaker.oscog-VB.2383 uuid: a0681b83-7110-3d47-9214-f4bcf9d4982a " __DATE__ ;
77

88

99

@@ -131,6 +131,9 @@ static sqInt (*isBytes)(sqInt oop);
131131
static sqInt (*isIntegerObject)(sqInt objectPointer);
132132
static sqInt (*isWords)(sqInt oop);
133133
static sqInt (*isWordsOrBytes)(sqInt oop);
134+
static sqInt (*methodReturnBool)(sqInt boolean);
135+
static sqInt (*methodReturnInteger)(sqInt integer);
136+
static sqInt (*methodReturnValue)(sqInt oop);
134137
static sqInt (*nilObject)(void);
135138
static sqInt (*pop)(sqInt nItems);
136139
static sqInt (*popthenPush)(sqInt nItems, sqInt oop);
@@ -143,8 +146,6 @@ static usqIntptr_t (*positiveMachineIntegerValueOf)(sqInt oop);
143146
static sqInt (*primitiveFail)(void);
144147
static sqInt (*primitiveFailFor)(sqInt reasonCode);
145148
static sqInt (*primitiveFailureCode)(void);
146-
static sqInt (*pushBool)(sqInt trueOrFalse);
147-
static sqInt (*pushInteger)(sqInt integerValue);
148149
static sqInt (*pushRemappableOop)(sqInt oop);
149150
static sqInt (*slotSizeOf)(sqInt oop);
150151
static sqInt (*stSizeOf)(sqInt oop);
@@ -183,6 +184,9 @@ extern sqInt isIntegerObject(sqInt objectPointer);
183184
#endif
184185
extern sqInt isWords(sqInt oop);
185186
extern sqInt isWordsOrBytes(sqInt oop);
187+
extern sqInt methodReturnBool(sqInt boolean);
188+
extern sqInt methodReturnInteger(sqInt integer);
189+
extern sqInt methodReturnValue(sqInt oop);
186190
extern sqInt nilObject(void);
187191
extern sqInt pop(sqInt nItems);
188192
extern sqInt popthenPush(sqInt nItems, sqInt oop);
@@ -195,8 +199,6 @@ extern usqIntptr_t positiveMachineIntegerValueOf(sqInt oop);
195199
extern sqInt primitiveFail(void);
196200
extern sqInt primitiveFailFor(sqInt reasonCode);
197201
extern sqInt primitiveFailureCode(void);
198-
extern sqInt pushBool(sqInt trueOrFalse);
199-
extern sqInt pushInteger(sqInt integerValue);
200202
extern sqInt pushRemappableOop(sqInt oop);
201203
extern sqInt slotSizeOf(sqInt oop);
202204
extern sqInt stSizeOf(sqInt oop);
@@ -211,9 +213,9 @@ extern
211213
struct VirtualMachine* interpreterProxy;
212214
static const char *moduleName =
213215
#ifdef SQUEAK_BUILTIN_PLUGIN
214-
"FilePlugin VMMaker.oscog-VB.2382 (i)"
216+
"FilePlugin VMMaker.oscog-VB.2383 (i)"
215217
#else
216-
"FilePlugin VMMaker.oscog-VB.2382 (e)"
218+
"FilePlugin VMMaker.oscog-VB.2383 (e)"
217219
#endif
218220
;
219221
static void * sCCPfn;
@@ -646,7 +648,7 @@ primitiveConnectToFile(void)
646648
}
647649
filePointer = fileOop;
648650
if (!(failed())) {
649-
popthenPush(3, filePointer);
651+
methodReturnValue(filePointer);
650652
}
651653
return 0;
652654
}
@@ -696,7 +698,7 @@ primitiveConnectToFileDescriptor(void)
696698
}
697699
filePointer = fileOop;
698700
if (!(failed())) {
699-
popthenPush(3, filePointer);
701+
methodReturnValue(filePointer);
700702
}
701703
return 0;
702704
}
@@ -1079,8 +1081,7 @@ primitiveFileAtEnd(void)
10791081
atEnd = sqFileAtEnd(file);
10801082
}
10811083
if (!(failed())) {
1082-
pop(2);
1083-
pushBool(atEnd);
1084+
methodReturnBool(atEnd);
10841085
}
10851086
return 0;
10861087
}
@@ -1171,8 +1172,7 @@ primitiveFileDescriptorType(void)
11711172
return primitiveFailFor(PrimErrBadArgument);
11721173
}
11731174
fileType = sqFileDescriptorType(fd);
1174-
pop(2);
1175-
pushInteger(fileType);
1175+
methodReturnInteger(fileType);
11761176
return 0;
11771177
}
11781178

@@ -1224,7 +1224,7 @@ primitiveFileGetPosition(void)
12241224
position = sqFileGetPosition(file);
12251225
}
12261226
if (!(failed())) {
1227-
popthenPush(2, positive64BitIntegerFor(position));
1227+
methodReturnValue(positive64BitIntegerFor(position));
12281228
}
12291229
return 0;
12301230
}
@@ -1248,7 +1248,7 @@ primitiveFileOpen(void)
12481248
nameSize = byteSizeOf(namePointer);
12491249
filePointer = fileOpenNamesizewritesecure(nameIndex, nameSize, writeFlag, 1);
12501250
if (!(failed())) {
1251-
popthenPush(3, filePointer);
1251+
methodReturnValue(filePointer);
12521252
}
12531253
return 0;
12541254
}
@@ -1270,7 +1270,7 @@ primitiveFileOpenNew(void)
12701270
nameSize = byteSizeOf(namePointer);
12711271
filePointer = fileOpenNewNamesizesecure(nameIndex, nameSize, 1);
12721272
if (!(failed())) {
1273-
popthenPush(2, filePointer);
1273+
methodReturnValue(filePointer);
12741274
}
12751275
return 0;
12761276
}
@@ -1328,7 +1328,7 @@ primitiveFileRead(void)
13281328
: (byteSizeOf(array)) / slotSize);
13291329
bytesRead = sqFileReadIntoAt(file, count * elementSize, ((char *) (firstIndexableField(array))), (startIndex - 1) * elementSize);
13301330
if (!(failed())) {
1331-
popthenPush(5, integerObjectOf(bytesRead / elementSize));
1331+
methodReturnValue(integerObjectOf(bytesRead / elementSize));
13321332
}
13331333
l2: /* end primitiveFileReadWithPinning */;
13341334
# else /* SPURVM */
@@ -1368,7 +1368,7 @@ primitiveFileRead(void)
13681368
primitiveFailFor(PrimNoErr);
13691369
}
13701370
if (!(failed())) {
1371-
popthenPush(5, integerObjectOf(bytesRead1 / elementSize1));
1371+
methodReturnValue(integerObjectOf(bytesRead1 / elementSize1));
13721372
}
13731373
l4: /* end primitiveFileReadWithoutPinning */;
13741374
# endif /* SPURVM */
@@ -1426,7 +1426,7 @@ primitiveFileReadWithoutPinning(void)
14261426
primitiveFailFor(PrimNoErr);
14271427
}
14281428
if (!(failed())) {
1429-
popthenPush(5, integerObjectOf(bytesRead / elementSize));
1429+
methodReturnValue(integerObjectOf(bytesRead / elementSize));
14301430
}
14311431
return 0;
14321432
}
@@ -1476,7 +1476,7 @@ primitiveFileReadWithPinning(void)
14761476
: (byteSizeOf(array)) / slotSize);
14771477
bytesRead = sqFileReadIntoAt(file, count * elementSize, ((char *) (firstIndexableField(array))), (startIndex - 1) * elementSize);
14781478
if (!(failed())) {
1479-
popthenPush(5, integerObjectOf(bytesRead / elementSize));
1479+
methodReturnValue(integerObjectOf(bytesRead / elementSize));
14801480
}
14811481
return 0;
14821482
}
@@ -1572,7 +1572,7 @@ primitiveFileSize(void)
15721572
size = sqFileSize(file);
15731573
}
15741574
if (!(failed())) {
1575-
popthenPush(2, positive64BitIntegerFor(size));
1575+
methodReturnValue(positive64BitIntegerFor(size));
15761576
}
15771577
return 0;
15781578
}
@@ -1628,7 +1628,7 @@ primitiveFileStdioHandles(void)
16281628
# endif /* SPURVM */
16291629
# endif /* COGMTVM */
16301630
result = popRemappableOop();
1631-
popthenPush(1, result);
1631+
methodReturnValue(result);
16321632
return 0;
16331633
}
16341634

@@ -1736,7 +1736,7 @@ primitiveFileWrite(void)
17361736
: (byteSizeOf(array)) / slotSize);
17371737
bytesWritten = sqFileWriteFromAt(file, count * elementSize, ((char *) (firstIndexableField(array))), (startIndex - 1) * elementSize);
17381738
if (!(failed())) {
1739-
popthenPush(5, integerObjectOf(bytesWritten / elementSize));
1739+
methodReturnValue(integerObjectOf(bytesWritten / elementSize));
17401740
}
17411741
return 0;
17421742
}
@@ -1756,8 +1756,7 @@ primitiveHasFileAccess(void)
17561756
else {
17571757
hasAccess = 1;
17581758
}
1759-
pop(1);
1760-
pushBool(hasAccess);
1759+
methodReturnBool(hasAccess);
17611760
return 0;
17621761
}
17631762

@@ -1804,6 +1803,9 @@ setInterpreter(struct VirtualMachine*anInterpreter)
18041803
isIntegerObject = interpreterProxy->isIntegerObject;
18051804
isWords = interpreterProxy->isWords;
18061805
isWordsOrBytes = interpreterProxy->isWordsOrBytes;
1806+
methodReturnBool = interpreterProxy->methodReturnBool;
1807+
methodReturnInteger = interpreterProxy->methodReturnInteger;
1808+
methodReturnValue = interpreterProxy->methodReturnValue;
18071809
nilObject = interpreterProxy->nilObject;
18081810
pop = interpreterProxy->pop;
18091811
popthenPush = interpreterProxy->popthenPush;
@@ -1816,8 +1818,6 @@ setInterpreter(struct VirtualMachine*anInterpreter)
18161818
primitiveFail = interpreterProxy->primitiveFail;
18171819
primitiveFailFor = interpreterProxy->primitiveFailFor;
18181820
primitiveFailureCode = interpreterProxy->primitiveFailureCode;
1819-
pushBool = interpreterProxy->pushBool;
1820-
pushInteger = interpreterProxy->pushInteger;
18211821
pushRemappableOop = interpreterProxy->pushRemappableOop;
18221822
slotSizeOf = interpreterProxy->slotSizeOf;
18231823
stSizeOf = interpreterProxy->stSizeOf;

0 commit comments

Comments
 (0)