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

commits at source.squeak.org commits at source.squeak.org
Tue Oct 14 19:30:54 UTC 2014


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

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

Name: VMMaker.oscog-eem.902
Author: eem
Time: 14 October 2014, 12:26:26.07 pm
UUID: e97518bb-4f81-470b-9557-6beed90a223c
Ancestors: VMMaker.oscog-eem.901

Rewrite implicit receiver lookup logic to follow and
fix up forwarding pointers.  Fixes occasional failures
to locate correct implicit receiver which manifest as
MNUs.

Fix SimpleStackBasedCogit by marking
Spur's addressCouldBeOop: <api>

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

Item was changed:
  ----- Method: NewspeakInterpreter>>nextImplicitReceiverFor:withMixin: (in category 'stack bytecodes') -----
  nextImplicitReceiverFor: anObject withMixin: mixin
  	"This is used to implement the innards of the pushImplicitReceiverBytecode,
  	 used for implicit receiver sends in NS2/NS3.  Find the nearest lexically-enclosing
  	 implementation of selector by searching up the static chain of anObject,
  	 starting at mixin's application.  This is an iterative implementation derived from
  
  	<ContextPart> nextImplicitReceiverFor: obj <Object>
  				withMixin: mixin <Mixin>
  				implementing: selector <Symbol> ^<Object>"
  	| implicitReceiver mixinApplication theMixin targetMixin dictionary found |
  	implicitReceiver := anObject.
  	targetMixin := mixin.
  	[(targetMixin == nilObj "or: [implicitReceiver == nilObj]") ifTrue:
  		[^nilObj].
  	mixinApplication := self
  							findApplicationOfTargetMixin: targetMixin
  							startingAtNonMetaClass: (self fetchClassOf: implicitReceiver).
  	 mixinApplication == nilObj ifTrue:
  		[^nilObj].
+ 	 dictionary := self followObjField: MessageDictionaryIndex ofObject: mixinApplication.
- 	 dictionary := self fetchPointer: MessageDictionaryIndex ofObject: mixinApplication.
  	 found := self lookupMethodInDictionary: dictionary.
  	 found]
  		whileFalse:
+ 			[implicitReceiver := self followObjField: EnclosingObjectIndex ofObject: mixinApplication.
+ 			 theMixin := self followObjField: MixinIndex ofObject: mixinApplication.
- 			[implicitReceiver := self fetchPointer: EnclosingObjectIndex ofObject: mixinApplication.
- 			 theMixin := self fetchPointer: MixinIndex ofObject: mixinApplication.
  			 theMixin == nilObj ifTrue:[^nilObj].
+ 			 targetMixin := self followObjField: EnclosingMixinIndex ofObject: theMixin].
- 			 targetMixin := self fetchPointer: EnclosingMixinIndex ofObject: theMixin].
  	^implicitReceiver!

Item was added:
+ ----- Method: ObjectMemory>>followMaybeForwarded: (in category 'spur compatibility') -----
+ followMaybeForwarded: objOop
+ 	<inline: true>
+ 	^objOop!

Item was changed:
  ----- Method: SpurMemoryManager>>addressCouldBeOop: (in category 'debug support') -----
+ addressCouldBeOop: address
+ 	<api>
+ 	"Answer if address appears to be that of either an immediate or an object.
+ 	 For code disassembly and assertions."
- addressCouldBeOop: address 
  	^(self isImmediate: address)
  	  or: [self addressCouldBeObj: address]!

Item was changed:
+ ----- Method: SpurMemoryManager>>followMaybeForwarded: (in category 'forwarding') -----
- ----- Method: SpurMemoryManager>>followMaybeForwarded: (in category 'become implementation') -----
  followMaybeForwarded: objOop
+ 	<inline: true>
+ 	^(self isOopForwarded: objOop)
+ 		ifTrue: [self noInlineFollowForwarded: objOop]
- 	^(self isForwarded: objOop)
- 		ifTrue: [self followForwarded: objOop]
  		ifFalse: [objOop]!

Item was added:
+ ----- Method: SpurMemoryManager>>noInlineFollowForwarded: (in category 'forwarding') -----
+ noInlineFollowForwarded: objOop
+ 	<inline: false>
+ 	^self followForwarded: objOop!

Item was changed:
  ----- Method: StackInterpreter>>findApplicationOfTargetMixin:startingAtNonMetaClass: (in category 'newspeak bytecode support') -----
  findApplicationOfTargetMixin: targetMixin startingAtNonMetaClass: aClass
  	"This is used to implement the innards of the pushImplicitReceiverBytecode,
  	 used for outer sends in NS2/NS3.  Find the MixinApplcation of which aClass
  	 is a subclass that is an application of targetMixin.  This is an implementation derived from
  
  	<ContextPart> findApplicationOfTargetMixin: targetMixin startingAtNonMetaClass: aClass
  	"
  	| mixinOrMixinApplication |
