[Pkg] The Trunk: Compiler-eem.281.mcz

commits at source.squeak.org commits at source.squeak.org
Wed May 14 19:07:59 UTC 2014


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

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

Name: Compiler-eem.281
Author: eem
Time: 14 May 2014, 12:07:35.957 pm
UUID: 6bcb563c-2c68-4290-b63e-9a8cfc1eb1e9
Ancestors: Compiler-eem.280

Implement (more coherently than the alternateInterpret...
scheme) multiple bytecode set interpretation support in
BytecodeEncoder class and subclasses.  This support is
for a soon-to-be-published version of Kernel, whose
InstructionStream depends on this.

Nuke the now obsolete "long form" encoder class hacks.

=============== Diff against Compiler-eem.280 ===============

Item was added:
+ ----- Method: BytecodeEncoder class>>extensionsAt:in:into: (in category 'instruction stream support') -----
+ extensionsAt: pc in: aCompiledMethod into: trinaryBlock
+ 	"If the bytecode at pc is an extension then evaluate aTrinaryBlock
+ 	 with the values of extA and extB and number of extension *bytes*.
+ 	 If the bytecode at pc is not extended then evaluate with 0, 0, 0." 
+ 	self subclassResponsibility!

Item was added:
+ ----- Method: BytecodeEncoder class>>interpretJumpIfCondIn: (in category 'instruction stream support') -----
+ interpretJumpIfCondIn: anInstructionStream
+ 	"Double-dispatch through the encoder to select the correct conditional jump decoder for the instruction set."
+ 	self subclassResponsibility!

Item was added:
+ ----- Method: BytecodeEncoder class>>interpretJumpIn: (in category 'instruction stream support') -----
+ interpretJumpIn: anInstructionStream
+ 	"Double-dispatch through the encoder to select the correct jump decoder for the instruction set."
+ 	self subclassResponsibility!

Item was added:
+ ----- Method: BytecodeEncoder class>>interpretNextInstructionFor:in: (in category 'instruction stream support') -----
+ interpretNextInstructionFor: aClient in: anInstructionStream
+ 	"Double-dispatch through the encoder to select the correct instruction set decoder."
+ 	self subclassResponsibility!

Item was removed:
- BytecodeEncoder subclass: #EncoderForLongFormV3
- 	instanceVariableNames: ''
- 	classVariableNames: ''
- 	poolDictionaries: ''
- 	category: 'Compiler-Kernel'!
- 
- !EncoderForLongFormV3 commentStamp: '<historical>' prior: 0!
- I am an alternate to EncoderForV3 that tries to use thje longest forms of bytecodes possible so as to avoid using as many bytecode as possible to allow for the unused portions of the bytecode set this makes available to be reassigned.
- 
- 
- 
- I do not use the following ranges
- 
- 0 through 111
- 
- 	   0- 15 	0000iiii 	Push Receiver Variable #iiii
- 
- 	  16- 31 	0001iiii 	Push Temporary Location #iiii
- 
- 	  32- 63 	001iiiii 		Push Literal Constant #iiiii
- 
- 	  64- 95 	010iiiii 		Push Literal Variable #iiiii
- 
- 	  96-103 	01100iii 	Pop and Store Receiver Variable #iii
- 
- 	104-111 	01101iii 	Pop and Store Temporary Location #iii
- 
- 138-159
- 
- 	138-143 				Unused.
- 
- 	144-151 	10010iii 	Jump iii + 1 (i.e., 1 through 8).
- 
- 	152-159 	10011iii 	Pop and Jump 0n False iii +1 (i.e., 1 through 8).
- 
- 176-255
- 
- 	176-191 	1011iiii 	Send Arithmetic Message #iiii
- 
- 	192-207 	1100iiii 	Send Special Message #iiii
- 
- 	208-223 	1101iiii 	Send Literal Selector #iiii With No Arguments
- 
- 	224-239 	1110iiii 	Send Literal Selector #iiii With 1 Argument
- 
- 	240-255 	1111iiii 	Send Literal Selector #iiii With 2 Arguments
- 
- = 112 + (160 - 138) + (256 - 176) =  214, or 84% of the bytecodes!

