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

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

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

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

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

Name: VMMaker.oscog-eem.2707
Author: eem
Time: 6 February 2020, 7:11:51.600304 pm
UUID: a4344316-174b-4827-baa1-491549ea3e52
Ancestors: VMMaker.oscog-eem.2706

Slang: Eliminate one source of unused expressions, the expansions of literal block nodes not used for value with a trailing effectless expression.

Dual mapped zone:
Make assertValidDualZoneFrom:to: conditional on cppIf: #DUAL_MAPPED_CODE_ZONE

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

Item was changed:
  ----- Method: Cogit>>assertValidDualZoneFrom:to: (in category 'debugging') -----
  assertValidDualZoneFrom: startAddress to: endAddress
  "{(self firstInvalidDualZoneAddressFrom: startAddress to: endAddress) hex. ((self firstInvalidDualZoneAddressFrom: startAddress to: endAddress) + codeToDataDelta) hex }"
  "{self firstInvalidDualZoneAddress. self firstInvalidDualZoneAddress + codeToDataDelta }"
  "{self firstInvalidDualZoneAddress hex. (self firstInvalidDualZoneAddress + codeToDataDelta) hex }"
  "{(objectMemory longAt: self firstInvalidDualZoneAddress) hex. (objectMemory longAt: self firstInvalidDualZoneAddress + codeToDataDelta) hex }"
  "self armDisassembleDualZoneAnomalies"
  "self armPrintDualZoneAnomalies"
+ <inline: #always>
+ self cCode:
+ [self cppIf: #DUAL_MAPPED_CODE_ZONE
+ ifTrue:
+ [backEnd assertCoherentCodeAt: startAddress + cmNoCheckEntryOffset delta: codeToDataDelta]]
+ inSmalltalk:
+ [self assert: (self firstInvalidDualZoneAddressFrom: startAddress to: endAddress) isNil]!
- self cCode: ''
- inSmalltalk: [self assert: (self firstInvalidDualZoneAddressFrom: startAddress to: endAddress) isNil]!

Item was added:
+ ----- Method: TAssignmentNode>>hasEffect (in category 'testing') -----
+ hasEffect
+ "Answer if this node has an effect on execution state (does something).
+ Statements that don't have any effect can be elided if their value is unused."
+ ^true!

Item was added:
+ ----- Method: TBraceCaseNode>>hasEffect (in category 'testing') -----
+ hasEffect
+ "Answer if this node has an effect on execution state (does something).
+ Statements that don't have any effect can be elided if their value is unused."
+ ^cases anySatisfy: [:node| node hasEffect]!

Item was added:
+ ----- Method: TCaseStmtNode>>hasEffect (in category 'testing') -----
+ hasEffect
+ "Answer if this node has an effect on execution state (does something).
+ Statements that don't have any effect can be elided if their value is unused."
+ ^expression hasEffect
+  or: [cases anySatisfy: [:node| node hasEffect]]!

Item was added:
+ ----- Method: TGoToNode>>hasEffect (in category 'testing') -----
+ hasEffect
+ "Answer if this node has an effect on execution state (does something).
+ Statements that don't have any effect can be elided if their value is unused."
+ ^true!

Item was added:
+ ----- Method: TInlineNode>>hasEffect (in category 'testing') -----
+ hasEffect
+ "Answer if this node has an effect on execution state (does something).
+ Statements that don't have any effect can be elided if their value is unused."
+ ^method hasEffect!

Item was added:
+ ----- Method: TLabeledCommentNode>>hasEffect (in category 'testing') -----
+ hasEffect
+ "Answer if this node has an effect on execution state (does something).
+ Statements that don't have any effect can be elided if their value is unused."
+ ^true!

Item was added:
+ ----- Method: TMethod>>hasEffect (in category 'testing') -----
+ hasEffect
+ "Answer if this node has an effect on execution state (does something).
+ Statements that don't have any effect can be elided if their value is unused."
+ ^parseTree hasEffect!

Item was added:
+ ----- Method: TParseNode>>hasEffect (in category 'testing') -----
+ hasEffect
+ "Answer if this node has an effect on execution state (does something).
+ Statements that don't have any effect can be elided if their value is unused."
+ ^false!

Item was added:
+ ----- Method: TReturnNode>>hasEffect (in category 'testing') -----
+ hasEffect
+ "Answer if this node has an effect on execution state (does something).
+ Statements that don't have any effect can be elided if their value is unused."
+ ^true!

Item was added:
+ ----- Method: TSendNode>>hasEffect (in category 'testing') -----
+ hasEffect
+ "Answer if this node has an effect on execution state (does something).
+ Statements that don't have any effect can be elided if their value is unused."
+ (#(#+ #- #* #/ #// #\\ #= #== #~= #~~ not) includes: selector) ifTrue:
+ [^false].
+ (#(cCoerce:to: cCoerceSimple:to:) includes: selector) ifTrue:
+ [^arguments first hasEffect].
+ ^true!

Item was changed:
  ----- Method: TStmtListNode>>emitCCodeOn:prependToEnd:level:generator: (in category 'C code generation') -----
  emitCCodeOn: aStream prependToEnd: aNodeOrNil level: level generator: aCodeGen
+ | statementToElide |
  self emitCCommentOn: aStream level: level generator: aCodeGen.
+ (aNodeOrNil notNil or: [statements isEmpty or: [statements last hasEffect]]) ifFalse:
+ [statementToElide := statements last].
  statements withIndexDo:
  [:s :idx| | position |
  s emitCCommentOn: aStream level: level generator: aCodeGen.
+ (s == statementToElide
+ or: [s isLeaf and: [s isLabel not and: [aNodeOrNil isNil or: [idx < statements size]]]]) ifFalse:
- (s isLeaf and: [s isLabel not and: [aNodeOrNil isNil or: [idx < statements size]]]) ifFalse:
  [aStream peekLast ~~ Character tab ifTrue:
  [aStream tab: level].
  position := aStream position.
  (aNodeOrNil notNil
  and: [idx = statements size])
  ifTrue:
  [s emitCCodeOn: aStream prependToEnd: aNodeOrNil level: level generator: aCodeGen]
  ifFalse:
  [s emitCCodeOn: aStream level: level generator: aCodeGen].
  aStream position > position ifTrue:
  [(self stream: aStream endsWithAnyOf: '};') ifFalse:
  [s needsTrailingSemicolon ifTrue:
  [aStream nextPut: $;]].
  aStream peekLast ~~ Character cr ifTrue:
  [aStream cr]]]]!

Item was added:
+ ----- Method: TStmtListNode>>hasEffect (in category 'testing') -----
+ hasEffect
+ "Answer if this node has an effect on execution state (does something).
+ Statements that don't have any effect can be elided if their value is unused."
+ ^(arguments anySatisfy: [:node| node hasEffect])
+ or: [statements anySatisfy: [:node| node hasEffect]]!

Item was added:
+ ----- Method: TSwitchStmtNode>>hasEffect (in category 'testing') -----
+ hasEffect
+ "Answer if this node has an effect on execution state (does something).
+ Statements that don't have any effect can be elided if their value is unused."
+ ^expression hasEffect
+  or: [(otherwiseOrNil notNil and: [otherwiseOrNil hasEffect])
+  or: [cases anySatisfy: [:node| node hasEffect]]]!