A new version of System was added to project The Inbox:
http://source.squeak.org/inbox/System-djr.305.mcz ==================== Summary ==================== Name: System-djr.305 Author: djr Time: 31 March 2010, 2:54:59.346 pm UUID: 1bfe21fc-f91f-4769-b467-52cc2af8069a Ancestors: System-ar.304 Move (and delegate) Smalltalk>>hasSpecialSelector:ifTrueSetByte: and friends to SystemDictionary. The Refactoring Browser' tests expects it there and it makes more sense to me. =============== Diff against System-ar.304 =============== Item was changed: ----- Method: SmalltalkImage>>specialSelectorSize (in category 'special objects') ----- specialSelectorSize + ^ globals specialSelectorSize! - "Answer the number of special selectors in the system." - - ^ (self specialObjectsArray at: 24) size // 2! Item was changed: ----- Method: SmalltalkImage>>specialNargsAt: (in category 'special objects') ----- specialNargsAt: anInteger + ^ globals specialNargsAt: anInteger ! - "Answer the number of arguments for the special selector at: anInteger." - - ^ (self specialObjectsArray at: 24) at: anInteger * 2! Item was added: + ----- Method: SystemDictionary>>specialSelectorAt: (in category 'special objects') ----- + specialSelectorAt: anInteger + "Answer the special message selector from the interleaved specialSelectors array." + + ^ (self specialObjectsArray at: 24) at: anInteger * 2 - 1! Item was added: + ----- Method: SystemDictionary>>recreateSpecialObjectsArray (in category 'special objects') ----- + recreateSpecialObjectsArray + "Smalltalk recreateSpecialObjectsArray" + "The Special Objects Array is an array of object pointers used + by the + Squeak virtual machine. Its contents are critical and + unchecked, so don't even think of playing here unless you + know what you are doing." + | newArray | + newArray := Array new: 50. + "Nil false and true get used throughout the interpreter" + newArray at: 1 put: nil. + newArray at: 2 put: false. + newArray at: 3 put: true. + "This association holds the active process (a ProcessScheduler)" + newArray at: 4 put: (self associationAt: #Processor). + "Numerous classes below used for type checking and instantiation" + newArray at: 5 put: Bitmap. + newArray at: 6 put: SmallInteger. + newArray at: 7 put: ByteString. + newArray at: 8 put: Array. + newArray at: 9 put: Smalltalk. + newArray at: 10 put: Float. + newArray at: 11 put: MethodContext. + newArray at: 12 put: BlockContext. + newArray at: 13 put: Point. + newArray at: 14 put: LargePositiveInteger. + newArray at: 15 put: Display. + newArray at: 16 put: Message. + newArray at: 17 put: CompiledMethod. + newArray at: 18 put: (self specialObjectsArray at: 18). + "(low space Semaphore)" + newArray at: 19 put: Semaphore. + newArray at: 20 put: Character. + newArray at: 21 put: #doesNotUnderstand:. + newArray at: 22 put: #cannotReturn:. + newArray at: 23 put: nil. + "An array of the 32 selectors that are compiled as special bytecodes, + paired alternately with the number of arguments each takes." + newArray at: 24 put: #( #+ 1 #- 1 #< 1 #> 1 #<= 1 #>= 1 #= 1 #~= 1 + #* 1 #/ 1 #\\ 1 #@ 1 #bitShift: 1 #// 1 #bitAnd: 1 #bitOr: 1 + #at: 1 #at:put: 2 #size 0 #next 0 #nextPut: 1 #atEnd 0 #== 1 #class 0 + #blockCopy: 1 #value 0 #value: 1 #do: 1 #new 0 #new: 1 #x 0 #y 0 ). + "An array of the 255 Characters in ascii order." + newArray at: 25 put: ((0 to: 255) collect: [:ascii | Character value: ascii]). + newArray at: 26 put: #mustBeBoolean. + newArray at: 27 put: ByteArray. + newArray at: 28 put: Process. + "An array of up to 31 classes whose instances will have compact headers" + newArray at: 29 put: self compactClassesArray. + newArray at: 30 put: (self specialObjectsArray at: 30). + "(delay Semaphore)" + newArray at: 31 put: (self specialObjectsArray at: 31). + "(user interrupt Semaphore)" + "Prototype instances that can be copied for fast initialization" + newArray at: 32 put: (Float new: 2). + newArray at: 33 put: (LargePositiveInteger new: 4). + newArray at: 34 put: Point new. + newArray at: 35 put: #cannotInterpret:. + "Note: This must be fixed once we start using context prototypes (yeah, right)" + "(MethodContext new: CompiledMethod fullFrameSize)." + newArray at: 36 put: (self specialObjectsArray at: 36). "Is the prototype MethodContext (unused by the VM)" + newArray at: 37 put: BlockClosure. + "(BlockContext new: CompiledMethod fullFrameSize)." + newArray at: 38 put: (self specialObjectsArray at: 38). "Is the prototype BlockContext (unused by the VM)" + newArray at: 39 put: (self specialObjectsArray at: 39). "preserve external semaphores" + "array of objects referred to by external code" + newArray at: 40 put: PseudoContext. + newArray at: 41 put: TranslatedMethod. + "finalization Semaphore" + newArray at: 42 put: ((self specialObjectsArray at: 42) ifNil: [Semaphore new]). + newArray at: 43 put: LargeNegativeInteger. + "External objects for callout. + Note: Written so that one can actually completely remove the FFI." + newArray at: 44 put: (self at: #ExternalAddress ifAbsent: []). + newArray at: 45 put: (self at: #ExternalStructure ifAbsent: []). + newArray at: 46 put: (self at: #ExternalData ifAbsent: []). + newArray at: 47 put: (self at: #ExternalFunction ifAbsent: []). + newArray at: 48 put: (self at: #ExternalLibrary ifAbsent: []). + newArray at: 49 put: #aboutToReturn:through:. + newArray at: 50 put: #run:with:in:. + "Now replace the interpreter's reference in one atomic operation" + self specialObjectsArray become: newArray! Item was changed: ----- Method: SmalltalkImage>>specialSelectorAt: (in category 'special objects') ----- specialSelectorAt: anInteger + ^ globals specialSelectorAt: anInteger! - "Answer the special message selector from the interleaved specialSelectors array." - - ^ (self specialObjectsArray at: 24) at: anInteger * 2 - 1! Item was added: + ----- Method: SystemDictionary>>specialObjectsArray (in category 'special objects') ----- + specialObjectsArray "Smalltalk specialObjectsArray at: 1" + <primitive: 129> + ^ self primitiveFailed! Item was added: + ----- Method: SystemDictionary>>hasSpecialSelector:ifTrueSetByte: (in category 'special objects') ----- + hasSpecialSelector: aLiteral ifTrueSetByte: aBlock + 1 to: self specialSelectorSize do: [ :index | + (self specialSelectorAt: index) == aLiteral + ifTrue: [ + aBlock value: index + 16rAF. + ^ true ] ]. + ^ false! Item was added: + ----- Method: SystemDictionary>>specialSelectorSize (in category 'special objects') ----- + specialSelectorSize + "Answer the number of special selectors in the system." + + ^ (self specialObjectsArray at: 24) size // 2! Item was added: + ----- Method: SystemDictionary>>specialNargsAt: (in category 'special objects') ----- + specialNargsAt: anInteger + "Answer the number of arguments for the special selector at: anInteger." + + ^ (self specialObjectsArray at: 24) at: anInteger * 2! Item was changed: ----- Method: SmalltalkImage>>recreateSpecialObjectsArray (in category 'special objects') ----- recreateSpecialObjectsArray + globals recreateSpecialObjectsArray! - "Smalltalk recreateSpecialObjectsArray" - "The Special Objects Array is an array of object pointers used - by the - Squeak virtual machine. Its contents are critical and - unchecked, so don't even think of playing here unless you - know what you are doing." - | newArray | - newArray := Array new: 50. - "Nil false and true get used throughout the interpreter" - newArray at: 1 put: nil. - newArray at: 2 put: false. - newArray at: 3 put: true. - "This association holds the active process (a ProcessScheduler)" - newArray at: 4 put: (self associationAt: #Processor). - "Numerous classes below used for type checking and instantiation" - newArray at: 5 put: Bitmap. - newArray at: 6 put: SmallInteger. - newArray at: 7 put: ByteString. - newArray at: 8 put: Array. - newArray at: 9 put: Smalltalk. - newArray at: 10 put: Float. - newArray at: 11 put: MethodContext. - newArray at: 12 put: BlockContext. - newArray at: 13 put: Point. - newArray at: 14 put: LargePositiveInteger. - newArray at: 15 put: Display. - newArray at: 16 put: Message. - newArray at: 17 put: CompiledMethod. - newArray at: 18 put: (self specialObjectsArray at: 18). - "(low space Semaphore)" - newArray at: 19 put: Semaphore. - newArray at: 20 put: Character. - newArray at: 21 put: #doesNotUnderstand:. - newArray at: 22 put: #cannotReturn:. - newArray at: 23 put: nil. - "An array of the 32 selectors that are compiled as special bytecodes, - paired alternately with the number of arguments each takes." - newArray at: 24 put: #( #+ 1 #- 1 #< 1 #> 1 #<= 1 #>= 1 #= 1 #~= 1 - #* 1 #/ 1 #\\ 1 #@ 1 #bitShift: 1 #// 1 #bitAnd: 1 #bitOr: 1 - #at: 1 #at:put: 2 #size 0 #next 0 #nextPut: 1 #atEnd 0 #== 1 #class 0 - #blockCopy: 1 #value 0 #value: 1 #do: 1 #new 0 #new: 1 #x 0 #y 0 ). - "An array of the 255 Characters in ascii order." - newArray at: 25 put: ((0 to: 255) collect: [:ascii | Character value: ascii]). - newArray at: 26 put: #mustBeBoolean. - newArray at: 27 put: ByteArray. - newArray at: 28 put: Process. - "An array of up to 31 classes whose instances will have compact headers" - newArray at: 29 put: self compactClassesArray. - newArray at: 30 put: (self specialObjectsArray at: 30). - "(delay Semaphore)" - newArray at: 31 put: (self specialObjectsArray at: 31). - "(user interrupt Semaphore)" - "Prototype instances that can be copied for fast initialization" - newArray at: 32 put: (Float new: 2). - newArray at: 33 put: (LargePositiveInteger new: 4). - newArray at: 34 put: Point new. - newArray at: 35 put: #cannotInterpret:. - "Note: This must be fixed once we start using context prototypes (yeah, right)" - "(MethodContext new: CompiledMethod fullFrameSize)." - newArray at: 36 put: (self specialObjectsArray at: 36). "Is the prototype MethodContext (unused by the VM)" - newArray at: 37 put: BlockClosure. - "(BlockContext new: CompiledMethod fullFrameSize)." - newArray at: 38 put: (self specialObjectsArray at: 38). "Is the prototype BlockContext (unused by the VM)" - newArray at: 39 put: (self specialObjectsArray at: 39). "preserve external semaphores" - "array of objects referred to by external code" - newArray at: 40 put: PseudoContext. - newArray at: 41 put: TranslatedMethod. - "finalization Semaphore" - newArray at: 42 put: ((self specialObjectsArray at: 42) ifNil: [Semaphore new]). - newArray at: 43 put: LargeNegativeInteger. - "External objects for callout. - Note: Written so that one can actually completely remove the FFI." - newArray at: 44 put: (self at: #ExternalAddress ifAbsent: []). - newArray at: 45 put: (self at: #ExternalStructure ifAbsent: []). - newArray at: 46 put: (self at: #ExternalData ifAbsent: []). - newArray at: 47 put: (self at: #ExternalFunction ifAbsent: []). - newArray at: 48 put: (self at: #ExternalLibrary ifAbsent: []). - newArray at: 49 put: #aboutToReturn:through:. - newArray at: 50 put: #run:with:in:. - "Now replace the interpreter's reference in one atomic operation" - self specialObjectsArray become: newArray! Item was changed: ----- Method: SmalltalkImage>>specialObjectsArray (in category 'special objects') ----- + specialObjectsArray + ^ globals specialObjectsArray! - specialObjectsArray "Smalltalk specialObjectsArray at: 1" - <primitive: 129> - ^ self primitiveFailed! Item was changed: ----- Method: SmalltalkImage>>hasSpecialSelector:ifTrueSetByte: (in category 'special objects') ----- hasSpecialSelector: aLiteral ifTrueSetByte: aBlock + ^ globals hasSpecialSelector: aLiteral ifTrueSetByte: aBlock! - - 1 to: self specialSelectorSize do: - [:index | - (self specialSelectorAt: index) == aLiteral - ifTrue: [aBlock value: index + 16rAF. ^true]]. - ^false! |
On 3/31/2010 1:46 PM, [hidden email] wrote:
> ==================== Summary ==================== > > Name: System-djr.305 > Author: djr > Time: 31 March 2010, 2:54:59.346 pm > UUID: 1bfe21fc-f91f-4769-b467-52cc2af8069a > Ancestors: System-ar.304 > > Move (and delegate) Smalltalk>>hasSpecialSelector:ifTrueSetByte: and friends to SystemDictionary. > > The Refactoring Browser' tests expects it there and it makes more sense to me. Sorry, but that's a no-go. Special selectors and special objects are a system-wide facility not associated with an individual namespace like Smalltalk globals. If the RefactoringBrowser looks for these facilities in a namespace then it is broken and should be fixed. If a compatibility layer is needed then it should delegate the other way around, i.e., from SystemDictionary to SmalltalkImage. Feel free to add these methods in the 311Deprecated package with a comment noting that RB relies on those. Cheers, - Andreas |
Andreas,
<snip useful explanation> Please allow me to take this moment to say: The trunk process with the commit emails makes me happy. -- Danie Roux *shuffle* Adore Unix - http://danieroux.com |
On 2010-03-31, at 7:43 AM, Danie Roux wrote: > Andreas, > > <snip useful explanation> > > Please allow me to take this moment to say: The trunk process with > the commit emails makes me happy. Me too. Here I am sitting down to tackle this very problem, and in my inbox I see that not only has somebody beat me to it, but a better solution has been identified. Thanks Danie. Colin |
Free forum by Nabble | Edit this page |