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

commits at source.squeak.org commits at source.squeak.org
Wed Jul 9 01:15:30 UTC 2014

Eliot Miranda uploaded a new version of VMMaker to project VM Maker:

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

Name: VMMaker.oscog-eem.810
Author: eem
Time: 8 July 2014, 6:12:43.91 pm
UUID: a10a6172-0f6e-47a1-be39-cffd498c9661
Ancestors: VMMaker.oscog-eem.809

Fix bug in nilUnmarkedWeaklingSlotsIn: which was not
guarding the isForwarded: check with an isFreeObject: not check.  Optimizations, optimizations....

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

Item was changed:
  ----- Method: Cogit>>compileEntry (in category 'compile abstract instructions') -----
  	"The entry code to a method checks that the class of the current receiver matches
  	 that in the inline cache.  Other non-obvious elements are that its alignment must be
  	 different from the alignment of the noCheckEntry so that the method map machinery
  	 can distinguish normal and super sends (super sends bind to the noCheckEntry).
  	 In Newspeak we also need to distinguish dynSuperSends from normal and super
+ 	 and so on Nespeak, bind the dynSuperEntry to the preceeding nop (on x86 there
+ 	 happens to be one anyway)."
- 	 and so bind a the preceeding nop (on x86 there happens to be one anyway)."
  	self cppIf: NewspeakVM ifTrue:
  		[self Nop. "1st nop differentiates dynSuperEntry from no-check entry if using nextMethod"
  		 dynSuperEntry := self Nop].
  	entry := objectRepresentation genGetInlineCacheClassTagFrom: ReceiverResultReg into: TempReg forEntry: true.
  	self CmpR: ClassReg R: TempReg.
  	self JumpNonZero: sendMiss.
  	noCheckEntry := self Label.
  	self recordSendTrace ifTrue:
  		[self CallRT: ceTraceLinkedSendTrampoline]!

Item was changed:
  ----- Method: SpurMemoryManager>>followForwarded: (in category 'forwarding') -----
  followForwarded: objOop
  	"Follow a forwarding pointer.  THis must be a loop because we cannot prevent forwarders to
  	 forwarders being created by lazy become.  Consider the following example by Igor Stasenko:
  		array := { a. b. c }.
  		- array at: 1 points to &a. array at: 2 points to &b. array at: 3 points to &c
  		a becomeForward: b
  		- array at: 1 still points to &a. array at: 2 still points to &b. array at: 3 still points to &c
  		b becomeForward: c.
  		- array at: 1 still points to &a. array at: 2 still points to &b. array at: 3 still points to &c
  		- when accessing array first one has to follow a forwarding chain:
  		&a -> &b -> c"
  	| referent |
+ 	self assert: (self isReallyForwarded: objOop).
- 	self assert: (self isForwarded: objOop).
  	referent := self fetchPointer: 0 ofMaybeForwardedObject: objOop.
  	[(self isOopForwarded: referent)] whileTrue:
  		[referent := self fetchPointer: 0 ofMaybeForwardedObject: referent].

Item was added:
+ ----- Method: SpurMemoryManager>>isReallyForwarded: (in category 'object testing') -----
+ isReallyForwarded: objOop
+ 	"This version is for asserts.  It does not take advantage of the power-of0two optimization
+ 	 in isForwarded:."
+ 	<api>
+ 	^(self classIndexOf: objOop) = self isForwardedObjectClassIndexPun!

Item was changed:
  ----- Method: SpurMemoryManager>>nilUnmarkedWeaklingSlotsIn: (in category 'weakness and ephemerality') -----
  nilUnmarkedWeaklingSlotsIn: aWeakling
  	"Nil the unmarked slots in aWeakling and
  	 answer if any unmarked slots were found."
  	| anyUnmarked |
  	anyUnmarked := false.
  	(self numStrongSlotsOfWeakling: aWeakling) to: (self numSlotsOf: aWeakling) - 1 do:
  		[:i| | referent |
  		referent := self fetchPointer: i ofObject: aWeakling.
  		((self isNonImmediate: referent)
+ 		 and: [(self isFreeObject: referent) not
+ 		 and: [self isForwarded: referent]]) ifTrue:
- 		 and: [self isForwarded: referent]) ifTrue:
  			[referent := self fixFollowedField: i ofObject: aWeakling withInitialValue: referent].
  		((self isImmediate: referent) or: [self isMarked: referent]) ifFalse:
  			[self storePointerUnchecked: i ofObject: aWeakling withValue: nilObj.
  			 anyUnmarked := true]].

More information about the Vm-dev mailing list