Quantcast

VM Maker: VMMaker.oscog-eem.2064.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

VM Maker: VMMaker.oscog-eem.2064.mcz

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

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

Name: VMMaker.oscog-eem.2064
Author: eem
Time: 31 December 2016, 2:47:35.497669 pm
UUID: 732488bd-fbde-43e8-b942-4ca3e05e53a6
Ancestors: VMMaker.oscog-eem.2063

SmartSyntaxPlugin Slang:
And don't generate the return guard if there's nothing to guard.

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

Item was changed:
  ----- Method: SmartSyntaxPluginTMethod>>fixUpReturnOneStmt:on: (in category 'transforming') -----
  fixUpReturnOneStmt: stmt on: sStream
 
  stmt isReturn ifFalse: [^sStream nextPut: stmt].
  (stmt expression isSend
  and: [#('primitiveFail' 'primitiveFailFor:') includes: stmt expression selector]) ifTrue:
  ["failure return"
  sStream nextPut: stmt expression.
  sStream nextPut: self nullReturnExpr.
  ^nil].
  (stmt expression isVariable and: ['nil' = stmt expression name]) ifTrue:
  ["^ nil -- this is never right unless automatically generated"
  sStream nextPut: stmt.
  ^nil].
  (stmt expression isVariable and: ['self' = stmt expression name]) ifTrue:
  ["^ self"
  self generateFailureGuardOn: sStream.
  fullArgs isEmpty ifFalse:[ sStream nextPut: (self popExpr: fullArgs size)].
  sStream nextPut: self nullReturnExpr.
  ^nil].
  (stmt expression isVariable | stmt expression isConstant | suppressingFailureGuards) ifTrue:
  ["^ variable or ^ constant or ^ expr without guardchecking"
  self generateFailureGuardOn: sStream.
  sStream nextPut: (self pop: fullArgs size + 1 thenReturnExpr: stmt expression).
  sStream nextPut: self nullReturnExpr.
  ^nil].
  "^ expr with necessary guard checking"
+ sStream isEmpty ifFalse: [self generateFailureGuardOn: sStream].
- self generateFailureGuardOn: sStream.
  (self resultExpressionAlwaysFails: stmt expression)
  ifTrue:
  [sStream nextPut: stmt expression]
  ifFalse:
  [sStream nextPut: (self assign: (self oopVariable: '_return_value') expression: stmt expression).
  (self resultExpressionCanFail: stmt expression) ifTrue:
  [self generateFailureGuardOn: sStream].
  sStream nextPut: (self pop: fullArgs size + 1 thenReturnExpr: (self oopVariable: '_return_value'))].
  sStream nextPut: self nullReturnExpr!

Loading...