[Pkg] The Trunk: Kernel-eem.1072.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Mar 24 01:27:34 UTC 2017


Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1072.mcz

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

Name: Kernel-eem.1072
Author: eem
Time: 23 March 2017, 6:27:21.701732 pm
UUID: ecabc689-68b4-45ec-9668-a39f089448d0
Ancestors: Kernel-eem.1071

Revert the mistaken fix to needsFrameSize:.  It is not the perform:withArguments: context that needs a large frame, but its sender.  The arguments are pushed in the sender's context, not the perform:withArguments: context, which doesn't exist at the point the primitive is invoked.  If the primitive scceeds then the arguments are pushed on the context which is activated, which will /not/ be perform:withArguments:.  If the primitive fails, the arguments will be popped off the stack of the sender's context back into the array.

In the Stack (and Cog) VM this is not an issue because there is ample headroom on stack pages.  In a context interpreter the correct solution is to defer pushing the arguments until the new method has been found (which I think is the case anyway).  In any case setting the large frame bit in perform:withArguments: is wrong.  And if it were right, doing it only for perform:withArguments: and not for withArgs:evaluate:, valueWithArguments: and perform:inSuperclass:withArguments: is wrong too.

Add an argument count check to the inner simulated send machinery.

Nuke isPseudoContext; IIAC it's an obsolete remnant of the old jitter VM.

=============== Diff against Kernel-eem.1071 ===============

Item was changed:
  ----- Method: CompiledCode>>needsFrameSize: (in category 'initialize-release') -----
  needsFrameSize: newFrameSize
  	"Set the largeFrameBit to accomodate the newFrameSize"
  	| largeFrameBit header |
  	largeFrameBit := 16r20000.
  	(self numTemps + newFrameSize) > LargeFrame ifTrue:
  		[^ self error: 'Cannot compile -- stack including temps is too deep'].
  	header := self objectAt: 1.
  	(header bitAnd: largeFrameBit) ~= 0
  		ifTrue: [header := header - largeFrameBit].
  	self objectAt: 1 put: header
+ 			+ ((self numTemps + newFrameSize) > SmallFrame
- 			+ ( ((self numTemps + newFrameSize) > SmallFrame or: [ self primitive = 84 "perform:withArguments:"])
  					ifTrue: [largeFrameBit]
  					ifFalse: [0])!

Item was changed:
  ----- Method: ContextPart>>send:to:with:lookupIn: (in category 'controlling') -----
  send: selector to: rcvr with: arguments lookupIn: lookupClass
  	"Simulate the action of sending a message with selector and arguments
  	 to rcvr. The argument, lookupClass, is the class in which to lookup the
  	 message.  This is the receiver's class for normal messages, but for super
  	 messages it will be some specific class related to the source method."
  
  	| meth primIndex val ctxt |
  	(meth := lookupClass lookupSelector: selector) ifNil:
  		[^self send: #doesNotUnderstand:
  				to: rcvr
  				with: {Message selector: selector arguments: arguments}
  				lookupIn: lookupClass].
+ 	meth numArgs ~= arguments size ifTrue:
+ 		[^self error: 'Wrong number of arguments in simulated message ', selector printString].
  	(primIndex := meth primitive) > 0 ifTrue:
  		[val := self doPrimitive: primIndex method: meth receiver: rcvr args: arguments.
  		 (self isPrimFailToken: val) ifFalse:
  			[^val]].
  	(selector == #doesNotUnderstand: and: [lookupClass == ProtoObject]) ifTrue:
  		[^self error: 'Simulated message ', arguments first selector, ' not understood'].
  	ctxt := MethodContext sender: self receiver: rcvr method: meth arguments: arguments.
  	primIndex > 0 ifTrue:
  		[ctxt failPrimitiveWith: val].
  	^ctxt!

Item was removed:
- ----- Method: Object>>isPseudoContext (in category 'testing') -----
- isPseudoContext
- 	^false!



More information about the Packages mailing list