The Trunk: Compiler-eem.362.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Compiler-eem.362.mcz

commits-2
Eliot Miranda uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-eem.362.mcz

==================== Summary ====================

Name: Compiler-eem.362
Author: eem
Time: 5 January 2018, 10:30:42.489732 am
UUID: 6024b2f1-3e38-4625-a934-dd3f7cb29484
Ancestors: Compiler-eem.361

Implement super sends in full blocks.  Since CompiledBlock uses the last literal to refer to the outer CompiledCode, it can't hold the class association used in conventional super sends.  Hence within a block a super send must use the directed super send form.

=============== Diff against Compiler-eem.361 ===============

Item was added:
+ ----- Method: BytecodeEncoder>>generatingFullBlock (in category 'testing') -----
+ generatingFullBlock
+ "Answer if the encoder is currently generating a FullBlock, embedded in some method."
+
+ "When generating a FullBlock a copy of the encoder for the home emthod (rootNode)
+ is used, and hence the following is true."
+ ^rootNode encoder ~~ self!

Item was added:
+ ----- Method: Decompiler>>directedSuperSend:numArgs: (in category 'instruction decoding') -----
+ directedSuperSend: selector numArgs: numArgs
+ stack removeLast. "Discard the pushed class."
+ ^self send: selector super: true numArgs: numArgs!

Item was changed:
  ----- Method: SelectorNode>>emitCode:args:encoder:super: (in category 'code generation') -----
  emitCode: stack args: nArgs encoder: encoder super: supered
  stack pop: nArgs.
  ^supered
  ifTrue:
+ [(encoder supportsFullBlocks
+  and: [encoder generatingFullBlock])
+ ifTrue:
+ [encoder genPushLiteral: (encoder sharableLitIndex: encoder classEncoding).
+ encoder genSendDirectedSuper: index numArgs: nArgs]
+ ifFalse: [encoder genSendSuper: index numArgs: nArgs]]
- [encoder genSendSuper: index numArgs: nArgs]
  ifFalse:
  [encoder
  genSend: (code < Send ifTrue: [code negated] ifFalse: [index])
  numArgs: nArgs]!

Item was changed:
  ----- Method: SelectorNode>>sizeCode:args:super: (in category 'code generation') -----
  sizeCode: encoder args: nArgs super: supered
  self reserve: encoder.
  ^supered
  ifTrue:
  [code < Send "i.e. its a special selector" ifTrue:
  [code := self code: (index := encoder sharableLitIndex: key) type: 5].
+ (encoder supportsFullBlocks
+  and: [encoder generatingFullBlock])
+ ifTrue: [(encoder sizePushLiteral: (encoder sharableLitIndex: encoder classEncoding))
+ + (encoder sizeSendDirectedSuper: index numArgs: nArgs)]
+ ifFalse: [encoder sizeSendSuper: index numArgs: nArgs]]
- encoder sizeSendSuper: index numArgs: nArgs]
  ifFalse:
  [self flag: #yuck. "special selector sends cause this problem"
  encoder
  sizeSend: (code < Send ifTrue: [code negated] ifFalse: [index])
  numArgs: nArgs]!