[Vm-dev] VM Maker: VMMaker.oscog-cb.2350.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Mar 8 15:01:39 UTC 2018


ClementBera uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-cb.2350.mcz

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

Name: VMMaker.oscog-cb.2350
Author: cb
Time: 8 March 2018, 4:01:27.590241 pm
UUID: 9a7cc964-0dc5-471a-b648-967f32421bec
Ancestors: VMMaker.oscog-cb.2349

Decreases by 1 the number of instructions for byte reads on constants.

=============== Diff against VMMaker.oscog-cb.2349 ===============

Item was changed:
  ----- Method: SistaCogit>>genBinaryAtConstInlinePrimitive: (in category 'inline primitive binary generators') -----
  genBinaryAtConstInlinePrimitive: primIndex
  	"2064	pointerAt:
  	Pointer object (Fixed sized or not) and not a context, Smi =>  (1-based, optimised if arg1 is a constant)
  	2065	maybeContextPointerAt:
  	Pointer object (Fixed sized or not), Smi =>  (1-based, optimised if arg1 is a constant)
  	2066	byteAt:
  	byte object, Smi => 8 bits unsigned Smi (1-based, optimised if arg1 is a constant)
  	2067	shortAt:
  	short object, Smi => 16 bits unsigned Smi (1-based, optimised if arg1 is a constant)
  	2068	wordAt:
  	word object, Smi => 32 bits unsigned Smi (1-based, optimised if arg1 is a constant)
  	2069	doubleWordAt:
  	double word object, Smi => 64 bits unsigned Smi or LargePositiveInteger (1-based, optimised if arg1 is a constant)"
+ 	| rr val zeroBasedIndex |
- 	| rr val |
  	val := self ssTop constant.
  	rr := primIndex = 65 
  		ifFalse: [self allocateRegForStackEntryAt: 1]
  		ifTrue: [self ssAllocateRequiredReg: ReceiverResultReg.
  				self voidReceiverResultRegContainsSelf.
  				ReceiverResultReg].
  	(self ssValue: 1) popToReg: rr.
  	self ssPop: 2.
+ 	zeroBasedIndex := (objectMemory integerValueOf: val) - 1.
  	primIndex caseOf: {
+ 		[64] ->	[objectRepresentation genLoadSlot: zeroBasedIndex sourceReg: rr destReg: rr].
- 		[64] ->	[objectRepresentation genLoadSlot: (objectMemory integerValueOf: val) - 1 sourceReg: rr destReg: rr].
  		[65] ->	[self ssAllocateRequiredReg: SendNumArgsReg.
+ 				 ^self genPushMaybeContextSlotIndex: zeroBasedIndex].
+ 		[66] ->	[self MoveMb: zeroBasedIndex * objectMemory wordSize + objectMemory baseHeaderSize r: rr R: rr.
+ 				 objectRepresentation genConvertIntegerToSmallIntegerInReg: rr]
- 				 ^self genPushMaybeContextSlotIndex: (objectMemory integerValueOf: val) - 1].
- 		[66] ->	[self MoveCq: (objectMemory integerValueOf: val) + objectMemory baseHeaderSize - 1 R: TempReg.
- 				self MoveXbr: TempReg R: rr R: rr.
- 				objectRepresentation genConvertIntegerToSmallIntegerInReg: rr]
  	}
  	otherwise: [^EncounteredUnknownBytecode].
  	^self ssPushRegister: rr!



More information about the Vm-dev mailing list