/
sqVirtualMachine.h
executable file
·654 lines (574 loc) · 22.3 KB
/
sqVirtualMachine.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
#ifndef _SqueakVM_H
#define _SqueakVM_H
/* We expect interp.h to define VM_PROXY_MAJOR & VM_PROXY_MINOR, and other
* defines such as STACKVM, appropriately for the VM generated with it.
*/
#include "interp.h"
#pragma auto_inline(off)
#if defined(EXPORT) && !defined(SQUEAK_BUILTIN_PLUGIN)
EXPORT(void) error(const char *);
#else
extern void error(const char *);
#endif
#pragma auto_inline(on)
#if SPURVM
# define VM_VERSION "5.0"
#else
# define VM_VERSION "4.5"
#endif
#ifndef VM_PROXY_MAJOR
/* Increment the following number if you change the order of
functions listed or if you remove functions */
# define VM_PROXY_MAJOR 1
#endif
#ifndef VM_PROXY_MINOR
/* Increment the following number if you add functions at the end */
# if SPURVM
# define VM_PROXY_MINOR 13
# else
# define VM_PROXY_MINOR 12
# endif
#endif
#include "sqMemoryAccess.h"
#if VM_PROXY_MINOR > 8
# define PrimNoErr 0
# define PrimErrGenericFailure 1
# define PrimErrBadReceiver 2
# define PrimErrBadArgument 3
# define PrimErrBadIndex 4
# define PrimErrBadNumArgs 5
# define PrimErrInappropriate 6
# define PrimErrUnsupported 7
# define PrimErrNoModification 8
# define PrimErrNoMemory 9
# define PrimErrNoCMemory 10
# define PrimErrNotFound 11
# define PrimErrBadMethod 12
# define PrimErrNamedInternal 13
# define PrimErrObjectMayMove 14
# define PrimErrLimitExceeded 15
# define PrimErrObjectIsPinned 16
# define PrimErrWritePastObject 17
# define PrimErrObjectMoved 18
# define PrimErrObjectNotPinned 19
# define PrimErrCallbackError 20
# define PrimErrOSError 21
# define PrimErrFFIException 22
# define PrimErrNeedCompaction 23
# define PrimErrOperationFailed 24
/* VMCallbackContext opaque type avoids all including setjmp.h & vmCallback.h */
typedef struct _VMCallbackContext *vmccp;
#endif
typedef sqInt (*CompilerHook)(void);
struct VirtualMachine* sqGetInterpreterProxy(void);
typedef struct VirtualMachine {
sqInt (*minorVersion)(void);
sqInt (*majorVersion)(void);
/* InterpreterProxy methodsFor: 'stack access' */
sqInt (*pop)(sqInt nItems);
sqInt (*popthenPush)(sqInt nItems, sqInt oop);
sqInt (*push)(sqInt object);
sqInt (*pushBool)(sqInt trueOrFalse);
sqInt (*pushFloat)(double f);
sqInt (*pushInteger)(sqInt integerValue);
double (*stackFloatValue)(sqInt offset);
sqInt (*stackIntegerValue)(sqInt offset);
sqInt (*stackObjectValue)(sqInt offset);
sqInt (*stackValue)(sqInt offset);
/* InterpreterProxy methodsFor: 'object access' */
sqInt (*argumentCountOf)(sqInt methodPointer);
void *(*arrayValueOf)(sqInt oop);
sqInt (*byteSizeOf)(sqInt oop);
void *(*fetchArrayofObject)(sqInt fieldIndex, sqInt objectPointer);
sqInt (*fetchClassOf)(sqInt oop);
double (*fetchFloatofObject)(sqInt fieldIndex, sqInt objectPointer);
sqInt (*fetchIntegerofObject)(sqInt fieldIndex, sqInt objectPointer);
sqInt (*fetchPointerofObject)(sqInt fieldIndex, sqInt oop);
#if OLD_FOR_REFERENCE
/* sqInt (*fetchWordofObject)(sqInt fieldFieldIndex, sqInt oop); *
* has been rescinded as of VMMaker 3.8 and the 64bitclean VM *
* work. To support old plugins we keep a valid function in *
* the same location in the VM struct but rename it to *
* something utterly horrible to scare off the natives. A new *
* equivalent but 64 bit valid function is added as *
* 'fetchLong32OfObject' */
sqInt (*obsoleteDontUseThisFetchWordofObject)(sqInt fieldFieldIndex, sqInt oop);
#else /* since there is no legacy plugin problem back to 3.8 we repurpose... */
void (*error)(const char *);
#endif
void *(*firstFixedField)(sqInt oop);
void *(*firstIndexableField)(sqInt oop);
sqInt (*literalofMethod)(sqInt offset, sqInt methodPointer);
sqInt (*literalCountOf)(sqInt methodPointer);
sqInt (*methodArgumentCount)(void);
sqInt (*methodPrimitiveIndex)(void);
sqInt (*primitiveIndexOf)(sqInt methodPointer);
sqInt (*sizeOfSTArrayFromCPrimitive)(void *cPtr);
sqInt (*slotSizeOf)(sqInt oop);
sqInt (*stObjectat)(sqInt array, sqInt fieldIndex);
sqInt (*stObjectatput)(sqInt array, sqInt fieldIndex, sqInt value);
sqInt (*stSizeOf)(sqInt oop);
sqInt (*storeIntegerofObjectwithValue)(sqInt fieldIndex, sqInt oop, sqInt integer);
sqInt (*storePointerofObjectwithValue)(sqInt fieldIndex, sqInt oop, sqInt valuePointer);
/* InterpreterProxy methodsFor: 'testing' */
sqInt (*isKindOf)(sqInt oop, char *aString);
sqInt (*isMemberOf)(sqInt oop, char *aString);
sqInt (*isBytes)(sqInt oop);
sqInt (*isFloatObject)(sqInt oop);
sqInt (*isIndexable)(sqInt oop);
sqInt (*isIntegerObject)(sqInt oop);
sqInt (*isIntegerValue)(sqInt intValue);
sqInt (*isPointers)(sqInt oop);
sqInt (*isWeak)(sqInt oop);
sqInt (*isWords)(sqInt oop);
sqInt (*isWordsOrBytes)(sqInt oop);
/* InterpreterProxy methodsFor: 'converting' */
sqInt (*booleanValueOf)(sqInt obj);
sqInt (*checkedIntegerValueOf)(sqInt intOop);
sqInt (*floatObjectOf)(double aFloat);
double (*floatValueOf)(sqInt oop);
sqInt (*integerObjectOf)(sqInt value);
sqInt (*integerValueOf)(sqInt oop);
sqInt (*positive32BitIntegerFor)(unsigned int integerValue);
usqInt (*positive32BitValueOf)(sqInt oop);
/* InterpreterProxy methodsFor: 'special objects' */
sqInt (*characterTable)(void);
sqInt (*displayObject)(void);
sqInt (*falseObject)(void);
sqInt (*nilObject)(void);
sqInt (*trueObject)(void);
/* InterpreterProxy methodsFor: 'special classes' */
sqInt (*classArray)(void);
sqInt (*classBitmap)(void);
sqInt (*classByteArray)(void);
sqInt (*classCharacter)(void);
sqInt (*classFloat)(void);
sqInt (*classLargePositiveInteger)(void);
sqInt (*classPoint)(void);
sqInt (*classSemaphore)(void);
sqInt (*classSmallInteger)(void);
sqInt (*classString)(void);
/* InterpreterProxy methodsFor: 'instance creation' */
sqInt (*clone)(sqInt oop);
sqInt (*instantiateClassindexableSize)(sqInt classPointer, sqInt size);
sqInt (*makePointwithxValueyValue)(sqInt xValue, sqInt yValue);
sqInt (*popRemappableOop)(void);
sqInt (*pushRemappableOop)(sqInt oop);
/* InterpreterProxy methodsFor: 'other' */
sqInt (*becomewith)(sqInt array1, sqInt array2);
sqInt (*byteSwapped)(sqInt w);
sqInt (*failed)(void);
sqInt (*fullDisplayUpdate)(void);
void (*fullGC)(void);
void (*incrementalGC)(void);
sqInt (*primitiveFail)(void);
sqInt (*showDisplayBitsLeftTopRightBottom)(sqInt aForm, sqInt l, sqInt t, sqInt r, sqInt b);
sqInt (*signalSemaphoreWithIndex)(sqInt semaIndex);
sqInt (*success)(sqInt aBoolean);
sqInt (*superclassOf)(sqInt classPointer);
# if VM_PROXY_MINOR > 13
/* Reuse these now that Cog provides a production JIT. */
sqInt (*statNumGCs)(void);
sqInt (*stringForCString)(char *nullTerminatedCString);
# else
/* InterpreterProxy methodsFor: 'compiler' */
CompilerHook *(*compilerHookVector)(void);
sqInt (*setCompilerInitialized)(sqInt initFlag);
# endif
#if VM_PROXY_MINOR > 1
/* InterpreterProxy methodsFor: 'BitBlt support' */
sqInt (*loadBitBltFrom)(sqInt bbOop);
sqInt (*copyBits)(void);
sqInt (*copyBitsFromtoat)(sqInt leftX, sqInt rightX, sqInt yValue);
#endif
#if VM_PROXY_MINOR > 2
sqInt (*classLargeNegativeInteger)(void);
sqInt (*signed32BitIntegerFor)(sqInt integerValue);
int (*signed32BitValueOf)(sqInt oop);
sqInt (*includesBehaviorThatOf)(sqInt aClass, sqInt aSuperClass);
sqInt (*primitiveMethod)(void);
/* InterpreterProxy methodsFor: 'FFI support' */
sqInt (*classExternalAddress)(void);
sqInt (*classExternalData)(void);
sqInt (*classExternalFunction)(void);
sqInt (*classExternalLibrary)(void);
sqInt (*classExternalStructure)(void);
void *(*ioLoadModuleOfLength)(sqInt modIndex, sqInt modLength);
void *(*ioLoadSymbolOfLengthFromModule)(sqInt fnIndex, sqInt fnLength, sqInt handle);
sqInt (*isInMemory)(sqInt address);
#endif
#if VM_PROXY_MINOR > 3
void *(*ioLoadFunctionFrom)(char *fnName, char *modName);
sqInt (*ioMicroMSecs)(void);
#endif
#if VM_PROXY_MINOR > 4
# if !defined(sqLong)
# if _MSC_VER
# define sqLong __int64
# define usqLong unsigned __int64
# else
# define sqLong long long
# define usqLong unsigned long long
# endif
# endif
sqInt (*positive64BitIntegerFor)(usqLong integerValue);
usqLong(*positive64BitValueOf)(sqInt oop);
sqInt (*signed64BitIntegerFor)(sqLong integerValue);
sqLong (*signed64BitValueOf)(sqInt oop);
#endif
#if VM_PROXY_MINOR > 5
sqInt (*isArray)(sqInt oop);
void (*forceInterruptCheck)(void);
#endif
#if VM_PROXY_MINOR > 6
sqInt (*fetchLong32ofObject)(sqInt fieldFieldIndex, sqInt oop);
sqInt (*getThisSessionID)(void);
sqInt (*ioFilenamefromStringofLengthresolveAliases)(char* aCharBuffer, char* filenameIndex, sqInt filenameLength, sqInt resolveFlag);
sqInt (*vmEndianness)(void);
#endif
#if VM_PROXY_MINOR > 7
/* New methods for proxy version 1.8 */
/* callbackEnter: Re-enter the interpreter loop for a callback.
Arguments:
callbackID: Pointer to a location receiving the callback ID
used in callbackLeave
Returns: True if successful, false otherwise */
sqInt (*callbackEnter)(sqInt *callbackID);
/* callbackLeave: Leave the interpreter from a previous callback
Arguments:
callbackID: The ID of the callback received from callbackEnter()
Returns: True if succcessful, false otherwise. */
sqInt (*callbackLeave)(sqInt callbackID);
/* addGCRoot: Add a variable location to the garbage collector.
The contents of the variable location will be updated accordingly.
Arguments:
varLoc: Pointer to the variable location
Returns: True if successful, false otherwise. */
sqInt (*addGCRoot)(sqInt *varLoc);
/* removeGCRoot: Remove a variable location from the garbage collector.
Arguments:
varLoc: Pointer to the variable location
Returns: True if successful, false otherwise.
*/
sqInt (*removeGCRoot)(sqInt *varLoc);
#endif
#if VM_PROXY_MINOR > 8
/* See interp.h and above for standard error codes. */
sqInt (*primitiveFailFor)(sqInt code);
void *(*setInterruptCheckChain)(void (*aFunction)(void));
sqInt (*classAlien)(void);
sqInt (*classUnsafeAlien)(void);
sqInt (*sendInvokeCallbackStackRegistersJmpbuf)(sqInt thunkPtrAsInt, sqInt stackPtrAsInt, sqInt regsPtrAsInt, sqInt jmpBufPtrAsInt);
sqInt (*reestablishContextPriorToCallback)(sqInt callbackContext);
sqInt *(*getStackPointer)(void);
sqInt (*isOopImmutable)(sqInt oop);
sqInt (*isOopMutable)(sqInt oop);
#endif
#if VM_PROXY_MINOR > 9
# if VM_PROXY_MINOR > 13 /* OS Errors available in primitives; easy return forms */
sqInt (*methodReturnBool)(sqInt);
sqInt (*methodReturnFloat)(double);
sqInt (*methodReturnInteger)(sqInt);
sqInt (*methodReturnString)(char *);
# define returnSelf() methodReturnValue(0)
# else
sqInt (*methodArg) (sqInt index); /* These ended up never being used. */
sqInt (*objectArg) (sqInt index);
sqInt (*integerArg) (sqInt index);
double (*floatArg) (sqInt index);
# endif
sqInt (*methodReturnValue) (sqInt oop);
sqInt (*topRemappableOop) (void);
#endif
#if VM_PROXY_MINOR > 10
sqInt (*disownVM)(sqInt flags);
sqInt (*ownVM) (sqInt threadIdAndFlags);
void (*addHighPriorityTickee)(void (*ticker)(void), unsigned periodms);
void (*addSynchronousTickee)(void (*ticker)(void), unsigned periodms, unsigned roundms);
usqLong (*utcMicroseconds)(void);
void (*tenuringIncrementalGC)(void);
sqInt (*isYoung) (sqInt anOop);
sqInt (*isKindOfClass)(sqInt oop, sqInt aClass);
sqInt (*primitiveErrorTable)(void);
sqInt (*primitiveFailureCode)(void);
sqInt (*instanceSizeOf)(sqInt aClass);
#endif
#if VM_PROXY_MINOR > 11
/* VMCallbackContext opaque type avoids all including setjmp.h & vmCallback.h */
sqInt (*sendInvokeCallbackContext)(vmccp);
sqInt (*returnAsThroughCallbackContext)(int, vmccp, sqInt);
sqIntptr_t (*signedMachineIntegerValueOf)(sqInt);
sqIntptr_t (*stackSignedMachineIntegerValue)(sqInt);
usqIntptr_t (*positiveMachineIntegerValueOf)(sqInt);
usqIntptr_t (*stackPositiveMachineIntegerValue)(sqInt);
sqInt (*getInterruptPending)(void);
char *(*cStringOrNullFor)(sqInt);
void *(*startOfAlienData)(sqInt);
usqInt (*sizeOfAlienData)(sqInt);
sqInt (*signalNoResume)(sqInt);
#endif
#if VM_PROXY_MINOR > 12 /* Spur */
sqInt (*isImmediate)(sqInt objOop);
sqInt (*characterObjectOf)(int charCode);
sqInt (*characterValueOf)(sqInt objOop);
sqInt (*isCharacterObject)(sqInt objOop);
sqInt (*isCharacterValue)(int charCode);
sqInt (*isPinned)(sqInt objOop);
sqInt (*pinObject)(sqInt objOop);
sqInt (*unpinObject)(sqInt objOop);
#endif
#if VM_PROXY_MINOR > 13 /* OS Errors available in primitives; easy return forms (see above) */
sqInt (*primitiveFailForOSError)(sqLong osErrorCode);
sqInt (*methodReturnReceiver)(void);
sqInt (*primitiveFailForFFIExceptionat)(usqLong exceptionCode, usqInt pc);
#endif
#if VM_PROXY_MINOR > 14 /* SmartSyntaxPlugin validation rewrite support */
sqInt (*isBooleanObject)(sqInt oop);
sqInt (*isPositiveMachineIntegerObject)(sqInt);
#endif
#if VM_PROXY_MINOR > 15 /* Spur integer and float array classes */
sqInt (*classDoubleByteArray)(void);
sqInt (*classWordArray)(void);
sqInt (*classDoubleWordArray)(void);
sqInt (*classFloat32Array)(void);
sqInt (*classFloat64Array)(void);
#endif
#if VM_PROXY_MINOR > 16 /* Spur isShorts, isLong64s testing, hash etc */
sqInt (*isShorts)(sqInt oop);
sqInt (*isLong64s)(sqInt oop);
sqInt (*identityHashOf)(sqInt oop);
sqInt (*isWordsOrShorts)(sqInt oop); /* for SoundPlugin et al */
sqInt (*bytesPerElement)(sqInt oop); /* for SocketPugin et al */
sqInt (*fileTimesInUTC)(void); /* for FilePlugin et al */
#endif
} VirtualMachine;
# if (defined(SQUEAK_INTERNAL_PLUGIN) || defined(FOR_SVM_C)) \
&& !defined(SQ_USE_GLOBAL_STRUCT) // Prevent the interpereter seeing these
/*** Function prototypes ***/
/* InterpreterProxy methodsFor: 'stack access' */
sqInt pop(sqInt nItems);
sqInt popthenPush(sqInt nItems, sqInt oop);
sqInt push(sqInt object);
sqInt pushBool(sqInt trueOrFalse);
sqInt pushFloat(double f);
sqInt pushInteger(sqInt integerValue);
double stackFloatValue(sqInt offset);
sqInt stackIntegerValue(sqInt offset);
sqInt stackObjectValue(sqInt offset);
sqInt stackValue(sqInt offset);
/*** variables ***/
/* InterpreterProxy methodsFor: 'object access' */
sqInt argumentCountOf(sqInt methodPointer);
void *arrayValueOf(sqInt oop);
sqInt byteSizeOf(sqInt oop);
void *fetchArrayofObject(sqInt fieldIndex, sqInt objectPointer);
sqInt fetchClassOf(sqInt oop);
double fetchFloatofObject(sqInt fieldIndex, sqInt objectPointer);
sqInt fetchIntegerofObject(sqInt fieldIndex, sqInt objectPointer);
sqInt fetchPointerofObject(sqInt index, sqInt oop);
#if OLD_FOR_REFERENCE /* slot repurposed for error */
/* sqInt fetchWordofObject(sqInt fieldIndex, sqInt oop); *
* has been rescinded as of VMMaker 3.8 and the 64bitclean VM *
* work. To support old plugins we keep a valid function in *
* the same location in the VM struct but rename it to *
* something utterly horrible to scare off the natives. A new *
* equivalent but 64 bit valid function is added as *
* 'fetchLong32OfObject' */
sqInt obsoleteDontUseThisFetchWordofObject(sqInt index, sqInt oop);
#endif
sqInt fetchLong32ofObject(sqInt index, sqInt oop);
void *firstFixedField(sqInt oop);
void *firstIndexableField(sqInt oop);
sqInt literalofMethod(sqInt offset, sqInt methodPointer);
sqInt literalCountOf(sqInt methodPointer);
sqInt methodArgumentCount(void);
sqInt methodPrimitiveIndex(void);
sqInt primitiveMethod(void);
sqInt primitiveIndexOf(sqInt methodPointer);
sqInt sizeOfSTArrayFromCPrimitive(void *cPtr);
sqInt slotSizeOf(sqInt oop);
sqInt stObjectat(sqInt array, sqInt index);
sqInt stObjectatput(sqInt array, sqInt index, sqInt value);
sqInt stSizeOf(sqInt oop);
sqInt storeIntegerofObjectwithValue(sqInt index, sqInt oop, sqInt integer);
sqInt storePointerofObjectwithValue(sqInt index, sqInt oop, sqInt valuePointer);
/* InterpreterProxy methodsFor: 'testing' */
sqInt isKindOf(sqInt oop, char *aString);
sqInt isMemberOf(sqInt oop, char *aString);
sqInt isBytes(sqInt oop);
sqInt isFloatObject(sqInt oop);
sqInt isIndexable(sqInt oop);
sqInt isIntegerObject(sqInt oop);
sqInt isIntegerValue(sqInt intValue);
sqInt isPointers(sqInt oop);
sqInt isWeak(sqInt oop);
sqInt isWords(sqInt oop);
sqInt isWordsOrBytes(sqInt oop);
sqInt includesBehaviorThatOf(sqInt aClass, sqInt aSuperClass);
#if VM_PROXY_MINOR > 10
sqInt isKindOfClass(sqInt oop, sqInt aClass);
sqInt primitiveErrorTable(void);
sqInt primitiveFailureCode(void);
sqInt instanceSizeOf(sqInt aClass);
void tenuringIncrementalGC(void);
#endif
sqInt isArray(sqInt oop);
sqInt isOopMutable(sqInt oop);
sqInt isOopImmutable(sqInt oop);
/* InterpreterProxy methodsFor: 'converting' */
sqInt booleanValueOf(sqInt obj);
sqInt checkedIntegerValueOf(sqInt intOop);
sqInt floatObjectOf(double aFloat);
double floatValueOf(sqInt oop);
sqInt integerObjectOf(sqInt value);
sqInt integerValueOf(sqInt oop);
sqInt positive32BitIntegerFor(unsigned int integerValue);
usqInt positive32BitValueOf(sqInt oop);
sqInt signed32BitIntegerFor(sqInt integerValue);
int signed32BitValueOf(sqInt oop);
sqInt positive64BitIntegerFor(usqLong integerValue);
usqLong positive64BitValueOf(sqInt oop);
sqInt signed64BitIntegerFor(sqLong integerValue);
sqLong signed64BitValueOf(sqInt oop);
sqIntptr_t signedMachineIntegerValueOf(sqInt);
sqIntptr_t stackSignedMachineIntegerValue(sqInt);
usqIntptr_t positiveMachineIntegerValueOf(sqInt);
usqIntptr_t stackPositiveMachineIntegerValue(sqInt);
/* InterpreterProxy methodsFor: 'special objects' */
sqInt characterTable(void);
sqInt displayObject(void);
sqInt falseObject(void);
sqInt nilObject(void);
sqInt trueObject(void);
/* InterpreterProxy methodsFor: 'special classes' */
sqInt classArray(void);
sqInt classBitmap(void);
sqInt classByteArray(void);
sqInt classCharacter(void);
sqInt classFloat(void);
sqInt classLargePositiveInteger(void);
sqInt classLargeNegativeInteger(void);
sqInt classPoint(void);
sqInt classSemaphore(void);
sqInt classSmallInteger(void);
sqInt classString(void);
/* InterpreterProxy methodsFor: 'instance creation' */
sqInt clone(sqInt oop);
sqInt instantiateClassindexableSize(sqInt classPointer, sqInt size);
sqInt makePointwithxValueyValue(sqInt xValue, sqInt yValue);
sqInt popRemappableOop(void);
sqInt pushRemappableOop(sqInt oop);
/* InterpreterProxy methodsFor: 'other' */
sqInt becomewith(sqInt array1, sqInt array2);
sqInt byteSwapped(sqInt w);
sqInt failed(void);
sqInt fullDisplayUpdate(void);
void fullGC(void);
void incrementalGC(void);
sqInt primitiveFail(void);
sqInt primitiveFailFor(sqInt reasonCode);
sqInt showDisplayBitsLeftTopRightBottom(sqInt aForm, sqInt l, sqInt t, sqInt r, sqInt b);
sqInt signalSemaphoreWithIndex(sqInt semaIndex);
sqInt success(sqInt aBoolean);
sqInt superclassOf(sqInt classPointer);
sqInt ioMicroMSecs(void);
unsigned long long ioUTCMicroseconds(void);
unsigned long long ioUTCMicrosecondsNow(void);
void forceInterruptCheck(void);
sqInt getThisSessionID(void);
sqInt ioFilenamefromStringofLengthresolveAliases(char* aCharBuffer, char* filenameIndex, sqInt filenameLength, sqInt resolveFlag);
sqInt vmEndianness(void);
sqInt getInterruptPending(void);
void error(const char *);
/* InterpreterProxy methodsFor: 'BitBlt support' */
sqInt loadBitBltFrom(sqInt bbOop);
sqInt copyBits(void);
sqInt copyBitsFromtoat(sqInt leftX, sqInt rightX, sqInt yValue);
/* InterpreterProxy methodsFor: 'FFI support' */
sqInt classExternalAddress(void);
sqInt classExternalData(void);
sqInt classExternalFunction(void);
sqInt classExternalLibrary(void);
sqInt classExternalStructure(void);
void *ioLoadModuleOfLength(sqInt moduleNameIndex, sqInt moduleNameLength);
void *ioLoadSymbolOfLengthFromModule(sqInt functionNameIndex, sqInt functionNameLength, sqInt moduleHandle);
sqInt isInMemory(sqInt address);
sqInt classAlien(void); /* Alien FFI */
sqInt classUnsafeAlien(void); /* Alien FFI */
sqInt *getStackPointer(void); /* Newsqueak FFI */
void *startOfAlienData(sqInt);
usqInt sizeOfAlienData(sqInt);
sqInt signalNoResume(sqInt);
#if VM_PROXY_MINOR > 8
sqInt *getStackPointer(void); /* Alien FFI */
sqInt sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtrAsInt, sqInt stackPtrAsInt, sqInt regsPtrAsInt, sqInt jmpBufPtrAsInt); /* Alien FFI */
sqInt reestablishContextPriorToCallback(sqInt callbackContext); /* Alien FFI */
sqInt sendInvokeCallbackContext(vmccp);
sqInt returnAsThroughCallbackContext(int, vmccp, sqInt);
#endif /* VM_PROXY_MINOR > 8 */
#if VM_PROXY_MINOR > 12 /* Spur */
sqInt isImmediate(sqInt oop);
sqInt isCharacterObject(sqInt oop);
sqInt isCharacterValue(int charCode);
sqInt characterObjectOf(int charCode);
sqInt characterValueOf(sqInt oop);
sqInt isPinned(sqInt objOop);
sqInt pinObject(sqInt objOop);
sqInt unpinObject(sqInt objOop);
char *cStringOrNullFor(sqInt);
#endif
#if VM_PROXY_MINOR > 13 /* More Spur + OS Errors available via prim error code */
sqInt statNumGCs(void);
sqInt stringForCString(char *);
sqInt primitiveFailForOSError(sqLong);
sqInt primitiveFailForFFIExceptionat(usqLong exceptionCode, usqInt pc);
#endif
#if VM_PROXY_MINOR > 14 /* SmartSyntaxPlugin validation rewrite support */
sqInt isBooleanObject(sqInt oop);
sqInt isPositiveMachineIntegerObject(sqInt oop);
#endif
#if VM_PROXY_MINOR > 15 /* Spur integer and float array classes */
sqInt classDoubleByteArray(void);
sqInt classWordArray(void);
sqInt classDoubleWordArray(void);
sqInt classFloat32Array(void);
sqInt classFloat64Array(void);
#endif
#if VM_PROXY_MINOR > 16 /* Spur isShorts and isLong64s testing support, hash */
sqInt isShorts(sqInt);
sqInt isLong64s(sqInt);
sqInt identityHashOf(sqInt);
sqInt isWordsOrShorts(sqInt);
sqInt bytesPerElement(sqInt);
sqInt fileTimesInUTC(void);
#endif
void *ioLoadFunctionFrom(char *fnName, char *modName);
/* Proxy declarations for v1.8 */
#if NewspeakVM
static sqInt
callbackEnter(sqInt *callbackID) { return 0; }
static sqInt
callbackLeave(sqInt callbackID) { return 0; }
#else
sqInt callbackEnter(sqInt *callbackID);
sqInt callbackLeave(sqInt callbackID);
#endif
sqInt addGCRoot(sqInt *varLoc);
sqInt removeGCRoot(sqInt *varLoc);
/* Proxy declarations for v1.10 */
# if VM_PROXY_MINOR > 13 /* OS Errors available in primitives; easy return forms */
sqInt methodReturnBool(sqInt);
sqInt methodReturnFloat(double);
sqInt methodReturnInteger(sqInt);
sqInt methodReturnReceiver(void);
sqInt methodReturnString(char *);
# else
sqInt methodArg(sqInt index);
sqInt objectArg(sqInt index);
sqInt integerArg(sqInt index);
double floatArg(sqInt index);
#endif
sqInt methodReturnValue(sqInt oop);
sqInt topRemappableOop(void);
# endif
#endif /* _SqueakVM_H */