[squeak-dev] The Trunk: EToys-tfel.225.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Aug 31 13:14:20 UTC 2016
Tim Felgentreff uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-tfel.225.mcz
==================== Summary ====================
Name: EToys-tfel.225
Author: tfel
Time: 31 August 2016, 3:13:09.554793 pm
UUID: b4c31ceb-3ed5-ba40-a351-1672deafcacd
Ancestors: EToys-tfel.224
if any subnode of a message node sends a sequential selector, we need to make the node itself sequential, too
=============== Diff against EToys-tfel.224 ===============
Item was changed:
----- Method: KedamaExamplerPlayer>>containsSequentialSelector: (in category '*Etoys-Squeakland-private') -----
containsSequentialSelector: aSymbol
+ ^ (#(random random: atRandom) includes: aSymbol)!
- ^ (#(random random:) includes: aSymbol)!
Item was changed:
----- Method: KedamaTurtleMethodAttributionDefinition2 class>>determineStatementType:fromDict:primaryBreedPair:messageType:isStatement:receiverObject: (in category 'rules') -----
determineStatementType: parentStmtType fromDict: dict primaryBreedPair: myPrimaryBreedPair messageType: myMessageType isStatement: myIsStatement receiverObject: myReceiverObject
| vectorTurtle turtleSelectors participants reads writes unknownReceiverSelectors |
"Do the calculation only at the statement level."
myIsStatement ifFalse: [^ parentStmtType].
"If there is a doSequentially: block, the block is sequential."
participants := dict at: self.
(participants select: [:e | (e first notNil and: [e first isPrototypeTurtlePlayer])]) size = 0 ifTrue: [^ #none].
myMessageType = #sequential ifTrue: [^ #sequential].
parentStmtType = #sequential ifTrue: [^ #sequential].
"If there is not turtle involved in the statement, it is not transformed."
myPrimaryBreedPair ifNil: [^ #none].
vectorTurtle := myPrimaryBreedPair first.
myMessageType = #condition ifTrue: [
reads := IdentitySet new.
writes := IdentitySet new.
participants do: [:list |
(((list at: 5) = #testBody or: [(list at: 5) = #testCond]) and: [(list at: 4) ~= #read]) ifTrue: [list first ifNotNil: [writes add: list first]].
(((list at: 5) = #testBody or: [(list at: 5) = #testCond]) and: [(list at: 4) = #read]) ifTrue: [list first ifNotNil: [reads add: list first]].
].
((writes
intersection: reads)
copyWithout: vectorTurtle) ifNotEmpty: [
^ #sequential
].
^ #parallel.
].
reads := IdentitySet new.
writes := IdentitySet new.
turtleSelectors := OrderedCollection new.
unknownReceiverSelectors := OrderedCollection new.
participants do: [:list |
list first = vectorTurtle ifTrue: [
((vectorTurtle isBreedSelector: list second) or: [
(vectorTurtle isUserDefinedSelector: list second)]) ifFalse: [
turtleSelectors add: list second
].
].
list first
ifNil: [unknownReceiverSelectors add: list second]
ifNotNil: [
((list at: 4) == #read) ifTrue: [reads add: list first].
((list at: 4) == #read) ifFalse: [writes add: list first].
].
(vectorTurtle containsSequentialSelector: list second) ifTrue: [^ #sequential].
].
(turtleSelectors includes: #die) ifTrue: [^ #die].
(((self isKindOf: AssignmentNode) and: [myReceiverObject = vectorTurtle])
and: [vectorTurtle isBreedSelector: self property property]) ifTrue: [^ #none].
(vectorTurtle areOkaySelectors: unknownReceiverSelectors) ifFalse: [
^ #sequential.
].
(vectorTurtle vectorizableTheseSelectors: turtleSelectors) ifFalse: [^ #sequential].
((reads intersection: writes) copyWithout: vectorTurtle) ifNotEmpty: [^ #sequential].
+
+ "Check the hard way. If any leaf nodes"
+ self nodesDo: [:node |
+ (node isMessageNode and: [vectorTurtle containsSequentialSelector: node selector])
+ ifTrue: [^ #sequential]].
+
^ #parallel.
!
Item was changed:
----- Method: MessageAsTempNode>>determineStatementType:fromDict:primaryBreedPair:messageType:isStatement:receiverObject: (in category '*Etoys-Tweak-Kedama-Generated') -----
determineStatementType: t1 fromDict: t2 primaryBreedPair: t3 messageType: t4 isStatement: t5 receiverObject: t6
| t7 t8 t9 t10 t11 t13 |
t5
ifFalse: [^ t1].
t9 := t2 at: self.
(t9
select: [:t14 | t14 first notNil
and: [t14 first isPrototypeTurtlePlayer]]) size = 0
ifTrue: [^ #none].
t4 = #sequential
ifTrue: [^ #sequential].
t1 = #sequential
ifTrue: [^ #sequential].
t3
ifNil: [^ #none].
t7 := t3 first.
t4 = #condition
ifTrue: [t11 := IdentitySet new.
t13 := IdentitySet new.
t9
do: [:t14 |
(((t14 at: 5)
= #testBody
or: [(t14 at: 5)
= #testCond])
and: [(t14 at: 4)
~= #read])
ifTrue: [t14 first
ifNotNil: [t13 add: t14 first]].
(((t14 at: 5)
= #testBody
or: [(t14 at: 5)
= #testCond])
and: [(t14 at: 4)
= #read])
ifTrue: [t14 first
ifNotNil: [t11 add: t14 first]]].
((t13 intersection: t11)
copyWithout: t7)
ifNotEmpty: [^ #sequential].
^ #parallel].
t11 := IdentitySet new.
t13 := IdentitySet new.
t8 := OrderedCollection new.
t10 := OrderedCollection new.
t9
do: [:t14 |
t14 first = t7
ifTrue: [((t7 isBreedSelector: t14 second)
or: [t7 isUserDefinedSelector: t14 second])
ifFalse: [t8 add: t14 second]].
t14 first
ifNil: [t10 add: t14 second]
ifNotNil: [(t14 at: 4)
== #read
ifTrue: [t11 add: t14 first].
(t14 at: 4)
== #read
ifFalse: [t13 add: t14 first]].
(t7 containsSequentialSelector: t14 second)
ifTrue: [^ #sequential]].
(t8 includes: #die)
ifTrue: [^ #die].
(((self isKindOf: AssignmentNode)
and: [t6 = t7])
and: [t7 isBreedSelector: self property property])
ifTrue: [^ #none].
(t7 areOkaySelectors: t10)
ifFalse: [^ #sequential].
(t7 vectorizableTheseSelectors: t8)
ifFalse: [^ #sequential].
((t11 intersection: t13)
copyWithout: t7)
ifNotEmpty: [^ #sequential].
+ self
+ nodesDo: [:t14 | (t14 isLeaf
+ and: [t7 containsSequentialSelector: t14 key])
+ ifTrue: [^ #sequential]].
^ #parallel!
Item was changed:
----- Method: MessageNode>>determineStatementType:fromDict:primaryBreedPair:messageType:isStatement:receiverObject: (in category '*Etoys-Tweak-Kedama-Generated') -----
determineStatementType: t1 fromDict: t2 primaryBreedPair: t3 messageType: t4 isStatement: t5 receiverObject: t6
| t7 t8 t9 t10 t11 t13 |
t5
ifFalse: [^ t1].
t9 := t2 at: self.
(t9
select: [:t14 | t14 first notNil
and: [t14 first isPrototypeTurtlePlayer]]) size = 0
ifTrue: [^ #none].
t4 = #sequential
ifTrue: [^ #sequential].
t1 = #sequential
ifTrue: [^ #sequential].
t3
ifNil: [^ #none].
t7 := t3 first.
t4 = #condition
ifTrue: [t11 := IdentitySet new.
t13 := IdentitySet new.
t9
do: [:t14 |
(((t14 at: 5)
= #testBody
or: [(t14 at: 5)
= #testCond])
and: [(t14 at: 4)
~= #read])
ifTrue: [t14 first
ifNotNil: [t13 add: t14 first]].
(((t14 at: 5)
= #testBody
or: [(t14 at: 5)
= #testCond])
and: [(t14 at: 4)
= #read])
ifTrue: [t14 first
ifNotNil: [t11 add: t14 first]]].
((t13 intersection: t11)
copyWithout: t7)
ifNotEmpty: [^ #sequential].
^ #parallel].
t11 := IdentitySet new.
t13 := IdentitySet new.
t8 := OrderedCollection new.
t10 := OrderedCollection new.
t9
do: [:t14 |
t14 first = t7
ifTrue: [((t7 isBreedSelector: t14 second)
or: [t7 isUserDefinedSelector: t14 second])
ifFalse: [t8 add: t14 second]].
t14 first
ifNil: [t10 add: t14 second]
ifNotNil: [(t14 at: 4)
== #read
ifTrue: [t11 add: t14 first].
(t14 at: 4)
== #read
ifFalse: [t13 add: t14 first]].
(t7 containsSequentialSelector: t14 second)
ifTrue: [^ #sequential]].
(t8 includes: #die)
ifTrue: [^ #die].
(((self isKindOf: AssignmentNode)
and: [t6 = t7])
and: [t7 isBreedSelector: self property property])
ifTrue: [^ #none].
(t7 areOkaySelectors: t10)
ifFalse: [^ #sequential].
(t7 vectorizableTheseSelectors: t8)
ifFalse: [^ #sequential].
((t11 intersection: t13)
copyWithout: t7)
ifNotEmpty: [^ #sequential].
+ self
+ nodesDo: [:t14 | (t14 isLeaf
+ and: [t7 containsSequentialSelector: t14 key])
+ ifTrue: [^ #sequential]].
^ #parallel!
More information about the Squeak-dev
mailing list
|