Skip to content

Commit d0e7e46

Browse files
committed
CogVM source as per VMMaker.oscog-eem.3692/VectorEnginePlugin-jmv.26
Add VMMaker.oscog-jmv.3691 to ancestry. Add upscaleDisplayOnHighDPI() to sq.h alongside sendWheelEvents() Make vmEndianness answer a boolean, and get the sense of imageFloatsBigEndian, numericPrimsMixArithmetic, and numericPrimsMixComparison right (they should use noMask:). VectorEnginePlugin: Correct type (float) in contour initialization & use a large float constant for unknown left bound. [Check in broken versions of plugins that use sizeOfSTArrayFromCPrimitive; this will be fixed pronto]
1 parent a51d41c commit d0e7e46

File tree

43 files changed

+706
-712
lines changed

Some content is hidden

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

43 files changed

+706
-712
lines changed

platforms/Cross/vm/sq.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ sqInt sqGetFilenameFromString(char *aCharBuffer, char *aFilenameString, sqInt fi
191191

192192
/* VM_TICKER enables facilities providing periodic invocation of functions
193193
* on a high-priority thread in the VM, preempting Smalltalk execution.
194+
* This is used by Qwaq/Teleplace/Virtend VMs to do sound processing "in the background".
194195
*/
195196
#if VM_TICKER
196197
extern usqInt ioVMTickerCount(void);
@@ -220,7 +221,8 @@ extern VM_EXPORT void *displayBits;
220221
extern VM_EXPORT int displayWidth, displayHeight, displayDepth;
221222
#if !defined(SQ_USE_GLOBAL_STRUCT) // In the interpreter this is not const
222223
extern VM_EXPORT const sqInt imageHeaderFlags;
223-
#define sendWheelEvents() (imageHeaderFlags & 0x80)
224+
# define sendWheelEvents() (imageHeaderFlags & 0x80)
225+
# define upscaleDisplayOnHighDPI() (!(imageHeaderFlags & 0x400))
224226
#endif
225227

226228
sqInt ioBeep(void);

src/plugins/MiscPrimitivePlugin/MiscPrimitivePlugin.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* Automatically generated by
2-
VMPluginCodeGenerator VMMaker.oscog-eem.3475 uuid: d9ef6856-42d8-4074-bde7-82f1e1d41282
3-
(Compiler-eem.512)
2+
VMPluginCodeGenerator VMMaker.oscog-eem.3692 uuid: dfc1faff-a80e-4cb8-aef8-830c0c0d50e5
3+
(Compiler-eem.526)
44
from
5-
MiscPrimitivePlugin VMMaker.oscog-eem.3475 uuid: d9ef6856-42d8-4074-bde7-82f1e1d41282
5+
MiscPrimitivePlugin VMMaker.oscog-eem.3692 uuid: dfc1faff-a80e-4cb8-aef8-830c0c0d50e5
66
*/
7-
static char __buildInfo[] = "MiscPrimitivePlugin VMMaker.oscog-eem.3475 uuid: d9ef6856-42d8-4074-bde7-82f1e1d41282 " __DATE__ ;
7+
static char __buildInfo[] = "MiscPrimitivePlugin VMMaker.oscog-eem.3692 uuid: dfc1faff-a80e-4cb8-aef8-830c0c0d50e5 " __DATE__ ;
88

99

1010
#include "config.h"
@@ -69,7 +69,7 @@ static sqInt (*isWordsOrBytes)(sqInt oop);
6969
static sqInt (*methodReturnInteger)(sqInt integer);
7070
static sqInt (*methodReturnReceiver)(void);
7171
static sqInt (*primitiveFailFor)(sqInt reasonCode);
72-
static sqInt (*sizeOfSTArrayFromCPrimitive)(void *cPtr);
72+
static void (*sizeOfSTArrayFromCPrimitive)(void *cPtr);
7373
static sqInt (*stackIntegerValue)(sqInt offset);
7474
static sqInt (*stackValue)(sqInt offset);
7575
#else /* !defined(SQUEAK_BUILTIN_PLUGIN) */
@@ -95,13 +95,13 @@ extern sqInt isWordsOrBytes(sqInt oop);
9595
extern sqInt methodReturnInteger(sqInt integer);
9696
extern sqInt methodReturnReceiver(void);
9797
extern sqInt primitiveFailFor(sqInt reasonCode);
98-
extern sqInt sizeOfSTArrayFromCPrimitive(void *cPtr);
98+
extern void sizeOfSTArrayFromCPrimitive(void *cPtr);
9999
extern sqInt stackIntegerValue(sqInt offset);
100100
extern sqInt stackValue(sqInt offset);
101101
extern
102102
#endif
103103
struct VirtualMachine* interpreterProxy;
104-
static const char *moduleName = "MiscPrimitivePlugin VMMaker.oscog-eem.3475 " INT_EXT;
104+
static const char *moduleName = "MiscPrimitivePlugin VMMaker.oscog-eem.3692 " INT_EXT;
105105

106106

107107
/*** Methods ***/

src/plugins/UnixOSProcessPlugin/UnixOSProcessPlugin.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* Automatically generated by
2-
VMPluginCodeGenerator VMMaker.oscog-eem.3668 uuid: d0a2c840-707b-457e-9ff3-c455828ac41c
3-
(Compiler-eem.523)
2+
VMPluginCodeGenerator VMMaker.oscog-eem.3692 uuid: dfc1faff-a80e-4cb8-aef8-830c0c0d50e5
3+
(Compiler-eem.526)
44
from
55
UnixOSProcessPlugin VMConstruction-Plugins-OSProcessPlugin.oscog-eem.82 uuid: 1510486b-819a-4643-921a-1e39553cc4a8
66
*/
@@ -243,7 +243,7 @@ static sqInt (*pushInteger)(sqInt integerValue);
243243
static sqInt (*pushRemappableOop)(sqInt oop);
244244
static sqInt (*signalSemaphoreWithIndex)(sqInt semaIndex);
245245
static sqInt (*signed32BitIntegerFor)(sqInt integerValue);
246-
static sqInt (*sizeOfSTArrayFromCPrimitive)(void *cPtr);
246+
static void (*sizeOfSTArrayFromCPrimitive)(void *cPtr);
247247
static sqInt (*stObjectatput)(sqInt array, sqInt index, sqInt value);
248248
static sqInt (*stSizeOf)(sqInt oop);
249249
static sqInt (*stackIntegerValue)(sqInt offset);
@@ -288,7 +288,7 @@ extern sqInt pushInteger(sqInt integerValue);
288288
extern sqInt pushRemappableOop(sqInt oop);
289289
extern sqInt signalSemaphoreWithIndex(sqInt semaIndex);
290290
extern sqInt signed32BitIntegerFor(sqInt integerValue);
291-
extern sqInt sizeOfSTArrayFromCPrimitive(void *cPtr);
291+
extern void sizeOfSTArrayFromCPrimitive(void *cPtr);
292292
extern sqInt stObjectatput(sqInt array, sqInt index, sqInt value);
293293
extern sqInt stSizeOf(sqInt oop);
294294
extern sqInt stackIntegerValue(sqInt offset);

src/plugins/VectorEnginePlugin/VectorEnginePlugin.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* Automatically generated by
2-
SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.3690 uuid: b8fa6d9a-c8b4-4de4-9ecb-3bbc0d42fc4c
2+
SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.3692 uuid: dfc1faff-a80e-4cb8-aef8-830c0c0d50e5
33
(Compiler-eem.526)
44
from
5-
VectorEnginePlugin VectorEnginePlugin-jmv.23 uuid: 616c8d53-d834-4d11-a3b1-84e977cae8ca
5+
VectorEnginePlugin VectorEnginePlugin-jmv.26 uuid: 4a7f4646-3609-4ce7-8e92-81a5f13c8ce5
66
*/
7-
static char __buildInfo[] = "VectorEnginePlugin VectorEnginePlugin-jmv.23 uuid: 616c8d53-d834-4d11-a3b1-84e977cae8ca " __DATE__ ;
7+
static char __buildInfo[] = "VectorEnginePlugin VectorEnginePlugin-jmv.26 uuid: 4a7f4646-3609-4ce7-8e92-81a5f13c8ce5 " __DATE__ ;
88

99

1010
#include "config.h"
@@ -171,7 +171,7 @@ extern sqInt stackValue(sqInt offset);
171171
extern
172172
#endif
173173
struct VirtualMachine* interpreterProxy;
174-
static const char *moduleName = "VectorEnginePlugin VectorEnginePlugin-jmv.23 " INT_EXT;
174+
static const char *moduleName = "VectorEnginePlugin VectorEnginePlugin-jmv.26 " INT_EXT;
175175
static uint32_t * morphIds;
176176
static sqInt needsFullAlphaCircle;
177177
static sqInt prevYRounded;
@@ -2021,7 +2021,7 @@ primBlendStrokeOnlyWP(void)
20212021
EXPORT(sqInt)
20222022
primClearClippingSpec(void)
20232023
{
2024-
clippingSpec = 0;
2024+
clippingSpec = null;
20252025
return null;
20262026
}
20272027

@@ -3958,11 +3958,11 @@ primResetContour(void)
39583958
}
39593959
t = integerValueOf(t);
39603960
b = integerValueOf(b);
3961-
leftAtThisY = targetWidth;
3962-
rightAtThisY = 0;
3961+
leftAtThisY = 1.0e6;
3962+
rightAtThisY = 0.0;
39633963
for (y = t; y <= b; y += 1) {
3964-
contour[y * 2] = targetWidth;
3965-
contour[(y * 2) + 1] = 0;
3964+
contour[y * 2] = 1.0e6;
3965+
contour[(y * 2) + 1] = 0.0;
39663966
}
39673967
if (!(failed())) {
39683968
pop(2);
@@ -4026,7 +4026,7 @@ primSetTarget(void)
40264026
contour = aFloat32Array;
40274027
targetWidth = aNumber;
40284028
targetHeight = otherNumber;
4029-
clippingSpec = 0;
4029+
clippingSpec = null;
40304030
if (!(failed())) {
40314031
pop(8);
40324032
}
@@ -4072,7 +4072,7 @@ primSetTargetWP(void)
40724072
contour = aFloat32Array;
40734073
targetWidth = aNumber;
40744074
targetHeight = otherNumber;
4075-
clippingSpec = 0;
4075+
clippingSpec = null;
40764076
if (!(failed())) {
40774077
pop(8);
40784078
}

src/plugins/Win32OSProcessPlugin/Win32OSProcessPlugin.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* Automatically generated by
2-
VMPluginCodeGenerator VMMaker.oscog-eem.3668 uuid: d0a2c840-707b-457e-9ff3-c455828ac41c
3-
(Compiler-eem.523)
2+
VMPluginCodeGenerator VMMaker.oscog-eem.3692 uuid: dfc1faff-a80e-4cb8-aef8-830c0c0d50e5
3+
(Compiler-eem.526)
44
from
55
Win32OSProcessPlugin VMConstruction-Plugins-OSProcessPlugin.oscog-eem.82 uuid: 1510486b-819a-4643-921a-1e39553cc4a8
66
*/
@@ -161,7 +161,7 @@ static sqInt (*push)(sqInt object);
161161
static sqInt (*pushInteger)(sqInt integerValue);
162162
static sqInt (*pushRemappableOop)(sqInt oop);
163163
static sqInt (*signalSemaphoreWithIndex)(sqInt semaIndex);
164-
static sqInt (*sizeOfSTArrayFromCPrimitive)(void *cPtr);
164+
static void (*sizeOfSTArrayFromCPrimitive)(void *cPtr);
165165
static sqInt (*stObjectatput)(sqInt array, sqInt index, sqInt value);
166166
static sqInt (*stSizeOf)(sqInt oop);
167167
static sqInt (*stackIntegerValue)(sqInt offset);
@@ -200,7 +200,7 @@ extern sqInt push(sqInt object);
200200
extern sqInt pushInteger(sqInt integerValue);
201201
extern sqInt pushRemappableOop(sqInt oop);
202202
extern sqInt signalSemaphoreWithIndex(sqInt semaIndex);
203-
extern sqInt sizeOfSTArrayFromCPrimitive(void *cPtr);
203+
extern void sizeOfSTArrayFromCPrimitive(void *cPtr);
204204
extern sqInt stObjectatput(sqInt array, sqInt index, sqInt value);
205205
extern sqInt stSizeOf(sqInt oop);
206206
extern sqInt stackIntegerValue(sqInt offset);

src/plugins/XDisplayControlPlugin/XDisplayControlPlugin.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* Automatically generated by
2-
VMPluginCodeGenerator VMMaker.oscog-eem.3668 uuid: d0a2c840-707b-457e-9ff3-c455828ac41c
3-
(Compiler-eem.523)
2+
VMPluginCodeGenerator VMMaker.oscog-eem.3692 uuid: dfc1faff-a80e-4cb8-aef8-830c0c0d50e5
3+
(Compiler-eem.526)
44
from
55
XDisplayControlPlugin VMConstruction-Plugins-XDisplayControlPlugin.oscog-eem.20 uuid: 8f957df8-42a6-437b-b6a2-f9f954360ef0
66
*/
@@ -80,7 +80,7 @@ static sqInt (*popRemappableOop)(void);
8080
static sqInt (*push)(sqInt object);
8181
static sqInt (*pushInteger)(sqInt integerValue);
8282
static sqInt (*pushRemappableOop)(sqInt oop);
83-
static sqInt (*sizeOfSTArrayFromCPrimitive)(void *cPtr);
83+
static void (*sizeOfSTArrayFromCPrimitive)(void *cPtr);
8484
static sqInt (*stackObjectValue)(sqInt offset);
8585
static sqInt (*trueObject)(void);
8686
#else /* !defined(SQUEAK_BUILTIN_PLUGIN) */
@@ -97,7 +97,7 @@ extern sqInt popRemappableOop(void);
9797
extern sqInt push(sqInt object);
9898
extern sqInt pushInteger(sqInt integerValue);
9999
extern sqInt pushRemappableOop(sqInt oop);
100-
extern sqInt sizeOfSTArrayFromCPrimitive(void *cPtr);
100+
extern void sizeOfSTArrayFromCPrimitive(void *cPtr);
101101
extern sqInt stackObjectValue(sqInt offset);
102102
extern sqInt trueObject(void);
103103
extern

src/spur32.cog.lowcode/cointerp.c

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* Automatically generated by
2-
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3690 uuid: b8fa6d9a-c8b4-4de4-9ecb-3bbc0d42fc4c
2+
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3692 uuid: dfc1faff-a80e-4cb8-aef8-830c0c0d50e5
33
(Cog-eem.504, Compiler-eem.526)
44
from
5-
CoInterpreter VMMaker.oscog-eem.3690 uuid: b8fa6d9a-c8b4-4de4-9ecb-3bbc0d42fc4c
5+
CoInterpreter VMMaker.oscog-eem.3692 uuid: dfc1faff-a80e-4cb8-aef8-830c0c0d50e5
66
*/
7-
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3690 uuid: b8fa6d9a-c8b4-4de4-9ecb-3bbc0d42fc4c " __DATE__ ;
7+
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3692 uuid: dfc1faff-a80e-4cb8-aef8-830c0c0d50e5 " __DATE__ ;
88
char *__interpBuildInfo = __buildInfo;
99

1010

@@ -1234,7 +1234,7 @@ extern sqInt numBytesOf(sqInt objOop);
12341234
static NoDbgRegParms usqInt numPointerSlotsOf(sqInt objOop);
12351235
static NoDbgRegParms sqInt numSlotsForBytes(sqInt numBytes);
12361236
static NoDbgRegParms usqInt numSlotsOfAny(sqInt objOop);
1237-
static NoDbgRegParms sqInt numSlotsOfIndexablePointerObj(sqInt objOop);
1237+
static NoDbgRegParms usqInt numSlotsOfIndexablePointerObj(sqInt objOop);
12381238
extern usqInt numSlotsOf(sqInt objOop);
12391239
static NoDbgRegParms sqInt numStrongSlotsOfInephemeral(sqInt objOop);
12401240
static NoDbgRegParms sqInt numStrongSlotsOfWeakling(sqInt objOop);
@@ -2692,7 +2692,7 @@ sqInt debugCallbackReturns;
26922692
sqInt suppressHeartbeatFlag;
26932693
sqInt cannotDeferDisplayUpdates;
26942694
sqInt checkedPluginName;
2695-
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3690]";
2695+
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3692]";
26962696
const char * leakCheckFlagsMeanings[] = {
26972697
"1: check full GC", "2: check new space GC", "4: check incremental GC", "8: check become",
26982698
"16: check image segment", "32: check free space", "64: check shorten", "128: check prim call",
@@ -56399,9 +56399,9 @@ allWeakSurvivorsOnWeakList(void)
5639956399
/* begin nextCorpseOrNil: */
5640056400
assert(isYoung(corpse));
5640156401
listOffset = ((((usqInt)(((long32At((void *)(corpse + 4))) & (identityHashHalfWordMask()))) << (formatFieldWidthShift())))) + ((byteAt((void *)(corpse + (formatFieldByteOffset())))) & (formatMask()));
56402-
corpse = ((sqInt) ((listOffset
56403-
? ((((usqInt)((listOffset - 1)) << 3 /* shiftForAllocationUnit */))) + GIV(newSpaceStart)
56404-
: 0)));
56402+
corpse = (listOffset
56403+
? ((((usqInt)((listOffset - 1)) << 3 /* shiftForAllocationUnit */))) + GIV(newSpaceStart)
56404+
: 0);
5640556405
}
5640656406
return 0;
5640756407
return 0;
@@ -57239,9 +57239,9 @@ processEphemerons(void)
5723957239
/* begin nextCorpseOrNil: */
5724057240
assert(isYoung(ephemeronCorpse));
5724157241
listOffset = ((((usqInt)(((long32At((void *)(ephemeronCorpse + 4))) & (identityHashHalfWordMask()))) << (formatFieldWidthShift())))) + ((byteAt((void *)(ephemeronCorpse + (formatFieldByteOffset())))) & (formatMask()));
57242-
ephemeronCorpse = ((sqInt) ((listOffset
57243-
? ((((usqInt)((listOffset - 1)) << 3 /* shiftForAllocationUnit */))) + GIV(newSpaceStart)
57244-
: 0)));
57242+
ephemeronCorpse = (listOffset
57243+
? ((((usqInt)((listOffset - 1)) << 3 /* shiftForAllocationUnit */))) + GIV(newSpaceStart)
57244+
: 0);
5724557245
}
5724657246
/* end fireEphemeronsOnEphemeronList */
5724757247
l1:;
@@ -57314,9 +57314,9 @@ processWeaklings(void)
5731457314
/* begin nextCorpseOrNil: */
5731557315
assert(isYoung(weakCorpse));
5731657316
listOffset = ((((usqInt)(((long32At((void *)(weakCorpse + 4))) & (identityHashHalfWordMask()))) << (formatFieldWidthShift())))) + ((byteAt((void *)(weakCorpse + (formatFieldByteOffset())))) & (formatMask()));
57317-
weakCorpse = ((sqInt) ((listOffset
57318-
? ((((usqInt)((listOffset - 1)) << 3 /* shiftForAllocationUnit */))) + GIV(newSpaceStart)
57319-
: 0)));
57317+
weakCorpse = (listOffset
57318+
? ((((usqInt)((listOffset - 1)) << 3 /* shiftForAllocationUnit */))) + GIV(newSpaceStart)
57319+
: 0);
5732057320
}
5732157321
GIV(weakList) = null;
5732257322
}
@@ -69579,7 +69579,7 @@ numSlotsOfAny(sqInt objOop)
6957969579
*/
6958069580

