2014-10-17 13:28 GMT+02:00 Marcus Denker <[email protected]>:

>
> --
> Marcus Denker
> Sent with Airmail
>
> On 17 Oct 2014 at 12:46:20, Nicolai Hess ([email protected]) wrote:
>
>    I ran some testcases with your changes and I expect some test
> are failing now, but actually they don't fail but others do.
>
>
>
> Yes, but I think these tests are wrong.
> (needs to be carefully checked).
>
>

Ok, some checks:

OCASTCheckerTest

testSemanticAnalysisOnNonMethodNode
is this a testcase? what does it test?


testNoRemoteBlockArgument
testNoRemoteBlockTemp
both look similiar.

testsingleRemoteTempVarWhileWithTempNotInlined
I would add assertions for the  "temp" var

the others look fine.


OCASTClosureAnalyzerTest

testOptimizedBlockWriteInNestedBlockCase2:
the testmethos like
(OCOpalExamples>>#optimizedBlockWriteInNestedBlockCase2) arent
supposed to be runnable code, but I would change the "(true)whileTrue:" to
-> "[true] whileTrue:" anyway.

testOptimizedBlockWriteInNestedBlockCase3
look at the comment for :
self assert: ast scope copiedVars size = 1. "Is this correct, I think that
the copied vars should be empty."

I think the number of copiedVars is right, because there is a outer block.

the same for testOptimizedBlockWriteInNestedBlockCase4, the whileTrue is
inside of a block.

in testOptimizedBlockWrittenAfterClosedOverCase1
there is a comment
    "problem: as block is optimized, this var does not need to be remote"
    self assert: (scopes third tempVector at: 'temp') isRemote.
But I think this is correct, the temp var is within a block

the others look fine.

Changing the method visitVariableNode: and lookupVariableForWrite:
makes these tests failing:

testOptimizedBlockWrittenAfterClosedOverCase1 it fails in
self deny: (ast scope lookupVar: 'index') isEscaping.
I think the test is right, the var index is only used within the whileTrue
block.

the same for
testOptimizedBlockWrittenAfterClosedOverCase2

testExampleSimpleBlockLocalWhile fails, I think the test is right, but I am
not sure.

testOptimizedBlockWriteInBlock fails in
self assert: ast scope tempVars size = 1.
But I think the test is right, there is only one local var, and it is
written only
in the whileTrue:[block]

the same in testOptimizedBlockWriteInNestedBlockCase2, allthough the
whileTrue: is
in another ifTrue:[] block

the same for the other failing tests.

Reply via email to