Item was removed:
- ----- Method: EncoderForLongFormV3>>genBranchPopFalse: (in category 'bytecode generation') -----
- genBranchPopFalse: distance
- 	"See BlueBook page 596"
- 	distance < 0 ifTrue:
- 		[^self outOfRangeError: 'distance' index: distance range: 0 to: 1023].
- 	distance < 1024 ifTrue:
- 		["172-175 	101011ii jjjjjjjj 	Pop and Jump On False ii *256+jjjjjjjj"
- 		 stream
- 			nextPut: 172 + (distance bitShift: -8);
- 			nextPut: distance + 1024 \\ 256.
- 		 ^self].
- 	^self outOfRangeError: 'distance' index: distance range: 0 to: 1023!

Item was removed:
- ----- Method: EncoderForLongFormV3>>genBranchPopTrue: (in category 'bytecode generation') -----
- genBranchPopTrue: distance
- 	"See BlueBook page 596"
- 	distance < 0 ifTrue:
- 		[^self outOfRangeError: 'distance' index: distance range: 0 to: 1023].
- 	distance < 1024 ifTrue:
- 		["168-171 	101010ii jjjjjjjj 	Pop and Jump On True ii *256+jjjjjjjj"
- 		 stream
- 			nextPut: 168 + (distance bitShift: -8);
- 			nextPut: distance + 1024 \\ 256.
- 		 ^self].
- 	^self outOfRangeError: 'distance' index: distance range: 0 to: 1023!

Item was removed:
- ----- Method: EncoderForLongFormV3>>genDup (in category 'bytecode generation') -----
- genDup
- 	"See BlueBook page 596"
- 	"136 	10001000 	Duplicate Stack Top"
- 	stream nextPut: 136!

Item was removed:
- ----- Method: EncoderForLongFormV3>>genJump: (in category 'bytecode generation') -----
- genJump: distance
- 	"See BlueBook page 596"
- 	^self genJumpLong: distance!

Item was removed:
- ----- Method: EncoderForLongFormV3>>genJumpLong: (in category 'bytecode generation') -----
- genJumpLong: distance
- 	"See BlueBook page 596"
- 	(distance >= -1024 and: [distance < 1024]) ifTrue:
- 		["160-167 	10100iii jjjjjjjj 	Jump(iii - 4) *256+jjjjjjjj"
- 		 stream
- 			nextPut: 160 + (distance + 1024 bitShift: -8);
- 			nextPut: distance + 1024 \\ 256.
- 		 ^self].
- 	^self outOfRangeError: 'distance' index: distance range: -1024 to: 1023!

Item was removed:
- ----- Method: EncoderForLongFormV3>>genPop (in category 'bytecode generation') -----
- genPop
- 	"See BlueBook page 596"
- 	"135 	10000111 	Pop Stack Top"
- 	stream nextPut: 135!

Item was removed:
- ----- Method: EncoderForLongFormV3>>genPushInstVar: (in category 'bytecode generation') -----
- genPushInstVar: instVarIndex
- 	"See BlueBook page 596"
- 	(instVarIndex >= 0 and: [instVarIndex < 64]) ifTrue: 
- 		["128 	10000000 jjkkkkkk 	Push (Receiver Variable, Temporary Location, Literal Constant, Literal Variable) [jj] #kkkkkk"
- 		 stream
- 			nextPut: 128;
- 			nextPut: instVarIndex.
- 		 ^self].
- 	self genPushInstVarLong: instVarIndex!

Item was removed:
- ----- Method: EncoderForLongFormV3>>genPushInstVarLong: (in category 'bytecode generation') -----
- genPushInstVarLong: instVarIndex
- 	"See BlueBook page 596"
- 	"See also MaybeContextInstanceVariableNode"
- 	(instVarIndex >= 0 and: [instVarIndex < 256]) ifTrue: 
- 		["132 	10000100 iiijjjjj kkkkkkkk 	(Send, Send Super, Push Receiver Variable, Push Literal Constant, Push Literal Variable, Store Receiver Variable, Store-Pop Receiver Variable, Store Literal Variable)[iii] #kkkkkkkk jjjjj"
- 		 stream
- 			nextPut: 132;
- 			nextPut: 64;
- 			nextPut: instVarIndex.
- 		 ^self].
- 	^self outOfRangeError: 'index' index: instVarIndex range: 0 to: 255!

