[Vm-dev] VM Maker: VMMaker.oscog-rmacnak.1184.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Apr 13 00:22:24 UTC 2015


Ryan Macnak uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-rmacnak.1184.mcz

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

Name: VMMaker.oscog-rmacnak.1184
Author: rmacnak
Time: 12 April 2015, 5:20:57.049 pm
UUID: 7dbf0e4d-ab34-4318-963f-f4cd8c08f047
Ancestors: VMMaker.oscog-rmacnak.1183

Fix unlinking dynamic super sends.

=============== Diff against VMMaker.oscog-rmacnak.1183 ===============

Item was changed:
  ----- Method: Cogit>>offsetAndSendTableFor:annotation:into: (in category 'in-line cacheing') -----
  offsetAndSendTableFor: entryPoint annotation: annotation into: binaryBlock
  	"Find the relevant sendTable for a linked-send to entryPoint.  Do this based on the
  	 annotation.  c.f. annotationForSendTable:"
  	<inline: true>
  	| offset sendTable |
  	<var: #sendTable type: #'sqInt *'>
  	annotation = IsSendCall ifTrue:
  		[offset := cmEntryOffset.
  		 sendTable := ordinarySendTrampolines] ifFalse:
  	[(BytecodeSetHasDirectedSuperSend and: [annotation = IsDirectedSuperSend]) ifTrue:
  		[offset := cmNoCheckEntryOffset.
  		 sendTable := directedSuperSendTrampolines] ifFalse:
  	[(NewspeakVM and: [annotation = IsNSSelfSend]) ifTrue:
  		[offset := cmEntryOffset.
  		 sendTable := selfSendTrampolines] ifFalse:
+ 	[(NewspeakVM and: [annotation = IsNSDynamicSuperSend]) ifTrue:
- 	[(NewspeakVM and: [annotation = IsNSSelfSend]) ifTrue:
  		[offset := cmEntryOffset.
+ 		 sendTable := dynamicSuperSendTrampolines] ifFalse:
- 		 sendTable := selfSendTrampolines] ifFalse:
- 	[(NewspeakVM and: [annotation = IsNSSelfSend]) ifTrue:
- 		[offset := cmEntryOffset.
- 		 sendTable := selfSendTrampolines] ifFalse:
  	[self assert: annotation = IsSuperSend.
  	 offset := cmNoCheckEntryOffset.
+ 	 sendTable := superSendTrampolines]]]].
- 	 sendTable := superSendTrampolines]]]]].
  
  	binaryBlock
  		value: offset
  		value: sendTable!

Item was changed:
  ----- Method: Cogit>>targetMethodAndSendTableFor:annotation:into: (in category 'in-line cacheing') -----
  targetMethodAndSendTableFor: entryPoint annotation: annotation into: binaryBlock
  	"Evaluate binaryBlock with the targetMethod and relevant send table for a linked-send
  	 to entryPoint.  Do so based on the alignment of entryPoint.  N.B.  For Newspeak sends
  	 we don't need to distinguish between ceImplicitReceiver and the other sends since
  	 ceImplicitReceiver will never appear to be linked, so only three cases here."
  	<inline: true>
  	| targetMethod sendTable |
  	<var: #targetMethod type: #'CogMethod *'>
  	<var: #sendTable type: #'sqInt *'>
  
  	annotation = IsSendCall ifTrue:
  		[targetMethod := self cCoerceSimple: entryPoint - cmEntryOffset to: #'CogMethod *'.
  		 sendTable := ordinarySendTrampolines] ifFalse:
  	[(BytecodeSetHasDirectedSuperSend and: [annotation = IsDirectedSuperSend]) ifTrue:
  		[targetMethod := self cCoerceSimple: entryPoint - cmNoCheckEntryOffset to: #'CogMethod *'.
  		 sendTable := directedSuperSendTrampolines] ifFalse:
  	[(NewspeakVM and: [annotation = IsNSSelfSend]) ifTrue:
  		[targetMethod := self cCoerceSimple: entryPoint - cmEntryOffset to: #'CogMethod *'.
  		 sendTable := selfSendTrampolines] ifFalse:
+ 	[(NewspeakVM and: [annotation = IsNSDynamicSuperSend]) ifTrue:
- 	[(NewspeakVM and: [annotation = IsNSSelfSend]) ifTrue:
  		[targetMethod := self cCoerceSimple: entryPoint - cmEntryOffset to: #'CogMethod *'.
+ 		 sendTable := dynamicSuperSendTrampolines] ifFalse:
- 		 sendTable := selfSendTrampolines] ifFalse:
- 	[(NewspeakVM and: [annotation = IsNSSelfSend]) ifTrue:
- 		[targetMethod := self cCoerceSimple: entryPoint - cmEntryOffset to: #'CogMethod *'.
- 		 sendTable := selfSendTrampolines] ifFalse:
  	[self assert: annotation = IsSuperSend.
  	 targetMethod := self cCoerceSimple: entryPoint - cmNoCheckEntryOffset to: #'CogMethod *'.
+ 	 sendTable := superSendTrampolines]]]].
- 	 sendTable := superSendTrampolines]]]]].
  
  	binaryBlock
  		value: targetMethod
  		value: sendTable!

Item was changed:
  ----- Method: SimpleStackBasedCogit>>annotationForSendTable: (in category 'bytecode generator support') -----
  annotationForSendTable: sendTable
  	"c.f. offsetAndSendTableFor:annotation:into:"
  	<inline: true>
  	<var: #sendTable type: #'sqInt *'>
+ 	(NewspeakVM and: [sendTable == implicitReceiverSendTrampolines]) ifTrue:
+ 		[self error: 'Unexpected implicit receiver send using dirty send machinery'].
+ 	(NewspeakVM and: [sendTable == outerSendTrampolines]) ifTrue:
+ 		[self error: 'Unexpected outer send using dirty send machinery'].
  	(NewspeakVM and: [sendTable == selfSendTrampolines]) ifTrue:
  		[^IsNSSelfSend].
  	(NewspeakVM and: [sendTable == dynamicSuperSendTrampolines]) ifTrue:
  		[^IsNSDynamicSuperSend].
- 	(NewspeakVM and: [sendTable == implicitReceiverSendTrampolines]) ifTrue:
- 		[^IsNSImplicitReceiverSend].
  	(BytecodeSetHasDirectedSuperSend and: [sendTable == directedSuperSendTrampolines]) ifTrue:
  		[^IsDirectedSuperSend].
  	sendTable == superSendTrampolines ifTrue:
  		[^IsSuperSend].
  	self assert: sendTable == ordinarySendTrampolines.
  	^IsSendCall!



More information about the Vm-dev mailing list