Eliot Miranda uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-eem.836.mcz
==================== Summary ====================
Name: System-eem.836
Author: eem
Time: 7 July 2016, 11:51:22.921345 am
UUID: b27dc440-8cbb-43a4-ac99-8db510ef9b1e
Ancestors: System-eem.835
Modify string search in methods to search symbols that are not used as message selectors.
=============== Diff against System-eem.835 ===============
Item was changed:
----- Method: SystemNavigation>>browseMethodsWithString:matchCase: (in category 'browse') -----
browseMethodsWithString: aString matchCase: caseSensitive
"Launch a browser on all methods that contain string literals with aString as a substring. Make the search case-sensitive or insensitive as dictated by the caseSensitive boolean parameter"
self browseAllSelect:
[:method |
+ method hasLiteralSuchThat:
+ [:lit |
+ lit isString
+ and: [(lit includesSubstring: aString caseSensitive: caseSensitive)
+ and: [lit isSymbol
+ ifTrue: [(method messages includes: lit) not]
+ ifFalse: [true]]]]]
- method hasLiteralSuchThat: [:lit |
- (lit isString and: [lit isSymbol not]) and:
- [lit includesSubstring: aString caseSensitive: caseSensitive]]]
name: 'Methods with string ', aString printString, (caseSensitive ifTrue: [' (case-sensitive)'] ifFalse: [' (case-insensitive)'])
+ autoSelect: aString!
- autoSelect: aString.
- !
Eliot Miranda uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-eem.1189.mcz
==================== Summary ====================
Name: Morphic-eem.1189
Author: eem
Time: 7 July 2016, 11:39:54.334537 am
UUID: 0aaf4adb-3407-4afb-b0c5-d8275daaa0db
Ancestors: Morphic-cmm.1188
Tiny cleanup.
=============== Diff against Morphic-cmm.1188 ===============
Item was changed:
----- Method: MorphicProject>>exportSegmentWithChangeSet:fileName:directory: (in category 'file in/out') -----
exportSegmentWithChangeSet: aChangeSetOrNil fileName: aFileName
directory: aDirectory
"Store my project out on the disk as an *exported*
ImageSegment. All outPointers will be in a form that can be resolved
in the target image. Name it <project name>.extSeg. Whatdo we do
about subProjects, especially if they are out as local image
segments? Force them to come in?
Player classes are included automatically."
| is str ans revertSeg roots holder collector fd mgr stacks |
"Files out a changeSet first, so that a project can contain
its own classes"
+ world ifNil: [^ false].
+ world presenter ifNil: [^ false].
- world ifNil: [^ false]. world presenter ifNil: [^ false].
ScrapBook default emptyScrapBook.
world currentHand pasteBuffer: nil. "don't write the paste buffer."
world currentHand mouseOverHandler initialize. "forget about any
references here"
"Display checkCurrentHandForObjectToPaste."
Command initialize.
world clearCommandHistory.
world fullReleaseCachedState; releaseViewers.
world cleanseStepList.
world localFlapTabs size = world flapTabs size ifFalse: [
self error: 'Still holding onto Global flaps'].
world releaseSqueakPages.
holder := Project allProjects. "force them in to outPointers, where
DiskProxys are made"
"Just export me, not my previous version"
revertSeg := self parameterAt: #revertToMe.
self removeParameter: #revertToMe.
roots := OrderedCollection new.
+ roots add: self; add: world; add: transcript; add: aChangeSetOrNil; add: thumbnail; add: world activeHand.
- roots add: self; add: world; add: transcript; add: changeSet; add: thumbnail.
- roots add: world activeHand.
"; addAll: classList; addAll: (classList collect: [:cls | cls class])"
roots := roots reject: [ :x | x isNil]. "early saves may not have
active hand or thumbnail"
+ fd := aDirectory directoryNamed: self resourceDirectoryName.
+ fd assureExistence.
+ "Clean up resource references before writing out"
+ mgr := self resourceManager.
+ self resourceManager: nil.
+ ResourceCollector current: ResourceCollector new.
+ ResourceCollector current localDirectory: fd.
+ ResourceCollector current baseUrl: self resourceUrl.
+ ResourceCollector current initializeFrom: mgr.
+ ProgressNotification signal: '2:findingResources' extra:
+ '(collecting resources...)' translated.
+ "Must activate old world because this is run at #armsLength.
+ Otherwise references to ActiveWorld, ActiveHand, or ActiveEvent
+ will not be captured correctly if referenced from blocks or user code."
+ world becomeActiveDuring:[
+ is := ImageSegment new copySmartRootsExport: roots asArray.
+ "old way was (is := ImageSegment new
+ copyFromRootsForExport: roots asArray)"
+ ].
+ self resourceManager: mgr.
+ collector := ResourceCollector current.
+ ResourceCollector current: nil.
+ ProgressNotification signal: '2:foundResources' extra: ''.
+ is state = #tooBig ifTrue: [
+ collector replaceAll.
+ ^ false].
- fd := aDirectory directoryNamed: self resourceDirectoryName.
- fd assureExistence.
- "Clean up resource references before writing out"
- mgr := self resourceManager.
- self resourceManager: nil.
- ResourceCollector current: ResourceCollector new.
- ResourceCollector current localDirectory: fd.
- ResourceCollector current baseUrl: self resourceUrl.
- ResourceCollector current initializeFrom: mgr.
- ProgressNotification signal: '2:findingResources' extra:
- '(collecting resources...)' translated.
- "Must activate old world because this is run at #armsLength.
- Otherwise references to ActiveWorld, ActiveHand, or ActiveEvent
- will not be captured correctly if referenced from blocks or user code."
- world becomeActiveDuring:[
- is := ImageSegment new copySmartRootsExport: roots asArray.
- "old way was (is := ImageSegment new
- copyFromRootsForExport: roots asArray)"
- ].
- self resourceManager: mgr.
- collector := ResourceCollector current.
- ResourceCollector current: nil.
- ProgressNotification signal: '2:foundResources' extra: ''.
- is state = #tooBig ifTrue: [
- collector replaceAll.
- ^ false].
str := ''.
"considered legal to save a project that has never been entered"
(is outPointers includes: world) ifTrue: [
str := str, '\Project''s own world is not in the segment.' translated withCRs].
str isEmpty ifFalse: [
ans := UIManager default chooseFrom: {
'Do not write file' translated.
'Write file anyway' translated.
'Debug' translated.
} title: str.
ans = 1 ifTrue: [
revertSeg ifNotNil: [projectParameters at:
#revertToMe put: revertSeg].
collector replaceAll.
^ false].
ans = 3 ifTrue: [
collector replaceAll.
self halt: 'Segment not written' translated]].
stacks := is findStacks.
is
writeForExportWithSources: aFileName
inDirectory: fd
changeSet: aChangeSetOrNil.
SecurityManager default signFile: aFileName directory: fd.
"Compress all files and update check sums"
collector forgetObsolete.
self storeResourceList: collector in: fd.
self storeHtmlPageIn: fd.
self storeManifestFileIn: fd.
self writeStackText: stacks in: fd registerIn: collector.
"local proj.005.myStack.t"
self compressFilesIn: fd to: aFileName in: aDirectory
resources: collector.
"also deletes the resource directory"
"Now update everything that we know about"
mgr updateResourcesFrom: collector.
revertSeg ifNotNil: [projectParameters at: #revertToMe put: revertSeg].
holder.
collector replaceAll.
world flapTabs do: [:ft |
(ft respondsTo: #unhibernate) ifTrue: [ft unhibernate]].
is arrayOfRoots do: [:obj |
obj isScriptEditorMorph ifTrue: [obj unhibernate]].
^ true
!
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1032.mcz
==================== Summary ====================
Name: Kernel-eem.1032
Author: eem
Time: 7 July 2016, 11:36:43.185017 am
UUID: 0e4a81f4-1688-419a-b951-f0bc7a0b33fd
Ancestors: Kernel-eem.1031
Faster method creation in CompiledMethodTrailer.
Provide CompiledMethod>>voidCogVMState with a fail-over to flushCache, for safe modification of methods.
Provide BlockClosure>>isNestedeWithin: for testing block nesting.
=============== Diff against Kernel-eem.1031 ===============
Item was added:
+ ----- Method: BlockClosure>>isNestedWithin: (in category 'testing') -----
+ isNestedWithin: aContextOrBlock
+ "Answer if the receiver is nested within aContextOrBlock, which may be ither a Context, or a BlockClosure."
+ aContextOrBlock ifNotNil:
+ [self outerContextsDo:
+ [:ctxt|
+ (ctxt == aContextOrBlock
+ or: [ctxt closureOrNil = aContextOrBlock]) ifTrue: [^true]]].
+ ^false!
Item was added:
+ ----- Method: CompiledMethod>>voidCogVMState (in category 'cleaning') -----
+ voidCogVMState
+ "Tell the VM to remove all references to any machine code form of the method.
+ This primitive must be called whenever a method is in use and modified. This is
+ more aggressive (and *much* more costly) than flushCache since it must search
+ through all context objects, making sure that none have a (hidden) machine code pc
+ in the receiver. Since modifying a method will likely change the generated machine code,
+ modifying a method (rather than redefining it) requires this more aggressive flush."
+
+ <primitive: 215>
+ ^self flushCache!
Item was changed:
----- Method: CompiledMethodTrailer>>createMethod:class:header: (in category 'creating a method') -----
createMethod: numberOfBytesForAllButTrailer class: aCompiledMethodClass header: headerWord
+ | meth delta |
- | meth |
encodedData ifNil: [self encode].
+
-
meth := aCompiledMethodClass newMethod: numberOfBytesForAllButTrailer + size header: headerWord.
"copy the encoded trailer data"
+ delta := meth size - size.
1 to: size do:
+ [:i | meth at: delta + i put: (encodedData at: i)].
- [:i | meth at: meth size - size + i put: (encodedData at: i)].
^meth!
Eliot Miranda uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-eem.323.mcz
==================== Summary ====================
Name: Compiler-eem.323
Author: eem
Time: 7 July 2016, 11:27:28.886558 am
UUID: 52466c66-954e-47f9-8c43-2ce094580ab4
Ancestors: Compiler-eem.322
Comment bytecode 139 as the callPrimitive bytecode (Spur mandates this to lift the number of literals).
=============== Diff against Compiler-eem.322 ===============
Item was changed:
EncoderForV3 subclass: #EncoderForV3PlusClosures
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Compiler-Kernel'!
+ !EncoderForV3PlusClosures commentStamp: 'eem 2/29/2016 00:07' prior: 0!
- !EncoderForV3PlusClosures commentStamp: '<historical>' prior: 0!
An encoder for the V3 bytecode set augmented with the following bytecodes that are part of the full closure implementation.
138 10001010 jkkkkkkk Push (Array new: kkkkkkk) (j = 0)
or Pop kkkkkkk elements into: (Array new: kkkkkkk) (j = 1)
+ 139 10001011 kkkkkkkk jjjjjjjj Invoke primitive number jjjjjjjjkkkkkkkk
-
140 10001100 kkkkkkkk jjjjjjjj Push Temp At kkkkkkkk In Temp Vector At: jjjjjjjj
141 10001101 kkkkkkkk jjjjjjjj Store Temp At kkkkkkkk In Temp Vector At: jjjjjjjj
142 10001110 kkkkkkkk jjjjjjjj Pop and Store Temp At kkkkkkkk In Temp Vector At: jjjjjjjj
143 10001111 llllkkkk jjjjjjjj iiiiiiii Push Closure Num Copied llll Num Args kkkk BlockSize jjjjjjjjiiiiiiii
This is an exact duplicate of EncoderForLongFormV3PlusClosures.
Could be a trait (or in Newspeak, a Mixin).
For now we impose upon you to synchronise any and all changes between these two classes.!
Eliot Miranda uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-eem.700.mcz
==================== Summary ====================
Name: Collections-eem.700
Author: eem
Time: 7 July 2016, 11:10:35.817225 am
UUID: 3761f170-2d94-4ed1-bf3d-1790217dc3d3
Ancestors: Collections-eem.699
Better error messages for primitive failure of one-way become. Set lastChar in TranscriptStream (does this really belong in Collections?) when resetting.
=============== Diff against Collections-eem.699 ===============
Item was changed:
----- Method: Array>>elementsForwardIdentityTo:copyHash: (in category 'converting') -----
elementsForwardIdentityTo: otherArray copyHash: copyHash
"This primitive performs a bulk mutation, causing all pointers to the elements of the
receiver to be replaced by pointers to the corresponding elements of otherArray.
If copyHash is true, the identityHashes remain with the pointers rather than with the
objects so that the objects in the receiver should still be properly indexed in any
existing hashed structures after the mutation. If copyHash is false, then the hashes
of the objects in otherArray remain unchanged. If you know what you're doing this
may indeed be what you want."
<primitive: 249 error: ec>
+ ec == #'bad receiver' ifTrue:
+ [^self error: 'receiver must be of class Array'].
+ ec == #'bad argument' ifTrue:
+ [^self error: (otherArray class == Array
+ ifTrue: ['arg must be of class Array']
+ ifFalse: ['receiver and argument must have the same size'])].
+ ec == #'inappropriate operation' ifTrue:
+ [^self error: 'can''t become immediates such as SmallIntegers or Characters'].
+ ec == #'no modification' ifTrue:
+ [^self error: 'can''t become immutable objects'].
+ ec == #'object is pinned' ifTrue:
+ [^self error: 'can''t become pinned objects'].
self primitiveFailed!
Item was added:
+ ----- Method: TranscriptStream>>reset (in category 'positioning') -----
+ reset
+ "Override to set lastChar"
+ position > 0 ifTrue:
+ [lastChar := collection at: position].
+ ^super reset!
Hi, there!
Is it okay that there is an endless recursion when evaluating "String new:
-1"?
...
ByteString class(Behavior)>>handleFailingFailingBasicNew:
ByteString class(Behavior)>>handleFailingBasicNew:
ByteString class(Behavior)>>basicNew:
ByteString class(Behavior)>>handleFailingFailingBasicNew:
ByteString class(Behavior)>>handleFailingBasicNew:
ByteString class(Behavior)>>basicNew:
ByteString class(Behavior)>>handleFailingFailingBasicNew:
ByteString class(Behavior)>>handleFailingBasicNew:
ByteString class(Behavior)>>basicNew:
...
I would like to have an error signaled instead. Note that the -1 is just an
example for a bad computation. The error I get is "Space is low" then. :-)
Best,
Marcel
--
View this message in context: http://forum.world.st/Endless-recursion-String-new-1-tp4905179.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.
Changes to Trunk (http://source.squeak.org/trunk.html) in the last 24 hours:
http://lists.squeakfoundation.org/pipermail/packages/2016-July/068253.html
Name: System-eem.835
Ancestors: System-eem.834
Fix reading methods from DataStreams on Spur. Old code used pre-Spur numLits header format, and was not 64-bit aware.
=============================================
http://lists.squeakfoundation.org/pipermail/packages/2016-July/068254.html
Name: Kernel-eem.1031
Ancestors: Kernel-eem.1030
Provide support for saving blocks on DataStreams. The old code only allowed saving contewxts in image segments. This code allows only the contexts of blocks being saved to be saved, an saves them with nilled senders, and is careful to manage fields beyond the top of stack, storing and reading nils.
With this code the following works, and one can e.g. save a MessageNames as a morph on file and read it in again.
[:a :b| a > b] saveOnFileNamed: 'block.bin'.
(MultiByteBinaryOrTextStream with: ((FileStream readOnlyFileNamed: 'block.bin') binary contentsOfEntireFile)) binary reset fileInObjectAndCode value: 2 value: 1
=============================================
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1031.mcz
==================== Summary ====================
Name: Kernel-eem.1031
Author: eem
Time: 5 July 2016, 6:16:17.071766 pm
UUID: 04b233a5-6540-4c4b-8a79-64e8e4c12e65
Ancestors: Kernel-eem.1030
Provide support for saving blocks on DataStreams. The old code only allowed saving contewxts in image segments. This code allows only the contexts of blocks being saved to be saved, an saves them with nilled senders, and is careful to manage fields beyond the top of stack, storing and reading nils.
With this code the following works, and one can e.g. save a MessageNames as a morph on file and read it in again.
[:a :b| a > b] saveOnFileNamed: 'block.bin'.
(MultiByteBinaryOrTextStream with: ((FileStream readOnlyFileNamed: 'block.bin') binary contentsOfEntireFile)) binary reset fileInObjectAndCode value: 2 value: 1
=============== Diff against Kernel-eem.1030 ===============
Item was added:
+ ----- Method: BlockClosure>>outerContextsDo: (in category 'private') -----
+ outerContextsDo: aBlock
+ "Evaluate aBlock with all the outer contexts along the receiver's static chain."
+ | outer |
+ outer := outerContext.
+ [outer notNil] whileTrue:
+ [aBlock value: outer.
+ outer := outer closure ifNotNil: [:outerClosure| outerClosure outerContext]]!
Item was added:
+ ----- Method: BlockClosure>>storeDataOn: (in category 'objects from disk') -----
+ storeDataOn: aDataStream
+ "Blocks are allowed go to out in DataStreams, but only without home senders."
+
+ | contexts |
+ contexts := IdentitySet new.
+ aDataStream insideASegment ifFalse:
+ [self outerContextsDo:
+ [:ctxt|
+ contexts add: ctxt.
+ aDataStream replace: ctxt sender with: nil]].
+ ^[super storeDataOn: aDataStream]
+ on: Notification
+ do: [:ex|
+ (contexts includes: ex tag)
+ ifTrue: [ex resume: ex tag]
+ ifFalse: [ex pass]]!
Item was added:
+ ----- Method: ContextPart>>readDataFrom:size: (in category 'objects from disk') -----
+ readDataFrom: aDataStream size: varsOnDisk
+ "Fill in the fields of self based on the contents of aDataStream. Answer self.
+ Read in the instance-variables written by Object>>storeDataOn:.
+ NOTE: This method must send beginReference: before reading any objects from aDataStream that might reference it.
+ Allow aDataStream to have fewer inst vars. See SmartRefStream.
+ Override to not store nil stack contents beyond stack pointer."
+ | cntInstVars cntIndexedVars |
+
+ cntInstVars := self class instSize.
+ cntIndexedVars := varsOnDisk - cntInstVars.
+ cntIndexedVars < 0 ifTrue:
+ [self error: 'Class has changed too much. Define a convertxxx method'].
+
+ aDataStream beginReference: self.
+ 1 to: cntInstVars do:
+ [:i | self instVarAt: i put: aDataStream next].
+ 1 to: stackp do:
+ [:i | self basicAt: i put: aDataStream next].
+ stackp + 1 to: cntIndexedVars do:
+ [:i | aDataStream next ~~ nil ifTrue:
+ [self error: 'Reading a Context''s contents expects only nil beyond top of stack']].
+ "Total number read MUST be equal to varsOnDisk!!"
+ ^self "If we ever answer something other than self, fix calls
+ on (super readDataFrom: aDataStream size: anInteger)"!
Item was changed:
----- Method: ContextPart>>storeDataOn: (in category 'objects from disk') -----
storeDataOn: aDataStream
+ "Contexts are not always allowed go to out in DataStreams. They must be included inside an ImageSegment,
+ or be being saved for a closure."
+ | cntInstVars cntIndexedVars |
- "Contexts are not allowed go to out in DataStreams. They must be included inside an ImageSegment."
+ (aDataStream insideASegment
+ or: [(Notification new tag: self; signal) == self]) ifFalse: "or perhaps ImageSegments were not used at all"
+ [self error: 'This Context was not included in the ImageSegment'].
- aDataStream insideASegment ifTrue: [^ super storeDataOn: aDataStream].
+ cntInstVars := self class instSize.
+ cntIndexedVars := self method frameSize.
+ aDataStream
+ beginInstance: self class
+ size: cntInstVars + cntIndexedVars.
+ 1 to: cntInstVars do:
+ [:i | aDataStream nextPut: (self instVarAt: i)].
+ 1 to: stackp do:
+ [:i | aDataStream nextPut: (self basicAt: i)].
+ stackp + 1 to: cntIndexedVars do:
+ [:i | aDataStream nextPut: nil]!
- self error: 'This Context was not included in the ImageSegment'.
- "or perhaps ImageSegments were not used at all"
- ^ nil!