Item was removed:
- ----- Method: EncoderForLongFormV3>>genPushLiteral: (in category 'bytecode generation') -----
- genPushLiteral: literalIndex
- 	"See BlueBook page 596"
- 	literalIndex < 0 ifTrue: 
- 		[^self outOfRangeError: 'index' index: literalIndex range: 0 to: 255].
- 	literalIndex < 64 ifTrue: 
- 		["128 	10000000 jjkkkkkk 	Push (Receiver Variable, Temporary Location, Literal Constant, Literal Variable) [jj] #kkkkkk"
- 		 stream
- 			nextPut: 128;
- 			nextPut: 128 + literalIndex.
- 		 ^self].
- 	literalIndex < 256 ifTrue: 
- 		["132 	10000100 iiijjjjj kkkkkkkk 	(Send, Send Super, Push Receiver Variable, Push Literal Constant, Push Literal Variable, Store Receiver Variable, Store-Pop Receiver Variable, Store Literal Variable)[iii] #kkkkkkkk jjjjj"
- 		 stream
- 			nextPut: 132;
- 			nextPut: 96;
- 			nextPut: literalIndex.
- 		 ^self].
- 	^self outOfRangeError: 'index' index: literalIndex range: 0 to: 255!

Item was removed:
- ----- Method: EncoderForLongFormV3>>genPushLiteralVar: (in category 'bytecode generation') -----
- genPushLiteralVar: literalIndex
- 	"See BlueBook page 596"
- 	literalIndex < 0 ifTrue: 
- 		[^self outOfRangeError: 'index' index: literalIndex range: 0 to: 255].
- 	literalIndex < 64 ifTrue: 
- 		["128 	10000000 jjkkkkkk 	Push (Receiver Variable, Temporary Location, Literal Constant, Literal Variable) [jj] #kkkkkk"
- 		 stream
- 			nextPut: 128;
- 			nextPut: 192 + literalIndex.
- 		 ^self].
- 	literalIndex < 256 ifTrue: 
- 		["132 	10000100 iiijjjjj kkkkkkkk 	(Send, Send Super, Push Receiver Variable, Push Literal Constant, Push Literal Variable, Store Receiver Variable, Store-Pop Receiver Variable, Store Literal Variable)[iii] #kkkkkkkk jjjjj"
- 		 stream
- 			nextPut: 132;
- 			nextPut: 128;
- 			nextPut: literalIndex.
- 		 ^self].
- 	^self outOfRangeError: 'index' index: literalIndex range: 0 to: 255!

Item was removed:
- ----- Method: EncoderForLongFormV3>>genPushReceiver (in category 'bytecode generation') -----
- genPushReceiver
- 	"See BlueBook page 596"
- 	"112-119 	01110iii 	Push (receiver, true, false, nil, -1, 0, 1, 2) [iii]"
- 	stream nextPut: 112!

Item was removed:
- ----- Method: EncoderForLongFormV3>>genPushSpecialLiteral: (in category 'bytecode generation') -----
- genPushSpecialLiteral: aLiteral
- 	"112-119 	01110iii 	Push (receiver, true, false, nil, -1, 0, 1, 2) [iii]"
- 	| index |
- 	index := #(true false nil -1 0 1 2) indexOf: aLiteral ifAbsent: 0.
- 	index = 0 ifTrue:
- 		[^self error: 'push special literal: ', aLiteral printString,  ' is not one of true false nil -1 0 1 2'].
- 	stream nextPut: index + 112!

Item was removed:
- ----- Method: EncoderForLongFormV3>>genPushTemp: (in category 'bytecode generation') -----
- genPushTemp: tempIndex
- 	"See BlueBook page 596"
- 	tempIndex < 0 ifTrue:
- 		[^self outOfRangeError: 'index' index: tempIndex range: 0 to: 63].
- 	tempIndex < 64 ifTrue: 
- 		["128 	10000000 jjkkkkkk 	Push (Receiver Variable, Temporary Location, Literal Constant, Literal Variable) [jj] #kkkkkk"
- 		 stream
- 			nextPut: 128;
- 			nextPut: 64 + tempIndex.
- 		 ^self].
- 	^self outOfRangeError: 'index' index: tempIndex range: 0 to: 63!

Item was removed:
- ----- Method: EncoderForLongFormV3>>genPushThisContext (in category 'bytecode generation') -----
- genPushThisContext
- 	"See BlueBook page 596"
- 	"137 	10001001 	Push Active Context"
- 	stream nextPut: 137!

Item was removed:
- ----- Method: EncoderForLongFormV3>>genReturnReceiver (in category 'bytecode generation') -----
- genReturnReceiver
- 	"See BlueBook page 596"
- 	"120-123 	011110ii 	Return (receiver, true, false, nil) [ii] From Message"
- 	stream nextPut: 120!

