The Trunk: Compiler-ul.329.mcz

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

The Trunk: Compiler-ul.329.mcz

commits-2
Levente Uzonyi uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-ul.329.mcz

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

Name: Compiler-ul.329
Author: ul
Time: 27 February 2017, 2:04:49.47425 am
UUID: df499238-217a-4e1c-a710-77577e4df261
Ancestors: Compiler-nice.328

- omit ifAbsent from #index* sends when it would use the default value, 0

=============== Diff against Compiler-nice.328 ===============

Item was changed:
  ----- Method: EncoderForV3>>genPushSpecialLiteral: (in category 'bytecode generation') -----
  genPushSpecialLiteral: aLiteral
  "112-119 01110iii Push (receiver, true, false, nil, -1, 0, 1, 2) [iii]"
  | index |
+ index := #(true false nil -1 0 1 2) indexOf: aLiteral.
- index := #(true false nil -1 0 1 2) indexOf: aLiteral ifAbsent: 0.
  index = 0 ifTrue:
  [^self error: 'push special literal: ', aLiteral printString,  ' is not one of true false nil -1 0 1 2'].
  stream nextPut: index + 112!

Item was changed:
  ----- Method: EncoderForV3>>genReturnSpecialLiteral: (in category 'bytecode generation') -----
  genReturnSpecialLiteral: aLiteral
  "120-123 011110ii Return (receiver, true, false, nil) [ii] From Message"
  | index |
+ index := #(true false nil) indexOf: aLiteral.
- index := #(true false nil) indexOf: aLiteral ifAbsent: 0.
  index = 0 ifTrue:
  [^self error: 'return special literal: ', aLiteral printString,  ' is not one of true false nil'].
  stream nextPut: 120 + index!

Item was changed:
  ----- Method: Parser>>removeEmptyTempDeclarationsFrom: (in category 'error correction') -----
  removeEmptyTempDeclarationsFrom: methodNode
 
  | sourceCode madeChanges tempsMarkHolder |
  sourceCode := cue requestor text asString.
  tempsMarkHolder := self collectTemporaryDeclarationsFrom: methodNode.
  madeChanges := false.
  tempsMarkHolder do: [ :currentBlock | | tempsMarkChar0 tempsMarkChar1 tempsMarkChar2 end start |
  tempsMarkChar0 := (sourceCode at: currentBlock tempsMark).
  tempsMarkChar1 := (sourceCode at: currentBlock tempsMark - 1).
  tempsMarkChar2 := (sourceCode at: currentBlock tempsMark - 2).
  tempsMarkChar0 = $| & tempsMarkChar1 = $|
  ifTrue:
  [ end := currentBlock tempsMark.
  start := end - 1].
  tempsMarkChar0 = $| & tempsMarkChar1 = $  & tempsMarkChar2 = $|
  ifTrue:
  [ end := currentBlock tempsMark.
  start := end - 2].
 
  start notNil & end notNil ifTrue: [
  | lineStart lineEnd |
  lineStart := 1 + (sourceCode
  lastIndexOf: Character cr
+ startingAt: start - 1).
- startingAt: start - 1
- ifAbsent: [ 0 ]).
  lineEnd := sourceCode
  indexOf: Character cr
  startingAt: end + 1
  ifAbsent: [ sourceCode size ].
  ((sourceCode indexOfAnyOf: CharacterSet nonSeparators startingAt: lineStart) >= start
  and: [ (sourceCode indexOfAnyOf: CharacterSet nonSeparators startingAt: end + 1) > lineEnd ]) ifTrue: [
  start := lineStart.
  end := lineEnd ].
  cue requestor correctFrom: start to: end with: ''.
  madeChanges := true.
  currentBlock tempsMark: nil ] ].
  madeChanges ifTrue: [ReparseAfterSourceEditing signal]!