[Vm-dev] VM Maker: VMMaker.oscog-cb.1772.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Apr 6 17:03:45 UTC 2016


ClementBera uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-cb.1772.mcz

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

Name: VMMaker.oscog-cb.1772
Author: cb
Time: 6 April 2016, 10:01:10.859 am
UUID: 506063d2-bc8d-49df-806f-6fd35f262345
Ancestors: VMMaker.oscog-nice.1771

Fixed minor details related to full closures.

=============== Diff against VMMaker.oscog-nice.1771 ===============

Item was changed:
  ----- Method: StackInterpreter>>fullClosureIn:numArgs:numCopiedValues:compiledBlock: (in category 'control primitives') -----
  fullClosureIn: context numArgs: numArgs numCopiedValues: numCopied compiledBlock: compiledBlock 
  	| newClosure |
  	<inline: true>
- 	self assert: ClassFullBlockClosureCompactIndex ~= 0.
  	ClassFullBlockClosureCompactIndex ~= 0
  		ifTrue:
  			[newClosure := objectMemory
  								eeInstantiateSmallClassIndex: ClassFullBlockClosureCompactIndex
  								format: objectMemory indexablePointersFormat
  								numSlots: ClosureFirstCopiedValueIndex + numCopied]
  		ifFalse:
  			[newClosure := objectMemory
  								eeInstantiateSmallClass: (objectMemory splObj: ClassFullBlockClosure)
  								numSlots: FullClosureFirstCopiedValueIndex + numCopied].
  	"Assume: have just allocated a new closure; it must be young. Thus, can use unchecked stores."
  	objectMemory
  		storePointerUnchecked: ClosureOuterContextIndex ofObject: newClosure withValue: context;
  		storePointerUnchecked: FullClosureCompiledBlockIndex ofObject: newClosure withValue: compiledBlock;
  		storePointerUnchecked: ClosureNumArgsIndex ofObject: newClosure withValue: (objectMemory integerObjectOf: numArgs).
  	^newClosure!

Item was added:
+ ----- Method: StackInterpreter>>pushFullClosureNumArgs:copiedValues:compiledBlock:receiverIsOnStack: (in category 'stack bytecodes') -----
+ pushFullClosureNumArgs: numArgs copiedValues: numCopiedArg compiledBlock: compiledBlock receiverIsOnStack: receiverIsOnStack
+ 	"The compiler has pushed the values to be copied, if any. The receiver has been pushed on stack before if specified. 
+ 	 Create a Closure with space for the copiedValues and pop numCopied values off the stack into the closure.
+ 	 Sets outerContext, compiledBlock, numArgs and receiver as specified.."
+ 	<inline: true>
+ 	| numCopied newClosure context startIndex |
+ 	"No need to record the pushed copied values in the outerContext."
+ 	context := self ensureFrameIsMarried: localFP SP: localSP + (numCopiedArg * objectMemory bytesPerOop).
+ 	newClosure := self
+ 					fullClosureIn: context 
+ 					numArgs: numArgs 
+ 					numCopiedValues: numCopiedArg 
+ 					compiledBlock: compiledBlock.
+ 	receiverIsOnStack
+ 		ifFalse: 
+ 			[ startIndex := FullClosureFirstCopiedValueIndex.
+ 			   objectMemory storePointerUnchecked: FullClosureReceiverIndex
+ 				ofObject: newClosure
+ 				withValue: self receiver.
+ 			numCopied := numCopiedArg ]
+ 		ifTrue:
+ 			[ startIndex := FullClosureReceiverIndex.
+ 			numCopied := numCopiedArg + 1 ].
+ 	numCopied > 0 ifTrue:
+ 		[0 to: numCopied - 1 do:
+ 			[ :i |
+ 			"Assume: have just allocated a new BlockClosure; it must be young.
+ 			 Thus, can use unchecked stores."
+ 			 objectMemory storePointerUnchecked: i + startIndex
+ 				ofObject: newClosure
+ 				withValue: (self internalStackValue: numCopied - i - 1)].
+ 		 self internalPop: numCopied].
+ 	self fetchNextBytecode.
+ 	self internalPush: newClosure!



More information about the Vm-dev mailing list