Item was removed:
- ----- Method: EncoderForLongFormV3>>genReturnSpecialLiteral: (in category 'bytecode generation') -----
- genReturnSpecialLiteral: aLiteral
- 	"120-123 	011110ii 	Return (receiver, true, false, nil) [ii] From Message"
- 	| index |
- 	index := #(true false nil) indexOf: aLiteral ifAbsent: 0.
- 	index = 0 ifTrue:
- 		[^self error: 'return special literal: ', aLiteral printString,  ' is not one of true false nil'].
- 	stream nextPut: 120 + index!

Item was removed:
- ----- Method: EncoderForLongFormV3>>genReturnTop (in category 'bytecode generation') -----
- genReturnTop
- 	"See BlueBook page 596"
- 	"124-125 	0111110i 	Return Stack Top From (Message, Block) [i]"
- 	stream nextPut: 124!

Item was removed:
- ----- Method: EncoderForLongFormV3>>genReturnTopToCaller (in category 'bytecode generation') -----
- genReturnTopToCaller
- 	"See BlueBook page 596"
- 	"124-125 	0111110i 	Return Stack Top From (Message, Block) [i]"
- 	stream nextPut: 125!

Item was removed:
- ----- Method: EncoderForLongFormV3>>genSend:numArgs: (in category 'bytecode generation') -----
- genSend: selectorLiteralIndex numArgs: nArgs
- 	"See BlueBook page 596 (with exceptions for 132 & 134)"
- 	nArgs < 0 ifTrue:
- 		[^self outOfRangeError: 'numArgs' index: nArgs range: 0 to: 31 "!!!!"].
- 	selectorLiteralIndex < 0 ifTrue:
- 		["No special selector sends in long form."
- 		^self outOfRangeError: 'selector literal index' index: selectorLiteralIndex range: 0 to: 255].
- 	(selectorLiteralIndex < 32 and: [nArgs < 8]) ifTrue: 
- 		["	131 	10000011 jjjkkkkk 	Send Literal Selector #kkkkk With jjj Arguments"
- 		 stream
- 			nextPut: 131;
- 			nextPut: ((nArgs bitShift: 5) + selectorLiteralIndex).
- 		 ^self].
- 	(selectorLiteralIndex < 64 and: [nArgs < 4]) ifTrue: 
- 	 	["In Squeak V3
- 			134 	10000110 jjjjjjjj kkkkkkkk 	Send Literal Selector #kkkkkkkk To Superclass With jjjjjjjj Arguments
- 		 is replaced by
- 			134 	10000110 jjkkkkkk 	Send Literal Selector #kkkkkk With jj Arguments"
- 		 stream
- 			nextPut: 134;
- 			nextPut: ((nArgs bitShift: 6) + selectorLiteralIndex).
- 		 ^self].
- 	(selectorLiteralIndex <= 255 and: [nArgs <= 31]) ifTrue: 
- 		["In Squeak V3
- 			132 	10000100 jjjjjjjj kkkkkkkk 	Send Literal Selector #kkkkkkkk With jjjjjjjj Arguments
- 		  is replaced by
- 			132 	10000100 ooojjjjj kkkkkkkk
- 				ooo = 0 => Send Literal Selector #kkkkkkkk With jjjjj Arguments
- 				ooo = 1 => Send Literal Selector #kkkkkkkk To Superclass With jjjjj Arguments"
- 		stream
- 			nextPut: 132;
- 			nextPut: nArgs;
- 			nextPut: selectorLiteralIndex.
- 		 ^self].
- 	nArgs > 31 ifTrue:
- 		[^self outOfRangeError: 'numArgs' index: nArgs range: 0 to: 31].
- 	selectorLiteralIndex > 255 ifTrue: 
- 		[^self outOfRangeError: 'selector literal index' index: selectorLiteralIndex range: 0 to: 255]!

