[Vm-dev] VM Maker: VMMaker.oscog-rsf.2096.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Jan 17 15:06:34 UTC 2017


Ronie Salgado Faila uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-rsf.2096.mcz

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

Name: VMMaker.oscog-rsf.2096
Author: rsf
Time: 17 January 2017, 12:02:18.281444 pm
UUID: dfaaf8eb-16fb-4e51-966e-48c4d983a4d7
Ancestors: VMMaker.oscog-rsf.2095, VMMaker.oscog-cb.2095

Merging Clement version.
Fixing the character keycode is not normally used in source code problem.

=============== Diff against VMMaker.oscog-rsf.2095 ===============

Item was changed:
  ----- Method: CogX64Compiler>>dispatchConcretize (in category 'generate machine code') -----
  dispatchConcretize
  	"Attempt to generate concrete machine code for the instruction at address.
  	 This is the inner dispatch of concretizeAt: actualAddress which exists only
  	 to get around the branch size limits in the SqueakV3 (blue book derived)
  	 bytecode set."
  	<returnTypeC: #void>
  	opcode caseOf: {
  		"Noops & Pseudo Ops"
  		[Label]				-> [^self concretizeLabel].
  		[AlignmentNops]	-> [^self concretizeAlignmentNops].
  		[Fill32]				-> [^self concretizeFill32].
  		[Nop]				-> [^self concretizeNop].
  		"Specific Control/Data Movement"
  		[CDQ]					-> [^self concretizeCDQ].
  		[IDIVR]					-> [^self concretizeIDIVR].
  		[IMULRR]				-> [^self concretizeMulRR].
  		"[CPUID]					-> [^self concretizeCPUID]."
  		"[CMPXCHGAwR]			-> [^self concretizeCMPXCHGAwR]."
  		"[CMPXCHGMwrR]		-> [^self concretizeCMPXCHGMwrR]."
  		"[LFENCE]				-> [^self concretizeFENCE: 5]."
  		"[MFENCE]				-> [^self concretizeFENCE: 6].
  		[SFENCE]				-> [^self concretizeFENCE: 7]."
  		"[LOCK]					-> [^self concretizeLOCK]."
  		"[XCHGAwR]				-> [^self concretizeXCHGAwR]."
  		"[XCHGMwrR]			-> [^self concretizeXCHGMwrR]."
  		[XCHGRR]				-> [^self concretizeXCHGRR].
  		[REP]					-> [^self concretizeREP].
  		[CLD]					-> [^self concretizeCLD].
  		[MOVSB]				-> [^self concretizeMOVSB].
  		[MOVSQ]				-> [^self concretizeMOVSQ].
  		"Control"
  		[Call]					-> [^self concretizeCall].
  		[CallR]					-> [^self concretizeCallR].
  		[CallFull]				-> [^self concretizeCallFull].
  		[JumpR]					-> [^self concretizeJumpR].
  		[JumpFull]				-> [^self concretizeJumpFull].
  		[JumpLong]				-> [^self concretizeJumpLong].
  		[JumpLongZero]		-> [^self concretizeConditionalJump: 16r4].
  		[JumpLongNonZero]	-> [^self concretizeConditionalJump: 16r5].
  		[Jump]					-> [^self concretizeJump].
+ 		"Table B-1 Intel 64 and IA-32 Architectures Software Developer's Manual Volume 1: Basic Architecture"
- 		"Table B-1 Intel® 64 and IA-32 Architectures Software Developer's Manual Volume 1: Basic Architecture"
  		[JumpZero]				-> [^self concretizeConditionalJump: 16r4].
  		[JumpNonZero]			-> [^self concretizeConditionalJump: 16r5].
  		[JumpNegative]			-> [^self concretizeConditionalJump: 16r8].
  		[JumpNonNegative]		-> [^self concretizeConditionalJump: 16r9].
  		[JumpOverflow]			-> [^self concretizeConditionalJump: 16r0].
  		[JumpNoOverflow]		-> [^self concretizeConditionalJump: 16r1].
  		[JumpCarry]			-> [^self concretizeConditionalJump: 16r2].
  		[JumpNoCarry]			-> [^self concretizeConditionalJump: 16r3].
  		[JumpLess]				-> [^self concretizeConditionalJump: 16rC].
  		[JumpGreaterOrEqual]	-> [^self concretizeConditionalJump: 16rD].
  		[JumpGreater]			-> [^self concretizeConditionalJump: 16rF].
  		[JumpLessOrEqual]		-> [^self concretizeConditionalJump: 16rE].
  		[JumpBelow]			-> [^self concretizeConditionalJump: 16r2].
  		[JumpAboveOrEqual]	-> [^self concretizeConditionalJump: 16r3].
  		[JumpAbove]			-> [^self concretizeConditionalJump: 16r7].
  		[JumpBelowOrEqual]	-> [^self concretizeConditionalJump: 16r6].
  		[JumpFPEqual]				-> [^self concretizeConditionalJump: 16r4].
  		[JumpFPNotEqual]			-> [^self concretizeConditionalJump: 16r5].
  		[JumpFPLess]				-> [^self concretizeConditionalJump: 16r2].
  		[JumpFPGreaterOrEqual]	-> [^self concretizeConditionalJump: 16r3].
  		[JumpFPGreater]			-> [^self concretizeConditionalJump: 16r7].
  		[JumpFPLessOrEqual]		-> [^self concretizeConditionalJump: 16r6].
  		[JumpFPOrdered]			-> [^self concretizeConditionalJump: 16rB].
  		[JumpFPUnordered]			-> [^self concretizeConditionalJump: 16rA].
  		[RetN]						-> [^self concretizeRetN].
  		[Stop]						-> [^self concretizeStop].
  		"Arithmetic"
  		[AddCqR]					-> [^self concretizeArithCqRWithRO: 0 raxOpcode: 15r05].
  		[AddCwR]					-> [^self concretizeArithCwR: 16r03].
  		[AddRR]						-> [^self concretizeOpRR: 16r03].
  		[AddRsRs]					-> [^self concretizeSEEOpRsRs: 16r58].
  		[AddRdRd]					-> [^self concretizeSEE2OpRdRd: 16r58].
  		[AndCqR]					-> [^self concretizeArithCqRWithRO: 4 raxOpcode: 16r25].
  		[AndCwR]					-> [^self concretizeArithCwR: 16r23].
  		[AndRR]						-> [^self concretizeOpRR: 16r23].
  		[TstCqR]					-> [^self concretizeTstCqR].
  		[CmpCqR]					-> [^self concretizeArithCqRWithRO: 7 raxOpcode: 16r3D].
  		[CmpCwR]					-> [^self concretizeArithCwR: 16r39].
  		[CmpC32R]					-> [^self concretizeCmpC32R].
  		[CmpRR]					-> [^self concretizeReverseOpRR: 16r39].
  		[CmpRdRd]					-> [^self concretizeCmpRdRd].
  		[CmpRsRs]					-> [^self concretizeCmpRsRs].
  		[DivRdRd]					-> [^self concretizeSEE2OpRdRd: 16r5E].
  		[DivRsRs]					-> [^self concretizeSEEOpRsRs: 16r5E].
  		[MulRdRd]					-> [^self concretizeSEE2OpRdRd: 16r59].
  		[MulRsRs]					-> [^self concretizeSEEOpRsRs: 16r59].
  		[OrCqR]						-> [^self concretizeArithCqRWithRO: 1 raxOpcode: 16r0D].
  		[OrCwR]					-> [^self concretizeArithCwR: 16r0B].
  		[OrRR]						-> [^self concretizeOpRR: 16r0B].
  		[SubCqR]					-> [^self concretizeArithCqRWithRO: 5 raxOpcode: 16r2D].
  		[SubCwR]					-> [^self concretizeArithCwR: 16r2B].
  		[SubRR]						-> [^self concretizeOpRR: 16r2B].
  		[SubRdRd]					-> [^self concretizeSEE2OpRdRd: 16r5C].
  		[SubRsRs]					-> [^self concretizeSEEOpRsRs: 16r5C].
  		[SqrtRd]					-> [^self concretizeSqrtRd].
  		[SqrtRs]					-> [^self concretizeSqrtRs].
  		[XorCwR]					-> [^self concretizeArithCwR: 16r33].
  		[XorRR]						-> [^self concretizeOpRR: 16r33].
  		[XorRdRd]						-> [^self concretizeXorRdRd].
  		[XorRsRs]						-> [^self concretizeXorRsRs].
  		[NegateR]					-> [^self concretizeNegateR].
  		[LoadEffectiveAddressMwrR]	-> [^self concretizeLoadEffectiveAddressMwrR].
  		[RotateLeftCqR]				-> [^self concretizeShiftCqRegOpcode: 0].
  		[RotateRightCqR]				-> [^self concretizeShiftCqRegOpcode: 1].
  		[ArithmeticShiftRightCqR]		-> [^self concretizeShiftCqRegOpcode: 7].
  		[LogicalShiftRightCqR]			-> [^self concretizeShiftCqRegOpcode: 5].
  		[LogicalShiftLeftCqR]			-> [^self concretizeShiftCqRegOpcode: 4].
  		[ArithmeticShiftRightRR]			-> [^self concretizeShiftRegRegOpcode: 7].
  		[LogicalShiftLeftRR]				-> [^self concretizeShiftRegRegOpcode: 4].
  		"Data Movement"
  		[MoveCqR]			-> [^self concretizeMoveCqR].
  		[MoveCwR]			-> [^self concretizeMoveCwR].
  		[MoveC32R]		-> [^self concretizeMoveC32R].
  		[MoveRR]			-> [^self concretizeReverseOpRR: 16r89].
  		[MoveAwR]			-> [^self concretizeMoveAwR].
  		[MoveA32R]		-> [^self concretizeMoveA32R].
  		[MoveRAw]			-> [^self concretizeMoveRAw].
  		[MoveRA32]		-> [^self concretizeMoveRA32].
  		[MoveAbR]			-> [^self concretizeMoveAbR].
  		[MoveRAb]			-> [^self concretizeMoveRAb].
  		[MoveMbrR]			-> [^self concretizeMoveMbrR].
  		[MoveRMbr]			-> [^self concretizeMoveRMbr].
  		[MoveM8rR]		-> [^self concretizeMoveMbrR].
  		[MoveRM8r]		-> [^self concretizeMoveRMbr].
  		[MoveM16rR]		-> [^self concretizeMoveM16rR].
  		[MoveRM16r]		-> [^self concretizeMoveRM16r].
  		[MoveM32rR]		-> [^self concretizeMoveM32rR].
  		[MoveM32rRs]		-> [^self concretizeMoveM32rRs].
  		[MoveM64rRd]		-> [^self concretizeMoveM64rRd].
  		[MoveMwrR]		-> [^self concretizeMoveMwrR].
  		[MoveXbrRR]		-> [^self concretizeMoveXbrRR].
  		[MoveRXbrR]		-> [^self concretizeMoveRXbrR].
  		[MoveXwrRR]		-> [^self concretizeMoveXwrRR].
  		[MoveRXwrR]		-> [^self concretizeMoveRXwrR].
  		[MoveX32rRR]		-> [^self concretizeMoveX32rRR].
  		[MoveRX32rR]		-> [^self concretizeMoveRX32rR].
  		[MoveRMwr]		-> [^self concretizeMoveRMwr].
  		[MoveRM32r]		-> [^self concretizeMoveRM32r].
  		[MoveRsM32r]		-> [^self concretizeMoveRsM32r].
  		[MoveRdM64r]		-> [^self concretizeMoveRdM64r].
  		[MoveRdR]			-> [^self concretizeMoveRdR].
  		[MoveRRd]			-> [^self concretizeMoveRRd].
  		[MoveRdRd]		-> [^self concretizeMoveRdRd].
  		[MoveRsRs]		-> [^self concretizeMoveRsRs].
  		[PopR]				-> [^self concretizePopR].
  		[PushR]				-> [^self concretizePushR].
  		[PushCq]			-> [^self concretizePushCq].
  		[PushCw]			-> [^self concretizePushCw].
  		[PrefetchAw]		-> [^self concretizePrefetchAw].
  		"Conversion"
  		[ConvertRRd]		-> [^self concretizeConvertRRd].
  		[ConvertRdR]		-> [^self concretizeConvertRdR].
  		[ConvertRRs]		-> [^self concretizeConvertRRs].
  		[ConvertRsR]		-> [^self concretizeConvertRsR].
  		[ConvertRsRd]	-> [^self concretizeConvertRsRd].
  		[ConvertRdRs]	-> [^self concretizeConvertRdRs].
  			
  		[SignExtend8RR]		-> [^self concretizeSignExtend8RR].
  		[SignExtend16RR]	-> [^self concretizeSignExtend16RR].
  		[SignExtend32RR]	-> [^self concretizeSignExtend32RR].
  		
  		[ZeroExtend8RR]		-> [^self concretizeZeroExtend8RR].
  		[ZeroExtend16RR]	-> [^self concretizeZeroExtend16RR].
  		[ZeroExtend32RR]	-> [^self concretizeZeroExtend32RR].
  		}!

