Eliot Miranda uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-eem.751.mcz
==================== Summary ====================
Name: Tools-eem.751
Author: eem
Time: 30 March 2017, 3:24:18.73121 pm
UUID: a07a8811-44e8-4eec-9d25-e8459f1c6ee4
Ancestors: Tools-eem.750
Commit the essential cange of reference from MethodContext to Context before commiting the Kernel that does away with MethodContext.
=============== Diff against Tools-eem.750 ===============
Item was added:
+ ----- Method: Context>>errorReportOn: (in category '*Tools-debugger access') -----
+ errorReportOn: strm
+ "Write a detailed error report on the stack (above me) on a stream. For both the error file, and emailing a bug report. Suppress any errors while getting printStrings. Limit the length."
+
+ | cnt aContext startPos |
+ strm print: Date today; space; print: Time now; cr.
+ strm cr.
+ strm nextPutAll: 'VM: ';
+ nextPutAll: Smalltalk platformName asString;
+ nextPutAll: ' - ';
+ nextPutAll: Smalltalk asString;
+ cr.
+ strm nextPutAll: 'Image: ';
+ nextPutAll: SystemVersion current version asString;
+ nextPutAll: ' [';
+ nextPutAll: Smalltalk lastUpdateString asString;
+ nextPutAll: ']';
+ cr.
+ strm cr.
+ SecurityManager default printStateOn: strm.
+
+ "Note: The following is an open-coded version of ContextPart>>stackOfSize: since this method may be called during a low space condition and we might run out of space for allocating the full stack."
+ cnt := 0. startPos := strm position.
+ aContext := self.
+ [aContext notNil and: [(cnt := cnt + 1) < 20]] whileTrue:
+ [aContext printDetails: strm. "variable values"
+ strm cr.
+ aContext := aContext sender].
+
+ strm cr; nextPutAll: '--- The full stack ---'; cr.
+ aContext := self.
+ cnt := 0.
+ [aContext == nil] whileFalse:
+ [cnt := cnt + 1.
+ cnt = 20 ifTrue: [strm nextPutAll: ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -'; cr].
+ strm print: aContext; cr. "just class>>selector"
+
+ "exit early if too long..."
+ strm position > (startPos+ self class maxLengthForASingleDebugLogReport) ifTrue: [strm nextPutAll: '...etc...'. ^ self]. cnt > self class maxStackDepthForASingleDebugLogReport ifTrue: [strm nextPutAll: '-- and more not shown --'. ^ self].
+ aContext := aContext sender].
+ !
Item was added:
+ ----- Method: Context>>inspectorClass (in category '*Tools-Inspector') -----
+ inspectorClass
+ "Answer the class of the inspector to be used on the receiver. Called by inspect;
+ use basicInspect to get a normal (less useful) type of inspector."
+
+ ^ ContextInspector!
Item was changed:
----- Method: Debugger class>>informExistingDebugger:label: (in category 'instance creation') -----
informExistingDebugger: aContext label: aString
"Walking the context chain, we try to find out if we're in a debugger stepping situation.
If we find the relevant contexts, we must rearrange them so they look just like they would
if the methods were executed outside of the debugger.
hmm 8/3/2001 13:05"
| ctx quickStepMethod oldSender baseContext |
ctx := thisContext.
+ quickStepMethod := Context compiledMethodAt: #quickSend:to:with:super:.
- quickStepMethod := MethodContext compiledMethodAt: #quickSend:to:with:super:.
[ctx sender == nil or: [ctx sender method == quickStepMethod]] whileFalse: [ctx := ctx sender].
ctx sender ifNil: [^self].
baseContext := ctx.
"baseContext is now the context created by the #quickSend... method."
oldSender := ctx := ctx sender home sender.
"oldSender is the context which originally sent the #quickSend... method"
[ctx == nil or: [(ctx objectClass: ctx receiver) includesBehavior: self]] whileFalse: [ctx := ctx sender].
ctx ifNil: [^self].
"ctx is the context of the Debugger method #doStep"
ctx receiver
labelString: aString;
externalInterrupt: false;
proceedValue: aContext receiver.
baseContext swapSender: baseContext sender sender sender. "remove intervening contexts"
thisContext swapSender: oldSender. "make myself return to debugger"
ErrorRecursion := false.
^aContext!
Eliot Miranda uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-eem.944.mcz
==================== Summary ====================
Name: System-eem.944
Author: eem
Time: 30 March 2017, 3:20:14.605252 pm
UUID: 2723331f-0c11-4484-a28e-7b9c5f6a9b3a
Ancestors: System-eem.943
Commit the essential cange of reference from MethodContext to Context before commiting the Kernel that does away with MethodContext.
=============== Diff against System-eem.943 ===============
Item was changed:
----- Method: WrappedBreakpoint>>run:with:in: (in category 'evaluation') -----
run: aSelector with: anArray in: aReceiver
| process |
process := Process
+ forContext: (Context
- forContext: (MethodContext
sender: thisContext sender
receiver: aReceiver
method: method
arguments: anArray)
priority: Processor activeProcess priority.
ToolSet
+ debug: process
+ context: process suspendedContext
- debug: process context: process suspendedContext
label: 'Breakpoint in ' , method methodClass name , '>>#' , method selector
+ contents: nil
+ fullView: true.
- contents: nil fullView: true.
Project current spawnNewProcessIfThisIsUI: Processor activeProcess.
thisContext swapSender: nil.
+ Processor activeProcess terminate!
- Processor activeProcess terminate.!
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1077.mcz
==================== Summary ====================
Name: Kernel-eem.1077
Author: eem
Time: 30 March 2017, 3:10:36.830931 pm
UUID: f5ff4330-d306-4363-811c-7b3f933c2c47
Ancestors: Kernel-eem.1076
Pull the MethodContext => Context switch. Better luck this time, we hope.
=============== Diff against Kernel-eem.1076 ===============
Item was changed:
+ (PackageInfo named: 'Kernel') preamble: 'CompiledMethod addCompiledCodeAndCompiledBlock.
+ [InstructionStream bootstrapContext] valueSupplyingAnswer: #default'!
- (PackageInfo named: 'Kernel') preamble: 'CompiledMethod addCompiledCodeAndCompiledBlock'!
Eliot Miranda uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-eem.750.mcz
==================== Summary ====================
Name: Tools-eem.750
Author: eem
Time: 30 March 2017, 1:31:36.530145 pm
UUID: 2188b2e3-1681-43f0-aa6c-2df827745939
Ancestors: Tools-eem.749
Eliminate an explicit reference to MethodContext in the PointerFInder and make its access to the class of the context's receiver robust in the face of forwarders.
=============== Diff against Tools-eem.749 ===============
Item was changed:
----- Method: PointerExplorerWrapper>>contents (in category 'accessing') -----
contents
"Return the wrappers with the objects holding references to item. Eldest objects come first, weak only referencers are at the end and have parentheses around their identity hash."
| objects weakOnlyReferences |
objects := self object inboundPointersExcluding: { self. self item. model }.
weakOnlyReferences := OrderedCollection new.
objects removeAllSuchThat: [ :each |
each class == self class
or: [ each class == PointerExplorer
+ or: [ (each isContext
+ and: [ (each objectClass: each receiver) == PointerExplorer ] )
- or: [ (each class == MethodContext
- and: [ each receiver class == PointerExplorer ] )
or: [ (each pointsOnlyWeaklyTo: self object)
ifTrue: [ weakOnlyReferences add: each. true ]
ifFalse: [ false ] ] ] ] ].
^(objects replace: [ :each |
self class with: each name: each identityHash asString model: self object ])
addAll: (weakOnlyReferences replace: [ :each |
(self class with: each name: '(', each identityHash asString, ')' model: self object)
weakOnly: true;
yourself ]);
yourself!
Eliot Miranda uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-eem.373.mcz
==================== Summary ====================
Name: Tests-eem.373
Author: eem
Time: 30 March 2017, 1:29:06.956254 pm
UUID: baddb401-7953-4a95-ad16-0c2424edab06
Ancestors: Tests-eem.372
In the Monticello tests for kindOfSubclass, eliminate a reference to the variable subclass MethodContext in favour of the variable subclass BlockClosure, and add BoxedFloat64 and SmallFloat64 and CompiledMethod and the non-pointer variable subclasses (no ephemeronSubclass: in the base image as of yet).
=============== Diff against Tests-eem.372 ===============
Item was changed:
----- Method: MCClassDefinitionTest>>testKindOfSubclass (in category 'as yet unclassified') -----
testKindOfSubclass
+ {self mockClassA. String. ByteString. WideString. BlockClosure. WeakArray. BoxedFloat64. SmallFloat64. CompiledMethod. ByteArray. DoubleByteArray. IntegerArray. DoubleWordArray. }
+ do: [:c |
+ self assert: c asClassDefinition kindOfSubclass equals: c kindOfSubclass]!
- | classes |
- classes := {self mockClassA. String. MethodContext. WeakArray. Float}.
- classes do: [:c | | d |
- d := c asClassDefinition.
- self assert: d kindOfSubclass = c kindOfSubclass.
- ].!
Eliot Miranda uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-eem.943.mcz
==================== Summary ====================
Name: System-eem.943
Author: eem
Time: 30 March 2017, 1:13:51.515243 pm
UUID: 9668f030-a0c9-42bf-a030-8ffd7af62ed5
Ancestors: System-eem.942
Eliminate an explicit reference to MethodContext in lowSpaceThreshold and make it more accurate for 64-bits.
=============== Diff against System-eem.942 ===============
Item was changed:
----- Method: SmalltalkImage>>lowSpaceThreshold (in category 'memory space') -----
lowSpaceThreshold
"Answer the low space threshold. When the amount of free memory (after garbage collection)
falls below this limit, the system is in serious danger of completely exhausting memory and
crashing. This limit should be made high enough to allow the user open a debugger to diagnose
a problem or to save the image. In a stack-based VM such as Cog contexts for activations in
the stack zone will have to be created as the debugger opens, requiring additional headroom."
| slotsForDebugger slotsForContextsOnStackPages |
slotsForDebugger := 65536. "Arbitrary guess"
slotsForContextsOnStackPages :=
(self vmParameterAt: 42)
ifNil: [0]
ifNotNil:
[:numStackPages| | headerSize numActivationsPerPage maxContextSize |
+ numActivationsPerPage := 40. "Design goal of the Cog & Stack VMs"
+ headerSize := 8 / self wordSize. "64-bits for Spur"
+ maxContextSize := thisContext class instSize + CompiledMethod fullFrameSize + headerSize.
- numActivationsPerPage := 40. "Design goal of the Cog VM"
- headerSize := 2. "64-bytes for Spur"
- maxContextSize := MethodContext instSize + CompiledMethod fullFrameSize + headerSize.
numStackPages * numActivationsPerPage * maxContextSize].
^slotsForDebugger + slotsForContextsOnStackPages * self wordSize!
Eliot Miranda uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-eem.288.mcz
==================== Summary ====================
Name: EToys-eem.288
Author: eem
Time: 30 March 2017, 1:00:57.646171 pm
UUID: 34cc818f-f554-4177-b1f5-cbdde48a1882
Ancestors: EToys-eem.287
Eliminate an explicit reference to MethodContext and correct the intent, which was to look for a method activation. With closures we use a single context cass (methodCOntxt, soon to be names Context) to execute both blocks and methods. Use the more popular sExecutingBlock to determine which.
=============== Diff against EToys-eem.287 ===============
Item was changed:
----- Method: StandardScriptingSystem>>reportToUser: (in category '*Etoys-utilities') -----
reportToUser: aString
"Make a message accessible to the user. "
| trigger current baseTriggerer topTriggerer mclass sel topSelector |
trigger := Player compiledMethodAt: #triggerScript:.
current := thisContext.
baseTriggerer := nil.
topTriggerer := nil.
[current notNil] whileTrue: [
topTriggerer ifNil: [
current receiver class isUniClass ifTrue: [
"Look for the top-most uniclass script in the call chain."
sel := current receiver class selectorAtMethod: current method setClass: [:c | mclass := c].
mclass = current receiver class ifTrue: [
topTriggerer := current.
topSelector := sel.
].
].
].
+ (current method = trigger and: [current isExecutingBlock not]) ifTrue: [
- (current method = trigger and: [current class == MethodContext]) ifTrue: [
"Look for the bottom-most #triggerScript: and its selector."
baseTriggerer := current
].
current := current sender.
].
baseTriggerer ifNotNil: [
(baseTriggerer receiver scriptInstantiationForSelector: (baseTriggerer at: 1)) resetTo: #paused ifCurrently: #ticking.
].
(topTriggerer notNil and: [topSelector notNil]) ifTrue: [
^ self eToysError: aString, '\', topTriggerer receiver knownName, '\', topSelector.
].
+ self error: aString!
- self error: aString.
- !