Item was removed:
- ----- Method: EncoderForLongFormV3>>genSendSuper:numArgs: (in category 'bytecode generation') -----
- genSendSuper: selectorLiteralIndex numArgs: nArgs
- 	"See BlueBook page 596 (with exceptions for 132 & 134)"
- 	nArgs < 0 ifTrue:
- 		[^self outOfRangeError: 'numArgs' index: nArgs range: 0 to: 31 "!!!!"].
- 	selectorLiteralIndex < 0 ifTrue:
- 		[^self outOfRangeError: 'selector literal index' index: selectorLiteralIndex range: 0 to: 255].
- 	(selectorLiteralIndex < 32 and: [nArgs < 8]) ifTrue: 
- 		["	133 	10000011 jjjkkkkk 	Send Literal Selector #kkkkk To Superclass With jjj Arguments"
- 		 stream
- 			nextPut: 133;
- 			nextPut: ((nArgs bitShift: 5) + selectorLiteralIndex).
- 		 ^self].
- 	(selectorLiteralIndex <= 255 and: [nArgs <= 31]) ifTrue: 
- 		["In Squeak V3
- 			132 	10000100 jjjjjjjj kkkkkkkk 	Send Literal Selector #kkkkkkkk With jjjjjjjj Arguments
- 		  is replaced by
- 			132 	10000100 ooojjjjj kkkkkkkk
- 				ooo = 0 => Send Literal Selector #kkkkkkkk With jjjjj Arguments
- 				ooo = 1 => Send Literal Selector #kkkkkkkk To Superclass With jjjjj Arguments"
- 		stream
- 			nextPut: 132;
- 			nextPut: 32 + nArgs;
- 			nextPut: selectorLiteralIndex.
- 		 ^self].
- 	nArgs > 31 ifTrue:
- 		[^self outOfRangeError: 'numArgs' index: nArgs range: 0 to: 31].
- 	selectorLiteralIndex > 255 ifTrue: 
- 		[^self outOfRangeError: 'selector literal index' index: selectorLiteralIndex range: 0 to: 255]!

Item was removed:
- ----- Method: EncoderForLongFormV3>>genStoreInstVar: (in category 'bytecode generation') -----
- genStoreInstVar: instVarIndex
- 	"See BlueBook page 596"
- 	(instVarIndex >= 0 and: [instVarIndex < 64]) ifTrue: 
- 		["129 	10000001 jjkkkkkk 	Store (Receiver Variable, Temporary Location, Illegal, Literal Variable) [jj] #kkkkkk"
- 		 stream
- 			nextPut: 129;
- 			nextPut: instVarIndex.
- 		 ^self].
- 	self genStoreInstVarLong: instVarIndex!

Item was removed:
- ----- Method: EncoderForLongFormV3>>genStoreInstVarLong: (in category 'bytecode generation') -----
- genStoreInstVarLong: instVarIndex
- 	"See BlueBook page 596"
- 	"See also MaybeContextInstanceVariableNode"
- 	(instVarIndex >= 0 and: [instVarIndex < 256]) ifTrue: 
- 		["132 	10000100 iiijjjjj kkkkkkkk 	(Send, Send Super, Push Receiver Variable, Push Literal Constant, Push Literal Variable, Store Receiver Variable, Store-Pop Receiver Variable, Store Literal Variable)[iii] #kkkkkkkk jjjjj"
- 		 stream
- 			nextPut: 132;
- 			nextPut: 160;
- 			nextPut: instVarIndex.
- 		 ^self].
- 	^self outOfRangeError: 'index' index: instVarIndex range: 0 to: 255!

Item was removed:
- ----- Method: EncoderForLongFormV3>>genStoreLiteralVar: (in category 'bytecode generation') -----
- genStoreLiteralVar: literalIndex
- 	"See BlueBook page 596"
- 	literalIndex < 0 ifTrue:
- 		[^self outOfRangeError: 'index' index: literalIndex range: 0 to: 255].
- 	literalIndex < 64 ifTrue: 
- 		["129 	10000001 jjkkkkkk 	Store (Receiver Variable, Temporary Location, Illegal, Literal Variable) [jj] #kkkkkk"
- 		 stream
- 			nextPut: 129;
- 			nextPut: 192 + literalIndex.
- 		 ^self].
- 	literalIndex <= 255 ifTrue: 
- 		["132 	10000100 iiijjjjj kkkkkkkk 	(Send, Send Super, Push Receiver Variable, Push Literal Constant, Push Literal Variable, Store Receiver Variable, Store-Pop Receiver Variable, Store Literal Variable)[iii] #kkkkkkkk jjjjj"
- 		 stream
- 			nextPut: 132;
- 			nextPut: 224;
- 			nextPut: literalIndex.
- 		 ^self].
- 	^self outOfRangeError: 'index' index: literalIndex range: 0 to: 255!

Item was removed:
- ----- Method: EncoderForLongFormV3>>genStorePopInstVar: (in category 'bytecode generation') -----
- genStorePopInstVar: instVarIndex
- 	"See BlueBook page 596"
- 	(instVarIndex >= 0 and: [instVarIndex < 64]) ifTrue:
- 		["130 	10000010 jjkkkkkk 	Pop and Store (Receiver Variable, Temporary Location, Illegal, Literal Variable) [jj] #kkkkkk"
- 		 stream
- 			nextPut: 130;
- 			nextPut: instVarIndex.
- 		 ^self].
- 	self genStorePopInstVarLong: instVarIndex!

