[Vm-dev] VM Maker: VMMaker.oscog-eem.2940.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Jan 23 05:29:44 UTC 2021


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

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

Name: VMMaker.oscog-eem.2940
Author: eem
Time: 22 January 2021, 9:29:33.858798 pm
UUID: 29171f50-756f-4560-8488-ced65f2d4841
Ancestors: VMMaker.oscog-eem.2939

Implement primitive 18, makePoint in the JIT for Spur, mainly to reduce the noise in the primTraceLog.

=============== Diff against VMMaker.oscog-eem.2939 ===============

Item was added:
+ ----- Method: CogObjectRepresentation>>genPrimitiveMakePoint (in category 'primitive generators') -----
+ genPrimitiveMakePoint
+ 	"subclasses override if they so desire"
+ 	^UnimplementedPrimitive!

Item was added:
+ ----- Method: CogObjectRepresentationForSpur>>genPrimitiveMakePoint (in category 'primitive generators') -----
+ genPrimitiveMakePoint
+ 	"<returnTypeC: #'AbstractInstruction *'>"
+ 	| allocSize newPointHeader jumpFail resultReg scratchReg |
+ 	resultReg := ClassReg.
+ 	scratchReg := SendNumArgsReg.
+ 	"<var: #jumpFail type: #'AbstractInstruction *'>"
+ 	allocSize := objectMemory baseHeaderSize + (objectMemory wordSize * 2).
+ 	newPointHeader := objectMemory
+ 							headerForSlots: 2
+ 							format: objectMemory nonIndexablePointerFormat
+ 							classIndex: ClassPointCompactIndex.
+ 	cogit
+ 		MoveAw: objectMemory freeStartAddress R: resultReg;
+ 		LoadEffectiveAddressMw: allocSize r: resultReg R: scratchReg;
+ 		CmpCq: objectMemory getScavengeThreshold R: scratchReg.
+ 	jumpFail := cogit JumpAboveOrEqual: 0.
+ 	cogit MoveR: scratchReg Aw: objectMemory freeStartAddress.
+ 	self genStoreHeader: newPointHeader intoNewInstance: resultReg using: scratchReg.
+ 	cogit
+ 		MoveR: ReceiverResultReg Mw: objectMemory baseHeaderSize r: resultReg;
+ 		MoveR: Arg0Reg Mw: objectMemory baseHeaderSize + objectMemory wordSize r: resultReg;
+ 		MoveR: resultReg R: ReceiverResultReg;
+ 		genPrimReturn.
+ 	jumpFail jmpTarget: cogit Label.
+ 	^0!

Item was changed:
  ----- Method: ObjectMemory class>>initializeCompactClassIndices (in category 'initialization') -----
  initializeCompactClassIndices
  	"Initialize indices for compact classes we are going to depend on being compact.
  	 The VI allows classes to become compact and become uncompact.  For efficiency
  	 the VM assumes certain classes are compact with particular indices."
  
  	"Smalltalk compactClassesArray"
  	"{Array. LargePositiveInteger. Float. MethodContext. } collect: [:c| c -> c indexIfCompact]"
  
  	ClassArrayCompactIndex := 3.
  	ClassLargeNegativeIntegerCompactIndex := 4. "Was PseudoContext class"
  	ClassLargePositiveIntegerCompactIndex := 5.
  	ClassFloatCompactIndex := 6.
  	ClassBlockClosureCompactIndex := 0 "12". "Prospective.  May still be TranslatedMethod class"
  	ClassByteStringCompactIndex := 11.
  	ClassBlockContextCompactIndex := 13.
  	ClassMethodContextCompactIndex := 14.
  
  	ClassByteArrayCompactIndex := 0.
  	ClassMessageCompactIndex := 0.
+ 	ClassBitmapCompactIndex := 0.
+ 	ClassPointCompactIndex := 0!
- 	ClassBitmapCompactIndex := 0!

