The Trunk: Compiler-eem.298.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.298.mcz

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

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

Name: Compiler-eem.298
Author: eem
Time: 29 May 2015, 11:59:13.77 am
UUID: b06cc000-4a40-45cd-a0b2-a2d1c0309e39
Ancestors: Compiler-cmm.297

Provide multiple-bytecode-sets aware support for markerOrNil

=============== Diff against Compiler-cmm.297 ===============

Item was added:
+ ----- Method: BytecodeEncoder 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"
+ ^self subclassResponsibility!

Item was added:
+ ----- 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"
+ | e |
+ ^(((e := aMethod endPC) = 19 or: [e = 20])
+  and: [aMethod numLiterals = 3
+  and: [(aMethod at: 17) = 16r70 "push self"
+  and: [(aMethod at: 18) = 16rD0]]]) "send <literal 1>"
+ ifTrue: [aMethod literalAt: 1]!