Skip to content

Commit a118d61

Browse files
committed
CogVM source as per VMMaker.oscog-eem.3699
Rename processHasOSErr to the more useful processOSErrInstVarOffset. Cogit: Have the pre-compilation scan also collect all bytes, not just for extensions, allowing the introduction of needsFrameIfReadMediated: for long inst var push bytecodes. Hence at least Context>>#isClosureContext is now compiled frameless. As part of the above refactor loadBytesAndGetDescriptor into loadBytesAndGetDescriptor: aPC, and inline loadSubsequentBytesForDescriptor:at: into it. Also be explicit about the return types of the various needsFrameXXX: methods.
1 parent f8b2ba3 commit a118d61

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1590
-1379
lines changed

platforms/Cross/vm/sqVirtualMachine.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ struct VirtualMachine* sqGetInterpreterProxy(void)
379379
VM->isWordsOrShorts = isWordsOrShorts;
380380
VM->bytesPerElement = bytesPerElement;
381381
VM->fileTimesInUTC = fileTimesInUTC;
382-
VM->processHasOSErr = processHasOSErr;
382+
VM->processOSErrInstVarOffset = processOSErrInstVarOffset;
383383
#endif
384384
return VM;
385385
}

platforms/Cross/vm/sqVirtualMachine.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ typedef struct VirtualMachine {
380380
sqInt (*isWordsOrShorts)(sqInt oop); /* for SoundPlugin et al */
381381
sqInt (*bytesPerElement)(sqInt oop); /* for SocketPugin et al */
382382
sqInt (*fileTimesInUTC)(void); /* for FilePlugin et al */
383-
sqInt (*processHasOSErr)(void); /* for ThreadedFFIPlugin/SqueakFFIPrims */
383+
sqInt (*processOSErrInstVarOffset)(void); /* for ThreadedFFIPlugin/SqueakFFIPrims */
384384
#endif
385385
} VirtualMachine;
386386

@@ -607,7 +607,7 @@ sqInt identityHashOf(sqInt);
607607
sqInt isWordsOrShorts(sqInt);
608608
sqInt bytesPerElement(sqInt);
609609
sqInt fileTimesInUTC(void);
610-
sqInt processHasOSErr(void);
610+
sqInt processOSErrInstVarOffset(void);
611611
sqInt primitiveFailForwithSecondary(sqInt reasonCode,sqLong extraErrorCode);
612612
#endif
613613

src/plugins/B2DPlugin/B2DPlugin.c

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* Automatically generated by
2-
VMPluginCodeGenerator VMMaker.oscog-eem.3675 uuid: 4b2d2b05-7985-4fbc-9eb5-ebbc0f408b65
3-
(* Compiler-eem.523)
2+
VMPluginCodeGenerator VMMaker.oscog-eem.3699 uuid: 2952dbcc-35c1-4c63-8bf1-bfac32f0e33d
3+
(Compiler-eem.526)
44
from
5-
BalloonEnginePlugin VMMaker.oscog-eem.3675 uuid: 4b2d2b05-7985-4fbc-9eb5-ebbc0f408b65
5+
BalloonEnginePlugin VMMaker.oscog-eem.3699 uuid: 2952dbcc-35c1-4c63-8bf1-bfac32f0e33d
66
*/
7-
static char __buildInfo[] = "BalloonEnginePlugin VMMaker.oscog-eem.3675 uuid: 4b2d2b05-7985-4fbc-9eb5-ebbc0f408b65 " __DATE__ ;
7+
static char __buildInfo[] = "BalloonEnginePlugin VMMaker.oscog-eem.3699 uuid: 2952dbcc-35c1-4c63-8bf1-bfac32f0e33d " __DATE__ ;
88

99

1010
#include "config.h"
@@ -534,7 +534,7 @@ extern
534534
#endif
535535
struct VirtualMachine* interpreterProxy;
536536
static void * loadBBFn;
537-
static const char *moduleName = "B2DPlugin VMMaker.oscog-eem.3675 " INT_EXT;
537+
static const char *moduleName = "B2DPlugin VMMaker.oscog-eem.3699 " INT_EXT;
538538
static int* objBuffer;
539539
static sqInt objUsed;
540540
static unsigned int* spanBuffer;
@@ -1412,10 +1412,10 @@ fillBitmapSpanAAfromtoat(sqInt bmFill, sqInt leftX, sqInt rightX, sqInt yValue)
14121412
int dtX;
14131413
sqInt fillValue;
14141414
sqInt firstPixel;
1415-
sqInt firstPixelSqInt;
1415+
unsigned int firstPixel1;
14161416
usqInt g;
14171417
sqInt idx;
1418-
sqInt lastPixel;
1418+
unsigned int lastPixel;
14191419
sqInt newDelta;
14201420
sqInt newDeltaSqInt;
14211421
usqInt r;
@@ -1442,12 +1442,12 @@ fillBitmapSpanAAfromtoat(sqInt bmFill, sqInt leftX, sqInt rightX, sqInt yValue)
14421442
aaLevel = workBuffer[GWAALevel];
14431443