Item was changed:
  ----- Method: SimpleStackBasedCogit class>>initializePrimitiveTableForSqueak (in category 'class initialization') -----
  initializePrimitiveTableForSqueak
  	"Initialize the table of primitive generators.  This does not include normal primitives implemented in the coInterpreter.
  	 N.B. primitives that don't have an explicit arg count (the integer following the generator) may be variadic."
  	"SimpleStackBasedCogit initializePrimitiveTableForSqueak"
  	MaxCompiledPrimitiveIndex := self objectRepresentationClass wordSize = 8
  										ifTrue: [575]
  										ifFalse: [575].
  	primitiveTable := CArrayAccessor on: (Array new: MaxCompiledPrimitiveIndex + 1).
  	self table: primitiveTable from: 
  	#(	"Integer Primitives (0-19)"
  		(1 genPrimitiveAdd				1)
  		(2 genPrimitiveSubtract			1)
  		(3 genPrimitiveLessThan		1)
  		(4 genPrimitiveGreaterThan		1)
  		(5 genPrimitiveLessOrEqual		1)
  		(6 genPrimitiveGreaterOrEqual	1)
  		(7 genPrimitiveEqual			1)
  		(8 genPrimitiveNotEqual		1)
  		(9 genPrimitiveMultiply			1)
  		(10 genPrimitiveDivide			1)
  		(11 genPrimitiveMod			1)
  		(12 genPrimitiveDiv				1)
  		(13 genPrimitiveQuo			1)
  		(14 genPrimitiveBitAnd			1)
  		(15 genPrimitiveBitOr			1)
  		(16 genPrimitiveBitXor			1)
  		(17 genPrimitiveBitShift			1)
