Skip to content

Commit

Permalink
Use methodReturn***: instead of pop: + push***: in FilePlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentBlondeau committed May 12, 2018
1 parent 48101cd commit 82d6abc
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions src/plugins/FilePlugin/FilePlugin.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Automatically generated by
VMPluginCodeGenerator VMMaker.oscog-VB.2382 uuid: da8a5d36-0cd4-b641-865f-a139b3914245
VMPluginCodeGenerator VMMaker.oscog-VB.2383 uuid: a0681b83-7110-3d47-9214-f4bcf9d4982a
from
FilePlugin VMMaker.oscog-VB.2382 uuid: da8a5d36-0cd4-b641-865f-a139b3914245
FilePlugin VMMaker.oscog-VB.2383 uuid: a0681b83-7110-3d47-9214-f4bcf9d4982a
*/
static char __buildInfo[] = "FilePlugin VMMaker.oscog-VB.2382 uuid: da8a5d36-0cd4-b641-865f-a139b3914245 " __DATE__ ;
static char __buildInfo[] = "FilePlugin VMMaker.oscog-VB.2383 uuid: a0681b83-7110-3d47-9214-f4bcf9d4982a " __DATE__ ;



Expand Down Expand Up @@ -131,6 +131,9 @@ static sqInt (*isBytes)(sqInt oop);
static sqInt (*isIntegerObject)(sqInt objectPointer);
static sqInt (*isWords)(sqInt oop);
static sqInt (*isWordsOrBytes)(sqInt oop);
static sqInt (*methodReturnBool)(sqInt boolean);
static sqInt (*methodReturnInteger)(sqInt integer);
static sqInt (*methodReturnValue)(sqInt oop);
static sqInt (*nilObject)(void);
static sqInt (*pop)(sqInt nItems);
static sqInt (*popthenPush)(sqInt nItems, sqInt oop);
Expand All @@ -143,8 +146,6 @@ static usqIntptr_t (*positiveMachineIntegerValueOf)(sqInt oop);
static sqInt (*primitiveFail)(void);
static sqInt (*primitiveFailFor)(sqInt reasonCode);
static sqInt (*primitiveFailureCode)(void);
static sqInt (*pushBool)(sqInt trueOrFalse);
static sqInt (*pushInteger)(sqInt integerValue);
static sqInt (*pushRemappableOop)(sqInt oop);
static sqInt (*slotSizeOf)(sqInt oop);
static sqInt (*stSizeOf)(sqInt oop);
Expand Down Expand Up @@ -183,6 +184,9 @@ extern sqInt isIntegerObject(sqInt objectPointer);
#endif
extern sqInt isWords(sqInt oop);
extern sqInt isWordsOrBytes(sqInt oop);
extern sqInt methodReturnBool(sqInt boolean);
extern sqInt methodReturnInteger(sqInt integer);
extern sqInt methodReturnValue(sqInt oop);
extern sqInt nilObject(void);
extern sqInt pop(sqInt nItems);
extern sqInt popthenPush(sqInt nItems, sqInt oop);
Expand All @@ -195,8 +199,6 @@ extern usqIntptr_t positiveMachineIntegerValueOf(sqInt oop);
extern sqInt primitiveFail(void);
extern sqInt primitiveFailFor(sqInt reasonCode);
extern sqInt primitiveFailureCode(void);
extern sqInt pushBool(sqInt trueOrFalse);
extern sqInt pushInteger(sqInt integerValue);
extern sqInt pushRemappableOop(sqInt oop);
extern sqInt slotSizeOf(sqInt oop);
extern sqInt stSizeOf(sqInt oop);
Expand All @@ -211,9 +213,9 @@ extern
struct VirtualMachine* interpreterProxy;
static const char *moduleName =
#ifdef SQUEAK_BUILTIN_PLUGIN
"FilePlugin VMMaker.oscog-VB.2382 (i)"
"FilePlugin VMMaker.oscog-VB.2383 (i)"
#else
"FilePlugin VMMaker.oscog-VB.2382 (e)"
"FilePlugin VMMaker.oscog-VB.2383 (e)"
#endif
;
static void * sCCPfn;
Expand Down Expand Up @@ -646,7 +648,7 @@ primitiveConnectToFile(void)
}
filePointer = fileOop;
if (!(failed())) {
popthenPush(3, filePointer);
methodReturnValue(filePointer);
}
return 0;
}
Expand Down Expand Up @@ -696,7 +698,7 @@ primitiveConnectToFileDescriptor(void)
}
filePointer = fileOop;
if (!(failed())) {
popthenPush(3, filePointer);
methodReturnValue(filePointer);
}
return 0;
}
Expand Down Expand Up @@ -1079,8 +1081,7 @@ primitiveFileAtEnd(void)
atEnd = sqFileAtEnd(file);
}
if (!(failed())) {
pop(2);
pushBool(atEnd);
methodReturnBool(atEnd);
}
return 0;
}
Expand Down Expand Up @@ -1171,8 +1172,7 @@ primitiveFileDescriptorType(void)
return primitiveFailFor(PrimErrBadArgument);
}
fileType = sqFileDescriptorType(fd);
pop(2);
pushInteger(fileType);
methodReturnInteger(fileType);
return 0;
}

