71 |
71 |
72 test_01 |
72 test_01 |
73 | object | |
73 | object | |
74 self ensureCompiled: #methodWithConstant. |
74 self ensureCompiled: #methodWithConstant. |
75 object := (self class >> #methodWithConstant) codeObject. |
75 object := (self class >> #methodWithConstant) codeObject. |
76 self assert: object methodOrBlock == (self class >> #methodWithConstant). |
76 self assert: object compiledCode == (self class >> #methodWithConstant). |
77 self assert: object sections size == 1. "/ No literals no ILC's |
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 type = SectionTypeText. |
|
80 self assert: object sections second name = '.stx.codeobj.specialcells'. |
|
81 self assert: object sections second type = SectionTypeSCLs. |
80 |
82 |
81 |
83 |
82 self ensureCompiled: #methodWithLiteral. |
84 self ensureCompiled: #methodWithLiteral. |
83 object := (self class >> #methodWithLiteral) codeObject. |
85 object := (self class >> #methodWithLiteral) codeObject. |
84 self assert: object sections size == 2. "/ No ILC's but literals |
86 self assert: object sections size == 3. "/ No ILC's but literals, code and special cells |
85 |
87 |
86 self ensureCompiled: #methodWithSend. |
88 self ensureCompiled: #methodWithSend. |
87 self assert: object sections size == 2. "/ No literals but ILC |
89 self assert: object sections size == 3. "/ No literals but ILC, code and special cells |
88 |
90 |
89 "Created: / 06-12-2015 / 00:15:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
91 "Created: / 06-12-2015 / 00:15:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
90 "Modified: / 11-12-2015 / 10:07:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
92 "Modified: / 11-01-2016 / 09:54:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
91 ! ! |
93 ! ! |
92 |
94 |
93 !CompiledCodeObjectTests methodsFor:'utilities'! |
95 !CompiledCodeObjectTests methodsFor:'utilities'! |
94 |
96 |
95 ensureCompiled: selector |
97 ensureCompiled: selector |