Tim Felgentreff uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-tfel.265.mcz ==================== Summary ==================== Name: EToys-tfel.265 Author: tfel Time: 30 September 2016, 10:40:09.643046 am UUID: bc1d4833-2a0a-e64f-8cbd-b63fc582cdd5 Ancestors: EToys-tfel.264 - remove the old KedamaVectorizer class - remove all autogenerated methods - make it so that any user defined script call to a turtle forces the surrounding conditionals be sequentially executed. this can be optimized further, but considering we'll rewrite this entire thing anyway, it might not be worth it right now. =============== Diff against EToys-tfel.264 =============== Item was removed: - ----- Method: AssignmentNode>>assignmentMsgType (in category '*Etoys-Tweak-Kedama-Generated') ----- - assignmentMsgType - ^ #assignment! Item was removed: - ----- Method: AssignmentNode>>defaultBlockType: (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultBlockType: t1 - ^ #default! Item was removed: - ----- Method: AssignmentNode>>defaultMessageType (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultMessageType - ^ #none! Item was removed: - ----- Method: AssignmentNode>>firstInReceivers: (in category '*Etoys-Tweak-Kedama-Generated') ----- - firstInReceivers: t1 - ^ t1 first! Item was removed: - ----- Method: AssignmentNode>>isStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isStmt: t1 - ^ t1 = #top - or: [t1 = #condition]! Item was removed: - ----- Method: AssignmentNode>>isTest:parentNode: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTest: t1 parentNode: t2 - t1 = true - ifTrue: [^ true]. - ^ (t2 isMemberOf: MessageNode) - and: [t2 receiver = self - and: [t2 messageType value = #condition]]! Item was removed: - ----- Method: AssignmentNode>>isTopStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTopStmt: t1 - t1 = nil - ifTrue: [^ true]. - ^ false! Item was removed: - ----- Method: AssignmentNode>>rcvr: (in category '*Etoys-Tweak-Kedama-Generated') ----- - rcvr: t1 - ^ t1! Item was removed: - ----- Method: AssignmentNode>>thisNode (in category '*Etoys-Tweak-Kedama-Generated') ----- - thisNode - ^ self! Item was removed: - ----- Method: AssignmentNode>>transfer: (in category '*Etoys-Tweak-Kedama-Generated') ----- - transfer: t1 - ^ t1! Item was removed: - ----- Method: BlockNode>>blockRewriteInfo:statementType:primaryBreedPair: (in category '*Etoys-Tweak-Kedama-Generated') ----- - blockRewriteInfo: t1 statementType: t2 primaryBreedPair: t3 - (#(#parallel #sequential #die ) includes: t2) - ifFalse: [^ t1]. - t3 - ifNil: [^ t1]. - ^ Array with: t3 first with: 'var' , t3 first identityHash printString , self identityHash printString! Item was removed: - ----- Method: BlockNode>>blockType:parentMessageType: (in category '*Etoys-Tweak-Kedama-Generated') ----- - blockType: t1 parentMessageType: t2 - t1 = #none - ifTrue: [^ #top]. - t2 = #condition - ifTrue: [^ #condition]. - t2 = #sequential - ifTrue: [^ #sequential]. - ^ #default! Item was removed: - ----- Method: BlockNode>>defaultBlockType: (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultBlockType: t1 - ^ #default! Item was removed: - ----- Method: BlockNode>>defaultMessageType (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultMessageType - ^ #none! Item was removed: - ----- Method: BlockNode>>firstInReceivers: (in category '*Etoys-Tweak-Kedama-Generated') ----- - firstInReceivers: t1 - ^ t1 first! Item was removed: - ----- Method: BlockNode>>initialNil (in category '*Etoys-Tweak-Kedama-Generated') ----- - initialNil - ^ nil! Item was removed: - ----- Method: BlockNode>>isStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isStmt: t1 - ^ t1 = #top - or: [t1 = #condition]! Item was removed: - ----- Method: BlockNode>>isTest:parentNode: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTest: t1 parentNode: t2 - t1 = true - ifTrue: [^ true]. - ^ (t2 isMemberOf: MessageNode) - and: [t2 receiver = self - and: [t2 messageType value = #condition]]! Item was removed: - ----- Method: BlockNode>>isTopStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTopStmt: t1 - t1 = nil - ifTrue: [^ true]. - ^ false! Item was removed: - ----- Method: BlockNode>>isTopStmtForBlock: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTopStmtForBlock: t1 - t1 = nil - ifTrue: [^ nil]. - ^ false! Item was removed: - ----- Method: BlockNode>>rcvr: (in category '*Etoys-Tweak-Kedama-Generated') ----- - rcvr: t1 - ^ t1! Item was removed: - ----- Method: BlockNode>>thisNode (in category '*Etoys-Tweak-Kedama-Generated') ----- - thisNode - ^ self! Item was removed: - ----- Method: BlockNode>>transfer: (in category '*Etoys-Tweak-Kedama-Generated') ----- - transfer: t1 - ^ t1! Item was removed: - ----- Method: BraceNode>>defaultBlockType: (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultBlockType: t1 - ^ #default! Item was removed: - ----- Method: BraceNode>>defaultMessageType (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultMessageType - ^ #none! Item was removed: - ----- Method: BraceNode>>firstInReceivers: (in category '*Etoys-Tweak-Kedama-Generated') ----- - firstInReceivers: t1 - ^ t1 first! Item was removed: - ----- Method: BraceNode>>isStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isStmt: t1 - ^ t1 = #top - or: [t1 = #condition]! Item was removed: - ----- Method: BraceNode>>isTest:parentNode: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTest: t1 parentNode: t2 - t1 = true - ifTrue: [^ true]. - ^ (t2 isMemberOf: MessageNode) - and: [t2 receiver = self - and: [t2 messageType value = #condition]]! Item was removed: - ----- Method: BraceNode>>isTopStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTopStmt: t1 - t1 = nil - ifTrue: [^ true]. - ^ false! Item was removed: - ----- Method: BraceNode>>rcvr: (in category '*Etoys-Tweak-Kedama-Generated') ----- - rcvr: t1 - ^ t1! Item was removed: - ----- Method: BraceNode>>thisNode (in category '*Etoys-Tweak-Kedama-Generated') ----- - thisNode - ^ self! Item was removed: - ----- Method: BraceNode>>transfer: (in category '*Etoys-Tweak-Kedama-Generated') ----- - transfer: t1 - ^ t1! Item was removed: - ----- Method: CascadeNode>>defaultBlockType: (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultBlockType: t1 - ^ #default! Item was removed: - ----- Method: CascadeNode>>defaultMessageType (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultMessageType - ^ #none! Item was removed: - ----- Method: CascadeNode>>firstInReceivers: (in category '*Etoys-Tweak-Kedama-Generated') ----- - firstInReceivers: t1 - ^ t1 first! Item was removed: - ----- Method: CascadeNode>>isStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isStmt: t1 - ^ t1 = #top - or: [t1 = #condition]! Item was removed: - ----- Method: CascadeNode>>isTest:parentNode: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTest: t1 parentNode: t2 - t1 = true - ifTrue: [^ true]. - ^ (t2 isMemberOf: MessageNode) - and: [t2 receiver = self - and: [t2 messageType value = #condition]]! Item was removed: - ----- Method: CascadeNode>>isTopStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTopStmt: t1 - t1 = nil - ifTrue: [^ true]. - ^ false! Item was removed: - ----- Method: CascadeNode>>rcvr: (in category '*Etoys-Tweak-Kedama-Generated') ----- - rcvr: t1 - ^ t1! Item was removed: - ----- Method: CascadeNode>>thisNode (in category '*Etoys-Tweak-Kedama-Generated') ----- - thisNode - ^ self! Item was removed: - ----- Method: CascadeNode>>transfer: (in category '*Etoys-Tweak-Kedama-Generated') ----- - transfer: t1 - ^ t1! Item was removed: - ----- Method: CommentNode>>defaultBlockType: (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultBlockType: t1 - ^ #default! Item was removed: - ----- Method: CommentNode>>defaultMessageType (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultMessageType - ^ #none! Item was removed: - ----- Method: CommentNode>>firstInReceivers: (in category '*Etoys-Tweak-Kedama-Generated') ----- - firstInReceivers: t1 - ^ t1 first! Item was removed: - ----- Method: CommentNode>>isStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isStmt: t1 - ^ t1 = #top - or: [t1 = #condition]! Item was removed: - ----- Method: CommentNode>>isTest:parentNode: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTest: t1 parentNode: t2 - t1 = true - ifTrue: [^ true]. - ^ (t2 isMemberOf: MessageNode) - and: [t2 receiver = self - and: [t2 messageType value = #condition]]! Item was removed: - ----- Method: CommentNode>>isTopStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTopStmt: t1 - t1 = nil - ifTrue: [^ true]. - ^ false! Item was removed: - ----- Method: CommentNode>>rcvr: (in category '*Etoys-Tweak-Kedama-Generated') ----- - rcvr: t1 - ^ t1! Item was removed: - ----- Method: CommentNode>>thisNode (in category '*Etoys-Tweak-Kedama-Generated') ----- - thisNode - ^ self! Item was removed: - ----- Method: CommentNode>>transfer: (in category '*Etoys-Tweak-Kedama-Generated') ----- - transfer: t1 - ^ t1! Item was changed: ----- Method: KedamaAttributeEvaluator class>>clearGeneratedMethodsFrom: (in category 'as yet unclassified') ----- clearGeneratedMethodsFrom: rootClass " self clearGeneratedMethodsFrom: ParseNode " (rootClass allSubclasses copyWith: rootClass) do: [:cls | + #('*Autogenerated-Kedama' '*Autogenerated-Kedama-accessing') do: [:cat | - #('*Etoys-Tweak-Kedama-Generated' '*Etoys-Tweak-Kedama-accessing') do: [:cat | (cls organization listAtCategoryNamed: cat) do: [:sel | cls removeSelectorSilently: sel. ] ]. ]. "(ParseNode organization listAtCategoryNamed: 'accessing') do: [:sel | ParseNode removeSelectorSilently: sel ]. " ! Item was changed: ----- Method: KedamaAttributeEvaluator>>compileEvaluator (in category 'actions') ----- compileEvaluator | meth | semanticRules associationsDo: [:assoc | assoc value do: [:rule | meth := rule ruleText. Debug == true ifTrue: [ Transcript show: assoc key name; cr; show: meth; cr. ]. + assoc key compileSilently: meth classified: '*Autogenerated-Kedama'. - assoc key compileSilently: meth classified: '*Etoys-Tweak-Kedama-Generated'. ]. ]. ! Item was changed: ----- Method: KedamaAttributeEvaluator>>generateInstVarAndAccessor:forGrammarClass: (in category 'private') ----- generateInstVarAndAccessor: attrName forGrammarClass: grammarClass | newMessage | newMessage := attrName, ' "Answer the value of ', attrName, '" ^ (KedamaEvaluatorNodeState stateFor: self at: #', attrName, ') value'. + grammarClass compileSilently: newMessage classified: '*Autogenerated-Kedama-accessing' notifying: nil. - grammarClass compileSilently: newMessage classified: '*Etoys-Tweak-Kedama-accessing' notifying: nil. newMessage := 'raw', attrName, ' "Answer the value of ', attrName, '" ^ KedamaEvaluatorNodeState stateFor: self at: #', attrName. + grammarClass compileSilently: newMessage classified: '*Autogenerated-Kedama-accessing' notifying: nil. - grammarClass compileSilently: newMessage classified: '*Etoys-Tweak-Kedama-accessing' notifying: nil. newMessage := attrName, ':', ' anObject "Set the value of ', attrName, '" KedamaEvaluatorNodeState stateFor: self at: #', attrName, ' put: anObject'. + grammarClass compileSilently: newMessage classified: '*Autogenerated-Kedama-accessing' notifying: nil - grammarClass compileSilently: newMessage classified: '*Etoys-Tweak-Kedama-accessing' notifying: nil ! Item was changed: ----- Method: KedamaExamplerPlayer>>copyAllMethodsAgain2 (in category '*Etoys-Squeakland-debug support') ----- copyAllMethodsAgain2 | c result | c := turtles class. result := (ClassBuilder new) name: c name inEnvironment: c environment subclassOf: c superclass type: c typeOfClass instanceVariableNames: KedamaTurtleVectorPlayer2 instanceVariablesString classVariableNames: KedamaTurtleVectorPlayer2 classVariablesString poolDictionaries: KedamaTurtleVectorPlayer2 sharedPoolsString category: Object categoryForUniclasses. turtles class copyAllCategoriesUnobtrusivelyFrom: KedamaTurtleVectorPlayer2. sequentialStub ifNotNil: [sequentialStub class copyAllCategoriesUnobtrusivelyFrom: KedamaSequenceExecutionStub]. self flag: #todo. self flag: #uniclasses. "Discuss if we really want to hide uniclasses again" + c superclass environment forgetClass: result logged: false. - result environment forgetClass: result logged: false. c superclass removeSubclass: result. ! Item was added: + ----- Method: KedamaExamplerPlayer>>selectorIncludesSequentialCommand: (in category '*Etoys-Squeakland-testing') ----- + selectorIncludesSequentialCommand: aSymbol + + self flag: #todo. "for now we go sequential for any user defined script" + ^ self class scripts includesKey: aSymbol "(self class sourceCodeAt: aSymbol) + includesSubstring: 'doSequentialCommand:'"! 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 first = vectorTurtle) and: [list fifth = #testBody and: [list fourth isNil and: [ + vectorTurtle selectorIncludesSequentialCommand: list second]]]) + ifTrue: [^ #sequential]. + (((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]]. - (((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. - 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 removed: - Object subclass: #KedamaVectorizer - instanceVariableNames: 'attributes root' - classVariableNames: '' - poolDictionaries: '' - category: 'Etoys-StarSqueak'! Item was removed: - ----- Method: KedamaVectorizer>>checkFirstPairFor:in: (in category 'private') ----- - checkFirstPairFor: stmt in: obj - - ^ self checkRequireVectorIn: stmt for: obj. - " - - | receiver selector ret | - receiver := Compiler evaluate: (self getReceiverFromStatement: stmt) name for: obj logged: false. - selector := (self getSelectorFromStatement: stmt) key. - ret := self isVectorizationRequiredWithPlayer: receiver andSelector: selector. - attributes setAttribute: #firstTurtle of: stmt to: receiver. - attributes setAttribute: #requireVector of: stmt to: ret. - ^ ret. - "! Item was removed: - ----- Method: KedamaVectorizer>>checkRequireVectorIn:for: (in category 'private') ----- - checkRequireVectorIn: aMessageNode for: obj - - | players playersSet playerNodes | - "self halt." - playerNodes := self getAllPlayersIn: aMessageNode for: obj. - players := playerNodes collect: [:e | Compiler evaluate: e name for: obj.]. - playersSet := players asSet. - (playersSet select: [:e | e isPrototypeTurtlePlayer]) size = 0 ifTrue: [ - attributes setAttribute: #firstTurtle of: aMessageNode to: (Compiler evaluate: playerNodes first name for: obj). - attributes setAttribute: #requireVector of: aMessageNode to: false. - ^ self. - ]. - (playersSet select: [:e | e isPrototypeTurtlePlayer]) size > 0 ifTrue: [ - playerNodes with: players do: [:n :p | | sel | - p isPrototypeTurtlePlayer ifTrue: [ - sel := self getSelectorRootFor: p fromMessageNode: aMessageNode for: obj ignoreSelectors: #(beNotZero: setTurtleCount: getTurtleCount setGrouped: getGrouped). - sel ifNotNil: [ - (self isVectorizationRequiredWithPlayer: p andSelector: sel) ifTrue: [ - attributes setAttribute: #requireVector of: aMessageNode to: true. - attributes setAttribute: #firstTurtle of: aMessageNode to: p. - attributes setAttribute: #firstNode of: aMessageNode to: n. - ^ self. - ]. - ]. - ]. - ]. - ]. - - attributes setAttribute: #firstTurtle of: aMessageNode to: players first. - attributes setAttribute: #requireVector of: aMessageNode to: false. - ! Item was removed: - ----- Method: KedamaVectorizer>>getAllPlayersIn:for: (in category 'player and selector look up') ----- - getAllPlayersIn: aMessageNode for: obj - - | aCollection | - aCollection := OrderedCollection new. - self getPlayersMessage: aMessageNode for: obj into: aCollection. - ^ aCollection. - ! Item was removed: - ----- Method: KedamaVectorizer>>getAllPlayersInMethodNode:for: (in category 'player and selector look up') ----- - getAllPlayersInMethodNode: aMethodNode for: obj - - | aCollection | - aCollection := OrderedCollection new. - aMethodNode block statements do: [:stmt | - (stmt isMemberOf: MessageNode) ifTrue: [ - self getPlayersMessage: stmt for: obj into: aCollection. - ]. - (stmt isMemberOf: BlockNode) ifTrue: [ - self getPlayersBlock: stmt for: obj into: aCollection. - ]. - ]. - ^ aCollection. - ! Item was removed: - ----- Method: KedamaVectorizer>>getPlayersBlock:for:into: (in category 'player and selector look up') ----- - getPlayersBlock: aBlockNode for: obj into: aCollection - - - | statements | - statements := aBlockNode statements. - statements do: [:stmt | - (stmt isMemberOf: MessageNode) ifTrue: [ - self getPlayersMessage: stmt for: obj into: aCollection. - ]. - (stmt isMemberOf: BlockNode) ifTrue: [ - self getPlayersBlock: stmt for: obj into: aCollection.. - ]. - ]. - ! Item was removed: - ----- Method: KedamaVectorizer>>getPlayersMessage:for:into: (in category 'player and selector look up') ----- - getPlayersMessage: aMessageNode for: obj into: aCollection - - - ((Array with: aMessageNode receiver), aMessageNode arguments) do: [:stmt | | thisPlayer | - (stmt isMemberOf: MessageNode) ifTrue: [ - self getPlayersMessage: stmt for: obj into: aCollection. - ]. - (stmt isMemberOf: BlockNode) ifTrue: [ - self getPlayersBlock: stmt for: obj into: aCollection.. - ]. - (stmt isMemberOf: VariableNode) ifTrue: [ - thisPlayer := Compiler evaluate: stmt name for: obj. - (thisPlayer isKindOf: Player) ifTrue: [aCollection add: stmt]. - ]. - ]. - ! Item was removed: - ----- Method: KedamaVectorizer>>getSelectorFor:fromBlockNode:for:ifFoundDo:ignoreSelectors: (in category 'player and selector look up') ----- - getSelectorFor: receiver fromBlockNode: aBlockNode for: obj ifFoundDo: aBlock ignoreSelectors: ignoreSelectors - - root ifNotNil: [^ self]. - aBlockNode statements do: [:stmt | - (stmt isMemberOf: MessageNode) ifTrue: [ - self getSelectorFor: receiver fromMessageNode: stmt for: obj ifFoundDo: aBlock ignoreSelectors: ignoreSelectors - ]. - (stmt isMemberOf: BlockNode) ifTrue: [ - self getSelectorFor: receiver fromBlockNode: stmt for: obj ifFoundDo: aBlock ignoreSelectors: ignoreSelectors - ]. - ]. - ! Item was removed: - ----- Method: KedamaVectorizer>>getSelectorFor:fromMessageNode:for:ifFoundDo:ignoreSelectors: (in category 'player and selector look up') ----- - getSelectorFor: receiver fromMessageNode: aMessageNode for: obj ifFoundDo: aBlock ignoreSelectors: ignoreSelectors - - - root ifNotNil: [^ self]. - (Array with: aMessageNode receiver), aMessageNode arguments do: [:stmt | | key thisPlayer | - (stmt isMemberOf: VariableNode) ifTrue: [ - thisPlayer := Compiler evaluate: stmt name for: obj. - thisPlayer == receiver ifTrue: [ - key := aMessageNode selector key. - (ignoreSelectors includes: key) ifFalse: [aBlock value: key. ^ self]]. - ]. - (stmt isMemberOf: MessageNode) ifTrue: [ - self getSelectorFor: receiver fromMessageNode: stmt for: obj ifFoundDo: aBlock ignoreSelectors: ignoreSelectors - ]. - (stmt isMemberOf: BlockNode) ifTrue: [ - self getSelectorFor: receiver fromBlockNode: stmt for: obj ifFoundDo: aBlock ignoreSelectors: ignoreSelectors - ]. - ]. - ! Item was removed: - ----- Method: KedamaVectorizer>>getSelectorRootFor:fromMessageNode:for:ignoreSelectors: (in category 'player and selector look up') ----- - getSelectorRootFor: receiver fromMessageNode: aMessageNode for: obj ignoreSelectors: ignoreSelectors - - | val | - root := nil. - self getSelectorFor: receiver fromMessageNode: aMessageNode for: obj ifFoundDo: [:sel | root := sel] ignoreSelectors: ignoreSelectors. - val := root. - root := nil. - ^ val. - ! Item was removed: - ----- Method: KedamaVectorizer>>includesTurtlePlayer:for: (in category 'entry point') ----- - includesTurtlePlayer: aMethodNode for: obj - - | players | - players := self getAllPlayersInMethodNode: aMethodNode for: obj. - players do: [:e | | p | - p := Compiler evaluate: e name for: obj. - (p isKindOf: KedamaExamplerPlayer) ifTrue: [^ true]. - ]. - ^ false. - ! Item was removed: - ----- Method: KedamaVectorizer>>initialize (in category 'initialization') ----- - initialize - - attributes := KedamaAttributeDictionary new initialize. - ! Item was removed: - ----- Method: KedamaVectorizer>>insertTurtleCommandAt:in:variableNode:from:firstReceiverName: (in category 'insert block node') ----- - insertTurtleCommandAt: index in: statements variableNode: varNode from: encoder firstReceiverName: origName - - | messageNode blockNode newMessageNode selector | - messageNode := statements at: index. - (attributes getAttribute: #requireVector of: messageNode) ifFalse: [^ self]. - blockNode := BlockNode new arguments: (Array with: varNode) statements: (Array with: messageNode) returns: false from: encoder. - selector := (attributes getAttribute: #dieMessage of: messageNode) ifNotNil: [#doDieCommand:]. - selector ifNil: [ - selector := (attributes getAttribute: #constant of: messageNode) ifTrue: [#doCommand:] ifFalse: [#doSequentialCommand:]. - ]. - - newMessageNode := MessageNode new - receiver: (encoder encodeVariable: origName) - selector: selector - arguments: (Array with: blockNode) - precedence: 3 - from: encoder - sourceRange: nil. - - statements at: index put: newMessageNode. - ! Item was removed: - ----- Method: KedamaVectorizer>>isScalarizable:andSelector: (in category 'private') ----- - isScalarizable: aPlayer andSelector: selector - - (aPlayer isKindOf: Player) ifFalse: [^ false]. - aPlayer isPrototypeTurtlePlayer ifFalse: [^ false]. - - (#(getX getY getHeading getAngleTo: getDistanceTo: getUphillIn: getReplicated color) includes: selector) ifTrue: [^ true]. - - ^ ((aPlayer class organization listAtCategoryNamed: 'access') select: [:sel | sel beginsWith: 'get']) includes: selector. - ! Item was removed: - ----- Method: KedamaVectorizer>>isVectorizationRequiredWithPlayer:andSelector: (in category 'private') ----- - isVectorizationRequiredWithPlayer: aPlayer andSelector: selector - - (aPlayer isKindOf: Player) ifFalse: [^ false]. - aPlayer isPrototypeTurtlePlayer ifFalse: [^ false]. - - ^ (#(setTurtleCount: getTurtleCount setGrouped: getGrouped) includes: selector) not. - ! Item was removed: - ----- Method: KedamaVectorizer>>replace:with:inBlockNode: (in category 'replace receiver') ----- - replace: varName with: newNode inBlockNode: aBlockNode - - aBlockNode statements do: [:e | - (e isMemberOf: MessageNode) ifTrue: [ - self replace: varName with: newNode inMessageNode: e. - ]. - (e isMemberOf: BlockNode) ifTrue: [ - self replace: varName with: newNode inBlockNode: e. - ]. - ]. - ! Item was removed: - ----- Method: KedamaVectorizer>>replace:with:inMessageNode: (in category 'replace receiver') ----- - replace: varName with: newNode inMessageNode: aMessageNode - - | receiver att | - aMessageNode arguments withIndexDo: [:e :index | - (e isMemberOf: MessageNode) ifTrue: [ - self replace: varName with: newNode inMessageNode: e. - ]. - (e isMemberOf: BlockNode) ifTrue: [ - self replace: varName with: newNode inBlockNode: e. - ]. - (e isMemberOf: VariableNode) ifTrue: [ - att := attributes getAttribute: #isTurtle of: e. - ((att notNil & att) and: [e name = varName]) ifTrue: [aMessageNode arguments at: index put: newNode]. - ]. - - ]. - - receiver := aMessageNode receiver. - (receiver isMemberOf: MessageNode) ifTrue: [ - self replace: varName with: newNode inMessageNode: receiver. - ]. - - (receiver isMemberOf: VariableNode) ifTrue: [ - att := attributes getAttribute: #isTurtle of: receiver. - ((att notNil & att) and: [receiver name = varName]) ifTrue: [aMessageNode receiver: newNode]. - ]. - ! Item was removed: - ----- Method: KedamaVectorizer>>replaceRoot:with:inMessageNode: (in category 'replace receiver') ----- - replaceRoot: varName with: newNode inMessageNode: aMessageNode - - (attributes getAttribute: #requireVector of: aMessageNode) ifFalse: [^ self]. - - (aMessageNode isMemberOf: MessageNode) ifTrue: [ - self replace: varName with: newNode inMessageNode: aMessageNode. - ]. - (aMessageNode isMemberOf: BlockNode) ifTrue: [ - self replace: varName with: newNode inBlockNode: aMessageNode. - ]. - ! Item was removed: - ----- Method: KedamaVectorizer>>traverseBlock:in:firstPlayer:inCondition: (in category 'vectorization attribute calculation') ----- - traverseBlock: aBlockNode in: obj firstPlayer: firstPlayer inCondition: inCondition - - | value statements | - statements := aBlockNode statements. - statements do: [:stmt | - (stmt isMemberOf: MessageNode) ifTrue: [ - self traverseMessage: stmt in: obj firstPlayer: firstPlayer inCondition: inCondition. - ]. - (stmt isMemberOf: BlockNode) ifTrue: [ - self traverseBlock: stmt in: obj firstPlayer: firstPlayer inCondition: inCondition. - ]. - (stmt isMemberOf: VariableNode) ifTrue: [ - attributes setAttribute: #constant of: stmt to: false - ]. - (stmt isMemberOf: LiteralNode) ifTrue: [ - attributes setAttribute: #constant of: stmt to: true - ]. - ]. - value := statements allSatisfy: [:stmt | attributes getAttribute: #constant of: stmt]. - - attributes setAttribute: #constant of: aBlockNode to: value. - ! Item was removed: - ----- Method: KedamaVectorizer>>traverseMessage:in:firstPlayer:inCondition: (in category 'vectorization attribute calculation') ----- - traverseMessage: aMessageNode in: obj firstPlayer: firstPlayer inCondition: inCondition - - | receiver thisPlayer ret constant proto | - - aMessageNode arguments do: [:argument | - (argument isMemberOf: MessageNode) ifTrue: [ - self traverseMessage: argument in: obj firstPlayer: firstPlayer inCondition: inCondition. - ]. - (argument isMemberOf: BlockNode) ifTrue: [ - self traverseBlock: argument in: obj firstPlayer: firstPlayer inCondition: inCondition. - ]. - (argument isMemberOf: LiteralNode) ifTrue: [ - attributes setAttribute: #constant of: argument to: true. - ]. - (argument isMemberOf: VariableNode) ifTrue: [ - thisPlayer := Compiler evaluate: argument name for: obj. - ret := (thisPlayer isKindOf: Player) and: [thisPlayer costume renderedMorph isKindOf: KedamaPatchMorph]. - attributes setAttribute: #constant of: argument to: ret. - ]. - ]. - - receiver := aMessageNode receiver. - (receiver isMemberOf: MessageNode) ifTrue: [ - self traverseMessage: receiver in: obj firstPlayer: firstPlayer inCondition: inCondition. - ]. - (receiver isMemberOf: BlockNode) ifTrue: [ - self traverseBlock: receiver in: obj firstPlayer: firstPlayer inCondition: inCondition. - ]. - (receiver isMemberOf: LiteralNode) ifTrue: [ - attributes setAttribute: #constant of: receiver to: true. - ]. - (receiver isMemberOf: VariableNode) ifTrue: [ - thisPlayer := Compiler evaluate: receiver name for: obj. - ret := thisPlayer == firstPlayer. - attributes setAttribute: #constant of: receiver to: ret. - proto := (thisPlayer isKindOf: Player) and: [thisPlayer isPrototypeTurtlePlayer]. - attributes setAttribute: #isTurtle of: receiver to: proto. - attributes setAttribute: #scalar of: aMessageNode selector to: - (ret not and: [(proto and: [self isScalarizable: thisPlayer andSelector: aMessageNode selector key])]). - ]. - - "special cases..." - (#(atRandom die getReplicated bounceOn: bounceOn:color: bounceOnColor: ifTrue: ifFalse: ifTrue:ifFalse: itFalse:ifTrue: - setPatchValueIn:to: getTurtleAt: getTurtleOf:) includes: aMessageNode selector key) ifTrue: [ - attributes setAttribute: #constant of: aMessageNode to: false. - aMessageNode selector key = #die ifTrue: [ - attributes setAttribute: #dieMessage of: root to: true. - ]. - - ] ifFalse: [ - constant := (aMessageNode arguments copyWith: receiver) allSatisfy: [:t | attributes getAttribute: #constant of: t]. - attributes setAttribute: #constant of: aMessageNode to: constant. - ]. - - ! Item was removed: - ----- Method: KedamaVectorizer>>traverseMessageRoot:in:firstPlayer: (in category 'vectorization attribute calculation') ----- - traverseMessageRoot: aMessageNode in: obj firstPlayer: firstPlayer - - | inCondition | - inCondition := #(ifTrue: ifFalse: ifTrue:ifFalse:) includes: aMessageNode selector key. - - root := aMessageNode. - - self traverseMessage: aMessageNode in: obj firstPlayer: firstPlayer inCondition: inCondition. - ! Item was removed: - ----- Method: KedamaVectorizer>>vectorize:object: (in category 'entry point') ----- - vectorize: aMethodNode object: obj - - aMethodNode block statements withIndexDo: [:stmt :index | - (stmt isMemberOf: MessageNode) ifTrue: [ - self checkFirstPairFor: stmt in: obj. - self traverseMessageRoot: stmt in: obj firstPlayer: (attributes getAttribute: #firstTurtle of: stmt). - ]. - - (stmt isMemberOf: MessageNode) ifTrue: [ - self vectorizeAt: index inMethodNode: aMethodNode. - ]. - ]. - - ^ aMethodNode. - - - ! Item was removed: - ----- Method: KedamaVectorizer>>vectorizeAt:inMethodNode: (in category 'private') ----- - vectorizeAt: index inMethodNode: aMethodNode - - | v encoder origReceiverName origReceiver aMessageNode | - aMessageNode := aMethodNode block statements at: index. - (attributes getAttribute: #requireVector of: aMessageNode) ifFalse: [^ self]. - - encoder := aMethodNode encoder. - encoder autoBind: 'xxxObj'. - v := encoder encodeVariable: 'xxxObj' sourceRange: nil ifUnknown: []. - origReceiver := attributes getAttribute: #firstNode of: aMessageNode. - (origReceiver isMemberOf: VariableNode) ifTrue: [ - origReceiverName := origReceiver name. - ] ifFalse: [ - origReceiverName := 'self'. - ]. - - self replaceRoot: origReceiverName with: v inMessageNode: aMessageNode. - "self changeSelectorAt: index inMethodNode: aMethodNode." - self insertTurtleCommandAt: index in: aMethodNode block statements variableNode: v from: encoder firstReceiverName: origReceiverName. - - ! Item was removed: - ----- Method: LeafNode>>defaultBlockType: (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultBlockType: t1 - ^ #default! Item was removed: - ----- Method: LeafNode>>defaultMessageType (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultMessageType - ^ #none! Item was removed: - ----- Method: LeafNode>>firstInReceivers: (in category '*Etoys-Tweak-Kedama-Generated') ----- - firstInReceivers: t1 - ^ t1 first! Item was removed: - ----- Method: LeafNode>>initialNil (in category '*Etoys-Tweak-Kedama-Generated') ----- - initialNil - ^ nil! Item was removed: - ----- Method: LeafNode>>isStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isStmt: t1 - ^ t1 = #top - or: [t1 = #condition]! Item was removed: - ----- Method: LeafNode>>isTest:parentNode: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTest: t1 parentNode: t2 - t1 = true - ifTrue: [^ true]. - ^ (t2 isMemberOf: MessageNode) - and: [t2 receiver = self - and: [t2 messageType value = #condition]]! Item was removed: - ----- Method: LeafNode>>isTopStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTopStmt: t1 - t1 = nil - ifTrue: [^ true]. - ^ false! Item was removed: - ----- Method: LeafNode>>rcvr: (in category '*Etoys-Tweak-Kedama-Generated') ----- - rcvr: t1 - ^ t1! Item was removed: - ----- Method: LeafNode>>thisNode (in category '*Etoys-Tweak-Kedama-Generated') ----- - thisNode - ^ self! Item was removed: - ----- Method: LeafNode>>transfer: (in category '*Etoys-Tweak-Kedama-Generated') ----- - transfer: t1 - ^ t1! Item was removed: - ----- Method: LiteralNode>>defaultBlockType: (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultBlockType: t1 - ^ #default! Item was removed: - ----- Method: LiteralNode>>defaultMessageType (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultMessageType - ^ #none! Item was removed: - ----- Method: LiteralNode>>firstInReceivers: (in category '*Etoys-Tweak-Kedama-Generated') ----- - firstInReceivers: t1 - ^ t1 first! Item was removed: - ----- Method: LiteralNode>>initialNil (in category '*Etoys-Tweak-Kedama-Generated') ----- - initialNil - ^ nil! Item was removed: - ----- Method: LiteralNode>>isStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isStmt: t1 - ^ t1 = #top - or: [t1 = #condition]! Item was removed: - ----- Method: LiteralNode>>isTest:parentNode: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTest: t1 parentNode: t2 - t1 = true - ifTrue: [^ true]. - ^ (t2 isMemberOf: MessageNode) - and: [t2 receiver = self - and: [t2 messageType value = #condition]]! Item was removed: - ----- Method: LiteralNode>>isTopStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTopStmt: t1 - t1 = nil - ifTrue: [^ true]. - ^ false! Item was removed: - ----- Method: LiteralNode>>rcvr: (in category '*Etoys-Tweak-Kedama-Generated') ----- - rcvr: t1 - ^ t1! Item was removed: - ----- Method: LiteralNode>>thisNode (in category '*Etoys-Tweak-Kedama-Generated') ----- - thisNode - ^ self! Item was removed: - ----- Method: LiteralNode>>transfer: (in category '*Etoys-Tweak-Kedama-Generated') ----- - transfer: t1 - ^ t1! Item was removed: - ----- Method: LiteralVariableNode>>defaultBlockType: (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultBlockType: t1 - ^ #default! Item was removed: - ----- Method: LiteralVariableNode>>defaultMessageType (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultMessageType - ^ #none! Item was removed: - ----- Method: LiteralVariableNode>>firstInReceivers: (in category '*Etoys-Tweak-Kedama-Generated') ----- - firstInReceivers: t1 - ^ t1 first! Item was removed: - ----- Method: LiteralVariableNode>>initialNil (in category '*Etoys-Tweak-Kedama-Generated') ----- - initialNil - ^ nil! Item was removed: - ----- Method: LiteralVariableNode>>isStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isStmt: t1 - ^ t1 = #top - or: [t1 = #condition]! Item was removed: - ----- Method: LiteralVariableNode>>isTest:parentNode: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTest: t1 parentNode: t2 - t1 = true - ifTrue: [^ true]. - ^ (t2 isMemberOf: MessageNode) - and: [t2 receiver = self - and: [t2 messageType value = #condition]]! Item was removed: - ----- Method: LiteralVariableNode>>isTopStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTopStmt: t1 - t1 = nil - ifTrue: [^ true]. - ^ false! Item was removed: - ----- Method: LiteralVariableNode>>rcvr: (in category '*Etoys-Tweak-Kedama-Generated') ----- - rcvr: t1 - ^ t1! Item was removed: - ----- Method: LiteralVariableNode>>rewriteVariable:with:rewriteInfo: (in category '*Etoys-Tweak-Kedama-Generated') ----- - rewriteVariable: t1 with: t2 rewriteInfo: t3 - t2 - ifNil: [^ nil]. - t2 first = t1 - ifTrue: [^ t3]. - ^ nil! Item was removed: - ----- Method: LiteralVariableNode>>thisNode (in category '*Etoys-Tweak-Kedama-Generated') ----- - thisNode - ^ self! Item was removed: - ----- Method: LiteralVariableNode>>transfer: (in category '*Etoys-Tweak-Kedama-Generated') ----- - transfer: t1 - ^ t1! Item was removed: - ----- Method: LiteralVariableNode>>variableReceiver: (in category '*Etoys-Tweak-Kedama-Generated') ----- - variableReceiver: t1 - | t2 t3 | - (self key isKindOf: LookupKey) - ifTrue: [^ self key value]. - t3 := self key. - t2 := Compiler new - evaluate: t3 asString - in: nil - to: t1 - notifying: nil - ifFail: [] - logged: false. - ^ t2! Item was removed: - ----- Method: MessageAsTempNode>>addNodeInfoTo:receiverObject:stmtChain:scriptReceiver:messageType:isStatement:isInTest:parentNode: (in category '*Etoys-Tweak-Kedama-Generated') ----- - addNodeInfoTo: t1 receiverObject: t2 stmtChain: t3 scriptReceiver: t4 messageType: t5 isStatement: t6 isInTest: t7 parentNode: t8 - | t9 t10 t11 t12 t13 t14 t15 t16 t17 | - t12 := WriteStream - on: (Array new: 2). - t13 := #none. - t16 := Player readOrWriteOrNil: self selector key. - t14 := t3 - inject: false - into: [:t18 :t19 | t18 - | (t19 at: 2)]. - (t14 - and: [t7 not]) - ifTrue: [t13 := #testBody]. - t7 - ifTrue: [t13 := #testCond]. - t7 - ifTrue: [t15 := t3 reverse - detect: [:t18 | t18 second] - ifNone: [self halt]. - (t1 at: t15 first) - add: (Array - with: t2 - with: self selector - with: self receiver - with: #read - with: t13). - ^ t1]. - self receiver isLeaf - ifTrue: [t2 isPlayerLike - ifTrue: [(#(#getPatchValueIn: #setPatchValueIn:to: ) includes: self selector key) - ifTrue: [t17 := self selector key = #getPatchValueIn:. - t9 := self arguments first. - t9 isLeaf - ifTrue: [t10 := (t9 key isKindOf: LookupKey) - ifTrue: [t9 key key] - ifFalse: [t9 key]. - t11 := Compiler - evaluate: t10 - for: t4 - notifying: nil - logged: false. - t12 - nextPut: (Array - with: t11 - with: self selector key - with: self receiver key - with: (t17 - ifTrue: [#read] - ifFalse: [#write]) - with: t13). - t12 - nextPut: (Array - with: t2 - with: self selector key - with: self receiver key - with: (t17 - ifTrue: [#write] - ifFalse: [#read]) - with: t13)] - ifFalse: [t12 - nextPut: (Array - with: t2 - with: self selector key - with: self receiver key - with: #read - with: t13)]] - ifFalse: [t12 - nextPut: (Array - with: t2 - with: self selector key - with: self receiver key - with: t16 - with: t13)]]] - ifFalse: [(t6 - and: [t5 ~~ #condition]) - ifTrue: [t12 - nextPut: (Array - with: nil - with: self selector key - with: self receiver - with: t16 - with: t13)]]. - t12 contents - do: [:t18 | t3 - do: [:t19 | (t1 - at: (t19 at: 1)) - addFirst: t18]]. - ^ t1! Item was removed: - ----- Method: MessageAsTempNode>>addToStmtChain:isStatement: (in category '*Etoys-Tweak-Kedama-Generated') ----- - addToStmtChain: t1 isStatement: t2 - | t3 | - t3 := self messageType value = #condition. - t2 - ifTrue: [^ t1 - copyWith: (Array with: self with: t3)]. - ^ t1! Item was removed: - ----- Method: MessageAsTempNode>>defaultBlockType: (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultBlockType: t1 - ^ #default! Item was removed: - ----- Method: MessageAsTempNode>>defaultMessageType (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultMessageType - ^ #none! Item was removed: - ----- 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 isMessageNode - and: [t7 containsSequentialSelector: t14 selector]) - ifTrue: [^ #sequential]]. - ^ #parallel! Item was removed: - ----- Method: MessageAsTempNode>>firstInReceivers: (in category '*Etoys-Tweak-Kedama-Generated') ----- - firstInReceivers: t1 - ^ t1 first! Item was removed: - ----- Method: MessageAsTempNode>>isStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isStmt: t1 - ^ t1 = #top - or: [t1 = #condition]! Item was removed: - ----- Method: MessageAsTempNode>>isTest:parentNode: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTest: t1 parentNode: t2 - t1 = true - ifTrue: [^ true]. - ^ (t2 isMemberOf: MessageNode) - and: [t2 receiver = self - and: [t2 messageType value = #condition]]! Item was removed: - ----- Method: MessageAsTempNode>>isTopStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTopStmt: t1 - t1 = nil - ifTrue: [^ true]. - ^ false! Item was removed: - ----- Method: MessageAsTempNode>>msgType (in category '*Etoys-Tweak-Kedama-Generated') ----- - msgType - (#(#ifTrue: #ifFalse: #ifTrue:ifFalse: #ifFalse:ifTrue: ) includes: self selector key) - ifTrue: [^ #condition]. - (#(#whileTrue: #whileFalse: ) includes: self selector key) - ifTrue: [^ #loop]. - (#(#doSequentially: ) includes: self selector key) - ifTrue: [^ #sequential]. - ^ #none! Item was removed: - ----- Method: MessageAsTempNode>>parentRewriteInfo:primaryBreedPair:isStatement:isTopStatement: (in category '*Etoys-Tweak-Kedama-Generated') ----- - parentRewriteInfo: t1 primaryBreedPair: t2 isStatement: t3 isTopStatement: t4 - t4 - ifTrue: [t2 - ifNil: [^ t1]. - ^ t2]. - t3 - ifTrue: [t2 - ifNil: [^ t1]. - t1 - ifNil: [^ t1]. - t1 first = t2 first - ifFalse: [^ t2]]. - ^ t1! Item was removed: - ----- Method: MessageAsTempNode>>primaryBreedPair:fromDict:isStatement: (in category '*Etoys-Tweak-Kedama-Generated') ----- - primaryBreedPair: t1 fromDict: t2 isStatement: t3 - | t4 t5 | - t3 - ifTrue: [t4 := (t2 at: self) - select: [:t6 | t6 first notNil - and: [t6 first isPrototypeTurtlePlayer - and: [(t6 first isBreedSelector: t6 second) not]]]. - (t4 - collect: [:t6 | t6 first]) asSet size = 0 - ifTrue: [^ t1]. - t5 := t4 first third. - ^ Array - with: t4 first first - with: ((t5 isKindOf: LookupKey) - ifTrue: [t5 key] - ifFalse: [t5])]. - ^ t1! Item was removed: - ----- Method: MessageAsTempNode>>rcvr: (in category '*Etoys-Tweak-Kedama-Generated') ----- - rcvr: t1 - ^ t1! Item was removed: - ----- Method: MessageAsTempNode>>rewriteInfo:statementType:primaryBreedPair:isStatement: (in category '*Etoys-Tweak-Kedama-Generated') ----- - rewriteInfo: t1 statementType: t2 primaryBreedPair: t3 isStatement: t4 - t4 - ifTrue: [(#(#parallel #sequential #die ) includes: t2) - ifFalse: [^ nil]. - t3 - ifNil: [^ nil]. - ^ Array with: t3 first with: 'var' , t3 first identityHash printString , self identityHash printString]. - ^ t1! Item was removed: - ----- Method: MessageAsTempNode>>thisNode (in category '*Etoys-Tweak-Kedama-Generated') ----- - thisNode - ^ self! Item was removed: - ----- Method: MessageAsTempNode>>transfer: (in category '*Etoys-Tweak-Kedama-Generated') ----- - transfer: t1 - ^ t1! Item was removed: - ----- Method: MessageAsTempNode>>transfer:isStatement: (in category '*Etoys-Tweak-Kedama-Generated') ----- - transfer: t1 isStatement: t2 - t2 - ifTrue: [t1 at: self put: OrderedCollection new]. - ^ t1! Item was removed: - ----- Method: MessageNode>>addNodeInfoTo:receiverObject:stmtChain:scriptReceiver:messageType:isStatement:isInTest:parentNode: (in category '*Etoys-Tweak-Kedama-Generated') ----- - addNodeInfoTo: t1 receiverObject: t2 stmtChain: t3 scriptReceiver: t4 messageType: t5 isStatement: t6 isInTest: t7 parentNode: t8 - | t9 t10 t11 t12 t13 t14 t15 t16 t17 | - t12 := WriteStream - on: (Array new: 2). - t13 := #none. - t16 := Player readOrWriteOrNil: self selector key. - t14 := t3 - inject: false - into: [:t18 :t19 | t18 - | (t19 at: 2)]. - (t14 - and: [t7 not]) - ifTrue: [t13 := #testBody]. - t7 - ifTrue: [t13 := #testCond]. - t7 - ifTrue: [t15 := t3 reverse - detect: [:t18 | t18 second] - ifNone: [self halt]. - (t1 at: t15 first) - add: (Array - with: t2 - with: self selector - with: self receiver - with: #read - with: t13). - ^ t1]. - self receiver isLeaf - ifTrue: [t2 isPlayerLike - ifTrue: [(#(#getPatchValueIn: #setPatchValueIn:to: ) includes: self selector key) - ifTrue: [t17 := self selector key = #getPatchValueIn:. - t9 := self arguments first. - t9 isLeaf - ifTrue: [t10 := (t9 key isKindOf: LookupKey) - ifTrue: [t9 key key] - ifFalse: [t9 key]. - t11 := Compiler - evaluate: t10 - for: t4 - notifying: nil - logged: false. - t12 - nextPut: (Array - with: t11 - with: self selector key - with: self receiver key - with: (t17 - ifTrue: [#read] - ifFalse: [#write]) - with: t13). - t12 - nextPut: (Array - with: t2 - with: self selector key - with: self receiver key - with: (t17 - ifTrue: [#write] - ifFalse: [#read]) - with: t13)] - ifFalse: [t12 - nextPut: (Array - with: t2 - with: self selector key - with: self receiver key - with: #read - with: t13)]] - ifFalse: [t12 - nextPut: (Array - with: t2 - with: self selector key - with: self receiver key - with: t16 - with: t13)]]] - ifFalse: [(t6 - and: [t5 ~~ #condition]) - ifTrue: [t12 - nextPut: (Array - with: nil - with: self selector key - with: self receiver - with: t16 - with: t13)]]. - t12 contents - do: [:t18 | t3 - do: [:t19 | (t1 - at: (t19 at: 1)) - addFirst: t18]]. - ^ t1! Item was removed: - ----- Method: MessageNode>>addToStmtChain:isStatement: (in category '*Etoys-Tweak-Kedama-Generated') ----- - addToStmtChain: t1 isStatement: t2 - | t3 | - t3 := self messageType value = #condition. - t2 - ifTrue: [^ t1 - copyWith: (Array with: self with: t3)]. - ^ t1! Item was removed: - ----- Method: MessageNode>>defaultBlockType: (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultBlockType: t1 - ^ #default! Item was removed: - ----- Method: MessageNode>>defaultMessageType (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultMessageType - ^ #none! Item was removed: - ----- 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 isMessageNode - and: [t7 containsSequentialSelector: t14 selector]) - ifTrue: [^ #sequential]]. - ^ #parallel! Item was removed: - ----- Method: MessageNode>>firstInReceivers: (in category '*Etoys-Tweak-Kedama-Generated') ----- - firstInReceivers: t1 - ^ t1 first! Item was removed: - ----- Method: MessageNode>>isStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isStmt: t1 - ^ t1 = #top - or: [t1 = #condition]! Item was removed: - ----- Method: MessageNode>>isTest:parentNode: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTest: t1 parentNode: t2 - t1 = true - ifTrue: [^ true]. - ^ (t2 isMemberOf: MessageNode) - and: [t2 receiver = self - and: [t2 messageType value = #condition]]! Item was removed: - ----- Method: MessageNode>>isTopStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTopStmt: t1 - t1 = nil - ifTrue: [^ true]. - ^ false! Item was removed: - ----- Method: MessageNode>>msgType (in category '*Etoys-Tweak-Kedama-Generated') ----- - msgType - (#(#ifTrue: #ifFalse: #ifTrue:ifFalse: #ifFalse:ifTrue: ) includes: self selector key) - ifTrue: [^ #condition]. - (#(#whileTrue: #whileFalse: ) includes: self selector key) - ifTrue: [^ #loop]. - (#(#doSequentially: ) includes: self selector key) - ifTrue: [^ #sequential]. - ^ #none! Item was removed: - ----- Method: MessageNode>>parentRewriteInfo:primaryBreedPair:isStatement:isTopStatement: (in category '*Etoys-Tweak-Kedama-Generated') ----- - parentRewriteInfo: t1 primaryBreedPair: t2 isStatement: t3 isTopStatement: t4 - t4 - ifTrue: [t2 - ifNil: [^ t1]. - ^ t2]. - t3 - ifTrue: [t2 - ifNil: [^ t1]. - t1 - ifNil: [^ t1]. - t1 first = t2 first - ifFalse: [^ t2]]. - ^ t1! Item was removed: - ----- Method: MessageNode>>primaryBreedPair:fromDict:isStatement: (in category '*Etoys-Tweak-Kedama-Generated') ----- - primaryBreedPair: t1 fromDict: t2 isStatement: t3 - | t4 t5 | - t3 - ifTrue: [t4 := (t2 at: self) - select: [:t6 | t6 first notNil - and: [t6 first isPrototypeTurtlePlayer - and: [(t6 first isBreedSelector: t6 second) not]]]. - (t4 - collect: [:t6 | t6 first]) asSet size = 0 - ifTrue: [^ t1]. - t5 := t4 first third. - ^ Array - with: t4 first first - with: ((t5 isKindOf: LookupKey) - ifTrue: [t5 key] - ifFalse: [t5])]. - ^ t1! Item was removed: - ----- Method: MessageNode>>rcvr: (in category '*Etoys-Tweak-Kedama-Generated') ----- - rcvr: t1 - ^ t1! Item was removed: - ----- Method: MessageNode>>rewriteInfo:statementType:primaryBreedPair:isStatement: (in category '*Etoys-Tweak-Kedama-Generated') ----- - rewriteInfo: t1 statementType: t2 primaryBreedPair: t3 isStatement: t4 - t4 - ifTrue: [(#(#parallel #sequential #die ) includes: t2) - ifFalse: [^ nil]. - t3 - ifNil: [^ nil]. - ^ Array with: t3 first with: 'var' , t3 first identityHash printString , self identityHash printString]. - ^ t1! Item was removed: - ----- Method: MessageNode>>thisNode (in category '*Etoys-Tweak-Kedama-Generated') ----- - thisNode - ^ self! Item was removed: - ----- Method: MessageNode>>transfer: (in category '*Etoys-Tweak-Kedama-Generated') ----- - transfer: t1 - ^ t1! Item was removed: - ----- Method: MessageNode>>transfer:isStatement: (in category '*Etoys-Tweak-Kedama-Generated') ----- - transfer: t1 isStatement: t2 - t2 - ifTrue: [t1 at: self put: OrderedCollection new]. - ^ t1! Item was removed: - ----- Method: MethodNode>>defaultBlockType: (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultBlockType: t1 - ^ #default! Item was removed: - ----- Method: MethodNode>>defaultMessageType (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultMessageType - ^ #none! Item was removed: - ----- Method: MethodNode>>firstInReceivers: (in category '*Etoys-Tweak-Kedama-Generated') ----- - firstInReceivers: t1 - ^ t1 first! Item was removed: - ----- Method: MethodNode>>initialBlockType (in category '*Etoys-Tweak-Kedama-Generated') ----- - initialBlockType - ^ #none! Item was removed: - ----- Method: MethodNode>>initialDictForNodeInfo (in category '*Etoys-Tweak-Kedama-Generated') ----- - initialDictForNodeInfo - ^ Dictionary new! Item was removed: - ----- Method: MethodNode>>initialEmptyList (in category '*Etoys-Tweak-Kedama-Generated') ----- - initialEmptyList - ^ #()! Item was removed: - ----- Method: MethodNode>>initialFalse (in category '*Etoys-Tweak-Kedama-Generated') ----- - initialFalse - ^ false! Item was removed: - ----- Method: MethodNode>>initialNil (in category '*Etoys-Tweak-Kedama-Generated') ----- - initialNil - ^ nil! Item was removed: - ----- Method: MethodNode>>isStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isStmt: t1 - ^ t1 = #top - or: [t1 = #condition]! Item was removed: - ----- Method: MethodNode>>isTest:parentNode: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTest: t1 parentNode: t2 - t1 = true - ifTrue: [^ true]. - ^ (t2 isMemberOf: MessageNode) - and: [t2 receiver = self - and: [t2 messageType value = #condition]]! Item was removed: - ----- Method: MethodNode>>isTopStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTopStmt: t1 - t1 = nil - ifTrue: [^ true]. - ^ false! Item was removed: - ----- Method: MethodNode>>rawstart (in category '*Etoys-Tweak-Kedama-accessing') ----- - rawstart - ^ KedamaEvaluatorNodeState stateFor: self at: #start! Item was removed: - ----- Method: MethodNode>>rcvr (in category '*Etoys-Tweak-Kedama-Generated') ----- - rcvr - ^ true! Item was removed: - ----- Method: MethodNode>>rcvr: (in category '*Etoys-Tweak-Kedama-Generated') ----- - rcvr: t1 - ^ t1! Item was removed: - ----- Method: MethodNode>>start (in category '*Etoys-Tweak-Kedama-accessing') ----- - start - ^ (KedamaEvaluatorNodeState stateFor: self at: #start) value! Item was removed: - ----- Method: MethodNode>>start: (in category '*Etoys-Tweak-Kedama-accessing') ----- - start: t1 - KedamaEvaluatorNodeState - stateFor: self - at: #start - put: t1! Item was removed: - ----- Method: MethodNode>>thisNode (in category '*Etoys-Tweak-Kedama-Generated') ----- - thisNode - ^ self! Item was removed: - ----- Method: MethodNode>>transfer: (in category '*Etoys-Tweak-Kedama-Generated') ----- - transfer: t1 - ^ t1! Item was removed: - ----- Method: MethodTempsNode>>defaultBlockType: (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultBlockType: t1 - ^ #default! Item was removed: - ----- Method: MethodTempsNode>>defaultMessageType (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultMessageType - ^ #none! Item was removed: - ----- Method: MethodTempsNode>>firstInReceivers: (in category '*Etoys-Tweak-Kedama-Generated') ----- - firstInReceivers: t1 - ^ t1 first! Item was removed: - ----- Method: MethodTempsNode>>isStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isStmt: t1 - ^ t1 = #top - or: [t1 = #condition]! Item was removed: - ----- Method: MethodTempsNode>>isTest:parentNode: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTest: t1 parentNode: t2 - t1 = true - ifTrue: [^ true]. - ^ (t2 isMemberOf: MessageNode) - and: [t2 receiver = self - and: [t2 messageType value = #condition]]! Item was removed: - ----- Method: MethodTempsNode>>isTopStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTopStmt: t1 - t1 = nil - ifTrue: [^ true]. - ^ false! Item was removed: - ----- Method: MethodTempsNode>>rcvr: (in category '*Etoys-Tweak-Kedama-Generated') ----- - rcvr: t1 - ^ t1! Item was removed: - ----- Method: MethodTempsNode>>thisNode (in category '*Etoys-Tweak-Kedama-Generated') ----- - thisNode - ^ self! Item was removed: - ----- Method: MethodTempsNode>>transfer: (in category '*Etoys-Tweak-Kedama-Generated') ----- - transfer: t1 - ^ t1! Item was removed: - ----- Method: ParseNode>>blockType (in category '*Etoys-Tweak-Kedama-accessing') ----- - blockType - ^ (KedamaEvaluatorNodeState stateFor: self at: #blockType) value! Item was removed: - ----- Method: ParseNode>>blockType: (in category '*Etoys-Tweak-Kedama-accessing') ----- - blockType: t1 - KedamaEvaluatorNodeState - stateFor: self - at: #blockType - put: t1! Item was removed: - ----- Method: ParseNode>>defaultBlockType: (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultBlockType: t1 - ^ #default! Item was removed: - ----- Method: ParseNode>>defaultMessageType (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultMessageType - ^ #none! Item was removed: - ----- Method: ParseNode>>firstInReceivers: (in category '*Etoys-Tweak-Kedama-Generated') ----- - firstInReceivers: t1 - ^ t1 first! Item was removed: - ----- Method: ParseNode>>isInTest (in category '*Etoys-Tweak-Kedama-accessing') ----- - isInTest - ^ (KedamaEvaluatorNodeState stateFor: self at: #isInTest) value! Item was removed: - ----- Method: ParseNode>>isInTest: (in category '*Etoys-Tweak-Kedama-accessing') ----- - isInTest: t1 - KedamaEvaluatorNodeState - stateFor: self - at: #isInTest - put: t1! Item was removed: - ----- Method: ParseNode>>isStatement (in category '*Etoys-Tweak-Kedama-accessing') ----- - isStatement - ^ (KedamaEvaluatorNodeState stateFor: self at: #isStatement) value! Item was removed: - ----- Method: ParseNode>>isStatement: (in category '*Etoys-Tweak-Kedama-accessing') ----- - isStatement: t1 - KedamaEvaluatorNodeState - stateFor: self - at: #isStatement - put: t1! Item was removed: - ----- Method: ParseNode>>isStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isStmt: t1 - ^ t1 = #top - or: [t1 = #condition]! Item was removed: - ----- Method: ParseNode>>isTest:parentNode: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTest: t1 parentNode: t2 - t1 = true - ifTrue: [^ true]. - ^ (t2 isMemberOf: MessageNode) - and: [t2 receiver = self - and: [t2 messageType value = #condition]]! Item was removed: - ----- Method: ParseNode>>isTopStatement (in category '*Etoys-Tweak-Kedama-accessing') ----- - isTopStatement - ^ (KedamaEvaluatorNodeState stateFor: self at: #isTopStatement) value! Item was removed: - ----- Method: ParseNode>>isTopStatement: (in category '*Etoys-Tweak-Kedama-accessing') ----- - isTopStatement: t1 - KedamaEvaluatorNodeState - stateFor: self - at: #isTopStatement - put: t1! Item was removed: - ----- Method: ParseNode>>isTopStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTopStmt: t1 - t1 = nil - ifTrue: [^ true]. - ^ false! Item was removed: - ----- Method: ParseNode>>messageType (in category '*Etoys-Tweak-Kedama-accessing') ----- - messageType - ^ (KedamaEvaluatorNodeState stateFor: self at: #messageType) value! Item was removed: - ----- Method: ParseNode>>messageType: (in category '*Etoys-Tweak-Kedama-accessing') ----- - messageType: t1 - KedamaEvaluatorNodeState - stateFor: self - at: #messageType - put: t1! Item was removed: - ----- Method: ParseNode>>myNode (in category '*Etoys-Tweak-Kedama-accessing') ----- - myNode - ^ (KedamaEvaluatorNodeState stateFor: self at: #myNode) value! Item was removed: - ----- Method: ParseNode>>myNode: (in category '*Etoys-Tweak-Kedama-accessing') ----- - myNode: t1 - KedamaEvaluatorNodeState - stateFor: self - at: #myNode - put: t1! Item was removed: - ----- Method: ParseNode>>nodeInfoIn (in category '*Etoys-Tweak-Kedama-accessing') ----- - nodeInfoIn - ^ (KedamaEvaluatorNodeState stateFor: self at: #nodeInfoIn) value! Item was removed: - ----- Method: ParseNode>>nodeInfoIn: (in category '*Etoys-Tweak-Kedama-accessing') ----- - nodeInfoIn: t1 - KedamaEvaluatorNodeState - stateFor: self - at: #nodeInfoIn - put: t1! Item was removed: - ----- Method: ParseNode>>nodeInfoOut (in category '*Etoys-Tweak-Kedama-accessing') ----- - nodeInfoOut - ^ (KedamaEvaluatorNodeState stateFor: self at: #nodeInfoOut) value! Item was removed: - ----- Method: ParseNode>>nodeInfoOut: (in category '*Etoys-Tweak-Kedama-accessing') ----- - nodeInfoOut: t1 - KedamaEvaluatorNodeState - stateFor: self - at: #nodeInfoOut - put: t1! Item was removed: - ----- Method: ParseNode>>primaryBreedPair (in category '*Etoys-Tweak-Kedama-accessing') ----- - primaryBreedPair - ^ (KedamaEvaluatorNodeState stateFor: self at: #primaryBreedPair) value! Item was removed: - ----- Method: ParseNode>>primaryBreedPair: (in category '*Etoys-Tweak-Kedama-accessing') ----- - primaryBreedPair: t1 - KedamaEvaluatorNodeState - stateFor: self - at: #primaryBreedPair - put: t1! Item was removed: - ----- Method: ParseNode>>rawblockType (in category '*Etoys-Tweak-Kedama-accessing') ----- - rawblockType - ^ KedamaEvaluatorNodeState stateFor: self at: #blockType! Item was removed: - ----- Method: ParseNode>>rawisInTest (in category '*Etoys-Tweak-Kedama-accessing') ----- - rawisInTest - ^ KedamaEvaluatorNodeState stateFor: self at: #isInTest! Item was removed: - ----- Method: ParseNode>>rawisStatement (in category '*Etoys-Tweak-Kedama-accessing') ----- - rawisStatement - ^ KedamaEvaluatorNodeState stateFor: self at: #isStatement! Item was removed: - ----- Method: ParseNode>>rawisTopStatement (in category '*Etoys-Tweak-Kedama-accessing') ----- - rawisTopStatement - ^ KedamaEvaluatorNodeState stateFor: self at: #isTopStatement! Item was removed: - ----- Method: ParseNode>>rawmessageType (in category '*Etoys-Tweak-Kedama-accessing') ----- - rawmessageType - ^ KedamaEvaluatorNodeState stateFor: self at: #messageType! Item was removed: - ----- Method: ParseNode>>rawmyNode (in category '*Etoys-Tweak-Kedama-accessing') ----- - rawmyNode - ^ KedamaEvaluatorNodeState stateFor: self at: #myNode! Item was removed: - ----- Method: ParseNode>>rawnodeInfoIn (in category '*Etoys-Tweak-Kedama-accessing') ----- - rawnodeInfoIn - ^ KedamaEvaluatorNodeState stateFor: self at: #nodeInfoIn! Item was removed: - ----- Method: ParseNode>>rawnodeInfoOut (in category '*Etoys-Tweak-Kedama-accessing') ----- - rawnodeInfoOut - ^ KedamaEvaluatorNodeState stateFor: self at: #nodeInfoOut! Item was removed: - ----- Method: ParseNode>>rawprimaryBreedPair (in category '*Etoys-Tweak-Kedama-accessing') ----- - rawprimaryBreedPair - ^ KedamaEvaluatorNodeState stateFor: self at: #primaryBreedPair! Item was removed: - ----- Method: ParseNode>>rawreceiverObject (in category '*Etoys-Tweak-Kedama-accessing') ----- - rawreceiverObject - ^ KedamaEvaluatorNodeState stateFor: self at: #receiverObject! Item was removed: - ----- Method: ParseNode>>rawrewriteInfoIn (in category '*Etoys-Tweak-Kedama-accessing') ----- - rawrewriteInfoIn - ^ KedamaEvaluatorNodeState stateFor: self at: #rewriteInfoIn! Item was removed: - ----- Method: ParseNode>>rawrewriteInfoOut (in category '*Etoys-Tweak-Kedama-accessing') ----- - rawrewriteInfoOut - ^ KedamaEvaluatorNodeState stateFor: self at: #rewriteInfoOut! Item was removed: - ----- Method: ParseNode>>rawrvr (in category '*Etoys-Tweak-Kedama-accessing') ----- - rawrvr - ^ KedamaEvaluatorNodeState stateFor: self at: #rvr! Item was removed: - ----- Method: ParseNode>>rawstatementType (in category '*Etoys-Tweak-Kedama-accessing') ----- - rawstatementType - ^ KedamaEvaluatorNodeState stateFor: self at: #statementType! Item was removed: - ----- Method: ParseNode>>rawstmtChain (in category '*Etoys-Tweak-Kedama-accessing') ----- - rawstmtChain - ^ KedamaEvaluatorNodeState stateFor: self at: #stmtChain! Item was removed: - ----- Method: ParseNode>>rawxxxOccurences (in category '*Etoys-Tweak-Kedama-accessing') ----- - rawxxxOccurences - ^ KedamaEvaluatorNodeState stateFor: self at: #xxxOccurences! Item was removed: - ----- Method: ParseNode>>rcvr: (in category '*Etoys-Tweak-Kedama-Generated') ----- - rcvr: t1 - ^ t1! Item was removed: - ----- Method: ParseNode>>receiverObject (in category '*Etoys-Tweak-Kedama-accessing') ----- - receiverObject - ^ (KedamaEvaluatorNodeState stateFor: self at: #receiverObject) value! Item was removed: - ----- Method: ParseNode>>receiverObject: (in category '*Etoys-Tweak-Kedama-accessing') ----- - receiverObject: t1 - KedamaEvaluatorNodeState - stateFor: self - at: #receiverObject - put: t1! Item was removed: - ----- Method: ParseNode>>rewriteInfoIn (in category '*Etoys-Tweak-Kedama-accessing') ----- - rewriteInfoIn - ^ (KedamaEvaluatorNodeState stateFor: self at: #rewriteInfoIn) value! Item was removed: - ----- Method: ParseNode>>rewriteInfoIn: (in category '*Etoys-Tweak-Kedama-accessing') ----- - rewriteInfoIn: t1 - KedamaEvaluatorNodeState - stateFor: self - at: #rewriteInfoIn - put: t1! Item was removed: - ----- Method: ParseNode>>rewriteInfoOut (in category '*Etoys-Tweak-Kedama-accessing') ----- - rewriteInfoOut - ^ (KedamaEvaluatorNodeState stateFor: self at: #rewriteInfoOut) value! Item was removed: - ----- Method: ParseNode>>rewriteInfoOut: (in category '*Etoys-Tweak-Kedama-accessing') ----- - rewriteInfoOut: t1 - KedamaEvaluatorNodeState - stateFor: self - at: #rewriteInfoOut - put: t1! Item was removed: - ----- Method: ParseNode>>rvr (in category '*Etoys-Tweak-Kedama-accessing') ----- - rvr - ^ (KedamaEvaluatorNodeState stateFor: self at: #rvr) value! Item was removed: - ----- Method: ParseNode>>rvr: (in category '*Etoys-Tweak-Kedama-accessing') ----- - rvr: t1 - KedamaEvaluatorNodeState - stateFor: self - at: #rvr - put: t1! Item was removed: - ----- Method: ParseNode>>statementType (in category '*Etoys-Tweak-Kedama-accessing') ----- - statementType - ^ (KedamaEvaluatorNodeState stateFor: self at: #statementType) value! Item was removed: - ----- Method: ParseNode>>statementType: (in category '*Etoys-Tweak-Kedama-accessing') ----- - statementType: t1 - KedamaEvaluatorNodeState - stateFor: self - at: #statementType - put: t1! Item was removed: - ----- Method: ParseNode>>stmtChain (in category '*Etoys-Tweak-Kedama-accessing') ----- - stmtChain - ^ (KedamaEvaluatorNodeState stateFor: self at: #stmtChain) value! Item was removed: - ----- Method: ParseNode>>stmtChain: (in category '*Etoys-Tweak-Kedama-accessing') ----- - stmtChain: t1 - KedamaEvaluatorNodeState - stateFor: self - at: #stmtChain - put: t1! Item was removed: - ----- Method: ParseNode>>thisNode (in category '*Etoys-Tweak-Kedama-Generated') ----- - thisNode - ^ self! Item was removed: - ----- Method: ParseNode>>transfer: (in category '*Etoys-Tweak-Kedama-Generated') ----- - transfer: t1 - ^ t1! Item was removed: - ----- Method: ParseNode>>xxxOccurences (in category '*Etoys-Tweak-Kedama-accessing') ----- - xxxOccurences - ^ (KedamaEvaluatorNodeState stateFor: self at: #xxxOccurences) value! Item was removed: - ----- Method: ParseNode>>xxxOccurences: (in category '*Etoys-Tweak-Kedama-accessing') ----- - xxxOccurences: t1 - KedamaEvaluatorNodeState - stateFor: self - at: #xxxOccurences - put: t1! Item was changed: ----- Method: Player class>>setNewInstVarNames: (in category 'user-defined inst vars') ----- setNewInstVarNames: listOfStrings "Make listOfStrings be the new list of instance variable names for the receiver" | disappearing firstAppearing instVarString instVarList | instVarList := self instVarNames asOrderedCollection. disappearing := instVarList copy. disappearing removeAllFoundIn: listOfStrings. disappearing do: [:oldName | self removeAccessorsFor: oldName]. firstAppearing := listOfStrings copy. firstAppearing removeAllFoundIn: instVarList. instVarString := String streamContents: [:aStream | listOfStrings do: [:aString | aStream nextPutAll: aString; nextPut: $ ]]. superclass subclass: self name instanceVariableNames: instVarString classVariableNames: '' poolDictionaries: '' category: self categoryForUniclasses. self flag: #todo. self flag: #uniclasses. "Discuss if we really want to hide uniclasses again" + superclass environment forgetClass: self logged: false. - self environment forgetClass: self logged: false. superclass removeSubclass: self. firstAppearing do: [:newName | self compileAccessorsFor: newName]. ! Item was changed: ----- Method: Project class>>cleanUpEtoysGarbage (in category '*Etoys-Squeakland-utilities') ----- cleanUpEtoysGarbage "Project cleanUpEtoysGarbage" "All these should eventuall go away and be fixed, but for now we have this here." Smalltalk garbageCollect. "Clear weak message sends to remove modal windows from worlds that are closing." (WeakMessageSend allInstances select: [:wm | (wm receiver isKindOf: PasteUpMorph) and: [wm selector = #removeModalWindow]]) do: [:wm | wm receiver: nil]. "Clear the weak dictionary on the class side that keeps node state around in the rewriter" KedamaEvaluatorNodeState initialize. "Clear the KedamaEvaluator that holds on to the last Kedama world" ScriptEditorMorph setDefaultEvaluator. "Clear the hard references to player classes, " (Smalltalk organization listAtCategoryNamed: 'UserObjects') do: [:name | Smalltalk forgetClass: (Smalltalk classNamed: name) logged: false]. Player withAllSubclasses select: [:c | c isSystemDefined not] thenDo: [:c | c superclass removeSubclass: c]. "Clear the paste buffer" HandMorph initialize. "Clear the reference to the project tree in SkObject" SkObject initialize. + PasteUpMorph allInstancesDo: [:m | m presenter ifNotNil: [:p | p flushPlayerListCache]]. Smalltalk garbageCollect.! Item was removed: - ----- Method: ReturnNode>>defaultBlockType: (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultBlockType: t1 - ^ #default! Item was removed: - ----- Method: ReturnNode>>defaultMessageType (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultMessageType - ^ #none! Item was removed: - ----- Method: ReturnNode>>firstInReceivers: (in category '*Etoys-Tweak-Kedama-Generated') ----- - firstInReceivers: t1 - ^ t1 first! Item was removed: - ----- Method: ReturnNode>>isStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isStmt: t1 - ^ t1 = #top - or: [t1 = #condition]! Item was removed: - ----- Method: ReturnNode>>isTest:parentNode: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTest: t1 parentNode: t2 - t1 = true - ifTrue: [^ true]. - ^ (t2 isMemberOf: MessageNode) - and: [t2 receiver = self - and: [t2 messageType value = #condition]]! Item was removed: - ----- Method: ReturnNode>>isTopStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTopStmt: t1 - t1 = nil - ifTrue: [^ true]. - ^ false! Item was removed: - ----- Method: ReturnNode>>rcvr: (in category '*Etoys-Tweak-Kedama-Generated') ----- - rcvr: t1 - ^ t1! Item was removed: - ----- Method: ReturnNode>>thisNode (in category '*Etoys-Tweak-Kedama-Generated') ----- - thisNode - ^ self! Item was removed: - ----- Method: ReturnNode>>transfer: (in category '*Etoys-Tweak-Kedama-Generated') ----- - transfer: t1 - ^ t1! Item was removed: - ----- Method: SelectorNode>>defaultBlockType: (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultBlockType: t1 - ^ #default! Item was removed: - ----- Method: SelectorNode>>defaultMessageType (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultMessageType - ^ #none! Item was removed: - ----- Method: SelectorNode>>firstInReceivers: (in category '*Etoys-Tweak-Kedama-Generated') ----- - firstInReceivers: t1 - ^ t1 first! Item was removed: - ----- Method: SelectorNode>>initialNil (in category '*Etoys-Tweak-Kedama-Generated') ----- - initialNil - ^ nil! Item was removed: - ----- Method: SelectorNode>>isStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isStmt: t1 - ^ t1 = #top - or: [t1 = #condition]! Item was removed: - ----- Method: SelectorNode>>isTest:parentNode: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTest: t1 parentNode: t2 - t1 = true - ifTrue: [^ true]. - ^ (t2 isMemberOf: MessageNode) - and: [t2 receiver = self - and: [t2 messageType value = #condition]]! Item was removed: - ----- Method: SelectorNode>>isTopStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTopStmt: t1 - t1 = nil - ifTrue: [^ true]. - ^ false! Item was removed: - ----- Method: SelectorNode>>rcvr: (in category '*Etoys-Tweak-Kedama-Generated') ----- - rcvr: t1 - ^ t1! Item was removed: - ----- Method: SelectorNode>>thisNode (in category '*Etoys-Tweak-Kedama-Generated') ----- - thisNode - ^ self! Item was removed: - ----- Method: SelectorNode>>transfer: (in category '*Etoys-Tweak-Kedama-Generated') ----- - transfer: t1 - ^ t1! Item was removed: - ----- Method: TempVariableNode>>defaultBlockType: (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultBlockType: t1 - ^ #default! Item was removed: - ----- Method: TempVariableNode>>defaultMessageType (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultMessageType - ^ #none! Item was removed: - ----- Method: TempVariableNode>>firstInReceivers: (in category '*Etoys-Tweak-Kedama-Generated') ----- - firstInReceivers: t1 - ^ t1 first! Item was removed: - ----- Method: TempVariableNode>>initialNil (in category '*Etoys-Tweak-Kedama-Generated') ----- - initialNil - ^ nil! Item was removed: - ----- Method: TempVariableNode>>isStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isStmt: t1 - ^ t1 = #top - or: [t1 = #condition]! Item was removed: - ----- Method: TempVariableNode>>isTest:parentNode: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTest: t1 parentNode: t2 - t1 = true - ifTrue: [^ true]. - ^ (t2 isMemberOf: MessageNode) - and: [t2 receiver = self - and: [t2 messageType value = #condition]]! Item was removed: - ----- Method: TempVariableNode>>isTopStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTopStmt: t1 - t1 = nil - ifTrue: [^ true]. - ^ false! Item was removed: - ----- Method: TempVariableNode>>rcvr: (in category '*Etoys-Tweak-Kedama-Generated') ----- - rcvr: t1 - ^ t1! Item was removed: - ----- Method: TempVariableNode>>rewriteVariable:with:rewriteInfo: (in category '*Etoys-Tweak-Kedama-Generated') ----- - rewriteVariable: t1 with: t2 rewriteInfo: t3 - t2 - ifNil: [^ nil]. - t2 first = t1 - ifTrue: [^ t3]. - ^ nil! Item was removed: - ----- Method: TempVariableNode>>thisNode (in category '*Etoys-Tweak-Kedama-Generated') ----- - thisNode - ^ self! Item was removed: - ----- Method: TempVariableNode>>transfer: (in category '*Etoys-Tweak-Kedama-Generated') ----- - transfer: t1 - ^ t1! Item was removed: - ----- Method: TempVariableNode>>variableReceiver: (in category '*Etoys-Tweak-Kedama-Generated') ----- - variableReceiver: t1 - | t2 t3 | - (self key isKindOf: LookupKey) - ifTrue: [^ self key value]. - t3 := self key. - t2 := Compiler new - evaluate: t3 asString - in: nil - to: t1 - notifying: nil - ifFail: [] - logged: false. - ^ t2! Item was removed: - ----- Method: VariableNode>>defaultBlockType: (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultBlockType: t1 - ^ #default! Item was removed: - ----- Method: VariableNode>>defaultMessageType (in category '*Etoys-Tweak-Kedama-Generated') ----- - defaultMessageType - ^ #none! Item was removed: - ----- Method: VariableNode>>firstInReceivers: (in category '*Etoys-Tweak-Kedama-Generated') ----- - firstInReceivers: t1 - ^ t1 first! Item was removed: - ----- Method: VariableNode>>initialNil (in category '*Etoys-Tweak-Kedama-Generated') ----- - initialNil - ^ nil! Item was removed: - ----- Method: VariableNode>>isStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isStmt: t1 - ^ t1 = #top - or: [t1 = #condition]! Item was removed: - ----- Method: VariableNode>>isTest:parentNode: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTest: t1 parentNode: t2 - t1 = true - ifTrue: [^ true]. - ^ (t2 isMemberOf: MessageNode) - and: [t2 receiver = self - and: [t2 messageType value = #condition]]! Item was removed: - ----- Method: VariableNode>>isTopStmt: (in category '*Etoys-Tweak-Kedama-Generated') ----- - isTopStmt: t1 - t1 = nil - ifTrue: [^ true]. - ^ false! Item was removed: - ----- Method: VariableNode>>rcvr: (in category '*Etoys-Tweak-Kedama-Generated') ----- - rcvr: t1 - ^ t1! Item was removed: - ----- Method: VariableNode>>rewriteVariable:with:rewriteInfo: (in category '*Etoys-Tweak-Kedama-Generated') ----- - rewriteVariable: t1 with: t2 rewriteInfo: t3 - t2 - ifNil: [^ nil]. - t2 first = t1 - ifTrue: [^ t3]. - ^ nil! Item was removed: - ----- Method: VariableNode>>thisNode (in category '*Etoys-Tweak-Kedama-Generated') ----- - thisNode - ^ self! Item was removed: - ----- Method: VariableNode>>transfer: (in category '*Etoys-Tweak-Kedama-Generated') ----- - transfer: t1 - ^ t1! Item was removed: - ----- Method: VariableNode>>variableReceiver: (in category '*Etoys-Tweak-Kedama-Generated') ----- - variableReceiver: t1 - | t2 t3 | - (self key isKindOf: LookupKey) - ifTrue: [^ self key value]. - t3 := self key. - t2 := Compiler new - evaluate: t3 asString - in: nil - to: t1 - notifying: nil - ifFail: [] - logged: false. - ^ t2! |
Free forum by Nabble | Edit this page |