Item was changed:
  ----- Method: SistaCogit>>genUnaryInlinePrimitive: (in category 'inline primitive generators') -----
  genUnaryInlinePrimitive: prim
  	"Unary inline primitives."
  	"SistaV1: 248		11111000 	iiiiiiii		mjjjjjjj		Call Primitive #iiiiiiii + (jjjjjjj * 256) m=1 means inlined primitive, no hard return after execution.
  	 See EncoderForSistaV1's class comment and StackInterpreter>>#unaryInlinePrimitive:"
  	| rcvrReg resultReg |
  	rcvrReg := self allocateRegForStackEntryAt: 0.
  	resultReg := self allocateRegNotConflictingWith: (self registerMaskFor: rcvrReg).
  	prim
  		caseOf: {
  					"00		unchecked class"
  			[1] ->	"01		unchecked pointer numSlots"
  				[self ssTop popToReg: rcvrReg.
  				 self ssPop: 1.
  				 objectRepresentation
  					genGetNumSlotsOf: rcvrReg into: resultReg;
  					genConvertIntegerToSmallIntegerInReg: resultReg].
  					"02		unchecked pointer basicSize"
  			[3] ->	"03		unchecked byte numBytes"
  				[self ssTop popToReg: rcvrReg.
  				 self ssPop: 1.
  				 objectRepresentation
  					genGetNumBytesOf: rcvrReg into: resultReg;
  					genConvertIntegerToSmallIntegerInReg: resultReg].
  					"04		unchecked short16Type format numShorts"
  					"05		unchecked word32Type format numWords"
  					"06		unchecked doubleWord64Type format numDoubleWords"
  			[11] ->	"11		unchecked fixed pointer basicNew"
  				[self ssTop type ~= SSConstant ifTrue:
  					[^EncounteredUnknownBytecode].
  				 (objectRepresentation
  					genGetInstanceOf: self ssTop constant
  						into: resultReg
  							initializingIf: self extBSpecifiesInitializeInstance) ~= 0 ifTrue:
  					[^ShouldNotJIT]. "e.g. bad class"
  				 self ssPop: 1] .
  			[20] ->	"20 	identityHash"
  				[self ssTop popToReg: rcvrReg.
  				 objectRepresentation genGetHashFieldNonImmOf: rcvrReg asSmallIntegerInto: resultReg.
+ 				 self ssPop: 1] .
- 				 self ssPop: 1]
  					"21		identityHash (SmallInteger)"
  					"22		identityHash (Character)"
  					"23		identityHash (SmallFloat64)"
  					"24		identityHash (Behavior)"
