[Vm-dev] VM Maker: BytecodeSets.spur-eem.78.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Mar 14 20:31:05 UTC 2018


Eliot Miranda uploaded a new version of BytecodeSets to project VM Maker:
http://source.squeak.org/VMMaker/BytecodeSets.spur-eem.78.mcz

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

Name: BytecodeSets.spur-eem.78
Author: eem
Time: 14 March 2018, 1:30:53.55385 pm
UUID: d8b1dd67-7d87-4b6b-91f2-d29060f54f32
Ancestors: BytecodeSets.spur-eem.77

Implement multiple bytecode set aware scanning machinery for NewsqueakV4.

=============== Diff against BytecodeSets.spur-eem.77 ===============

Item was added:
+ ----- Method: EncoderForNewsqueakV4 class>>scanBlockOrNilForLiteral: (in category 'scanning') -----
+ scanBlockOrNilForLiteral: aLiteral
+ 	"Answer a block argument for CompiledMethod>>#scanFor: that answers
+ 	 if the method refers to the literal implicitly via a special bytecode.
+ 	 If the literal is not accessible via a special bytecode, answer nil."
+ 	| value |
+ 
+ 	"80-95		0101 i i i i		Send Arithmetic Message #iiii
+ 	 96-111	0110 i i i i		Send Special Message #iiii"
+ 	aLiteral isSymbol ifTrue:
+ 		[value := 80 + ((Smalltalk specialSelectors indexOf: aLiteral ifAbsent: [^nil]) // 2).
+ 		 ^[:byte| byte = value]].
+ 
+ 	"78			01001110		Push 0
+ 	 79			01001111		Push 1"
+ 	aLiteral isInteger ifTrue:
+ 		[(aLiteral between: 0 and: 1) ifFalse: [^nil].
+ 		 value := aLiteral + 78.
+ 		 ^[:byte| byte = value]].
+ 
+ 	"77			01001101		Push false [* 1:true, 2:nil, 3:thisContext, ..., -N: pushExplicitOuter: N, N = Extend B]"
+ 	aLiteral == false ifTrue:
+ 		[^[:byte| byte = 77]].
+ 	aLiteral == true ifTrue:
+ 		[^[:b1 :b2 :b3| b1 = 16rE1 and: [b2 = 1 and: [b3 = 77]]]].
+ 	aLiteral == nil ifTrue:
+ 		[^[:b1 :b2 :b3| b1 = 16rE1 and: [b2 = 2 and: [b3 = 77]]]].
+ 
+ 	^nil!



More information about the Vm-dev mailing list