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

commits at source.squeak.org commits at source.squeak.org
Thu Mar 16 19:41:15 UTC 2023


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

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

Name: VMMaker.oscog-eem.3311
Author: eem
Time: 16 March 2023, 12:40:54.390562 pm
UUID: 635091b8-f80a-43b2-817b-14723e9d73c2
Ancestors: VMMaker.oscog-eem.3310

Implement SpurSegmentManager>>segmentContainingObj: via binary search for the benefit of the IGC.
Make stack page printing less confusing (include the baseAddress).
Include a benchmark primitive to run the scavenge (we have garbageCollectMost, but the benchmark answers the time taken as measured by the high-res timer).
Cull some unused simulation methods.

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

Item was added:
+ ----- Method: CoInterpreterPrimitives>>primitiveBenchmarkScavenge (in category 'benchmark primitives') -----
+ primitiveBenchmarkScavenge
+ 	<option: #VMBenchmarks>
+ 	<export: true>
+ 	self primitiveReturnTimeTakenFor:
+ 		[objectMemory hasSpurMemoryManagerAPI
+ 			ifTrue: [objectMemory scavengingGC]
+ 			ifFalse: [objectMemory incrementalGC].
+ 		 self integerObjectOf: (objectMemory bytesLeft: false)]!

Item was changed:
  ----- Method: CogStackPageSurrogate>>printOn: (in category 'printing') -----
  printOn: aStream
  	super printOn: aStream.
+ 	aStream space.
+ 	self baseAddress printOn: aStream base: 16.
+ 	aStream nextPut: $@.
+ 	aStream space; print: address; nextPut: $/.
- 	aStream nextPut: $@; print: address; nextPut: $/.
  	address printOn: aStream base: 16!

Item was removed:
- ----- Method: CogVMSimulator>>sqMemoryExtraBytesLeft: (in category 'memory access') -----
- sqMemoryExtraBytesLeft: includingSwap
- 	^0!

Item was removed:
- ----- Method: InterpreterSimulator>>sqMemoryExtraBytesLeft: (in category 'memory access') -----
- sqMemoryExtraBytesLeft: includingSwap
- 	^0!

Item was changed:
  ----- Method: SpurSegmentManager>>segmentContainingObj: (in category 'accessing') -----
  segmentContainingObj: objOop
+ 	"Answer the segment containing an object.  This is mostly for assert checking, but
+ 	 variations on the incremental GC may use it in anger. Binary search is (of course)
+ 	 marginally slower than linear search for a single segment (e.g. in a 720k object heap,
+ 	 67.1ms vs 61.3ms, or 9.5% slower to derive the segment containing every old space
+ 	 entity), but usefully faster for many segments (e.g. 92.7ms vs 116ms, or 20% faster
+ 	 in the same heap extended with enough large arrays to require 11 segments; and this
+ 	 is pessimal; there are fewer objects at high addresses since the large arrays are there)."
  	<export: true>
  	<returnTypeC: #'SpurSegmentInfo *'>
+ 	| high low mid seg |
+ 	low := 0. mid := numSegments // 2. high := numSegments - 1.
+ 	[seg := segments at: mid.
+ 	(self oop: objOop isGreaterThanOrEqualTo: seg segStart)
+ 		ifTrue:
+ 			[mid = high
+ 				ifTrue:
+ 					[^(self oop: objOop isLessThan: seg segLimit) ifTrue:
+ 						[seg]]
+ 				ifFalse:
+ 					[low := mid.
+ 					 mid := mid + high + 1 // 2]]
+ 		ifFalse:
+ 			[high := mid - 1.
+ 			mid := low + mid // 2].
+ 	low <= high] whileTrue.
- 	numSegments - 1 to: 0 by: -1 do:
- 		[:i|
- 		objOop >= (segments at: i) segStart ifTrue:
- 			[^self addressOf: (segments at: i)]].
  	^nil!

Item was removed:
- ----- Method: StackInterpreterSimulator>>sqMemoryExtraBytesLeft: (in category 'memory access') -----
- sqMemoryExtraBytesLeft: includingSwap
- 	^0!



More information about the Vm-dev mailing list