Item was removed:
- ----- Method: EncoderForLongFormV3>>genStorePopInstVarLong: (in category 'bytecode generation') -----
- genStorePopInstVarLong: instVarIndex
- 	"See BlueBook page 596"
- 	"See also MaybeContextInstanceVariableNode"
- 	(instVarIndex >= 0 and: [instVarIndex < 256]) ifTrue: 
- 		["132 	10000100 iiijjjjj kkkkkkkk 	(Send, Send Super, Push Receiver Variable, Push Literal Constant, Push Literal Variable, Store Receiver Variable, Store-Pop Receiver Variable, Store Literal Variable)[iii] #kkkkkkkk jjjjj"
- 		 stream
- 			nextPut: 132;
- 			nextPut: 192;
- 			nextPut: instVarIndex.
- 		 ^self].
- 	^self outOfRangeError: 'index' index: instVarIndex range: 0 to: 255!

Item was removed:
- ----- Method: EncoderForLongFormV3>>genStorePopLiteralVar: (in category 'bytecode generation') -----
- genStorePopLiteralVar: literalIndex
- 	"See BlueBook page 596"
- 	literalIndex < 0 ifTrue:
- 		[^self outOfRangeError: 'index' index: literalIndex range: 0 to: 255].
- 	literalIndex < 64 ifTrue: 
- 		["130 	10000010 jjkkkkkk 	Pop and Store (Receiver Variable, Temporary Location, Illegal, Literal Variable) [jj] #kkkkkk"
- 		 stream
- 			nextPut: 130;
- 			nextPut: 192 + literalIndex.
- 		 ^self].
- 	literalIndex <= 255 ifTrue: 
- 		["132 	10000100 iiijjjjj kkkkkkkk 	(Send, Send Super, Push Receiver Variable, Push Literal Constant, Push Literal Variable, Store Receiver Variable, Store-Pop Receiver Variable, Store Literal Variable)[iii] #kkkkkkkk jjjjj"
- 		 stream
- 			nextPut: 132;
- 			nextPut: 224;
- 			nextPut: literalIndex.
- 		 self genPop.
- 		 ^self].
- 	^self outOfRangeError: 'index' index: literalIndex range: 0 to: 255!

Item was removed:
- ----- Method: EncoderForLongFormV3>>genStorePopTemp: (in category 'bytecode generation') -----
- genStorePopTemp: tempIndex
- 	"See BlueBook page 596"
- 	tempIndex < 0 ifTrue:
- 		[^self outOfRangeError: 'index' index: tempIndex range: 0 to: 63].
- 	tempIndex < 64 ifTrue: 
- 		["130 	10000010 jjkkkkkk 	Pop and Store (Receiver Variable, Temporary Location, Illegal, Literal Variable) [jj] #kkkkkk"
- 		 stream
- 			nextPut: 130;
- 			nextPut: 64 + tempIndex.
- 		 ^self].
- 	^self outOfRangeError: 'index' index: tempIndex range: 0 to: 63!

Item was removed:
- ----- Method: EncoderForLongFormV3>>genStoreTemp: (in category 'bytecode generation') -----
- genStoreTemp: tempIndex
- 	"See BlueBook page 596"
- 	tempIndex < 0 ifTrue:
- 		[^self outOfRangeError: 'index' index: tempIndex range: 0 to: 63].
- 	tempIndex < 64 ifTrue: 
- 		["129 	10000001 jjkkkkkk 	Store (Receiver Variable, Temporary Location, Illegal, Literal Variable) [jj] #kkkkkk"
- 		 stream
- 			nextPut: 129;
- 			nextPut: 64 + tempIndex.
- 		 ^self].
- 	^self outOfRangeError: 'index' index: tempIndex range: 0 to: 63!

Item was removed:
- ----- Method: EncoderForLongFormV3>>initScopeAndLiteralTables (in category 'initialize-release') -----
- initScopeAndLiteralTables
- 	super initScopeAndLiteralTables.
- 	"Start with an empty selector set to avoid the special selectors."
- 	selectorSet := Dictionary new: 16!

