-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathIntegerArrayWordArray-stdint-VMMaker-jmv.006.cs.st
67 lines (54 loc) · 2.48 KB
/
IntegerArrayWordArray-stdint-VMMaker-jmv.006.cs.st
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
'From Cuis 5.0 [latest update: #4538] on 22 March 2021 at 4:00:39 pm'!
!SmartSyntaxPluginCodeGenerator methodsFor: 'coercing' stamp: 'jmv 3/18/2021 09:56:07'!
ccgLoad: aBlock expr: aString asint32PtrFrom: anInteger andThen: valBlock
"Answer a codestring for integer pointer to first indexable field of object (without validating side-effect unless specified in valBlock), as described in comment to ccgLoad:expr:asRawOopFrom:"
^(valBlock value: anInteger), '.',
(aBlock value: (String streamContents: [:aStream | aStream
nextPutAll: 'self cCoerce: (interpreterProxy firstIndexableField:';
crtab: 4;
nextPutAll: '(interpreterProxy stackValue:';
nextPutAll: anInteger asString;
nextPutAll: '))';
crtab: 3;
nextPutAll: 'to: ''int32_t *''']))! !
!SmartSyntaxPluginCodeGenerator methodsFor: 'coercing' stamp: 'jmv 3/8/2021 11:00:21'!
ccgLoad: aBlock expr: aString asuint32PtrFrom: anInteger andThen: valBlock
"Answer a codestring for integer pointer to first indexable field of object (without validating side-effect unless specified in valBlock), as described in comment to ccgLoad:expr:asRawOopFrom:"
^(valBlock value: anInteger), '.',
(aBlock value: (String streamContents: [:aStream | aStream
nextPutAll: 'self cCoerce: (interpreterProxy firstIndexableField:';
crtab: 4;
nextPutAll: '(interpreterProxy stackValue:';
nextPutAll: anInteger asString;
nextPutAll: '))';
crtab: 3;
nextPutAll: 'to: ''uint32_t *''']))! !
!IntegerArray class methodsFor: '*VMMaker-plugin generation' stamp: 'jmv 3/18/2021 09:56:12'!
ccg: cg prolog: aBlock expr: aString index: anInteger
^cg
ccgLoad: aBlock
expr: aString
asint32PtrFrom: anInteger
andThen: (cg ccgValBlock: 'isWords')! !
!IntegerArray class methodsFor: '*VMMaker-plugin generation' stamp: 'jmv 3/17/2021 15:52:02'!
ccgDeclareCForVar: aSymbolOrString
"We need to start using stdint.h !!!!!!!!!!!!"
"
^'int *', aSymbolOrString
"
^'int32_t *', aSymbolOrString! !
!WordArray class methodsFor: '*VMMaker-plugin generation' stamp: 'jmv 3/8/2021 10:59:03'!
ccg: cg prolog: aBlock expr: aString index: anInteger
^cg
ccgLoad: aBlock
expr: aString
asuint32PtrFrom: anInteger
andThen: (cg ccgValBlock: 'isWords')! !
!WordArray class methodsFor: '*VMMaker-plugin generation' stamp: 'jmv 3/8/2021 10:40:08'!
ccgDeclareCForVar: aSymbolOrString
"Address of an unsigned 32 bit value, regardless of Smalltalk wordSize"
"We need to start using stdint.h !!!!!!!!!!!!"
"
^'unsigned *', aSymbolOrString
"
^'uint32_t *', aSymbolOrString! !