3 "{ NameSpace: Smalltalk }" |
3 "{ NameSpace: Smalltalk }" |
4 |
4 |
5 TestCase subclass:#CompiledCodeObjectTests |
5 TestCase subclass:#CompiledCodeObjectTests |
6 instanceVariableNames:'jitEnabled' |
6 instanceVariableNames:'jitEnabled' |
7 classVariableNames:'' |
7 classVariableNames:'' |
8 poolDictionaries:'CompiledCodeObjectSectionType' |
8 poolDictionaries:'CompiledCodeObjectSectionFormat' |
9 category:'System-Compiler-Interface' |
9 category:'System-Compiler-Interface' |
10 ! |
10 ! |
11 |
11 |
12 !CompiledCodeObjectTests class methodsFor:'documentation'! |
12 !CompiledCodeObjectTests class methodsFor:'documentation'! |
13 |
13 |
74 self ensureCompiled: #methodWithConstant. |
74 self ensureCompiled: #methodWithConstant. |
75 object := (self class >> #methodWithConstant) codeObject. |
75 object := (self class >> #methodWithConstant) codeObject. |
76 self assert: object compiledCode == (self class >> #methodWithConstant). |
76 self assert: object compiledCode == (self class >> #methodWithConstant). |
77 self assert: object sections size == 2. "/ No literals no ILC's, only code and special cells |
77 self assert: object sections size == 2. "/ No literals no ILC's, only code and special cells |
78 self assert: object sections first name = '.text'. |
78 self assert: object sections first name = '.text'. |
79 self assert: object sections first type = SectionTypeText. |
79 self assert: object sections first format = SectionFormatText. |
80 self assert: object sections second name = '.stx.codeobj.specialcells'. |
80 self assert: object sections second name = '.stx.codeobj.specialcells'. |
81 self assert: object sections second type = SectionTypeSCLs. |
81 self assert: object sections second format = SectionTypeINTVector. |
82 |
82 |
83 |
83 |
84 self ensureCompiled: #methodWithLiteral. |
84 self ensureCompiled: #methodWithLiteral. |
85 object := (self class >> #methodWithLiteral) codeObject. |
85 object := (self class >> #methodWithLiteral) codeObject. |
86 self assert: object sections size == 3. "/ No ILC's but literals, code and special cells |
86 self assert: object sections size == 3. "/ No ILC's but literals, code and special cells |
|
87 |
87 |
88 |
88 self ensureCompiled: #methodWithSend. |
89 self ensureCompiled: #methodWithSend. |
89 self assert: object sections size == 3. "/ No literals but ILC, code and special cells |
90 self assert: object sections size == 3. "/ No literals but ILC, code and special cells |
90 |
91 |
91 "Created: / 06-12-2015 / 00:15:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
92 "Created: / 06-12-2015 / 00:15:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |