-
Notifications
You must be signed in to change notification settings - Fork 68
/
VMSpurOldSpaceBootstrapTest.class.st
72 lines (53 loc) · 2.03 KB
/
VMSpurOldSpaceBootstrapTest.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
68
69
70
71
72
Class {
#name : #VMSpurOldSpaceBootstrapTest,
#superclass : #VMSpurMemoryManagerTest,
#category : #'VMMakerTests-MemoryTests'
}
{ #category : #'tests-memory-bootstrap' }
VMSpurOldSpaceBootstrapTest >> testClassTableHasTablePagesAndHiddenRoots [
| tableRoot |
memory nilObject: self newZeroSizedObject.
memory falseObject: self newZeroSizedObject.
memory trueObject: self newZeroSizedObject.
"Initialize old space with free list, class table, hidden roots and remembered set to be able to scavenge"
memory initializeFreeList.
memory segmentManager collapseSegmentsPostSwizzle.
memory segmentManager plantBridgeAtTheEndOfMemory.
memory segmentManager assertBridge.
memory updateFreeLists.
memory computeFreeSpacePostSwizzle.
memory initializeOldSpaceFirstFree: memory freeOldSpaceStart.
tableRoot := memory allocateClassTable.
self
assert: (memory numSlotsOf: tableRoot)
equals: memory classTableRootSlots + memory hiddenRootSlots
]
{ #category : #'tests-memory-bootstrap' }
VMSpurOldSpaceBootstrapTest >> testFreeListHasAsManySlotsAsRequiredByTheVM [
| freeListOop |
freeListOop := memory initializeFreeList.
self assert: (memory numSlotsOf: freeListOop) equals: memory numFreeLists
]
{ #category : #'tests-memory-bootstrap' }
VMSpurOldSpaceBootstrapTest >> testFreeListIsWordIndexable [
| freeListOop |
freeListOop := memory initializeFreeList.
self assert: (memory formatOf: freeListOop) equals: memory wordIndexableFormat
]
{ #category : #'tests-memory-bootstrap' }
VMSpurOldSpaceBootstrapTest >> testNewFreeListHasAllSlotsInitializedInZero [
| freeListOop |
freeListOop := memory initializeFreeList.
0 to: memory numFreeLists - 1 do: [ :i |
self assert: (memory fetchPointer: i ofObject: freeListOop) equals: 0 ]
]
{ #category : #'tests-memory-bootstrap' }
VMSpurOldSpaceBootstrapTest >> testNewFreeListIsValid [
memory initializeFreeList.
memory validFreeTree
]
{ #category : #'tests-memory-bootstrap' }
VMSpurOldSpaceBootstrapTest >> testNewFreeListIsValid2 [
memory initializeFreeList.
memory totalFreeListBytes
]