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

commits at source.squeak.org commits at source.squeak.org
Sat Jul 20 02:31:06 UTC 2019


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

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

Name: VMMaker.oscog-eem.2536
Author: eem
Time: 19 July 2019, 7:30:49.136299 pm
UUID: b62bbbd8-9091-4f4a-a64e-c2d09f0863e5
Ancestors: VMMaker.oscog-eem.2535

Have primitiveNextObject fail in Spur.  DTL's recent Kernel changes are good, but it's still preferrable for the primtiive to check since performance isn't an issue in Spur (we use allObjects).

Have the code generator eliminate redundant assignments (aVar = aVar) which tend to be generated from Smalltalk idioms where a variable is assigned from a method taking it as a parameter that in some circumstances is a noop, e.g. assignment to latestContinuation from maybeDealWithUnsafeJumpForDescriptor:pc:latestContinuation:.

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

Item was removed:
- ----- Method: BlockClosure>>value:value:value:value:value: (in category '*VMMaker-conveniences') -----
- value: firstArg value: secondArg value: thirdArg value: fourthArg value: fifthArg
- 	"Activate the receiver, creating a closure activation (MethodContext)
- 	 whose closure is the receiver and whose caller is the sender of this
- 	 message. Supply the arguments and copied values to the activation
- 	 as its arguments and copied temps. Primitive. Essential."
- 	<primitive: 205>
- 	| newContext |
- 	numArgs ~= 5 ifTrue:
- 		[self numArgsError: 5].
- 	false
- 		ifTrue: "Old code to simulate the closure value primitive on VMs that lack it."
- 			[newContext := self asContextWithSender: thisContext sender.
- 			newContext at: 1 put: firstArg.
- 			newContext at: 2 put: secondArg.
- 			newContext at: 3 put: thirdArg.
- 			newContext at: 4 put: fourthArg.
- 			newContext at: 5 put: fifthArg.
- 			thisContext privSender: newContext]
- 		ifFalse: [self primitiveFailed]!

Item was added:
+ ----- Method: CCodeGenerator>>mustBeGlobal: (in category 'C translation support') -----
+ mustBeGlobal: varName
+ 	"Answer if a variable must be global and exported.  Used for inst vars that are accessed from VM support code."
+ 
+ 	^vmClass notNil and: [vmClass mustBeGlobal: varName]!

Item was changed:
  ----- Method: InterpreterPrimitives>>primitiveNextObject (in category 'object access primitives') -----
  primitiveNextObject
  	"Return the object following the receiver in the heap. Return the SmallInteger zero when there are no more objects."
  
+ 	(objectMemory hasSpurMemoryManagerAPI
+ 	 and: [objectMemory isImmediate: self stackTop]) ifTrue:
+ 		[^self primitiveFailFor: PrimErrBadReceiver].
  	(objectMemory accessibleObjectAfter: self stackTop)
  		ifNil: [self pop: argumentCount+1 thenPushInteger: 0]
  		ifNotNil: [:instance|
  			self assert: (objectMemory isInMemory: instance).
  			self pop: argumentCount+1 thenPush: instance]!

Item was changed:
  ----- Method: TAssignmentNode>>emitCCodeOn:level:generator: (in category 'C code generation') -----
  emitCCodeOn: aStream level: level generator: aCodeGen
+ 	| selfAssignment |
  	expression isSwitch ifTrue:
  		[^expression emitCCodeOn: aStream addToEndOfCases: self level: level generator: aCodeGen].
  	expression isLiteralArrayDeclaration ifTrue:
  		[^self emitLiteralArrayDeclarationOn: aStream level: level generator: aCodeGen].
  	(expression isSend and: [expression isValueExpansion]) ifTrue:
  		[^self emitValueExpansionOn: aStream level: level generator: aCodeGen].
  	(expression isStmtList and: [expression statements size > 1]) ifTrue:
  		[^self emitStatementListExpansion: expression on: aStream level: level generator: aCodeGen].
+ 	(selfAssignment := (variable isSameAs: expression) and: [(aCodeGen mustBeGlobal: variable name) not]) ifTrue:
+ 		[aStream nextPutAll: '/* '].
  	variable emitCCodeOn: aStream level: level generator: aCodeGen.
  	self isVariableUpdatingAssignment
  		ifTrue:
  			[aStream
  				space;
  				nextPutAll: expression selector;	"+ or -"
  				nextPut: $=;
  				space.
  			expression args first emitCCodeAsArgumentOn: aStream level: level generator: aCodeGen]
  		ifFalse:
  			[aStream space; nextPut: $=; space.
+ 			 selfAssignment ifTrue: [aStream nextPutAll: '*/ '].
  			 expression emitCCodeAsArgumentOn: aStream level: level generator: aCodeGen]!



More information about the Vm-dev mailing list