On Sat, Jan 16, 2010 at 8:14 AM, Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com> wrote:
Then blockExtentsToTempsMap values are Arrays of pairs, not exactly
what expected by the test...

The keys are ranges, the values are arrays of arrays of name, index, e.g.
a Dictionary(
�� � � � (0 to: 6)->#(#('thisValue' 1) #('binaryBlock' 2) #('nextValue' #(3 1)))
�� � � �(2 to: 4)->#(#('each' 1) #('binaryBlock' 2) #('nextValue' #(3 1))) )�

so�
self assert: tempRefs keys = method startpcsToBlockExtents values asSet.
needs to become
self assert: tempRefs keys asSet = method startpcsToBlockExtents values asSet.
if keys no longer returns a set.

Here's the (working) test in my image:

testBlockNumberingForInjectInto
"Test that the compiler and CompiledMethod agree on the block numbering of Collection>>inject:into:
and that temp names for inject:into: are recorded."
"self new testBlockNumberingForInjectInto"
| methodNode method tempRefs |
methodNode := Parser new
encoderClass: EncoderForV3PlusClosures;
parse: (Collection sourceCodeAt: #inject:into:)
class: Collection.
method := methodNode generate: #(0 0 0 0).
tempRefs := methodNode encoder blockExtentsToTempsMap.
self assert: tempRefs keys = method startpcsToBlockExtents values asSet.
self assert: ((tempRefs includesKey: (0 to: 6))
and: [(tempRefs at: (0 to: 6)) hasEqualElements: #(('thisValue' 1) ('binaryBlock' 2) ('nextValue' (3 1)))]).
self assert: ((tempRefs includesKey: (2 to: 4))
and: [(tempRefs at: (2 to: 4)) hasEqualElements: #(('each' 1) ('binaryBlock' 2) ('nextValue' (3 1)))])


Nicolas

2010/1/16 Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com>:
> Correct message is blockExtentsToTempsMap rather than blockExtentsToTempRefs
>
> But then, method still fails because keys does not answer a Set
> anymore. Use keys asSet.
>
> Nicolas
>
> 2010/1/16 Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com>:
>> The test is incompatible with new CompiledMethod trailer
>> Use generate rather than generate: #(0 0 0 0)
>>
>> Then the method still fails because sending unimplemented
>> #blockExtentsToTempRefs
>>
>> same for testBlockNumberingForInjectInto testTempNameAccessForInjectInto
>>
>> Nicolas
>>
>

_______________________________________________
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project