14441444
/* begin aaFirstPixelFrom:to: */
1445-
firstPixelSqInt = ((leftX + (workBuffer[GWAALevel])) - 1) & ((unsigned int)~((workBuffer[GWAALevel]) - 1));
1446-
if (firstPixelSqInt > rightX) {
1445+
firstPixel1 = ((leftX + (workBuffer[GWAALevel])) - 1) & ((unsigned int)~((workBuffer[GWAALevel]) - 1));
1446+
if (firstPixel1 > rightX) {
14471447
firstPixel = rightX;
14481448
}
14491449
else {
1450-
firstPixel = firstPixelSqInt;
1450+
firstPixel = firstPixel1;
14511451
}
14521452
lastPixel = (rightX - 1) & ((unsigned int)~((workBuffer[GWAALevel]) - 1));
14531453
baseShift = workBuffer[GWAAShift];
@@ -2020,22 +2020,22 @@ fillColorSpanAAx0x1(sqInt pixelValue32, sqInt leftX, sqInt rightX)
20202020
int baseShift;
20212021
unsigned int colorMask;
20222022
sqInt firstPixel;
2023-
sqInt firstPixelSqInt;
2023+
unsigned int firstPixel1;
20242024
sqInt idx;
2025-
sqInt lastPixel;
2025+
unsigned int lastPixel;
20262026
sqInt pv32;
20272027
sqInt x;
20282028

20292029

20302030
/* Not now -- maybe later */
20312031
/* Compute the pixel boundaries. */
20322032
/* begin aaFirstPixelFrom:to: */
2033-
firstPixelSqInt = ((leftX + (workBuffer[GWAALevel])) - 1) & ((unsigned int)~((workBuffer[GWAALevel]) - 1));
2034-
if (firstPixelSqInt > rightX) {
2033+
firstPixel1 = ((leftX + (workBuffer[GWAALevel])) - 1) & ((unsigned int)~((workBuffer[GWAALevel]) - 1));
2034+
if (firstPixel1 > rightX) {
20352035
firstPixel = rightX;
20362036
}
20372037
else {
2038-
firstPixel = firstPixelSqInt;
2038+
firstPixel = firstPixel1;
20392039
}
20402040
lastPixel = (rightX - 1) & ((unsigned int)~((workBuffer[GWAALevel]) - 1));
20412041
aaLevel = workBuffer[GWAALevel];
@@ -2088,9 +2088,9 @@ fillLinearGradientAArampdsdsXfromto(sqInt fill, int *ramp, sqInt deltaS, sqInt d
20882088
int colorShift;
20892089
sqInt ds;
20902090
sqInt firstPixel;
2091-
sqInt firstPixelSqInt;
2091+
unsigned int firstPixel1;
20922092
sqInt idx;
2093-
sqInt lastPixel;
2093+
unsigned int lastPixel;
20942094
sqInt rampIndex;
20952095
int rampSize;
20962096
sqInt rampValue;
@@ -2104,12 +2104,12 @@ fillLinearGradientAArampdsdsXfromto(sqInt fill, int *ramp, sqInt deltaS, sqInt d
21042104
rampIndex = ds / 0x10000;
21052105

21062106
/* begin aaFirstPixelFrom:to: */
2107-
firstPixelSqInt = ((leftX + (workBuffer[GWAALevel])) - 1) & ((unsigned int)~((workBuffer[GWAALevel]) - 1));
2108-
if (firstPixelSqInt > rightX) {
2107+
firstPixel1 = ((leftX + (workBuffer[GWAALevel])) - 1) & ((unsigned int)~((workBuffer[GWAALevel]) - 1));
2108+
if (firstPixel1 > rightX) {
21092109
firstPixel = rightX;
21102110
}
21112111
else {
2112-
firstPixel = firstPixelSqInt;
2112+
firstPixel = firstPixel1;
21132113
}
21142114
lastPixel = (rightX - 1) & ((unsigned int)~((workBuffer[GWAALevel]) - 1));
21152115

@@ -2302,9 +2302,9 @@ fillRadialDecreasingAArampdeltaSTdsXdtXfromto(sqInt fill, int *ramp, int *deltaS
23022302
int ds;
23032303
int dt;
23042304
sqInt firstPixel;
2305-
sqInt firstPixelSqInt;
2305+
unsigned int firstPixel1;
23062306
sqInt index;
2307-
sqInt lastPixel;
2307+
unsigned int lastPixel;
23082308
sqInt length2;
23092309
sqInt nextLength;
23102310
sqInt rampIndex;
@@ -2325,12 +2325,12 @@ fillRadialDecreasingAArampdeltaSTdsXdtXfromto(sqInt fill, int *ramp, int *deltaS
23252325
}
23262326

23272327
/* begin aaFirstPixelFrom:to: */
2328-
firstPixelSqInt = ((leftX + (workBuffer[GWAALevel])) - 1) & ((unsigned int)~((workBuffer[GWAALevel]) - 1));
2329-
if (firstPixelSqInt > x1) {
2328+
firstPixel1 = ((leftX + (workBuffer[GWAALevel])) - 1) & ((unsigned int)~((workBuffer[GWAALevel]) - 1));
2329+
if (firstPixel1 > x1) {
23302330
firstPixel = x1;
23312331
}
23322332
else {
2333-
firstPixel = firstPixelSqInt;
2333+
firstPixel = firstPixel1;
23342334
}
23352335
lastPixel = (x1 - 1) & ((unsigned int)~((workBuffer[GWAALevel]) - 1));
23362336

@@ -2629,10 +2629,10 @@ fillRadialIncreasingAArampdeltaSTdsXdtXfromto(sqInt fill, int *ramp, int *deltaS
26292629
int ds;
26302630
int dt;
26312631
sqInt firstPixel;
2632-
sqInt firstPixelSqInt;
2632+
unsigned int firstPixel1;
26332633
sqInt index;
26342634
sqInt lastLength;
2635-
sqInt lastPixel;
2635+
unsigned int lastPixel;
26362636
int length2;
26372637
sqInt nextLength;
26382638
sqInt rampIndex;
@@ -2654,12 +2654,12 @@ fillRadialIncreasingAArampdeltaSTdsXdtXfromto(sqInt fill, int *ramp, int *deltaS
26542654
x = leftX;
26552655

26562656
/* begin aaFirstPixelFrom:to: */
2657-
firstPixelSqInt = ((leftX + (workBuffer[GWAALevel])) - 1) & ((unsigned int)~((workBuffer[GWAALevel]) - 1));
2658-
if (firstPixelSqInt > rightX) {
2657+
firstPixel1 = ((leftX + (workBuffer[GWAALevel])) - 1) & ((unsigned int)~((workBuffer[GWAALevel]) - 1));
2658+
if (firstPixel1 > rightX) {
26592659
firstPixel = rightX;
26602660
}
26612661
else {
2662-
firstPixel = firstPixelSqInt;
2662+
firstPixel = firstPixel1;
26632663
}
26642664
lastPixel = (rightX - 1) & ((unsigned int)~((workBuffer[GWAALevel]) - 1));
26652665

src/plugins/BitBltPlugin/BitBltPlugin.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* Automatically generated by
2-
SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.3675 uuid: 4b2d2b05-7985-4fbc-9eb5-ebbc0f408b65
3-
(* Compiler-eem.523)
2+
SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.3699 uuid: 2952dbcc-35c1-4c63-8bf1-bfac32f0e33d
3+
(Compiler-eem.526)
44
from
5-
BitBltSimulation VMMaker.oscog-eem.3675 uuid: 4b2d2b05-7985-4fbc-9eb5-ebbc0f408b65
5+
BitBltSimulation VMMaker.oscog-eem.3699 uuid: 2952dbcc-35c1-4c63-8bf1-bfac32f0e33d
66
*/
7-
static char __buildInfo[] = "BitBltSimulation VMMaker.oscog-eem.3675 uuid: 4b2d2b05-7985-4fbc-9eb5-ebbc0f408b65 " __DATE__ ;
7+
static char __buildInfo[] = "BitBltSimulation VMMaker.oscog-eem.3699 uuid: 2952dbcc-35c1-4c63-8bf1-bfac32f0e33d " __DATE__ ;
88

99

1010
#include "config.h"
@@ -346,7 +346,7 @@ static int maskTable[33] = {
346346
0, 1, 3, 0, 15, 31, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 65535,
347347
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1
348348
};
349-
static const char *moduleName = "BitBltPlugin VMMaker.oscog-eem.3675 " INT_EXT;
349+
static const char *moduleName = "BitBltPlugin VMMaker.oscog-eem.3699 " INT_EXT;
350350
static sqInt noHalftone;
351351
static sqInt noSource;
352352
static sqInt numGCsOnInvocation;
@@ -966,7 +966,7 @@ alphaSourceBlendBits8(void)
966966
unsigned int dstMask;
967967
sqInt dstValue;
968968
sqInt dstY;
969-
sqInt mapperFlags;
969+
unsigned int mapperFlags;
970970
unsigned int *mappingTable;
971971
sqInt pv;
972972
unsigned int sourceWord;
@@ -2472,15 +2472,15 @@ copyLoopPixMap(void)
24722472
sqInt endBits;
24732473
unsigned int halftoneWord;
24742474
sqInt i;
2475-
sqInt mapperFlags;
2475+
unsigned int mapperFlags;
24762476
unsigned int (*mergeFnwith)(unsigned int, unsigned int);
24772477
unsigned int mergeWord;
24782478
sqInt nPix;
24792479
sqInt nPixSqInt;
24802480
sqInt nSourceIncs;
24812481
sqInt scrStartBits;
24822482
unsigned int skewWord;
2483-
sqInt sourcePix;
2483+
unsigned int sourcePix;
24842484
unsigned int sourcePixMask;
24852485
unsigned int sourceWord;
24862486
sqInt srcShift;
@@ -2596,7 +2596,7 @@ copyLoopPixMap(void)
25962596
if (mapperFlags & ColorMapPresent) {
25972597
if (mapperFlags & ColorMapFixedPart) {
25982598
/* begin rgbMapPixel:flags: */
2599-
val = (((((int) (cmShiftTable[0]))) < 0) ? (((usqInt)((sourcePix & (cmMaskTable[0])))) >> (-(((int) (cmShiftTable[0]))))) : (((sqInt)((usqInt)((sourcePix & (cmMaskTable[0]))) << (((int) (cmShiftTable[0])))))));
2599+
val = (((((int) (cmShiftTable[0]))) < 0) ? (((usqInt)((sourcePix & (cmMaskTable[0])))) >> (-(((int) (cmShiftTable[0]))))) : ((((usqInt)((sourcePix & (cmMaskTable[0]))) << (((int) (cmShiftTable[0])))))));
26002600
val = val | ((((((int) (cmShiftTable[1]))) < 0) ? (((usqInt)((sourcePix & (cmMaskTable[1])))) >> (-(((int) (cmShiftTable[1]))))) : ((((usqInt)((sourcePix & (cmMaskTable[1]))) << (((int) (cmShiftTable[1]))))))));
26012601
val = val | ((((((int) (cmShiftTable[2]))) < 0) ? (((usqInt)((sourcePix & (cmMaskTable[2])))) >> (-(((int) (cmShiftTable[2]))))) : ((((usqInt)((sourcePix & (cmMaskTable[2]))) << (((int) (cmShiftTable[2]))))))));
26022602
destPix = val | ((((((int) (cmShiftTable[3]))) < 0) ? (((usqInt)((sourcePix & (cmMaskTable[3])))) >> (-(((int) (cmShiftTable[3]))))) : ((((usqInt)((sourcePix & (cmMaskTable[3]))) << (((int) (cmShiftTable[3]))))))));
@@ -3758,7 +3758,7 @@ OLDtallyIntoMapwith(sqInt sourceWord, sqInt destinationWord)
37583758
sqInt i;
37593759
sqInt mapIndex;
37603760
sqInt mask;
3761-
sqInt pixMask;
3761+
int pixMask;
37623762
sqInt shiftWord;
37633763
sqInt srcPix;
37643764

@@ -4129,7 +4129,7 @@ partitionedMulwithnBitswordBits(unsigned int word1, unsigned int word2, sqInt nB
41294129
doubleWordMul = 0;
41304130
for (i = 1; i <= (wordBits / nBits); i += 1) {
41314131
/* multiply each channel of the two operands */
4132-
doubleWordMul += ((((((doubleWord1) >> shift) & channelMask) * (((doubleWord2) >> shift) & channelMask)) + half) << shift);
4132+
doubleWordMul += (((usqInt)((((((doubleWord1) >> shift) & channelMask) * (((doubleWord2) >> shift) & channelMask)) + half)) << shift));
41334133
shift += n2;
41344134
}
41354135

@@ -5453,7 +5453,7 @@ rgbComponentAlpha8(void)
54535453
unsigned int dstMask;
54545454
sqInt dstValue;
54555455
sqInt dstY;
5456-
sqInt mapperFlags;
5456+
unsigned int mapperFlags;
54575457
unsigned int *mappingTable;
54585458
sqInt pv;
54595459
unsigned int sourceWord;
@@ -6328,7 +6328,7 @@ warpLoop(void)
63286328
unsigned int halftoneWord;
63296329
sqInt i;
63306330
sqInt iSqInt;
6331-
sqInt mapperFlags;
6331+
unsigned int mapperFlags;
63326332
unsigned int (*mergeFnwith)(unsigned int, unsigned int);
63336333
unsigned int mergeWord;
63346334
sqInt nPix;
@@ -6342,7 +6342,7 @@ warpLoop(void)
63426342
sqInt smoothingCount;
63436343
sqInt sourceMapOop;
63446344
unsigned int sourcePix;
6345-
sqInt sourcePixSqInt;
6345+
unsigned int sourcePix1;
63466346
unsigned int sourceWord;
63476347
sqInt srcIndex;
63486348
sqInt startBits;
@@ -6750,8 +6750,8 @@ warpLoop(void)
67506750

67516751
/* Extract pixel from word */
67526752
srcBitShift = warpBitShiftTable[x & warpAlignMask];
6753-
sourcePixSqInt = (((usqInt)(sourceWord)) >> srcBitShift) & warpSrcMask;
6754-
sourcePix = ((unsigned int) sourcePixSqInt);
6753+
sourcePix1 = (((usqInt)(sourceWord)) >> srcBitShift) & warpSrcMask;
6754+
sourcePix = sourcePix1;
67556755
/* end pickWarpPixelAtX:y: */
67566756
l7:
67576757
destPix = cmLookupTable[sourcePix & cmMask];
@@ -6780,8 +6780,8 @@ warpLoop(void)
67806780

67816781
/* Extract pixel from word */
67826782
srcBitShift = warpBitShiftTable[x & warpAlignMask];
6783-
sourcePixSqInt = (((usqInt)(sourceWord)) >> srcBitShift) & warpSrcMask;
6784-
sourcePix = ((unsigned int) sourcePixSqInt);
6783+
sourcePix1 = (((usqInt)(sourceWord)) >> srcBitShift) & warpSrcMask;
6784+
sourcePix = sourcePix1;
67856785
/* end pickWarpPixelAtX:y: */
67866786
l8:
67876787

@@ -6893,7 +6893,7 @@ warpPickSmoothPixelsxDeltahyDeltahxDeltavyDeltavsourceMapsmoothingdstShiftInc(sq
68936893
sqInt pv;
68946894
sqInt r;
68956895
unsigned int rgb;
6896-
sqInt sourcePix;
6896+
unsigned int sourcePix;
68976897
unsigned int sourceWord;
68986898
sqInt srcIndex;
68996899
sqInt val;
@@ -6961,7 +6961,7 @@ warpPickSmoothPixelsxDeltahyDeltahxDeltavyDeltavsourceMapsmoothingdstShiftInc(sq
69616961
/* Extract pixel from word */
69626962
srcBitShift = warpBitShiftTable[xSqInt & warpAlignMask];
69636963
sourcePix = (((usqInt)(sourceWord)) >> srcBitShift) & warpSrcMask;
6964-
rgb = ((unsigned int) sourcePix);
6964+
rgb = sourcePix;
69656965
/* end pickWarpPixelAtX:y: */
69666966
l1:
69676967
if (!((combinationRule == 25)

src/plugins/Squeak3D/Squeak3D.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* Automatically generated by
2-
VMPluginCodeGenerator VMMaker.oscog-eem.3675 uuid: 4b2d2b05-7985-4fbc-9eb5-ebbc0f408b65
3-
(* Compiler-eem.523)
2+
VMPluginCodeGenerator VMMaker.oscog-eem.3699 uuid: 2952dbcc-35c1-4c63-8bf1-bfac32f0e33d
3+
(Compiler-eem.526)
44
from
55
B3DEnginePlugin Balloon3D-Plugins-eem.24 uuid: 90e0bcc4-44f9-400e-afaa-09bf32ae0d67
66
*/
@@ -599,7 +599,7 @@ b3dDetermineClipFlags(void)
599599
{
600600
sqInt flags;
601601
sqInt i;
602-
int result;
602+
sqInt result;
603603
void *vtxArray;
604604
sqInt vtxCount;
605605
float *vtxPtr;

src/spur32.cog.lowcode/cogit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Automatically generated by
2-
CCodeGenerator VMMaker.oscog-eem.3697 uuid: 860ba564-bfe7-4177-b2b5-caec3e638883
2+
CCodeGenerator VMMaker.oscog-eem.3699 uuid: 2952dbcc-35c1-4c63-8bf1-bfac32f0e33d
33
(Cog-eem.504, Compiler-eem.526)
44
*/
55

0 commit comments

Comments
 (0)