[squeak-dev] The Trunk: Compiler-TraitTest.409.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Sep 2 15:11:01 UTC 2019


Marcel Taeumel uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-TraitTest.409.mcz

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

Name: Compiler-TraitTest.409
Author: TraitTest
Time: 2 September 2019, 5:10:57.854301 pm
UUID: b13d5a17-2a64-8048-9e67-c70d875eb5e6
Ancestors: Compiler-ct.408

Fixes #markerOrNilFor: comment (SistaV1) and implementation (V3). returnSelf and returnTop got mixed up.

=============== Diff against Compiler-ct.408 ===============

Item was changed:
  ----- Method: EncoderForSistaV1 class>>markerOrNilFor: (in category 'compiled method support') -----
  markerOrNilFor: aMethod
  	"If aMethod is a marker method, answer the symbol used to mark it.  Otherwise
  	 answer nil.  What is a marker method?  It is method with body like 
  		'self subclassResponsibility' or '^ self subclassResponsibility' 
  	 used to indicate ('mark') a special property.
  
  	Marker methods compile to two bytecode forms, this:
  		self
  		send: <literal 1>
  		pop
  		returnSelf
  	or this:
  		self
  		send: <literal 1>
  		returnTop"
  	| expectedHeaderPlusLliteralSize e byte |
  	expectedHeaderPlusLliteralSize := Smalltalk wordSize * 4.
  	^(((e := aMethod endPC - expectedHeaderPlusLliteralSize) = 3 or: [e = 4]) 
  	  and: [aMethod numLiterals = 3
+ 	  and: [(aMethod at: expectedHeaderPlusLliteralSize + 1) = 16r4C "push self"
+ 	  and: [(aMethod at: expectedHeaderPlusLliteralSize + 2) = 16r80 "send"
+ 	  and: [(byte := aMethod at: expectedHeaderPlusLliteralSize + 3) = 16rD8 "pop" or: [byte = 16r5C "returnTop"]]]]])
- 	  and: [(aMethod at: expectedHeaderPlusLliteralSize + 1) = 16r4C	"push self"
- 	  and: [(aMethod at: expectedHeaderPlusLliteralSize + 2) = 16r80
- 	  and: [(byte := aMethod at: expectedHeaderPlusLliteralSize + 3) = 16rD8 or: [byte = 16r5C]]]]])	"pop or returnSelf"
  		ifTrue: [aMethod literalAt: 1]!

Item was changed:
  ----- Method: EncoderForV3 class>>markerOrNilFor: (in category 'compiled method support') -----
  markerOrNilFor: aMethod
  	"If aMethod is a marker method, answer the symbol used to mark it.  Otherwise
  	 answer nil.  What is a marker method?  It is method with body like 
  		'self subclassResponsibility' or '^ self subclassResponsibility' 
  	 used to indicate ('mark') a special property.
  
  	Marker methods compile to two bytecode forms, this:
  		self
  		send: <literal 1>
  		pop
  		returnSelf
  	or this:
  		self
  		send: <literal 1>
  		returnTop"
  	| expectedHeaderPlusLliteralSize e byte |
  	expectedHeaderPlusLliteralSize := Smalltalk wordSize * 4.
  	^(((e := aMethod endPC - expectedHeaderPlusLliteralSize) = 3 or: [e = 4]) 
  	  and: [aMethod numLiterals = 3
+ 	  and: [(aMethod at: expectedHeaderPlusLliteralSize + 1) = 16r70 "push self"
+ 	  and: [(aMethod at: expectedHeaderPlusLliteralSize + 2) = 16rD0 "send"
+ 	  and: [(byte := aMethod at: expectedHeaderPlusLliteralSize + 3) = 16r87 "pop" or: [byte = 16r7C "returnTop"]]]]])
- 	  and: [(aMethod at: expectedHeaderPlusLliteralSize + 1) = 16r70	"push self"
- 	  and: [(aMethod at: expectedHeaderPlusLliteralSize + 2) = 16rD0
- 	  and: [(byte := aMethod at: expectedHeaderPlusLliteralSize + 3) = 16r87 or: [byte = 16r78]]]]])	"pop or returnSelf"
  		ifTrue: [aMethod literalAt: 1]!



More information about the Squeak-dev mailing list