[squeak-dev] The Trunk: KernelTests-codefrau.395.mcz

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Wed Apr 7 14:55:03 UTC 2021


The reason appears to be that CompiledCode >> #hash takes the receiver class into consideration whereas CompiledCode >> #= doesn't.

So what behavior do we actually want?

If you remove the "+ self methodClass hash" from CompiledCode >> #hash, #testHash fails in the last statement instead because there are too many double hashes.

Should we respect the methodClass in CompiledCode >> #= as well?

I think this could actually make sense because the byte codes for inst var access are only meaningful in combination with the definition of the receiver class.

Opinions? :-)


Best,

Christoph

________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Vanessa Freudenberg <vanessa at codefrau.net>
Gesendet: Montag, 5. April 2021 23:37:55
An: The general-purpose Squeak developers list
Cc: packages at lists.squeakfoundation.org
Betreff: Re: [squeak-dev] The Trunk: KernelTests-codefrau.395.mcz

Btw, I only fixed the test.

Which makes the test fail in trunk.

Eliot must have had a reason to create the test so Someone™️ should probably look at that. I probably don't have time for that soon.

- Vanessa -

On Sat, Apr 3, 2021 at 12:06 PM <commits at source.squeak.org<mailto:commits at source.squeak.org>> wrote:
Vanessa Freudenberg uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-codefrau.395.mcz

==================== Summary ====================

Name: KernelTests-codefrau.395
Author: codefrau
Time: 3 April 2021, 12:06:03.17026 pm
UUID: 062e8b73-a62e-46ce-af80-0dbb34c2f8dc
Ancestors: KernelTests-mt.394

Fix typo in CompiledMethodComparisonTest.

=============== Diff against KernelTests-mt.394 ===============

Item was changed:
  ----- Method: CompiledMethodComparisonTest>>testHash (in category 'tests') -----
  testHash
        <timeout: 120>

        | ai |
        ai := CompiledMethod allInstances.
        "We assume here that if two CompiledMethods are equal then they have the same size and header."
        (ai groupBy: [ :method | { method size. method header } ]) values
                replace: [ :each | each asArray ];
                do: [ :methods |
                        1 to: methods size do: [ :i |
                                i to: methods size do: [ :j |
                                        (methods at: i) = (methods at: j) ifTrue: [
+                                               self assert: (methods at: i) hash equals: (methods at: j) hash ] ] ] ]
-                                               self assert: (methods at: i) hash equals: (methods at: i) hash ] ] ] ]
                displayingProgress: 'Testing hashes'.
        self assert: (ai collect: [ :cm | cm hash ] as: Set) size * 2 >= ai asSet size!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210407/b3679eaa/attachment.html>


More information about the Squeak-dev mailing list