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

commits at source.squeak.org commits at source.squeak.org
Wed Dec 16 05:38:27 UTC 2015


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

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

Name: VMMaker.oscog-eem.1599
Author: eem
Time: 15 December 2015, 9:36:42.517 pm
UUID: 19b44fae-86ae-4f0e-a799-6d74f99dda78
Ancestors: VMMaker.oscog-eem.1598

x64 Cogit:
Fix cogit generation regression in last commit.  Fix generation of x64's isWithinMwOffsetRange:.  Mark the open pic probe routine as no inline.

Slang:
Fix inlining of chains of non-argument receiver sends, as in "cogit methodZone zoneEnd".

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

Item was changed:
  ----- Method: CogAbstractInstruction>>isWithinMwOffsetRange: (in category 'testing') -----
+ isWithinMwOffsetRange: anAddress
- isWithinMwOffsetRange: address
  	"Answer if an address can be accessed using the offset in a MoveMw:r:R: or similar instruction.
  	 We assume this is true for 32-bit processors and expect 64-bit processors to answer false
  	 for values in the interpreter or the object memory."
  
  	^true!

Item was changed:
  ----- Method: CogX64Compiler>>isWithinMwOffsetRange: (in category 'testing') -----
+ isWithinMwOffsetRange: anAddress
- isWithinMwOffsetRange: address
  	"Answer if an address can be accessed using the offset in a MoveMw:r:R: or similar instruction.
  	 We assume this is true for 32-bit processors and expect 64-bit processors to answer false
+ 	 for values in the interpreter or the object memory.    Restrict our use of offsets to reference
+ 	 addresses within the method zone, rather than checking for a 32-bit offset, si as to keep the
+ 	 simulator and real VM in sync."
- 	 for values in the interpreter or the object memory."
  
+ 	^anAddress asUnsignedInteger < cogit methodZone zoneEnd!
- 	^address asUnsignedInteger < cogit methodZone zoneEnd!

Item was changed:
+ ----- Method: Cogit>>methodZone (in category 'accessing') -----
- ----- Method: Cogit>>methodZone (in category 'simulation only') -----
  methodZone
- 	<doNotGenerate>
  	^methodZone!

Item was changed:
  ----- Method: SimpleStackBasedCogit>>compileOpenPICMethodCacheProbeFor:withShift:baseRegOrNone: (in category 'in-line cacheing') -----
  compileOpenPICMethodCacheProbeFor: selector withShift: shift baseRegOrNone: baseRegOrNone
  	"Compile one method cache probe in an OpenPIC's lookup of selector.  Answer the jump taken if the selector probe fails."
  	<returnTypeC: #'AbstractInstruction *'>
+ 	<inline: false>
  	| jumpSelectorMiss |
  	<var: 'jumpSelectorMiss' type: #'AbstractInstruction *'>
  	self MoveR: SendNumArgsReg R: ClassReg.
  	self annotate: (self XorCw: selector R: ClassReg) objRef: selector.
  	objectMemory shiftForWord > shift ifTrue:
  		[self LogicalShiftLeftCq: objectMemory shiftForWord - shift R: ClassReg].
  	self AndCq: MethodCacheMask << objectMemory shiftForWord R: ClassReg.
  	baseRegOrNone = NoReg
  		ifTrue:
  			[self MoveMw: coInterpreter methodCacheAddress asUnsignedInteger + (MethodCacheSelector << objectMemory shiftForWord)
  				r: ClassReg
  				R: TempReg]
  		ifFalse:
  			[self AddR: baseRegOrNone R: ClassReg;
  				MoveMw: MethodCacheSelector << objectMemory shiftForWord r: ClassReg R: TempReg].
  	self annotate: (self CmpCw: selector R: TempReg) objRef: selector.
  	jumpSelectorMiss := self JumpNonZero: 0.
  	baseRegOrNone = NoReg
  		ifTrue:
  			[self MoveMw: coInterpreter methodCacheAddress asUnsignedInteger + (MethodCacheClass << objectMemory shiftForWord)
  				r: ClassReg
  				R: TempReg]
  		ifFalse:
  			[self MoveMw: MethodCacheClass << objectMemory shiftForWord r: ClassReg R: TempReg].
  	self CmpR: SendNumArgsReg R: TempReg.
  	^jumpSelectorMiss!

Item was changed:
  ----- Method: TSendNode>>shouldExcludeReceiverAsFirstArgument: (in category 'C code generation') -----
  shouldExcludeReceiverAsFirstArgument: aCodeGen
  	"Only include the receiver as the first argument in certain cases.
  	 The receiver is always included if it is an expression.
  	 If it is a variable:
  		 If the vmClass says it is an implicit variable, don't include it.
  		 If the method's definingClass says it is an implicit variable, don't include it.
  		 If the variable is 'self' and the method being called is not in
  		 the method set (i.e. it is some external code), don't include it.
  		 If it is a struct send of something the vm says is an implicit variable, don't include it."
  	| m |
  	(aCodeGen isAssertSelector: selector) ifTrue:
  		[^true].
  
  	(receiver isSend
+ 	 and: [(receiver shouldExcludeReceiverAsFirstArgument: aCodeGen)
+ 		or: [receiver receiver isVariable
+ 			 and: [(self isSelfReference: receiver receiver in: aCodeGen)
+ 				or: [self isStructReference: receiver receiver in: aCodeGen]]]]) ifTrue:
- 	 and: [receiver receiver isVariable
- 	 and: [(self isSelfReference: receiver receiver in: aCodeGen)
- 		or: [self isStructReference: receiver receiver in: aCodeGen]]]) ifTrue:
  		[^aCodeGen isNonArgumentImplicitReceiverVariableName: receiver selector].
  
  	^receiver isVariable
  	    and: [(aCodeGen isNonArgumentImplicitReceiverVariableName: receiver name)
  		    or: [(self isSelfReference: receiver in: aCodeGen)
  			    and: [(m := aCodeGen methodNamed: selector) isNil
  					or: [#(implicit nil) includes: m typeForSelf]]]]!



More information about the Vm-dev mailing list