+ 	self deny: (objectMemory isForwarded: targetMixin).
+ 	self deny: (objectMemory isForwarded: aClass).
  	mixinOrMixinApplication := aClass.
  	[mixinOrMixinApplication = objectMemory nilObject
  	 or: [mixinOrMixinApplication = targetMixin
+ 	 or: [(objectMemory followObjField: MixinIndex ofObject: mixinOrMixinApplication) = targetMixin]]] whileFalse:
+ 		[mixinOrMixinApplication := objectMemory followObjField: SuperclassIndex ofObject: mixinOrMixinApplication].
- 	 or: [(objectMemory fetchPointer: MixinIndex ofObject: mixinOrMixinApplication) = targetMixin]]] whileFalse:
- 		[mixinOrMixinApplication := objectMemory fetchPointer: SuperclassIndex ofObject: mixinOrMixinApplication].
  	^mixinOrMixinApplication!

Item was changed:
  ----- Method: StackInterpreter>>implicitReceiverFor:mixin:implementing: (in category 'newspeak bytecode support') -----
  implicitReceiverFor: rcvr mixin: mixin implementing: selector
  	"This is used to implement the innards of the pushImplicitReceiverBytecode,
  	 used for implicit receiver sends in NS2/NS3.  Find the nearest lexically-enclosing
  	 implementation of selector by searching up the static chain of anObject,
  	 starting at mixin's application.  This is an iterative implementation derived from
  
  	<ContextPart> implicitReceiverFor: obj <Object>
  					withMixin: mixin <Mixin>
  					implementing: selector <Symbol> ^<Object>"
  	<api>
  	<option: #NewspeakVM>
  	| mixinApplication dictionary found |
+ 	self deny: (objectMemory isOopForwarded: rcvr).
+ 	self deny: (objectMemory isForwarded: mixin).
+ 	"messageSelector is an implicit parameter of lookupMethodInDictionary:"
+ 	messageSelector := objectMemory followMaybeForwarded: selector.
- 	messageSelector := selector. "messageSelector is an implicit parameter of lookupMethodInDictionary:"
  	mixinApplication := self
  							findApplicationOfTargetMixin: mixin
  							startingAtBehavior: (objectMemory fetchClassOf: rcvr).
  	 mixinApplication = objectMemory nilObject ifTrue:
  		[^rcvr].
  	 dictionary := objectMemory followObjField: MethodDictionaryIndex ofObject: mixinApplication.
  	 found := self lookupMethodInDictionary: dictionary.
  	 found ifFalse:
  		[| implicitReceiverOrNil theMixin |
+ 		 theMixin := objectMemory followObjField: MixinIndex ofObject: mixinApplication.
- 		 theMixin := objectMemory fetchPointer: MixinIndex ofObject: mixinApplication.
  		 implicitReceiverOrNil := self nextImplicitReceiverFor: (objectMemory
+ 																followObjField: EnclosingObjectIndex
- 																fetchPointer: EnclosingObjectIndex
  																ofObject: mixinApplication)
  									withMixin: (objectMemory
+ 													followObjField: EnclosingMixinIndex
- 													fetchPointer: EnclosingMixinIndex
  													ofObject: theMixin).
  		 implicitReceiverOrNil ~= objectMemory nilObject ifTrue:
  			[^implicitReceiverOrNil]].
  	^rcvr!

Item was changed:
  ----- Method: StackInterpreter>>nextImplicitReceiverFor:withMixin: (in category 'newspeak bytecode support') -----
  nextImplicitReceiverFor: anObject withMixin: mixin
  	"This is used to implement the innards of the pushImplicitReceiverBytecode,
  	 used for implicit receiver sends in NS2/NS3.  Find the nearest lexically-enclosing
  	 implementation of selector by searching up the static chain of anObject,
  	 starting at mixin's application.  This is an iterative implementation derived from
  
  	<ContextPart> nextImplicitReceiverFor: obj <Object>
  					withMixin: mixin <Mixin>
  					implementing: selector <Symbol> ^<Object>"
  	| implicitReceiver mixinApplication theMixin targetMixin dictionary found |
+ 	self deny: (objectMemory isOopForwarded: anObject).
+ 	self deny: (objectMemory isForwarded: mixin).
  	implicitReceiver := anObject.
  	targetMixin := mixin.
  	[(targetMixin = objectMemory nilObject "or: [implicitReceiver = objectMemory nilObject]") ifTrue:
  		[^objectMemory nilObject].
  	mixinApplication := self findApplicationOfTargetMixin: targetMixin
  							startingAtNonMetaClass: (objectMemory fetchClassOf: implicitReceiver).
  	 mixinApplication = objectMemory nilObject ifTrue:
  		[^objectMemory nilObject].
  	 dictionary := objectMemory followObjField: MethodDictionaryIndex ofObject: mixinApplication.
  	 found := self lookupMethodInDictionary: dictionary.
  	 found]
  		whileFalse:
+ 			[implicitReceiver := objectMemory followObjField: EnclosingObjectIndex ofObject: mixinApplication.
+ 			 theMixin := objectMemory followObjField: MixinIndex ofObject: mixinApplication.
- 			[implicitReceiver := objectMemory fetchPointer: EnclosingObjectIndex ofObject: mixinApplication.
- 			 theMixin := objectMemory fetchPointer: MixinIndex ofObject: mixinApplication.
  			 theMixin = objectMemory nilObject ifTrue:
  				[^objectMemory nilObject].
+ 			 targetMixin := objectMemory followObjField: EnclosingMixinIndex ofObject: theMixin].
- 			 targetMixin := objectMemory fetchPointer: EnclosingMixinIndex ofObject: theMixin].
  	^implicitReceiver!



More information about the Vm-dev mailing list