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

commits at source.squeak.org commits at source.squeak.org
Mon Jun 27 01:04:48 UTC 2016


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

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

Name: VMMaker.oscog-eem.1890
Author: eem
Time: 26 June 2016, 6:03:06.041002 pm
UUID: 63b22b9f-29ab-46d5-b533-05c17aa78dc6
Ancestors: VMMaker.oscog-eem.1889

Fix regression in Sista introsduced in VMMaker.oscog-eem.1877.  The Sista scanMethod:  should set useTwoPaths only for methods that would be frameless were it not for a store (which needs a frame if immutable).  The regression was to set useTwoPaths in frameful methods containing a store; a stupid slip by your's truly.

In 1890 Dutch artist Vincent van Gogh moves to Auvers-sur-Oise on the edge of Paris in the care of Dr Paul Gachet where he will produce around seventy paintings in as many days, and commit suicide soon thereafter, the Picture of Dorian Gray by Oscar Wilde is published by Philadelphia-based Lippincott's Monthly Magazine, and the United States Census Bureau begins using Herman Hollerith's tabulating machine to tabulate census returns using punched card input, a landmark in the history of computing hardware. Hollerith's company eventually becomes IBM.

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

Item was changed:
  ----- Method: StackToRegisterMappingCogit>>scanMethod (in category 'compile abstract instructions') -----
  scanMethod
  	"Scan the method (and all embedded blocks) to determine
  		- what the last bytecode is; extra bytes at the end of a method are used to encode things like source pointers or temp names
  		- if the method needs a frame or not
  		- what are the targets of any backward branches.
  		- how many blocks it creates
  	 Answer the block count or on error a negative error code"
  	| latestContinuation nExts descriptor pc numBlocks distance targetPC framelessStackDelta seenInstVarStore |
  	<var: #descriptor type: #'BytecodeDescriptor *'>
  	needsFrame := useTwoPaths := seenInstVarStore := false.
  	self maybeInitNumFixups.
  	self maybeInitNumCounters.
  	prevBCDescriptor := nil.
  	NewspeakVM ifTrue:
  		[numIRCs := 0].
  	(primitiveIndex > 0
  	 and: [coInterpreter isQuickPrimitiveIndex: primitiveIndex]) ifTrue:
  		[^0].
  	pc := latestContinuation := initialPC.
  	numBlocks := framelessStackDelta := nExts := extA := extB := 0.
  	[pc <= endPC] whileTrue:
  		[byte0 := (objectMemory fetchByte: pc ofObject: methodObj) + bytecodeSetOffset.
  		 descriptor := self generatorAt: byte0.
  		 descriptor isExtension ifTrue:
  			[descriptor opcode = Nop ifTrue: "unknown bytecode tag; see Cogit class>>#generatorTableFrom:"
  				[^EncounteredUnknownBytecode].
  			 self loadSubsequentBytesForDescriptor: descriptor at: pc.
  			 self perform: descriptor generator].
  		 (descriptor isReturn
  		  and: [pc >= latestContinuation]) ifTrue:
  			[endPC := pc].
  
  		  needsFrame ifFalse:
  			[(descriptor needsFrameFunction isNil
  			  or: [self perform: descriptor needsFrameFunction with: framelessStackDelta])
  					ifTrue:
+ 						[needsFrame := true]
- 						[needsFrame := true.
- 						 self cppIf: IMMUTABILITY
- 							ifTrue: [useTwoPaths := descriptor isInstVarStore]]
  					ifFalse:
  						[framelessStackDelta := framelessStackDelta + descriptor stackDelta.
+ 						 "With immutability we win simply by avoiding a frame build if the receiver is not immutable.
+ 						  Without immutability we win if there are two or more stores amd the receiver is new."
  						 self cppIf: IMMUTABILITY
+ 							ifTrue: [useTwoPaths := descriptor isInstVarStore]
- 							ifTrue: []
  							ifFalse:
  								[descriptor isInstVarStore ifTrue:
  									[seenInstVarStore
  										ifTrue: [useTwoPaths := true]
  										ifFalse: [seenInstVarStore := true]]]]].
  
  		 descriptor isBranch ifTrue:
  			[distance := self spanFor: descriptor at: pc exts: nExts in: methodObj.
  			 targetPC := pc + descriptor numBytes + distance.
  			 (self isBackwardBranch: descriptor at: pc exts: nExts in: methodObj)
  				ifTrue: [self initializeFixupAt: targetPC - initialPC]
  				ifFalse:
  					[latestContinuation := latestContinuation max: targetPC.
  					 self maybeCountFixup.
  					 self maybeCountCounter]].
  		 descriptor isBlockCreation ifTrue:
  			[numBlocks := numBlocks + 1.
  			 distance := self spanFor: descriptor at: pc exts: nExts in: methodObj.
  			 targetPC := pc + descriptor numBytes + distance.
  			 latestContinuation := latestContinuation max: targetPC.
  			 self maybeCountFixup].
  
  		 NewspeakVM ifTrue:
  			[descriptor hasIRC ifTrue:
  				[numIRCs := numIRCs + 1]].
  		 pc := pc + descriptor numBytes.
  		 descriptor isExtension
  			ifTrue: [nExts := nExts + 1]
  			ifFalse: [nExts := extA := extB := 0].
  		 prevBCDescriptor := descriptor].
  	^numBlocks!



More information about the Vm-dev mailing list