Expand Down Expand Up @@ -1224,7 +1224,7 @@ primitiveFileGetPosition(void)
position = sqFileGetPosition(file);
}
if (!(failed())) {
popthenPush(2, positive64BitIntegerFor(position));
methodReturnValue(positive64BitIntegerFor(position));
}
return 0;
}
Expand All @@ -1248,7 +1248,7 @@ primitiveFileOpen(void)
nameSize = byteSizeOf(namePointer);
filePointer = fileOpenNamesizewritesecure(nameIndex, nameSize, writeFlag, 1);
if (!(failed())) {
popthenPush(3, filePointer);
methodReturnValue(filePointer);
}
return 0;
}
Expand All @@ -1270,7 +1270,7 @@ primitiveFileOpenNew(void)
nameSize = byteSizeOf(namePointer);
filePointer = fileOpenNewNamesizesecure(nameIndex, nameSize, 1);
if (!(failed())) {
popthenPush(2, filePointer);
methodReturnValue(filePointer);
}
return 0;
}
Expand Down Expand Up @@ -1328,7 +1328,7 @@ primitiveFileRead(void)
: (byteSizeOf(array)) / slotSize);
bytesRead = sqFileReadIntoAt(file, count * elementSize, ((char *) (firstIndexableField(array))), (startIndex - 1) * elementSize);
if (!(failed())) {
popthenPush(5, integerObjectOf(bytesRead / elementSize));
methodReturnValue(integerObjectOf(bytesRead / elementSize));
}
l2: /* end primitiveFileReadWithPinning */;
# else /* SPURVM */
Expand Down Expand Up @@ -1368,7 +1368,7 @@ primitiveFileRead(void)
primitiveFailFor(PrimNoErr);
}
if (!(failed())) {
popthenPush(5, integerObjectOf(bytesRead1 / elementSize1));
methodReturnValue(integerObjectOf(bytesRead1 / elementSize1));
}
l4: /* end primitiveFileReadWithoutPinning */;
# endif /* SPURVM */
Expand Down Expand Up @@ -1426,7 +1426,7 @@ primitiveFileReadWithoutPinning(void)
primitiveFailFor(PrimNoErr);
}
if (!(failed())) {
popthenPush(5, integerObjectOf(bytesRead / elementSize));
methodReturnValue(integerObjectOf(bytesRead / elementSize));
}
return 0;
}
Expand Down Expand Up @@ -1476,7 +1476,7 @@ primitiveFileReadWithPinning(void)
: (byteSizeOf(array)) / slotSize);
bytesRead = sqFileReadIntoAt(file, count * elementSize, ((char *) (firstIndexableField(array))), (startIndex - 1) * elementSize);
if (!(failed())) {
popthenPush(5, integerObjectOf(bytesRead / elementSize));
methodReturnValue(integerObjectOf(bytesRead / elementSize));
}
return 0;
}
Expand Down Expand Up @@ -1572,7 +1572,7 @@ primitiveFileSize(void)
size = sqFileSize(file);
}
if (!(failed())) {
popthenPush(2, positive64BitIntegerFor(size));
methodReturnValue(positive64BitIntegerFor(size));
}
return 0;
}
Expand Down Expand Up @@ -1628,7 +1628,7 @@ primitiveFileStdioHandles(void)
# endif /* SPURVM */
# endif /* COGMTVM */
result = popRemappableOop();
popthenPush(1, result);
methodReturnValue(result);
return 0;
}

Expand Down Expand Up @@ -1736,7 +1736,7 @@ primitiveFileWrite(void)
: (byteSizeOf(array)) / slotSize);
bytesWritten = sqFileWriteFromAt(file, count * elementSize, ((char *) (firstIndexableField(array))), (startIndex - 1) * elementSize);
if (!(failed())) {
popthenPush(5, integerObjectOf(bytesWritten / elementSize));
methodReturnValue(integerObjectOf(bytesWritten / elementSize));
}
return 0;
}
Expand All @@ -1756,8 +1756,7 @@ primitiveHasFileAccess(void)
else {
hasAccess = 1;
}
pop(1);
pushBool(hasAccess);
methodReturnBool(hasAccess);
return 0;
}

Expand Down Expand Up @@ -1804,6 +1803,9 @@ setInterpreter(struct VirtualMachine*anInterpreter)
isIntegerObject = interpreterProxy->isIntegerObject;
isWords = interpreterProxy->isWords;
isWordsOrBytes = interpreterProxy->isWordsOrBytes;
methodReturnBool = interpreterProxy->methodReturnBool;
methodReturnInteger = interpreterProxy->methodReturnInteger;
methodReturnValue = interpreterProxy->methodReturnValue;
nilObject = interpreterProxy->nilObject;
pop = interpreterProxy->pop;
popthenPush = interpreterProxy->popthenPush;
Expand All @@ -1816,8 +1818,6 @@ setInterpreter(struct VirtualMachine*anInterpreter)
primitiveFail = interpreterProxy->primitiveFail;
primitiveFailFor = interpreterProxy->primitiveFailFor;
primitiveFailureCode = interpreterProxy->primitiveFailureCode;
pushBool = interpreterProxy->pushBool;
pushInteger = interpreterProxy->pushInteger;
pushRemappableOop = interpreterProxy->pushRemappableOop;
slotSizeOf = interpreterProxy->slotSizeOf;
stSizeOf = interpreterProxy->stSizeOf;
Expand Down

0 comments on commit 82d6abc

Please sign in to comment.