The Trunk: Tools-nice.138.mcz

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

The Trunk: Tools-nice.138.mcz

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

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

Name: Tools-nice.138
Author: nice
Time: 21 October 2009, 1:08:56 am
UUID: 14bf96c0-5ea5-42b3-90b6-f9703dc57c0b
Ancestors: Tools-nice.137

Use #keys rather than #fasterKeys
Note that pattern (x keys asArray sort) could as well be written (x keys sort) now that keys returns an Array...
This #asArray is here solely for cross-dialect/fork compatibility.

=============== Diff against Tools-nice.137 ===============

Item was changed:
  ----- Method: FileContentsBrowser>>findClass (in category 'class list') -----
  findClass
  | pattern foundClass classNames index foundPackage |
  self okToChange ifFalse: [^ self classNotFound].
  pattern := (UIManager default request: 'Class Name?') asLowercase.
  pattern isEmpty ifTrue: [^ self].
  classNames := Set new.
+ self packages do:[:p| classNames addAll: p classes keys].
- self packages do:[:p| classNames addAll: p classes fasterKeys].
  classNames := classNames asArray select:
  [:n | (n asLowercase indexOfSubCollection: pattern startingAt: 1) > 0].
  classNames isEmpty ifTrue: [^ self].
  index := classNames size == 1
  ifTrue: [1]
  ifFalse: [(UIManager default chooseFrom: classNames lines: #())].
  index = 0 ifTrue: [^ self].
  foundPackage := nil.
  foundClass := nil.
  self packages do:[:p|
  (p classes includesKey: (classNames at: index)) ifTrue:[
  foundClass := p classes at: (classNames at: index).
  foundPackage := p]].
  foundClass isNil ifTrue:[^self].
    self systemCategoryListIndex: (self systemCategoryList indexOf: foundPackage packageName asSymbol).
  self classListIndex: (self classList indexOf: foundClass name). !

Item was changed:
  ----- Method: FileContentsBrowser>>classList (in category 'class list') -----
  classList
  "Answer an array of the class names of the selected category. Answer an
  empty array if no selection exists."
 
  (systemCategoryListIndex = 0 or:[self selectedPackage isNil])
  ifTrue: [^Array new]
+ ifFalse: [^self selectedPackage classes keys asArray sort].!
- ifFalse: [^self selectedPackage classes fasterKeys sort].!

Item was changed:
  ----- Method: DebuggerMethodMap>>rangeForPC:contextIsActiveContext: (in category 'source mapping') -----
  rangeForPC: contextsConcretePC contextIsActiveContext: contextIsActiveContext
  "Answer the indices in the source code for the supplied pc.
  If the context is the actve context (is at the hot end of the stack)
  then its pc is the current pc.  But if the context isn't, because it is
  suspended sending a message, then its current pc is the previous pc."
 
  | pc i end |
  pc := self method abstractPCForConcretePC: (contextIsActiveContext
  ifTrue: [contextsConcretePC]
  ifFalse: [(self method pcPreviousTo: contextsConcretePC)
  ifNotNil: [:prevpc| prevpc]
  ifNil: [contextsConcretePC]]).
  (self abstractSourceMap includesKey: pc) ifTrue:
  [^self abstractSourceMap at: pc].
  sortedSourceMap ifNil:
  [sortedSourceMap := self abstractSourceMap.
+ sortedSourceMap := (sortedSourceMap keys collect:
- sortedSourceMap := (sortedSourceMap fasterKeys collect:
  [:key| key -> (sortedSourceMap at: key)]) asSortedCollection].
  (sortedSourceMap isNil or: [sortedSourceMap isEmpty]) ifTrue: [^1 to: 0].
  i := sortedSourceMap indexForInserting: (pc -> nil).
  i < 1 ifTrue: [^1 to: 0].
  i > sortedSourceMap size ifTrue:
  [end := sortedSourceMap inject: 0 into:
  [:prev :this | prev max: this value last].
  ^end+1 to: end].
  ^(sortedSourceMap at: i) value
 
  "| method source scanner map |
  method := DebuggerMethodMap compiledMethodAt: #rangeForPC:contextIsActiveContext:.
  source := method getSourceFromFile asString.
  scanner := InstructionStream on: method.
  map := method debuggerMap.
  Array streamContents:
  [:ranges|
  [scanner atEnd] whileFalse:
  [| range |
  range := map rangeForPC: scanner pc contextIsActiveContext: true.
  ((map abstractSourceMap includesKey: scanner abstractPC)
   and: [range first ~= 0]) ifTrue:
  [ranges nextPut: (source copyFrom: range first to: range last)].
  scanner interpretNextInstructionFor: InstructionClient new]]"!

Item was changed:
  ----- Method: FileContentsBrowser class>>browseStream:named: (in category 'instance creation') -----
  browseStream: aStream named: aString
 
  | package organizer packageDict browser |
  Cursor wait showWhile: [
  packageDict := Dictionary new.
  browser := self new.
  organizer := SystemOrganizer defaultList: Array new.
  package := (FilePackage new fullName: aString; fileInFrom: aStream).
  packageDict
  at: package packageName
  put: package.
  organizer
+ classifyAll: package classes keys
- classifyAll: package classes fasterKeys
  under: package packageName.
  (browser := self systemOrganizer: organizer)
  packages: packageDict].
  self
  openBrowserView: browser createViews
  label: 'File Contents Browser'.
  !

Item was changed:
  ----- Method: FileContentsBrowser class>>browseFiles: (in category 'instance creation') -----
  browseFiles: fileList
 
  | package organizer packageDict browser |
  Cursor wait showWhile: [
  packageDict := Dictionary new.
  organizer := SystemOrganizer defaultList: Array new.
  fileList do: [:fileName |
  package := FilePackage fromFileNamed: fileName.
  packageDict
  at: package packageName
  put: package.
  organizer
+ classifyAll: package classes keys
- classifyAll: package classes fasterKeys
  under: package packageName].
  (browser := self systemOrganizer: organizer)
  packages: packageDict].
  self
  openBrowserView: browser createViews
  label: 'File Contents Browser'.
  !

Item was changed:
  ----- Method: DebuggerMethodMap class>>cacheDebugMap:forMethod: (in category 'debugger support') -----
  cacheDebugMap: aDebuggerMethodMap forMethod: aCompiledMethod
  MapCache finalizeValues.
  [MapCache size >= MapCacheEntries] whileTrue:
  [| mapsByAge |
+ mapsByAge := MapCache keys asArray sort:
- mapsByAge := MapCache fasterKeys sort:
  [:m1 :m2|
  (MapCache at: m1) timestamp
  < (MapCache at: m2) timestamp].
  mapsByAge notEmpty ifTrue: "There be race conditions and reentrancy issues here"
  [MapCache removeKey: mapsByAge last]].
 
  ^MapCache
  at: aCompiledMethod
  put: aDebuggerMethodMap!