+ 		(18 genPrimitiveMakePoint		1)	"this is here mainly to remove noise from printPrimTraceLog()"
- 		"(18 primitiveMakePoint)"
  		"(19 primitiveFail)"					"Guard primitive for simulation -- *must* fail"
  
  		"LargeInteger Primitives (20-39)"
  		"(20 primitiveFail)"
  		"(21 primitiveAddLargeIntegers)"
  		"(22 primitiveSubtractLargeIntegers)"
  		"(23 primitiveLessThanLargeIntegers)"
  		"(24 primitiveGreaterThanLargeIntegers)"
  		"(25 primitiveLessOrEqualLargeIntegers)"
  		"(26 primitiveGreaterOrEqualLargeIntegers)"
  		"(27 primitiveEqualLargeIntegers)"
  		"(28 primitiveNotEqualLargeIntegers)"
  		"(29 primitiveMultiplyLargeIntegers)"
  		"(30 primitiveDivideLargeIntegers)"
  		"(31 primitiveModLargeIntegers)"
  		"(32 primitiveDivLargeIntegers)"
  		"(33 primitiveQuoLargeIntegers)"
  		"(34 primitiveBitAndLargeIntegers)"
  		"(35 primitiveBitOrLargeIntegers)"
  		"(36 primitiveBitXorLargeIntegers)"
  		"(37 primitiveBitShiftLargeIntegers)"
  
  		"Float Primitives (38-59)"
  		"(38 genPrimitiveFloatAt)"
  		"(39 genPrimitiveFloatAtPut)"
  		(40 genPrimitiveAsFloat					0)
  		(41 genPrimitiveFloatAdd				1)
  		(42 genPrimitiveFloatSubtract			1)
  		(43 genPrimitiveFloatLessThan			1)
  		(44 genPrimitiveFloatGreaterThan		1)
  		(45 genPrimitiveFloatLessOrEqual		1)
  		(46 genPrimitiveFloatGreaterOrEqual	1)
  		(47 genPrimitiveFloatEqual				1)
  		(48 genPrimitiveFloatNotEqual			1)
  		(49 genPrimitiveFloatMultiply			1)
  		(50 genPrimitiveFloatDivide				1)
  		"(51 genPrimitiveTruncated)"
  		"(52 genPrimitiveFractionalPart)"
  		"(53 genPrimitiveExponent)"
  		"(54 genPrimitiveTimesTwoPower)"
  		(55 genPrimitiveFloatSquareRoot		0)
  		"(56 genPrimitiveSine)"
  		"(57 genPrimitiveArctan)"
  		"(58 genPrimitiveLogN)"
  		"(59 genPrimitiveExp)"
  
  		"Subscript and Stream Primitives (60-67)"
  		(60 genPrimitiveAt				1)
  		(61 genPrimitiveAtPut			2)
  		(62 genPrimitiveSize			0)
  		(63 genPrimitiveStringAt		1)
  		(64 genPrimitiveStringAtPut		2)
  		"The stream primitives no longer pay their way; normal Smalltalk code is faster."
  		(65 genFastPrimFail)"was primitiveNext"
  		(66 genFastPrimFail) "was primitiveNextPut"
  		(67 genFastPrimFail) "was primitiveAtEnd"
  
  		"StorageManagement Primitives (68-79)"
  		(68 genPrimitiveObjectAt			1)	"Good for debugger/InstructionStream performance"
  		"(69 primitiveObjectAtPut)"
  		(70 genPrimitiveNew			0)
  		(71 genPrimitiveNewWithArg	1)
  		"(72 primitiveArrayBecomeOneWay)"		"Blue Book: primitiveBecome"
  		"(73 primitiveInstVarAt)"
  		"(74 primitiveInstVarAtPut)"
  		(75 genPrimitiveIdentityHash	0)
  		"(76 primitiveStoreStackp)"					"Blue Book: primitiveAsObject"
  		"(77 primitiveSomeInstance)"
  		"(78 primitiveNextInstance)"
  		(79 genPrimitiveNewMethod	2)
  
  		"Control Primitives (80-89)"
  		"(80 primitiveFail)"							"Blue Book: primitiveBlockCopy"
  		"(81 primitiveFail)"							"Blue Book: primitiveValue"
  		"(82 primitiveFail)"							"Blue Book: primitiveValueWithArgs"
  		(83 genPrimitivePerform)
  		"(84 primitivePerformWithArgs)"
  		"(85 primitiveSignal)"
  		"(86 primitiveWait)"
  		"(87 primitiveResume)"
  		"(88 primitiveSuspend)"
  		"(89 primitiveFlushCache)"
  
  		"(90 primitiveMousePoint)"
  		"(91 primitiveTestDisplayDepth)"			"Blue Book: primitiveCursorLocPut"
  		"(92 primitiveSetDisplayMode)"				"Blue Book: primitiveCursorLink"
  		"(93 primitiveInputSemaphore)"
  		"(94 primitiveGetNextEvent)"				"Blue Book: primitiveSampleInterval"
  		"(95 primitiveInputWord)"
  		"(96 primitiveFail)"	"primitiveCopyBits"
  		"(97 primitiveSnapshot)"
  		"(98 primitiveStoreImageSegment)"
  		"(99 primitiveLoadImageSegment)"
  		"(100 primitivePerformInSuperclass)"		"Blue Book: primitiveSignalAtTick"
  		"(101 primitiveBeCursor)"
  		"(102 primitiveBeDisplay)"
  		"(103 primitiveScanCharacters)"
  		"(104 primitiveFail)"	"primitiveDrawLoop"
  		(105 genPrimitiveStringReplace)
  		"(106 primitiveScreenSize)"
  		"(107 primitiveMouseButtons)"
  		"(108 primitiveKbdNext)"
  		"(109 primitiveKbdPeek)"
  
  
  		"System Primitives (110-119)"
  		(110 genPrimitiveIdentical 1)
  		(111 genPrimitiveClass)				"Support both class and Context>>objectClass:"
  		"(112 primitiveBytesLeft)"
  		"(113 primitiveQuit)"
  		"(114 primitiveExitToDebugger)"
  		"(115 primitiveChangeClass)"					"Blue Book: primitiveOopsLeft"
  		"(116 primitiveFlushCacheByMethod)"
  		"(117 primitiveExternalCall)"
  		"(118 primitiveDoPrimitiveWithArgs)"
  		"(119 primitiveFlushCacheSelective)"
  
  		(148 genPrimitiveShallowCopy 0)			"a.k.a. clone"
  
  		(158 genPrimitiveStringCompareWith 1)
  		(159 genPrimitiveHashMultiply 0)
  
  		(165 genPrimitiveIntegerAt			1)	"Signed version of genPrimitiveAt"
  		(166 genPrimitiveIntegerAtPut		2)	"Signed version of genPrimitiveAtPut"
  
  		(169 genPrimitiveNotIdentical 1)
  
  		(170 genPrimitiveAsCharacter)				"SmallInteger>>asCharacter, Character class>>value:"
  		(171 genPrimitiveImmediateAsInteger 0)	"Character>>value SmallFloat64>>asInteger"
  			
  		"(173 primitiveSlotAt 1)"
  		"(174 primitiveSlotAtPut 2)"
  		(175 genPrimitiveIdentityHash	0)		"Behavior>>identityHash"
  
  		"Old closure primitives"
  		"(186 primitiveFail)" "was primitiveClosureValue"
  		"(187 primitiveFail)" "was primitiveClosureValueWithArgs"
  
  		"Perform method directly"
  		"(188 primitiveExecuteMethodArgsArray)"
  		"(189 primitiveExecuteMethod)"
  
  		"Unwind primitives"
  		"(195 primitiveFindNextUnwindContext)"
  		"(196 primitiveTerminateTo)"
  		"(197 primitiveFindHandlerContext)"
  		(198 genFastPrimFail "primitiveMarkUnwindMethod")
  		(199 genFastPrimFail "primitiveMarkHandlerMethod")
  
  		"new closure primitives"
  		"(200 primitiveClosureCopyWithCopiedValues)"
  		(201 genPrimitiveClosureValue	0) "value"
  		(202 genPrimitiveClosureValue	1) "value:"
  		(203 genPrimitiveClosureValue	2) "value:value:"
  		(204 genPrimitiveClosureValue	3) "value:value:value:"
  		(205 genPrimitiveClosureValue	4) "value:value:value:value:"
  		"(206 genPrimitiveClosureValueWithArgs)" "valueWithArguments:"
  
  		(207 genPrimitiveFullClosureValue) "value[:value:value:value:] et al"
  		"(208 genPrimitiveFullClosureValueWithArgs)" "valueWithArguments:"
  		(209 genPrimitiveFullClosureValue) "valueNoContextSwitch[:value:] et al"
  
  		"(210 primitiveContextAt)"
  		"(211 primitiveContextAtPut)"
  		"(212 primitiveContextSize)"
  
  		"(218 primitiveDoNamedPrimitiveWithArgs)"
  		"(219 primitiveFail)"	"reserved for Cog primitives"
  
  		"(220 primitiveFail)"		"reserved for Cog primitives"
  
  		(221 genPrimitiveClosureValue	0) "valueNoContextSwitch"
  		(222 genPrimitiveClosureValue	1) "valueNoContextSwitch:"
  
  		"SmallFloat primitives (540-559)"
  		(541 genPrimitiveSmallFloatAdd				1)
  		(542 genPrimitiveSmallFloatSubtract			1)
  		(543 genPrimitiveSmallFloatLessThan			1)
  		(544 genPrimitiveSmallFloatGreaterThan		1)
  		(545 genPrimitiveSmallFloatLessOrEqual		1)
  		(546 genPrimitiveSmallFloatGreaterOrEqual		1)
  		(547 genPrimitiveSmallFloatEqual				1)
  		(548 genPrimitiveSmallFloatNotEqual			1)
  		(549 genPrimitiveSmallFloatMultiply				1)
  		(550 genPrimitiveSmallFloatDivide				1)
  		"(551 genPrimitiveSmallFloatTruncated			0)"
  		"(552 genPrimitiveSmallFloatFractionalPart		0)"
  		"(553 genPrimitiveSmallFloatExponent			0)"
  		"(554 genPrimitiveSmallFloatTimesTwoPower	1)"
  		(555 genPrimitiveSmallFloatSquareRoot			0)
  		"(556 genPrimitiveSmallFloatSine				0)"
  		"(557 genPrimitiveSmallFloatArctan				0)"
  		"(558 genPrimitiveSmallFloatLogN				0)"
  		"(559 genPrimitiveSmallFloatExp				0)"
  		(575 genPrimitiveHighBit			0)
  	)!

