-
Notifications
You must be signed in to change notification settings - Fork 71
/
CurrentImageCoInterpreterFacadeFor64BitSpurObjectRepresentation.class.st
67 lines (59 loc) · 2.37 KB
/
CurrentImageCoInterpreterFacadeFor64BitSpurObjectRepresentation.class.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
67
Class {
#name : #CurrentImageCoInterpreterFacadeFor64BitSpurObjectRepresentation,
#superclass : #CurrentImageCoInterpreterFacadeForSpurObjectRepresentation,
#category : #'VMMaker-Support'
}
{ #category : #'accessing class hierarchy' }
CurrentImageCoInterpreterFacadeFor64BitSpurObjectRepresentation class >> objectMemoryClass [
^Spur64BitCoMemoryManager
]
{ #category : #'accessing class hierarchy' }
CurrentImageCoInterpreterFacadeFor64BitSpurObjectRepresentation class >> objectRepresentationClass [
^CogObjectRepresentationFor64BitSpur
]
{ #category : #'private-cacheing' }
CurrentImageCoInterpreterFacadeFor64BitSpurObjectRepresentation >> objectForOop: anOop [
"This is a keyAtValue: search and so needs speeding up either by a reverse map or a simple cache."
^(anOop bitAnd: 7) caseOf: {
[0] -> [anOop = cachedOop
ifTrue: [cachedObject]
ifFalse: [cachedObject := objectMap keyAtNonIdentityValue: anOop. "may raise Error"
cachedOop := anOop. "Don't assign until accessed without error"
cachedObject]].
[1] -> [anOop signedIntFromLong64 >> 3].
[2] -> [Character value: anOop >> 3].
[4] -> [objectMemory smallFloatValueOf: anOop] }
]
{ #category : #'object map' }
CurrentImageCoInterpreterFacadeFor64BitSpurObjectRepresentation >> oopForObject: o [
o isNumber
ifTrue:
[o isInteger
ifTrue:
[(o between: objectMemory minSmallInteger and: objectMemory maxSmallInteger) ifTrue:
[^objectMemory integerObjectOf: o asInteger]]
ifFalse:
[o isFloat ifTrue:
[(objectMemory isSmallFloatValue: o) ifTrue:
[^objectMemory smallFloatObjectOf: o]]]]
ifFalse:
[o isCharacter ifTrue:
[^objectMemory characterObjectOf: o asInteger]].
^objectMap at: o ifAbsentPut: [objectMap size * 8 + (1024 * 1024 * 1024 * 4)]
]
{ #category : #accessing }
CurrentImageCoInterpreterFacadeFor64BitSpurObjectRepresentation >> smallFloatExponentOffset [
^objectMemory smallFloatExponentOffset
]
{ #category : #accessing }
CurrentImageCoInterpreterFacadeFor64BitSpurObjectRepresentation >> smallFloatMantissaBits [
^objectMemory smallFloatMantissaBits
]
{ #category : #accessing }
CurrentImageCoInterpreterFacadeFor64BitSpurObjectRepresentation >> smallFloatTag [
^objectMemory smallFloatTag
]
{ #category : #accessing }
CurrentImageCoInterpreterFacadeFor64BitSpurObjectRepresentation >> specialObjectsArrayAddress [
^self addressForLabel: #specialObjectsOop
]