David T. Lewis uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker-dtl.403.mcz ==================== Summary ==================== Name: VMMaker-dtl.403 Author: dtl Time: 18 October 2019, 8:15:50.289 pm UUID: dd763318-ebf1-426e-ba9b-f7a45e611ebb Ancestors: VMMaker-dtl.402 Add missing methods so that SlangBrowser works again on classes and methods that are not part of the VM. Methods that can be translated to C (or inlined C) are displayed, others result in assertion errors or invalid C code. For example, Scanner>>scanFieldNames: and many other methods in class Scanner are translated to C or inlined C, but Scanner>>scanAllTokenPositionsInto: cannot be translated and fails with an assertion error. =============== Diff against VMMaker-dtl.402 =============== Item was added: + ----- Method: TMethod>>comment (in category 'accessing') ----- + comment + ^comment! Item was added: + ----- Method: TMethod>>elideAnyFinalReturn (in category 'transformations') ----- + elideAnyFinalReturn + "For super expansions we need to eliminate any final return to prevent premature exit. + Anything meaningful in the returned expression must be retained." + + | stmtList expr | + stmtList := parseTree statements asOrderedCollection. + (stmtList notEmpty and: [stmtList last isReturn]) ifTrue: + [expr := stmtList last expression. + (expr isVariable and: [expr name = 'self']) + ifTrue: [stmtList := stmtList allButLast] + ifFalse: [stmtList at: stmtList size put: expr]. + parseTree setStatements: stmtList]! Item was added: + ----- Method: TMethod>>extraVariableNumber (in category 'transformations') ----- + extraVariableNumber + ^extraVariableNumber! Item was added: + ----- Method: TMethod>>hasProperties (in category 'testing') ----- + hasProperties + ^properties notNil and: [properties notEmpty]! Item was added: + ----- Method: TMethod>>mergePropertiesOfSuperMethod: (in category 'inlining') ----- + mergePropertiesOfSuperMethod: superTMethod + superTMethod hasProperties ifFalse: + [^self]. + self hasProperties ifFalse: + [properties := superTMethod properties. + ^self]. + superTMethod properties pragmas do: + [:aPragma| + (self shouldIncorporatePragmaFromSuperMethod: aPragma) ifTrue: + [properties := properties copyWith: aPragma]]! Item was added: + ----- Method: TMethod>>properties (in category 'accessing') ----- + properties + ^properties! Item was added: + ----- Method: TMethod>>shouldIncorporatePragmaFromSuperMethod: (in category 'inlining') ----- + shouldIncorporatePragmaFromSuperMethod: aPragma + (properties includesKey: aPragma keyword) ifFalse: + [^true]. + ((aPragma keyword beginsWith: #var:) + and: [properties pragmas noneSatisfy: + [:p| + (p keyword beginsWith: #var:) + and: [(p argumentAt: 1) = (aPragma argumentAt: 1)]]]) ifTrue: + [^true]. + ^false! Item was added: + (PackageInfo named: 'VMMaker') postscript: '"below, add code to be run after the loading of this package" + + VMMaker initialize. "enable SlangBrowser if previously installed"'! |
Free forum by Nabble | Edit this page |