Item was changed:
  ----- Method: SpurMemoryManager class>>initializeCompactClassIndices (in category 'class initialization') -----
  initializeCompactClassIndices
  	"Reuse the compact class indices to name known classIndices.
  	 This helps reduce the churn in the interpreters."
  	"c.f. SpurBootstrap>>defineKnownClassIndices"
  	FirstValidClassIndex :=
  	ClassLargeNegativeIntegerCompactIndex := 32.
  	ClassLargePositiveIntegerCompactIndex := 33.
  	ClassFloatCompactIndex := 34.
  
  	ClassMessageCompactIndex := 35.
  	ClassMethodContextCompactIndex := 36.
  	ClassBlockContextCompactIndex := 0.
  	ClassBlockClosureCompactIndex := 37.
  	ClassFullBlockClosureCompactIndex := 38.
  
  	ClassByteArrayCompactIndex := 50.
  	ClassArrayCompactIndex := 51.
  	ClassByteStringCompactIndex := 52.
+ 	ClassBitmapCompactIndex := 53.
+ 	ClassPointCompactIndex := 54!
- 	ClassBitmapCompactIndex := 53!

Item was changed:
  VMBasicConstants subclass: #VMSqueakClassIndices
  	instanceVariableNames: ''
+ 	classVariableNames: 'ClassArrayCompactIndex ClassBitmapCompactIndex ClassBlockClosureCompactIndex ClassBlockContextCompactIndex ClassByteArrayCompactIndex ClassByteStringCompactIndex ClassFloatCompactIndex ClassFullBlockClosureCompactIndex ClassLargeNegativeIntegerCompactIndex ClassLargePositiveIntegerCompactIndex ClassMessageCompactIndex ClassMethodContextCompactIndex ClassPointCompactIndex'
- 	classVariableNames: 'ClassArrayCompactIndex ClassBitmapCompactIndex ClassBlockClosureCompactIndex ClassBlockContextCompactIndex ClassByteArrayCompactIndex ClassByteStringCompactIndex ClassFloatCompactIndex ClassFullBlockClosureCompactIndex ClassLargeNegativeIntegerCompactIndex ClassLargePositiveIntegerCompactIndex ClassMessageCompactIndex ClassMethodContextCompactIndex'
  	poolDictionaries: ''
  	category: 'VMMaker-Interpreter'!



More information about the Vm-dev mailing list