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

Marcel Taeumel marcel.taeumel at hpi.de
Mon Sep 2 15:14:00 UTC 2019


Sorry for the wrong author initials "TraitsTest". I still had a debugger opened that replaced the author initials during a test run... :-)

Best,
Marcel
Am 02.09.2019 17:11:10 schrieb commits at source.squeak.org <commits at source.squeak.org>:
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:
pop
returnSelf
or this:
self
send:
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:
pop
returnSelf
or this:
self
send:
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]!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190902/ac2d03ac/attachment.html>


More information about the Squeak-dev mailing list