[Vm-dev] VM Maker: VMMakerUI-eem.51.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Nov 23 04:20:19 UTC 2021


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

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

Name: VMMakerUI-eem.51
Author: eem
Time: 22 November 2021, 8:20:17.845976 pm
UUID: 5779d432-7154-48d0-b157-8088b347acbf
Ancestors: VMMakerUI-eem.50

Fix formatting of word-indexable objects in the CogOopInspector (spaces were missing).

=============== Diff against VMMakerUI-eem.50 ===============

Item was changed:
  ----- Method: StackInterpreter>>printOop:on:oopAttribute: (in category '*VMMakerUI-debug printing') -----
  printOop: oop on: aStream oopAttribute: oopTextAttribute
  	<doNotGenerate>
  	| cls fmt lastIndex startIP bytecodesPerLine column |
  	<inline: false>
  	(objectMemory isImmediate: oop) ifTrue:
  		[^self shortPrintOop: oop on: aStream].
  	self printHex: oop on: aStream.
  	(objectMemory addressCouldBeObj: oop) ifFalse:
  		[(oop bitAnd: objectMemory allocationUnit - 1) ~= 0 ifTrue: [^aStream nextPutAll: ' is misaligned'; cr].
  		 ((objectMemory isInNewSpace: oop)
  		  and: [objectMemory isForwarded: oop]) ifTrue:
  			[self printForwarder: oop on: aStream oopAttribute: oopTextAttribute].
  		 ^aStream nextPutAll: (self whereIs: oop); cr].
  	(objectMemory isFreeObject: oop) ifTrue:
  		[aStream nextPutAll: ' is a free chunk of size '; print: (objectMemory sizeOfFree: oop).
  		 objectMemory hasSpurMemoryManagerAPI ifTrue:
  			[aStream nextPutAll: ' 0th: '. self printHex: (objectMemory fetchPointer: 0 ofFreeChunk: oop) on: aStream.
  			 objectMemory printHeaderTypeOf: oop on: aStream].
  		 ^aStream cr].
  	(objectMemory isForwarded: oop) ifTrue:
  		[self printForwarder: oop on: aStream oopAttribute: oopTextAttribute].
  	aStream nextPutAll: ': a(n) '.
  	self printNameOfClass: (cls := objectMemory fetchClassOfNonImm: oop) count: 5 on: aStream.
  	cls = (objectMemory splObj: ClassFloat) ifTrue:
  		[^aStream cr; print: (objectMemory dbgFloatValueOf: oop); cr].
  	fmt := objectMemory formatOf: oop.
  	fmt > objectMemory lastPointerFormat ifTrue:
  		[aStream nextPutAll: ' nbytes '; print: (objectMemory numBytesOf: oop)].
  	aStream cr.
  	(fmt between: objectMemory firstLongFormat and: objectMemory firstCompiledMethodFormat - 1) ifTrue:
  		["This will answer false if splObj: ClassAlien is nilObject"
  		 (self is: oop KindOfClass: (objectMemory splObj: ClassAlien)) ifTrue:
  			[aStream nextPutAll: ' datasize '; print: (self sizeOfAlienData: oop).
  			aStream nextPutAll: ((self isIndirectAlien: oop)
  							ifTrue: [' indirect @ ']
  							ifFalse:
  								[(self isPointerAlien: oop)
  									ifTrue: [' pointer @ ']
  									ifFalse: [' direct @ ']]).
  			 self printHex: (self startOfAlienData: oop) on: aStream. ^aStream cr].
  		 (objectMemory isWordsNonImm: oop) ifTrue:
  			[lastIndex := 64 min: ((objectMemory numBytesOf: oop) / objectMemory wordSize).
  			 lastIndex > 0 ifTrue:
  				[1 to: lastIndex do:
  					[:index|
  					self printHex: (objectMemory fetchLong32: index - 1 ofObject: oop) on: aStream.
+ 					index \\ self elementsPerPrintOopLine = 0
+ 						ifTrue: [aStream cr]
+ 						ifFalse: [aStream space]].
- 					index \\ self elementsPerPrintOopLine = 0 ifTrue:
- 						[aStream cr]].
  				lastIndex \\ self elementsPerPrintOopLine = 0 ifFalse:
  					[aStream cr]].
  			^self].
  		self printStringOf: oop on: aStream.
  		^aStream cr].
  	"this is nonsense.  apologies."
  	startIP := (objectMemory safeLastPointerOf: oop) + objectMemory bytesPerOop - objectMemory baseHeaderSize / objectMemory bytesPerOop.
  	lastIndex := 256 min: startIP.
  	lastIndex > 0 ifTrue:
  		[1 to: lastIndex do:
  			[:index|
  			aStream space; nextPutAll: (self hex: (objectMemory fetchPointer: index - 1 ofObject: oop) withAttribute: oopTextAttribute); space.
  			aStream nextPutAll: (self shortPrint: (objectMemory fetchPointer: index - 1 ofObject: oop)).
+ 			index \\ self elementsPerPrintOopLine = 0
+ 				ifTrue: [aStream cr]
+ 				ifFalse: [aStream space]].
- 			index \\ self elementsPerPrintOopLine = 0 ifTrue:
- 				[aStream cr]].
  		lastIndex \\ self elementsPerPrintOopLine = 0 ifFalse:
  			[aStream cr]].
  	(objectMemory isCompiledMethod: oop)
  		ifFalse:
  			[startIP > 64 ifTrue: [aStream nextPutAll: '...'; cr]]
  		ifTrue:
  			[startIP := startIP * objectMemory wordSize + 1.
  			 lastIndex := objectMemory lengthOf: oop.
  			 lastIndex - startIP > 100 ifTrue:
  				[lastIndex := startIP + 100].
  			 bytecodesPerLine := 8.
  			 column := 1.
  			 startIP to: lastIndex do:
  				[:index| | byte |
  				column = 1 ifTrue:
  					[aStream nextPutAll: (oop+objectMemory baseHeaderSize+index-1) hex; nextPutAll: ': '].
  				byte := objectMemory fetchByte: index - 1 ofObject: oop.
  				aStream space. byte printOn: aStream base: 16. aStream nextPut: $/. byte printOn: aStream.
  				column := column + 1.
  				column > bytecodesPerLine ifTrue:
  					[column := 1. aStream cr]].
  			column = 1 ifFalse:
  				[aStream cr]]!



More information about the Vm-dev mailing list