Bert Freudenberg uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-bf.392.mcz ==================== Summary ==================== Name: Compiler-bf.392 Author: bf Time: 23 August 2018, 6:06:38.314464 pm UUID: 039d1b50-5fe6-4c03-b82f-8015a2bac469 Ancestors: Compiler-eem.391 Mark macro senders for browsing =============== Diff against Compiler-eem.391 =============== Item was added: + ----- Method: MessageNode class>>isMacroEmitter: (in category 'browsing support') ----- + isMacroEmitter: aLiteral + "Let our macro methods be found when browsing senders" + ^aLiteral isSymbol + and: [MacroEmitters includes: aLiteral]! Item was added: + ----- Method: MessageNode class>>isMacroPrinter: (in category 'browsing support') ----- + isMacroPrinter: aLiteral + "Let our macro methods be found when browsing senders" + ^aLiteral isSymbol + and: [MacroPrinters includes: aLiteral] + ! Item was added: + ----- Method: MessageNode class>>isMacroSizer: (in category 'browsing support') ----- + isMacroSizer: aLiteral + "Let our macro methods be found when browsing senders" + ^aLiteral isSymbol + and: [MacroSizers includes: aLiteral] + ! Item was added: + ----- Method: MessageNode class>>isMacroTransformer: (in category 'browsing support') ----- + isMacroTransformer: aLiteral + "Let our macro methods be found when browsing senders" + ^aLiteral isSymbol + and: [MacroTransformers includes: aLiteral]! Item was changed: ----- Method: MessageNode>>emitCodeForEffect:encoder: (in category 'code generation') ----- emitCodeForEffect: stack encoder: encoder "For #ifTrue:ifFalse: and #whileTrue: / #whileFalse: style messages, the pc is set to the jump instruction, so that mustBeBoolean exceptions can be shown correctly." + <hasLiteralTest: #isMacroEmitter:> special > 0 ifTrue: [pc := 0. self perform: (MacroEmitters at: special) with: stack with: encoder with: false] ifFalse: [super emitCodeForEffect: stack encoder: encoder]! Item was changed: ----- Method: MessageNode>>emitCodeForValue:encoder: (in category 'code generation') ----- emitCodeForValue: stack encoder: encoder "For #ifTrue:ifFalse: and #whileTrue: / #whileFalse: style messages, the pc is set to the jump instruction, so that mustBeBoolean exceptions can be shown correctly." + <hasLiteralTest: #isMacroEmitter:> special > 0 ifTrue: [pc := 0. self perform: (MacroEmitters at: special) with: stack with: encoder with: true] ifFalse: [receiver ~~ nil ifTrue: [receiver emitCodeForValue: stack encoder: encoder]. arguments do: [:argument | argument emitCodeForValue: stack encoder: encoder]. pc := encoder nextPC. "debug pc is first byte of the send, i.e. the next byte". selector emitCode: stack args: arguments size encoder: encoder super: receiver == NodeSuper]! Item was changed: ----- Method: MessageNode>>printOn:indent: (in category 'printing') ----- printOn: aStream indent: level "may not need this check anymore - may be fixed by the #receiver: change" + <hasLiteralTest: #isMacroPrinter:> + special ifNil: [^aStream nextPutAll: '** MessageNode with nil special **']. special > 0 ifTrue: [^self perform: self macroPrinter with: aStream with: level]. self printReceiver: receiver on: aStream indent: level. selector isForFFICall ifTrue: [aStream space. selector printAsFFICallWithArguments: arguments on: aStream indent: 0] ifFalse: [self printKeywords: selector key arguments: arguments on: aStream indent: level]! Item was changed: ----- Method: MessageNode>>printWithClosureAnalysisOn:indent: (in category 'printing') ----- printWithClosureAnalysisOn: aStream indent: level "may not need this check anymore - may be fixed by the #receiver: change" + <hasLiteralTest: #isMacroPrinter:> + special ifNil: [^aStream nextPutAll: '** MessageNode with nil special **']. special > 0 ifTrue: [^self perform: self macroPrinter with: aStream with: level]. self printWithClosureAnalysisReceiver: receiver on: aStream indent: level. self printWithClosureAnalysisKeywords: selector key arguments: arguments on: aStream indent: level! Item was changed: ----- Method: MessageNode>>sizeCodeForEffect: (in category 'code generation') ----- sizeCodeForEffect: encoder + <hasLiteralTest: #isMacroSizer:> special > 0 ifTrue: [encoder noteOptimizedSelector: originalSelector. ^self perform: (MacroSizers at: special) with: encoder with: false]. ^super sizeCodeForEffect: encoder! Item was changed: ----- Method: MessageNode>>sizeCodeForValue: (in category 'code generation') ----- sizeCodeForValue: encoder + <hasLiteralTest: #isMacroSizer:> | total | special > 0 ifTrue: [encoder noteOptimizedSelector: originalSelector. ^self perform: (MacroSizers at: special) with: encoder with: true]. receiver == NodeSuper ifTrue: [selector := selector forSuperSend "only necessary for special selectors"]. total := selector sizeCode: encoder args: arguments size super: receiver == NodeSuper. receiver ifNotNil: [total := total + (receiver sizeCodeForValue: encoder)]. sizes := arguments collect: [:arg | | argSize | argSize := arg sizeCodeForValue: encoder. total := total + argSize. argSize]. ^total! Item was changed: ----- Method: MessageNode>>transform: (in category 'macro transformations') ----- transform: encoder + <hasLiteralTest: #isMacroTransformer:> + special = 0 ifTrue: [^false]. (self perform: (MacroTransformers at: special) with: encoder) ifTrue: [^true] ifFalse: [special := 0. ^false]! |
> On Aug 23, 2018, at 5:06 PM, [hidden email] wrote: > > Bert Freudenberg uploaded a new version of Compiler to project The Trunk: > http://source.squeak.org/trunk/Compiler-bf.392.mcz > > ==================== Summary ==================== > > Name: Compiler-bf.392 > Author: bf > Time: 23 August 2018, 6:06:38.314464 pm > UUID: 039d1b50-5fe6-4c03-b82f-8015a2bac469 > Ancestors: Compiler-eem.391 > > Mark macro senders for browsing Cool! Very nice. > > =============== Diff against Compiler-eem.391 =============== > > Item was added: > + ----- Method: MessageNode class>>isMacroEmitter: (in category 'browsing support') ----- > + isMacroEmitter: aLiteral > + "Let our macro methods be found when browsing senders" > + ^aLiteral isSymbol > + and: [MacroEmitters includes: aLiteral]! > > Item was added: > + ----- Method: MessageNode class>>isMacroPrinter: (in category 'browsing support') ----- > + isMacroPrinter: aLiteral > + "Let our macro methods be found when browsing senders" > + ^aLiteral isSymbol > + and: [MacroPrinters includes: aLiteral] > + ! > > Item was added: > + ----- Method: MessageNode class>>isMacroSizer: (in category 'browsing support') ----- > + isMacroSizer: aLiteral > + "Let our macro methods be found when browsing senders" > + ^aLiteral isSymbol > + and: [MacroSizers includes: aLiteral] > + ! > > Item was added: > + ----- Method: MessageNode class>>isMacroTransformer: (in category 'browsing support') ----- > + isMacroTransformer: aLiteral > + "Let our macro methods be found when browsing senders" > + ^aLiteral isSymbol > + and: [MacroTransformers includes: aLiteral]! > > Item was changed: > ----- Method: MessageNode>>emitCodeForEffect:encoder: (in category 'code generation') ----- > emitCodeForEffect: stack encoder: encoder > "For #ifTrue:ifFalse: and #whileTrue: / #whileFalse: style messages, the pc is set to the jump instruction, so that mustBeBoolean exceptions can be shown correctly." > + <hasLiteralTest: #isMacroEmitter:> > special > 0 > ifTrue: > [pc := 0. > self perform: (MacroEmitters at: special) with: stack with: encoder with: false] > ifFalse: > [super emitCodeForEffect: stack encoder: encoder]! > > Item was changed: > ----- Method: MessageNode>>emitCodeForValue:encoder: (in category 'code generation') ----- > emitCodeForValue: stack encoder: encoder > "For #ifTrue:ifFalse: and #whileTrue: / #whileFalse: style messages, the pc is set to the jump instruction, so that mustBeBoolean exceptions can be shown correctly." > + <hasLiteralTest: #isMacroEmitter:> > special > 0 > ifTrue: > [pc := 0. > self perform: (MacroEmitters at: special) with: stack with: encoder with: true] > ifFalse: > [receiver ~~ nil ifTrue: [receiver emitCodeForValue: stack encoder: encoder]. > arguments do: [:argument | argument emitCodeForValue: stack encoder: encoder]. > pc := encoder nextPC. "debug pc is first byte of the send, i.e. the next byte". > selector > emitCode: stack > args: arguments size > encoder: encoder > super: receiver == NodeSuper]! > > Item was changed: > ----- Method: MessageNode>>printOn:indent: (in category 'printing') ----- > printOn: aStream indent: level > "may not need this check anymore - may be fixed by the #receiver: change" > + <hasLiteralTest: #isMacroPrinter:> > + > special ifNil: [^aStream nextPutAll: '** MessageNode with nil special **']. > > special > 0 ifTrue: > [^self perform: self macroPrinter with: aStream with: level]. > > self printReceiver: receiver on: aStream indent: level. > selector isForFFICall > ifTrue: > [aStream space. > selector > printAsFFICallWithArguments: arguments > on: aStream > indent: 0] > ifFalse: > [self printKeywords: selector key > arguments: arguments > on: aStream > indent: level]! > > Item was changed: > ----- Method: MessageNode>>printWithClosureAnalysisOn:indent: (in category 'printing') ----- > printWithClosureAnalysisOn: aStream indent: level > "may not need this check anymore - may be fixed by the #receiver: change" > + <hasLiteralTest: #isMacroPrinter:> > + > special ifNil: [^aStream nextPutAll: '** MessageNode with nil special **']. > > special > 0 ifTrue: > [^self perform: self macroPrinter with: aStream with: level]. > > self printWithClosureAnalysisReceiver: receiver on: aStream indent: level. > self printWithClosureAnalysisKeywords: selector key > arguments: arguments > on: aStream > indent: level! > > Item was changed: > ----- Method: MessageNode>>sizeCodeForEffect: (in category 'code generation') ----- > sizeCodeForEffect: encoder > + <hasLiteralTest: #isMacroSizer:> > > special > 0 > ifTrue: > [encoder noteOptimizedSelector: originalSelector. > ^self perform: (MacroSizers at: special) with: encoder with: false]. > ^super sizeCodeForEffect: encoder! > > Item was changed: > ----- Method: MessageNode>>sizeCodeForValue: (in category 'code generation') ----- > sizeCodeForValue: encoder > + <hasLiteralTest: #isMacroSizer:> > | total | > special > 0 ifTrue: > [encoder noteOptimizedSelector: originalSelector. > ^self perform: (MacroSizers at: special) with: encoder with: true]. > receiver == NodeSuper ifTrue: > [selector := selector forSuperSend "only necessary for special selectors"]. > total := selector sizeCode: encoder args: arguments size super: receiver == NodeSuper. > receiver ifNotNil: > [total := total + (receiver sizeCodeForValue: encoder)]. > sizes := arguments collect: > [:arg | | argSize | > argSize := arg sizeCodeForValue: encoder. > total := total + argSize. > argSize]. > ^total! > > Item was changed: > ----- Method: MessageNode>>transform: (in category 'macro transformations') ----- > transform: encoder > + <hasLiteralTest: #isMacroTransformer:> > + > special = 0 ifTrue: [^false]. > (self perform: (MacroTransformers at: special) with: encoder) > ifTrue: > [^true] > ifFalse: > [special := 0. ^false]! > > |
Free forum by Nabble | Edit this page |