File: sqVirtualMachine.h

package info (click to toggle)
squeak-plugins-scratch 1.4.0.2~svn.r83-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 584 kB
  • sloc: ansic: 1,360; makefile: 88; sh: 88
file content (141 lines) | stat: -rw-r--r-- 4,233 bytes parent folder | download | duplicates (30)
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
#ifndef _SqueakVM_H
#define _SqueakVM_H

/* Increment the following number if you change the order of
   functions listed or if you remove functions */
#define VM_PROXY_MAJOR 1

/* Increment the following number if you add functions at the end */
#define VM_PROXY_MINOR 1

typedef int (*CompilerHook)();

struct VirtualMachine* sqGetInterpreterProxy(void);

typedef struct VirtualMachine {
	int (*minorVersion) (void);
	int (*majorVersion) (void);


	/* InterpreterProxy methodsFor: 'stack access' */

	int (*pop)(int nItems);
	int (*popthenPush)(int nItems, int oop);
	int (*push)(int object);
	int (*pushBool)(int trueOrFalse);
	int (*pushFloat)(double f);
	int (*pushInteger)(int integerValue);
	double (*stackFloatValue)(int offset);
	int (*stackIntegerValue)(int offset);
	int (*stackObjectValue)(int offset);
	int (*stackValue)(int offset);
	

	/* InterpreterProxy methodsFor: 'object access' */

	int (*argumentCountOf)(int methodPointer);
	void * (*arrayValueOf)(int oop);
	int (*byteSizeOf)(int oop);
	void * (*fetchArrayofObject)(int fieldIndex, int objectPointer);
	int (*fetchClassOf)(int oop);
	double (*fetchFloatofObject)(int fieldIndex, int objectPointer);
	int (*fetchIntegerofObject)(int fieldIndex, int objectPointer);
	int (*fetchPointerofObject)(int index, int oop);
	int (*fetchWordofObject)(int fieldIndex, int oop);
	void * (*firstFixedField)(int oop);
	void * (*firstIndexableField)(int oop);
	int (*literalofMethod)(int offset, int methodPointer);
	int (*literalCountOf)(int methodPointer);
	int (*methodArgumentCount)(void);
	int (*methodPrimitiveIndex)(void);
	int (*primitiveIndexOf)(int methodPointer);
	int (*sizeOfSTArrayFromCPrimitive)(void *cPtr);
	int (*slotSizeOf)(int oop);
	int (*stObjectat)(int array, int index);
	int (*stObjectatput)(int array, int index, int value);
	int (*stSizeOf)(int oop);
	int (*storeIntegerofObjectwithValue)(int index, int oop, int integer);
	int (*storePointerofObjectwithValue)(int index, int oop, int valuePointer);
	

	/* InterpreterProxy methodsFor: 'testing' */

	int (*isKindOf)(int oop, char *aString);
	int (*isMemberOf)(int oop, char *aString);
	int (*isBytes)(int oop);
	int (*isFloatObject)(int oop);
	int (*isIndexable)(int oop);
	int (*isIntegerObject)(int objectPointer);
	int (*isIntegerValue)(int intValue);
	int (*isPointers)(int oop);
	int (*isWeak)(int oop);
	int (*isWords)(int oop);
	int (*isWordsOrBytes)(int oop);
	

	/* InterpreterProxy methodsFor: 'converting' */

	int (*booleanValueOf)(int obj);
	int (*checkedIntegerValueOf)(int intOop);
	int (*floatObjectOf)(double aFloat);
	double (*floatValueOf)(int oop);
	int (*integerObjectOf)(int value);
	int (*integerValueOf)(int oop);
	int (*positive32BitIntegerFor)(int integerValue);
	int (*positive32BitValueOf)(int oop);
	

	/* InterpreterProxy methodsFor: 'special objects' */

	int (*characterTable)(void);
	int (*displayObject)(void);
	int (*falseObject)(void);
	int (*nilObject)(void);
	int (*trueObject)(void);
	

	/* InterpreterProxy methodsFor: 'special classes' */

	int (*classArray)(void);
	int (*classBitmap)(void);
	int (*classByteArray)(void);
	int (*classCharacter)(void);
	int (*classFloat)(void);
	int (*classLargePositiveInteger)(void);
	int (*classPoint)(void);
	int (*classSemaphore)(void);
	int (*classSmallInteger)(void);
	int (*classString)(void);
	

	/* InterpreterProxy methodsFor: 'instance creation' */

	int (*clone)(int oop);
	int (*instantiateClassindexableSize)(int classPointer, int size);
	int (*makePointwithxValueyValue)(int xValue, int yValue);
	int (*popRemappableOop)(void);
	int (*pushRemappableOop)(int oop);
	

	/* InterpreterProxy methodsFor: 'other' */

	int (*becomewith)(int array1, int array2);
	int (*byteSwapped)(int w);
	int (*failed)(void);
	int (*fullDisplayUpdate)(void);
	int (*fullGC)(void);
	int (*incrementalGC)(void);
	int (*primitiveFail)(void);
	int (*showDisplayBitsLeftTopRightBottom)(int aForm, int l, int t, int r, int b);
	int (*signalSemaphoreWithIndex)(int semaIndex);
	int (*success)(int aBoolean);
	int (*superclassOf)(int classPointer);
	
	/* InterpreterProxy methodsFor: 'compiler' */

	CompilerHook *(*compilerHookVector)(void);
	int (*setCompilerInitialized)(int initFlag);

} VirtualMachine;

#endif /* _SqueakVM_H */