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

commits at source.squeak.org commits at source.squeak.org
Wed Sep 28 00:47:07 UTC 2011


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

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

Name: VMMaker.oscog-eem.128
Author: eem
Time: 27 September 2011, 5:43:54.942 pm
UUID: 314823f6-cd6c-468f-9183-843b558f630b
Ancestors: VMMaker.oscog-eem.127

Fix regression in object-as-method/cannot-interpret for single and
polymorphic inline cache misses (lookup:for:methodAndErrorSelectorInto:).
Fix formatting bugette in context printing.

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

Item was changed:
  ----- Method: Cogit>>lookup:for:methodAndErrorSelectorInto: (in category 'in-line cacheing') -----
  lookup: selector for: receiver methodAndErrorSelectorInto: binaryBlock
  	"Lookup selector in the class of receiver.  If found, evaluate binaryBlock with
+ 	 the method, cogged if appropriate..  If not found, due to MNU, lookup the DNU
+ 	 selector and evaluate binaryBlock with the MNU method, cogged if appropriate..
- 	 the method, cogged if appopriate..  If not found, due to MNU, lookup the DNU
- 	 selector and evaluate binaryBlock with the MNU method, cogged if appopriate..
  	 If not found due to cannot interpret, evaluate binaryBlock with the error selector
  	 and a nil method."
  	| methodOrSelectorIndex |
  	<inline: true>
  	methodOrSelectorIndex := coInterpreter
  									lookup: selector
  									receiver: receiver.
  	methodOrSelectorIndex asUnsignedInteger > objectMemory startOfMemory ifTrue:
+ 		[(objectMemory isOopCompiledMethod: methodOrSelectorIndex) ifFalse:
+ 			[^binaryBlock value: methodOrSelectorIndex value: SelectorCannotInterpret].
- 		[self assert: (objectMemory isOopCompiledMethod: methodOrSelectorIndex).
  		 ((coInterpreter methodHasCogMethod: methodOrSelectorIndex) not
  		  and: [coInterpreter methodShouldBeCogged: methodOrSelectorIndex]) ifTrue:
  			["We assume cog:selector: will *not* reclaim the method zone"
  			 self cog: methodOrSelectorIndex selector: selector].
+ 		^binaryBlock value: methodOrSelectorIndex value: nil].
- 		^binaryBlock value: methodOrSelectorIndex value: 0].
  	methodOrSelectorIndex = SelectorDoesNotUnderstand ifTrue:
  		[methodOrSelectorIndex := coInterpreter
  										lookup: (objectMemory splObj: SelectorDoesNotUnderstand)
  										receiver: receiver.
  		 methodOrSelectorIndex asUnsignedInteger > objectMemory startOfMemory ifTrue:
  			[self assert: (objectMemory isOopCompiledMethod: methodOrSelectorIndex).
  			 ((coInterpreter methodHasCogMethod: methodOrSelectorIndex) not
  			  and: [coInterpreter methodShouldBeCogged: methodOrSelectorIndex]) ifTrue:
  				["We assume cog:selector: will *not* reclaim the method zone"
  				 self cog: methodOrSelectorIndex selector: selector].
  			^binaryBlock value: methodOrSelectorIndex value: SelectorDoesNotUnderstand]].
  	^binaryBlock value: methodOrSelectorIndex value: nil!

Item was changed:
  ----- Method: NewspeakInterpreter>>printContext: (in category 'debug printing') -----
  printContext: aContext
  	| sender ip sp na spc |
  	<api>
  	<inline: false>
  	self shortPrintContext: aContext.
  	sender := self fetchPointer: SenderIndex ofObject: aContext.
  	ip := self fetchPointer: InstructionPointerIndex ofObject: aContext.
  	self print: 'sender   '; shortPrintOop: sender.
+ 	self print: 'ip       '; printNum: ip; print: ' ('; printNum: (self integerValueOf: ip); space; printHex: (self integerValueOf: ip); printChar: $); cr.
- 	self print: 'ip       '; printNum: ip; print: ' ('; printNum: (self integerValueOf: ip); printHex: (self integerValueOf: ip); printChar: $); cr.
  	sp := self fetchPointer: StackPointerIndex ofObject: aContext.
  	self print: 'sp       '; printNum: sp; print: ' ('; printNum: (self integerValueOf: sp); printChar: $); cr.
  	(self isMethodContext: aContext)
  		ifTrue:
  			[self print: 'method   '; shortPrintOop: (self fetchPointer: MethodIndex ofObject: aContext).
  			self print: 'closure  '; shortPrintOop: (self fetchPointer: ClosureIndex ofObject: aContext).
  			self print: 'receiver '; shortPrintOop: (self fetchPointer: ReceiverIndex ofObject: aContext)]
  		ifFalse:
  			[na := self fetchPointer: BlockArgumentCountIndex ofObject: aContext.
  			self print: 'numargs  '; printNum: na; print: ' ('; printNum: (self integerValueOf: na); printChar: $); cr.
  			spc := self fetchPointer: InitialIPIndex ofObject: aContext.
  			self print: 'startpc  '; printNum: spc; print: ' ('; printNum: (self integerValueOf: spc); printChar: $); cr.
  			self print: 'home     '; shortPrintOop: (self fetchPointer: HomeIndex ofObject: aContext)].
  	sp := self integerValueOf: sp.
  	sp := sp min: (self lengthOf: aContext) - ReceiverIndex.
  	1 to: sp do:
  		[:i|
  		self print: '       '; printNum: i; space; shortPrintOop: (self fetchPointer: ReceiverIndex + i ofObject: aContext)]!