Item was removed:
- EncoderForLongFormV3 subclass: #EncoderForLongFormV3PlusClosures
- 	instanceVariableNames: ''
- 	classVariableNames: ''
- 	poolDictionaries: ''
- 	category: 'Compiler-Kernel'!
- 
- !EncoderForLongFormV3PlusClosures commentStamp: '<historical>' prior: 0!
- An encoder for the V3 bytecode set augmented with the following bytecodes that are part of the full closure implementation.
- 	138   10001010 jkkkkkkk		Push (Array new: kkkkkkk) (j = 0)
- 								or	Pop kkkkkkk elements into: (Array new: kkkkkkk) (j = 1)
- 
- 	140   10001100 kkkkkkkk jjjjjjjj 	Push Temp At kkkkkkkk In Temp Vector At: jjjjjjjj
- 	141   10001101 kkkkkkkk jjjjjjjj 	Store Temp At kkkkkkkk In Temp Vector At: jjjjjjjj
- 	142   10001110 kkkkkkkk jjjjjjjj 	Pop and Store Temp At kkkkkkkk In Temp Vector At: jjjjjjjj
- 	143   10001111 llllkkkk jjjjjjjj iiiiiiii	Push Closure Num Copied llll Num Args kkkk BlockSize jjjjjjjjiiiiiiii
- This is an exact duplicate of EncoderForV3PlusClosures.
- Could be a trait (or in Newspeak, a Mixin).
- For now we impose upon you to synchronise any and all changes between these two classes.!

Item was removed:
- ----- Method: EncoderForLongFormV3PlusClosures>>genPushClosureCopyNumCopiedValues:numArgs:jumpSize: (in category 'bytecode generation') -----
- genPushClosureCopyNumCopiedValues: numCopied numArgs: numArgs jumpSize: jumpSize
- 	"143 	10001111 llllkkkk jjjjjjjj iiiiiiii	Push Closure Num Copied llll Num Args kkkk BlockSize jjjjjjjjiiiiiiii"
- 	(jumpSize < 0 or: [jumpSize > 65535]) ifTrue:
- 		[^self outOfRangeError: 'block size' index: jumpSize range: 0 to: 65535].
- 	(numCopied < 0 or: [numCopied > 15]) ifTrue:
- 		[^self outOfRangeError: 'num copied' index: numCopied range: 0 to: 15].
- 	(numArgs < 0 or: [numArgs > 15]) ifTrue:
- 		[^self outOfRangeError: 'num args' index: numArgs range: 0 to: 15].
- 	stream
- 		nextPut: 143;
- 		nextPut: numArgs + (numCopied bitShift: 4);
- 		nextPut: (jumpSize bitShift: -8);
- 		nextPut: (jumpSize bitAnd: 16rFF)!

Item was removed:
- ----- Method: EncoderForLongFormV3PlusClosures>>genPushConsArray: (in category 'bytecode generation') -----
- genPushConsArray: size
- 	(size < 0 or: [size > 127]) ifTrue:
- 		[^self outOfRangeError: 'numElements' index: size range: 0 to: 127].
- 	"138 	10001010 1kkkkkkk 	Pop kkkkkkk into: (Array new: kkkkkkk)"
- 	stream
- 		nextPut: 138;
- 		nextPut: size + 128!

Item was removed:
- ----- Method: EncoderForLongFormV3PlusClosures>>genPushNewArray: (in category 'bytecode generation') -----
- genPushNewArray: size
- 	(size < 0 or: [size > 127]) ifTrue:
- 		[^self outOfRangeError: 'size' index: size range: 0 to: 127].
- 	"138 	10001010 0kkkkkkk 	Push (Array new: kkkkkkk)"
- 	stream
- 		nextPut: 138;
- 		nextPut: size!

Item was removed:
- ----- Method: EncoderForLongFormV3PlusClosures>>genPushRemoteTemp:inVectorAt: (in category 'bytecode generation') -----
- genPushRemoteTemp: tempIndex inVectorAt: tempVectorIndex
- 	(tempIndex >= 0 and: [tempIndex < 256
- 	 and: [tempVectorIndex >= 0 and: [tempVectorIndex < 256]]]) ifTrue:
- 		["140 	10001100 kkkkkkkk jjjjjjjj 	Push Temp At kkkkkkkk In Temp Vector At: jjjjjjjj"
- 		 stream
- 			nextPut: 140;
- 			nextPut: tempIndex;
- 			nextPut: tempVectorIndex.
- 		 ^self].
- 	tempIndex >= 256 ifTrue:
- 		[^self outOfRangeError: 'remoteTempIndex' index: tempIndex range: 0 to: 255].
- 	tempVectorIndex >= 256 ifTrue:
- 		[^self outOfRangeError: 'tempVectorIndex' index: tempVectorIndex range: 0 to: 255]!

