[squeak-dev] The Trunk: Compiler-ar.108.mcz
Nicolas Cellier
nicolas.cellier.aka.nice at gmail.com
Tue Dec 22 13:41:57 UTC 2009
Why does this depend on interactive ?
method := self interactive ifTrue: [ methodNode
generateWithTempNames ]
ifFalse: [methodNode generate].
Nicolas
2009/12/22 <commits at source.squeak.org>:
> Andreas Raab uploaded a new version of Compiler to project The Trunk:
> http://source.squeak.org/trunk/Compiler-ar.108.mcz
>
> ==================== Summary ====================
>
> Name: Compiler-ar.108
> Author: ar
> Time: 22 December 2009, 12:48:23 pm
> UUID: 538bb76e-8967-e445-9b2c-161c98c289d6
> Ancestors: Compiler-ar.107
>
> CompiledMethodTrailer phase 2.
>
> =============== Diff against Compiler-ar.107 ===============
>
> Item was changed:
> ----- Method: Compiler>>compiledMethodFor:in:to:notifying:ifFail:logged: (in category 'public access') -----
> compiledMethodFor: textOrStream in: aContext to: receiver notifying: aRequestor ifFail: failBlock logged: logFlag
> "Compiles the sourceStream into a parse tree, then generates code
> into a method, and answers it. If receiver is not nil, then the text can
> refer to instance variables of that receiver (the Inspector uses this).
> If aContext is not nil, the text can refer to temporaries in that context
> (the Debugger uses this). If aRequestor is not nil, then it will receive a
> notify:at: message before the attempt to evaluate is aborted."
>
> | methodNode method |
> class := (aContext == nil ifTrue: [receiver] ifFalse: [aContext receiver]) class.
> self from: textOrStream class: class context: aContext notifying: aRequestor.
> methodNode := self translate: sourceStream noPattern: true ifFail: [^failBlock value].
> + method := self interactive ifTrue: [ methodNode generateWithTempNames ]
> + ifFalse: [methodNode generate].
> +
> - method := methodNode generate: #(0 0 0 0).
> - self interactive ifTrue:
> - [method := method copyWithTempsFromMethodNode: methodNode].
> logFlag ifTrue:
> [SystemChangeNotifier uniqueInstance evaluated: sourceStream contents context: aContext].
> ^method!
>
> Item was changed:
> ----- Method: Compiler>>evaluate:in:to:notifying:ifFail:logged: (in category 'public access') -----
> evaluate: textOrStream in: aContext to: receiver notifying: aRequestor ifFail: failBlock logged: logFlag
> "Compiles the sourceStream into a parse tree, then generates code into a
> method. This method is then installed in the receiver's class so that it
> can be invoked. In other words, if receiver is not nil, then the text can
> refer to instance variables of that receiver (the Inspector uses this). If
> aContext is not nil, the text can refer to temporaries in that context (the
> Debugger uses this). If aRequestor is not nil, then it will receive a
> notify:at: message before the attempt to evaluate is aborted. Finally, the
> compiled method is invoked from here as DoIt or (in the case of
> evaluation in aContext) DoItIn:. The method is subsequently removed
> from the class, but this will not get done if the invocation causes an
> error which is terminated. Such garbage can be removed by executing:
> Smalltalk allBehaviorsDo: [:cl | cl removeSelector: #DoIt; removeSelector:
> #DoItIn:]."
>
> | methodNode method value toLog itsSelection itsSelectionString |
> class := (aContext == nil ifTrue: [receiver] ifFalse: [aContext receiver]) class.
> self from: textOrStream class: class context: aContext notifying: aRequestor.
> methodNode := self translate: sourceStream noPattern: true ifFail:
> [^failBlock value].
> +
> + method := self interactive ifTrue: [ methodNode generateWithTempNames ]
> + ifFalse: [methodNode generate].
> - method := methodNode generate: #(0 0 0 0).
> - self interactive ifTrue:
> - [method := method copyWithTempsFromMethodNode: methodNode].
>
> value := receiver
> withArgs: (context ifNil: [#()] ifNotNil: [{context}])
> executeMethod: method.
>
> logFlag ifTrue:[
> toLog := ((requestor respondsTo: #selection)
> and:[(itsSelection := requestor selection) notNil
> and:[(itsSelectionString := itsSelection asString) isEmptyOrNil not]])
> ifTrue:[itsSelectionString]
> ifFalse:[sourceStream contents].
> SystemChangeNotifier uniqueInstance evaluated: toLog context: aContext].
> ^ value!
>
>
>
More information about the Squeak-dev
mailing list
|