-
Notifications
You must be signed in to change notification settings - Fork 65
/
SmallInteger.extension.st
39 lines (31 loc) · 1.34 KB
/
SmallInteger.extension.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
Extension { #name : #SmallInteger }
{ #category : #'*VMMaker-plugin generation' }
SmallInteger class >> ccg: cg generateCoerceToOopFrom: aNode on: aStream [
"N.B. The is used both for generation and simulation so answer the result (for interpretation)"
^cg generateCoerceToSmallIntegerObjectFrom: aNode on: aStream
]
{ #category : #'*VMMaker-plugin generation' }
SmallInteger class >> ccg: cg generateCoerceToValueFrom: aNode on: aStream [
"N.B. The could be used both for generation and simulation so answer the result (for interpretation)"
^cg generateCoerceToSmallIntegerValueFrom: aNode on: aStream
]
{ #category : #'*VMMaker-plugin generation' }
SmallInteger class >> ccg: cg prolog: aBlock expr: aString index: anInteger [
^cg ccgLoad: aBlock expr: aString asIntegerValueFrom: anInteger
]
{ #category : #'*VMMaker-plugin generation' }
SmallInteger class >> ccgCanConvertFrom: anObject [
^anObject isInteger
]
{ #category : #'*VMMaker-interpreter simulator' }
SmallInteger >> isBreakpointFor: address [
<primitive: 7>
^self = address
]
{ #category : #'*VMMaker-interpreter simulator' }
SmallInteger >> signedIntFromLong64 [
"Self is a signed or unsigned 64-bit integer.
Currently SmallIntegers are either 31-bit (in the 32-bit implementation) or 61-bit
(in the 64-bit implementation) so save some time by overriding in the subclass."
^self
]