Item was changed:
  ----- Method: NewspeakInterpreter>>printContext:WithSP: (in category 'debug printing') -----
  printContext: aContext WithSP: theSP
  	| sender ip na spc sp |
  	<api>
  	<inline: false>
  	self shortPrintContext: aContext.
  	sender := self fetchPointer: SenderIndex ofObject: aContext.
  	ip := self fetchPointer: InstructionPointerIndex ofObject: aContext.
  	sp := self integerObjectOf: (self stackPointerIndexFor: theSP context: aContext) - ReceiverIndex.
  	self print: 'sender   '; shortPrintOop: sender.
+ 	self print: 'ip       '; printNum: ip; print: ' ('; printNum: (self integerValueOf: ip); space; printHex: (self integerValueOf: ip); printChar: $); cr.
- 	self print: 'ip       '; printNum: ip; print: ' ('; printNum: (self integerValueOf: ip); printHex: (self integerValueOf: ip); printChar: $); cr.
  	self print: 'sp       '; printNum: sp; print: ' ('; printNum: (self integerValueOf: sp); printChar: $); cr.
  	(self isMethodContext: aContext)
  		ifTrue:
  			[self print: 'method   '; shortPrintOop: (self fetchPointer: MethodIndex ofObject: aContext).
  			self print: 'closure  '; shortPrintOop: (self fetchPointer: ClosureIndex ofObject: aContext).
  			self print: 'receiver '; shortPrintOop: (self fetchPointer: ReceiverIndex ofObject: aContext)]
  		ifFalse:
  			[na := self fetchPointer: BlockArgumentCountIndex ofObject: aContext.
  			self print: 'numargs  '; printNum: na; print: ' ('; printNum: (self integerValueOf: na); printChar: $); cr.
  			spc := self fetchPointer: InitialIPIndex ofObject: aContext.
  			self print: 'startpc  '; printNum: spc; print: ' ('; printNum: (self integerValueOf: spc); printChar: $); cr.
  			self print: 'home     '; shortPrintOop: (self fetchPointer: HomeIndex ofObject: aContext)].
  	sp := self integerValueOf: sp.
  	sp := sp min: (self lengthOf: aContext) - ReceiverIndex.
  	1 to: sp do:
  		[:i|
  		self print: '       '; printNum: i; space; shortPrintOop: (self fetchPointer: ReceiverIndex + i ofObject: aContext)]!

Item was changed:
  ----- Method: StackInterpreter>>printContext: (in category 'debug printing') -----
  printContext: aContext
  	| sender ip sp |
  	<inline: false>
  	self shortPrintContext: aContext.
  	sender := objectMemory fetchPointer: SenderIndex ofObject: aContext.
  	ip := objectMemory fetchPointer: InstructionPointerIndex ofObject: aContext.
  	(objectMemory isIntegerObject: sender)
  		ifTrue:
  			[(self checkIsStillMarriedContext: aContext currentFP: framePointer)
  				ifTrue: [self print: 'married (assuming framePointer valid)'; cr]
  				ifFalse: [self print: 'widdowed (assuming framePointer valid)'; cr].
  			self print: 'sender   '; printNum: sender; print: ' (';
  				printHexPtr: (self withoutSmallIntegerTags: sender); printChar: $); cr.
  			 self print: 'ip       '; printNum: ip; print: ' (';
  				printHexPtr: (self withoutSmallIntegerTags: ip); printChar: $); cr]
  		ifFalse:
  			[self print: 'sender   '; shortPrintOop: sender.
+ 			 self print: 'ip       '; printNum: ip; print: ' ('; printNum: (objectMemory integerValueOf: ip); space; printHex: (objectMemory integerValueOf: ip); printChar: $); cr].
- 			 self print: 'ip       '; printNum: ip; print: ' ('; printNum: (objectMemory integerValueOf: ip); printHex: (objectMemory integerValueOf: ip); printChar: $); cr].
  	sp := objectMemory fetchPointer: StackPointerIndex ofObject: aContext.
  	sp := sp min: (objectMemory lengthOf: aContext) - ReceiverIndex.
  	self print: 'sp       '; printNum: sp; print: ' ('; printNum: (objectMemory integerValueOf: sp); printChar: $); cr.
  	self print: 'method   '; shortPrintOop: (objectMemory fetchPointer: MethodIndex ofObject: aContext).
  	self print: 'closure  '; shortPrintOop: (objectMemory fetchPointer: ClosureIndex ofObject: aContext).
  	self print: 'receiver '; shortPrintOop: (objectMemory fetchPointer: ReceiverIndex ofObject: aContext).
  	sp := objectMemory integerValueOf: sp.
  	1 to: sp do:
  		[:i|
  		self print: '       '; printNum: i; space; shortPrintOop: (objectMemory fetchPointer: ReceiverIndex + i ofObject: aContext)]!



More information about the Vm-dev mailing list