+ 					"30 	immediateAsInteger (Character)
+ 					 31 	immediateAsInteger (SmallFloat64)"
+ 			[30] -> 
+ 				[self ssTop popToReg: rcvrReg.
+ 				 objectRepresentation genConvertCharacterToSmallIntegerInReg: rcvrReg.
+ 				 self ssPop: 1]
  				  }
+ 				
  		otherwise:
  			[^EncounteredUnknownBytecode].
  	extB := 0.
  	numExtB := 0.
  	self ssPushRegister: resultReg.
  	^0!

Item was changed:
  ----- Method: StackInterpreter>>unaryInlinePrimitive: (in category 'miscellaneous bytecodes') -----
  unaryInlinePrimitive: primIndex
  	"SistaV1:	248		11111000 	iiiiiiii		mjjjjjjj		Call Primitive #iiiiiiii + (jjjjjjj * 256) m=1 means inlined primitive, no hard return after execution."
  	<option: #SistaVM>
  	| result |
  	primIndex caseOf: {
  		"1000	unchecked class"
  		[0]	->	[result := objectMemory fetchClassOf: self internalStackTop.
  				 self internalStackTopPut: result].
  		"1001	unchecked pointer numSlots"
  		[1]	->	[result := objectMemory numSlotsOf: self internalStackTop.
  				 self internalStackTopPut: (objectMemory integerObjectOf: result)].
  		"1002	unchecked pointer basicSize"
  		[2]	->	[result := (objectMemory numSlotsOf: self internalStackTop)
  						- (objectMemory fixedFieldsOfClass: (objectMemory fetchClassOfNonImm: self internalStackTop)).
  				 self internalStackTopPut: (objectMemory integerObjectOf: result)].
  		"1003	unchecked byte8Type format numBytes (includes CompiledMethod)"
  		[3]	->	[result := objectMemory numBytesOf: self internalStackTop.
  				 self internalStackTopPut: (objectMemory integerObjectOf: result)].
  		"1004	unchecked short16Type format numShorts"
  		[4]	->	[result := objectMemory num16BitUnitsOf: self internalStackTop.
  				 self internalStackTopPut: (objectMemory integerObjectOf: result)].
  		"1005	unchecked word32Type format numWords"
  		[5]	->	[result := objectMemory num32BitUnitsOf: self internalStackTop.
  				 self internalStackTopPut: (objectMemory integerObjectOf: result)].
  		"1006	unchecked doubleWord64Type format numDoubleWords"
  		[6]	->	[result := objectMemory num64BitUnitsOf: self internalStackTop.
  				 self internalStackTopPut: (objectMemory integerObjectOf: result)].
  
  		"1011	unchecked fixed pointer basicNew"
  		[11] ->	[| classObj numSlots |
  				 classObj := self internalStackTop.
  				 numSlots := objectMemory instanceSizeOf: classObj.
  				 result := objectMemory eeInstantiateSmallClass: classObj numSlots: numSlots.
  				 (extB noMask: 1) ifTrue:
  					[0 to: numSlots - 1 do:
  						[:i| objectMemory storePointerUnchecked: i ofObject: result withValue: objectMemory nilObject]].
  				 extB := 0.
  				numExtB := 0.
  				 self internalStackTopPut: result].
  		"1020 	identityHash"
  		[20] ->	[result := objectMemory hashBitsOf: self internalStackTop.
+ 				 self internalStackTopPut: (objectMemory integerObjectOf: result)].
- 				 self internalStackTopPut: (objectMemory integerObjectOf: result)]
  		"1021		identityHash (SmallInteger)"
  		"1022		identityHash (Character)"
  		"1023		identityHash (SmallFloat64)"
  		"1024		identityHash (Behavior)"
+ 		"1030 	immediateAsInteger (Character)
+ 		 1031 	immediateAsInteger (SmallFloat64)"
+ 		[30] -> [ result := objectMemory characterValueOf: self internalStackTop.
+ 				 self internalStackTopPut: (objectMemory integerObjectOf: result)]
  		 }
  	otherwise:
  		[localIP := localIP - 3.
  		 self respondToUnknownBytecode]!



More information about the Vm-dev mailing list