Item was removed:
- ----- Method: EncoderForLongFormV3PlusClosures>>genStorePopRemoteTemp:inVectorAt: (in category 'bytecode generation') -----
- genStorePopRemoteTemp: tempIndex inVectorAt: tempVectorIndex
- 	"142 	10001110 kkkkkkkk jjjjjjjj 	Pop and Store Temp At kkkkkkkk In Temp Vector At: jjjjjjjj"
- 	(tempIndex >= 0 and: [tempIndex < 256
- 	 and: [tempVectorIndex >= 0 and: [tempVectorIndex < 256]]]) ifTrue:
- 		[stream
- 			nextPut: 142;
- 			nextPut: tempIndex;
- 			nextPut: tempVectorIndex.
- 		 ^self].
- 	tempIndex >= 256 ifTrue:
- 		[^self outOfRangeError: 'remoteTempIndex' index: tempIndex range: 0 to: 255].
- 	tempVectorIndex >= 256 ifTrue:
- 		[^self outOfRangeError: 'tempVectorIndex' index: tempVectorIndex range: 0 to: 255]!

Item was removed:
- ----- Method: EncoderForLongFormV3PlusClosures>>genStoreRemoteTemp:inVectorAt: (in category 'bytecode generation') -----
- genStoreRemoteTemp: tempIndex inVectorAt: tempVectorIndex
- 	"141 	10001101 kkkkkkkk jjjjjjjj 	Store Temp At kkkkkkkk In Temp Vector At: jjjjjjjj"
- 	(tempIndex >= 0 and: [tempIndex < 256
- 	 and: [tempVectorIndex >= 0 and: [tempVectorIndex < 256]]]) ifTrue:
- 		[stream
- 			nextPut: 141;
- 			nextPut: tempIndex;
- 			nextPut: tempVectorIndex.
- 		 ^self].
- 	tempIndex >= 256 ifTrue:
- 		[^self outOfRangeError: 'remoteTempIndex' index: tempIndex range: 0 to: 255].
- 	tempVectorIndex >= 256 ifTrue:
- 		[^self outOfRangeError: 'tempVectorIndex' index: tempVectorIndex range: 0 to: 255]!

Item was removed:
- ----- Method: EncoderForLongFormV3PlusClosures>>supportsClosureOpcodes (in category 'testing') -----
- supportsClosureOpcodes
- 	^true!

Item was added:
+ ----- Method: EncoderForV3 class>>extensionsAt:in:into: (in category 'instruction stream support') -----
+ extensionsAt: pc in: aCompiledMethod into: trinaryBlock
+ 	"If the bytecode at pc is an extension then evaluate aTrinaryBlock
+ 	 with the values of extA and extB and number of extension *bytes*.
+ 	 If the bytecode at pc is not extended then evaluate with 0, 0, 0.
+ 	 There are no extensions in the SqueakV3/Smalltalk-80 bytecode set, so..." 
+ 	^trinaryBlock value: 0 value: 0 value: 0!

Item was added:
+ ----- Method: EncoderForV3 class>>interpretJumpIfCondIn: (in category 'instruction stream support') -----
+ interpretJumpIfCondIn: anInstructionStream
+ 	"Double-dispatch through the encoder to select the correct conditional jump decoder for the instruction set."
+ 	^anInstructionStream interpretV3JumpIfCond!

Item was added:
+ ----- Method: EncoderForV3 class>>interpretJumpIn: (in category 'instruction stream support') -----
+ interpretJumpIn: anInstructionStream
+ 	"Double-dispatch through the encoder to select the correct jump interpreter for the instruction set."
+ 	^anInstructionStream interpretV3Jump!

Item was added:
+ ----- Method: EncoderForV3 class>>interpretNextInstructionFor:in: (in category 'instruction stream support') -----
+ interpretNextInstructionFor: aClient in: anInstructionStream
+ 	"Double-dispatch through the encoder to select the correct instruction set decoder."
+ 	^anInstructionStream interpretNextV3InstructionFor: aClient!

Item was added:
+ ----- Method: EncoderForV3PlusClosures class>>interpretNextInstructionFor:in: (in category 'instruction stream support') -----
+ interpretNextInstructionFor: aClient in: anInstructionStream
+ 	"Double-dispatch through the encoder to select the correct instruction set decoder."
+ 	^anInstructionStream interpretNextV3ClosuresInstructionFor: aClient!



More information about the Packages mailing list