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

commits at source.squeak.org commits at source.squeak.org
Thu Jan 1 21:30:19 UTC 2015


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

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

Name: VMMaker.oscog-eem.1006
Author: eem
Time: 1 January 2015, 1:27:32.18 pm
UUID: 9d3cd4bd-d2d0-476b-bf87-1b040eaaf57e
Ancestors: VMMaker.oscog-eem.1005

Ugh, /really/ fix stupid regression in
findUnwindThroughContext:.

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

Item was changed:
  ----- Method: StackInterpreter>>findUnwindThroughContext: (in category 'return bytecodes') -----
  findUnwindThroughContext: homeContext
  	"Search for either an unwind-protect (activation of method with primitive 198)
  	 or homeContext along the sender chain, which ever is found first.  Return values:
  		0			home context was found on sender chain with no intervening unwind-protects
  		nilObj		home context could not be found => cannotReturn
  		context		the context of an intervening unwind-protect implies home context was found"
  	| onSamePage ctxtOrNilOrZero theMethod |
+ 	"Almost always (98%) the home is on the same page, in which case we know it will be found."
- 	"Almost always (98%) the home is on the same page."
  	onSamePage := (self isStillMarriedContext: homeContext)
  					and: [(stackPages pageIndexFor: framePointer) = (stackPages pageIndexFor: (self frameOfMarriedContext: homeContext))].
+ 
  	"Since nothing changes we don't need to internalize."
  	ctxtOrNilOrZero := self findMethodWithPrimitive: 198 FromFP: framePointer UpToContext: homeContext.
+ 	self deny: (onSamePage and: [ctxtOrNilOrZero = objectMemory nilObject]).
+ 
+ 	ctxtOrNilOrZero = 0 ifTrue:
- 	(onSamePage or: [ctxtOrNilOrZero = 0]) ifTrue:
  		[theMethod := objectMemory fetchPointer: MethodIndex ofObject: homeContext.
  		 (self primitiveIndexOf: theMethod) = 198 ifTrue:
+ 			[^homeContext]].
+ 
+ 	"If an unwind was found, can the home context be found also?  No need to look if on the same page.
+ 	 No need to look if cannot return (ctxtOrNilOrZero = objectMemory nilObject)"
+ 	(onSamePage
+ 	 or: [ctxtOrNilOrZero = objectMemory nilObject]) ifFalse:
- 			[^homeContext].
- 		 self assert: ctxtOrNilOrZero ~= objectMemory nilObject.
- 		 ^ctxtOrNilOrZero].
- 	"If an unwnd was found, can the home context be found also?"
- 	ctxtOrNilOrZero ~= objectMemory nilObject ifTrue:
  		[(self findMethodWithPrimitive: 0 FromContext: ctxtOrNilOrZero UpToContext: homeContext)
  		  = objectMemory nilObject ifTrue:
  			[^objectMemory nilObject]].
  	^ctxtOrNilOrZero!



More information about the Vm-dev mailing list