6958169581
/* SpurMemoryManager>>#numSlotsOfIndexablePointerObj: */
69582-
static NoDbgRegParms sqInt
69582+
static NoDbgRegParms usqInt
6958369583
numSlotsOfIndexablePointerObj(sqInt objOop)
6958469584
{
6958569585
usqInt numSlots;
@@ -75203,7 +75203,9 @@ validStorePointerUncheckedArgs(sqInt fieldIndex, sqInt objOop, sqInt valuePointe
7520375203
}
7520475204

7520575205

75206-
/* 1 = big, 0 = little */
75206+
/* 1/true = big, 0/false = little.
75207+
Answer false for little endian, true for big endian (should of course be
75208+
vmIsBigEndian; sigh) */
7520775209

7520875210
/* SpurMemoryManager>>#vmEndianness */
7520975211
sqInt
@@ -80412,7 +80414,7 @@ ensureImageFormatIsUpToDate(sqInt swapBytes)
8041280414
orginal order, and perform any other format conversions. */
8041380415

8041480416
/* begin updateObjectsPostByteSwap */
80415-
swapFloatWords = VMBIGENDIAN != (((imageHeaderFlags & 2) != 0));
80417+
swapFloatWords = VMBIGENDIAN != ((!(imageHeaderFlags & 2)));
8041680418
assert(ClassFloatCompactIndex != 0);
8041780419

8041880420
/* begin allObjectsDo: */
@@ -80510,7 +80512,7 @@ ensureImageFormatIsUpToDate(sqInt swapBytes)
8051080512
}
8051180513
else {
8051280514
/* begin convertFloatsToPlatformOrder */
80513-
if (VMBIGENDIAN == (((imageHeaderFlags & 2) != 0))) {
80515+
if (VMBIGENDIAN == ((!(imageHeaderFlags & 2)))) {
8051480516
goto l3;
8051580517
}
8051680518
assert(ClassFloatCompactIndex != 0);

src/spur32.cog.lowcode/cointerp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Automatically generated by
2-
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3690 uuid: b8fa6d9a-c8b4-4de4-9ecb-3bbc0d42fc4c
2+
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3692 uuid: dfc1faff-a80e-4cb8-aef8-830c0c0d50e5
33
(Cog-eem.504, Compiler-eem.526)
44
*/
55

0 commit comments

Comments
 (0)