[squeak-dev] The Inbox: PackageInfo-Base-fbs.69.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Jan 14 23:10:03 UTC 2014


A new version of PackageInfo-Base was added to project The Inbox:
http://source.squeak.org/inbox/PackageInfo-Base-fbs.69.mcz

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

Name: PackageInfo-Base-fbs.69
Author: fbs
Time: 14 January 2014, 11:10:06.583 pm
UUID: 3c931786-f212-434b-9fd0-8dd6f8036a19
Ancestors: PackageInfo-Base-nice.68

Eliot Miranda's filehandlelimits.1.cs changeset.

=============== Diff against PackageInfo-Base-nice.68 ===============

Item was changed:
  ----- Method: PackageInfo>>changeRecordForOverriddenMethod: (in category 'testing') -----
  changeRecordForOverriddenMethod: aMethodReference
+ 	| method position file prevPos prevFileIndex chunk stamp methodCategory tokens |
+ 	method := aMethodReference actualClass compiledMethodAt: aMethodReference methodSymbol.
+ 	position := method filePosition.
+ 	method fileIndex = 0 ifTrue: [^ nil].
+ 	file := CurrentReadOnlySourceFiles at: method fileIndex.
+ 	[position notNil & file notNil]
+ 		whileTrue:
+ 		[file position: (0 max: position-150).  "Skip back to before the preamble"
+ 		[file position < (position-1)]  "then pick it up from the front"
+ 			whileTrue: [chunk := file nextChunk].
+ 
+ 		"Preamble is likely a linked method preamble, if we're in
+ 			a changes file (not the sources file).  Try to parse it
+ 			for prior source position and file index"
+ 		prevPos := nil.
+ 		stamp := ''.
+ 		(chunk findString: 'methodsFor:' startingAt: 1) > 0
+ 			ifTrue: [tokens := Scanner new scanTokens: chunk]
+ 			ifFalse: [tokens := Array new  "ie cant be back ref"].
+ 		((tokens size between: 7 and: 8)
+ 			and: [(tokens at: tokens size-5) = #methodsFor:])
+ 			ifTrue:
+ 				[(tokens at: tokens size-3) = #stamp:
+ 				ifTrue: ["New format gives change stamp and unified prior pointer"
+ 						stamp := tokens at: tokens size-2.
+ 						prevPos := tokens last.
+ 						prevFileIndex := SourceFiles fileIndexFromSourcePointer: prevPos.
+ 						prevPos := SourceFiles filePositionFromSourcePointer: prevPos]
+ 				ifFalse: ["Old format gives no stamp; prior pointer in two parts"
+ 						prevPos := tokens at: tokens size-2.
+ 						prevFileIndex := tokens last].
+ 				(prevPos = 0 or: [prevFileIndex = 0]) ifTrue: [prevPos := nil]].
+ 		((tokens size between: 5 and: 6)
+ 			and: [(tokens at: tokens size-3) = #methodsFor:])
+ 			ifTrue:
+ 				[(tokens at: tokens size-1) = #stamp:
+ 				ifTrue: ["New format gives change stamp and unified prior pointer"
+ 						stamp := tokens at: tokens size]].
+ 		methodCategory := tokens after: #methodsFor: ifAbsent: ['as yet unclassifed'].
+ 		(self includesMethodCategory: methodCategory ofClass: aMethodReference actualClass) ifTrue:
+ 			[methodCategory = (Smalltalk at: #Categorizer ifAbsent: [Smalltalk at: #ClassOrganizer]) default ifTrue: [methodCategory := methodCategory, ' '].
+ 			^ ChangeRecord new file: file position: position type: #method
+ 						class: aMethodReference classSymbol category: methodCategory meta: aMethodReference classIsMeta stamp: stamp].
+ 		(self isOverrideCategory: methodCategory) ifFalse: [^nil].
+ 		position := prevPos.
+ 		prevPos notNil ifTrue:
+ 			[file := CurrentReadOnlySourceFiles at: prevFileIndex]].
+ 		^ nil
+ !
- 	self changeRecordsForMethod: aMethodReference do: [:record |
- 		(self includesMethodCategory: record category
- 			ofClass: aMethodReference actualClass)
- 				ifTrue: [^record]].
- 	^nil!



More information about the Squeak-dev mailing list