Nicolas Cellier uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-nice.136.mcz ==================== Summary ==================== Name: Tools-nice.136 Author: nice Time: 20 October 2009, 12:08:40 pm UUID: 2e17f776-1ae1-0845-b83c-c57286d61845 Ancestors: Tools-nice.135 use fasterKeys =============== Diff against Tools-nice.135 =============== 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 fasterKeys]. - self packages do:[:p| classNames addAll: p classes keys]. 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 fasterKeys sort].! - ifFalse: [^self selectedPackage classes keys asSortedCollection].! 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 fasterKeys collect: - sortedSourceMap := (sortedSourceMap keys 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 fasterKeys - classifyAll: package classes keys 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 fasterKeys - classifyAll: package classes keys 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 fasterKeys sort: - mapsByAge := MapCache keys asSortedCollection: [: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! |
Free forum by Nabble | Edit this page |