The Trunk: Kernel-nice.742.mcz

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

The Trunk: Kernel-nice.742.mcz

commits-2
Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.742.mcz

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

Name: Kernel-nice.742
Author: nice
Time: 24 February 2013, 6:13:51.724 pm
UUID: b2026116-be3c-4da6-a0af-0f223c9521a8
Ancestors: Kernel-nice.741

Diminish excessive usage of ReadWriteStream

=============== Diff against Kernel-nice.741 ===============

Item was changed:
  ----- Method: CompiledMethod>>symbolicLinesDo: (in category 'printing') -----
  symbolicLinesDo: aBlock
  "Evaluate aBlock with each of the lines in the symbolic output."
 
  | aStream pc |
+ aStream := (String new: 64) writeStream.
- aStream := ReadWriteStream on: (String new: 64).
  self isQuick ifTrue:
  [self longPrintOn: aStream.
  aBlock value: 0 value: aStream contents.
  ^self].
 
  self primitive ~= 0 ifTrue:
  [self printPrimitiveOn: aStream.
  aBlock value: 1 value: aStream contents.
  aStream resetContents].
 
  pc := self initialPC.
  (InstructionPrinter on: self)
  indent: 0;
  printPC: false; "explorer provides pc anyway"
  printInstructionsOn: aStream
  do: [:printer :scanner :stream| | line index |
  line := stream contents allButLast.
  (line includes: Character cr) ifTrue:
  [line := (line copyUpTo: Character cr), '...'' (continues)'].
  (index := line indexOf: $>) > 0 ifTrue:
  [[(line at: index + 1) isSeparator] whileTrue: [index := index + 1].
  line := ((line copyFrom: 1 to: index) copyReplaceAll: (String with: Character tab) with: (String new: 8 withAll: Character space)),
  (line copyFrom: index + 1 to: line size)].
  aBlock value: pc value: line.
  pc := scanner pc.
  stream resetContents]!

Item was changed:
  ----- Method: Month class>>readFrom: (in category 'squeak protocol') -----
  readFrom: aStream
+ | m y |
+ aStream skipSeparators.
+ m := aStream upToAnyOf: CharacterSet separators..
+ aStream skipSeparators.
+ y := aStream upToEnd.
-
- | m y c |
- m := (ReadWriteStream with: '') reset.
- [(c := aStream next) isSeparator] whileFalse: [m nextPut: c].
- [(c := aStream next) isSeparator] whileTrue.
- y := (ReadWriteStream with: '') reset.
- y nextPut: c.
- [aStream atEnd] whileFalse: [y nextPut: aStream next].
-
  ^ self
+ month: m
+ year: y asInteger
- month: m contents
- year: y contents asInteger
 
  "Month readFrom: 'July 1998' readStream"!