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

commits at source.squeak.org commits at source.squeak.org
Thu Nov 13 23:55:39 UTC 2014

Eliot Miranda uploaded a new version of VMMaker to project VM Maker:

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

Name: VMMaker.oscog-eem.926
Author: eem
Time: 13 November 2014, 3:52:55.604 pm
UUID: 9c0b0c9e-ba3b-4f54-bdf1-d9c1c18af828
Ancestors: VMMaker.oscog-eem.925

Make buildCaseStmt:in: look for code in all the right places

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

Item was changed:
  ----- Method: TMethod>>buildCaseStmt:in: (in category 'transformations') -----
  buildCaseStmt: aSendNode in: aCodeGen
  	"Build a case statement node for the given send of dispatchOn:in:."
  	"Note: the first argument is the variable to be dispatched on. The second argument is a constant node holding an array of unary selectors, which will be turned into sends to self."
  	| unimplemented errorMessage |
+ 	(aSendNode args size >= 2
+ 	 and: [aSendNode args second isConstant
+ 	 and: [aSendNode args second value isArray]]) ifFalse:
- 	((aSendNode args size >= 2) and:
- 	 [aSendNode args second isConstant and:
- 	 [aSendNode args second value class = Array]]) ifFalse:
  		[self error: 'wrong node structure for a case statement'].
+ 	unimplemented := aSendNode args second value select: [:s| (aCodeGen methodNamed: s) isNil].
- 	unimplemented := aSendNode args second value reject: [:s| self definingClass includesSelector: s].
  	unimplemented isEmpty ifFalse:
  		[errorMessage := 'The following selectors in case statement "', (aSendNode printString copyUpTo: $#), '..." are unimplemented: ',
  							(String streamContents: [:s| unimplemented do: [:sel| s crtab; store: sel]]).
  		 aCodeGen logger nextPutAll: errorMessage; cr; flush.
  		 (self confirm: errorMessage
  			orCancel: aCodeGen abortBlock) ifFalse:
  				[self halt]].
  	^TCaseStmtNode new
  		setExpression: aSendNode args first
  		selectors: aSendNode args second value
  		arguments: (aSendNode args copyFrom: 3 to: aSendNode args size)!

More information about the Vm-dev mailing list