David T. Lewis uploaded a new version of Chronology-Core to project The Trunk:
http://source.squeak.org/trunk/Chronology-Core-dtl.67.mcz
==================== Summary ====================
Name: Chronology-Core-dtl.67
Author: dtl
Time: 3 July 2021, 5:38:37.488688 pm
UUID: 142336d9-cfb5-476e-ba15-a8daf9aad710
Ancestors: Chronology-Core-dtl.66
Cruft removal. DateAndTime no longer needs to be in the startUp list. The canInitializeFromPrimitive workaround is no longer needed. Do not use the no-argument call to primitiveUtcWithOffset, which works fine but is easier to understand in the image if we always use a single primitive interface.
=============== Diff against Chronology-Core-dtl.66 ===============
Item was changed:
Magnitude subclass: #DateAndTime
instanceVariableNames: 'utcMicroseconds localOffsetSeconds'
+ classVariableNames: 'AutomaticTimezone ClockProvider LocalTimeZone PosixEpochJulianDays'
- classVariableNames: 'AutomaticTimezone ClockProvider InitializeFromPrimitive LocalTimeZone PosixEpochJulianDays'
poolDictionaries: 'ChronologyConstants'
category: 'Chronology-Core'!
!DateAndTime commentStamp: 'dtl 3/12/2016 10:32' prior: 0!
I represent a point in UTC time as defined by ISO 8601. I have zero duration.
My implementation uses variables utcMicroseconds and localOffsetSeconds. This represents time magnitude as elapsed microseconds since the Posix epoch, with localOffsetSeconds representing local offset from UTC. The magnitude is used for comparison and duration calculations, and the local offset is used for displaying this magnitude in the context of a local time zone.
The implementation ignores leap seconds, which are adjustments made to maintain earth rotational clock time in synchronization with elapsed seconds.
DateAndTime class>>now will use #primitiveUtcWithOffset to obtain current time in UTC microseconds with current local offset in seconds. The primitive provides an atomic query for UTC time and local offset as measured by the OS platform. If primitiveUtcWithOffset is not available, the traditional implementation is used, which relies on a primitive for microseconds in the local time zone and derives UTC based on the TimeZone setting.
!
Item was removed:
- ----- Method: DateAndTime class>>canInitializeFromPrimitive (in category 'system startup') -----
- canInitializeFromPrimitive
- "Some implementations of primitiveUtcWithOffset do not support passing the
- DateAndTime instance as a parameter to the primitive."
-
- ^self basicNew initializeFromPrimitive utcMicroseconds notNil!
Item was changed:
----- Method: DateAndTime class>>initialize (in category 'initialize-release') -----
initialize
ClockProvider := Time.
+ PosixEpochJulianDays := 2440588.!
- PosixEpochJulianDays := 2440588.
- InitializeFromPrimitive := self canInitializeFromPrimitive.
- Smalltalk addToStartUpList: self.
- self startUp: true
- !
Item was changed:
----- Method: DateAndTime class>>now (in category 'ansi protocol') -----
now
"Answer time now as reported by #primitiveUtcWithOffset. If the primitive is not
available, answer the Posix epoch GMT."
self automaticTimezone
+ ifTrue: [ ^ self basicNew initializeFromPrimitive ]
- ifTrue: [ InitializeFromPrimitive
- ifTrue: [ ^ self basicNew initializeFromPrimitive ]
- ifFalse: [ | timeArray |
- timeArray := Time posixMicrosecondClockWithOffset.
- ^ self utcMicroseconds: timeArray first offset: timeArray second ] ]
ifFalse: [ | timeArray |
timeArray := Time posixMicrosecondClockWithOffset.
^ self utcMicroseconds: timeArray first offset: self localOffsetSeconds ]
!
Item was removed:
- ----- Method: DateAndTime class>>startUp: (in category 'system startup') -----
- startUp: startingAfresh
- "Set local timezone"
- startingAfresh
- ifTrue: [InitializeFromPrimitive := self canInitializeFromPrimitive.
- Time initialize. "set LastClockTick to 0".
- self now]!
Item was changed:
----- Method: Time class>>posixMicrosecondClockWithOffset (in category 'clock') -----
posixMicrosecondClockWithOffset
"Answer an array with local microseconds since the Posix epoch and the
current seconds offset from GMT in the local time zone."
| array posixUtcValue |
+ array := self primPosixMicrosecondClockWithOffset: (Array new: 2).
- array := self primPosixMicrosecondClockWithOffset.
posixUtcValue := array at: 1.
(self updateTimeZoneCacheAt: posixUtcValue) ifTrue: [ "Time zone may have changed: fetch again."
self primPosixMicrosecondClockWithOffset: array.
posixUtcValue := array at: 1 ].
ClockPolicy caseOf: {
[#acceptPlatformTime] -> [^ array] .
[#monotonicAllowDuplicates] -> [
posixUtcValue > LastClockTick
ifTrue: [LastClockTick := posixUtcValue]
ifFalse: [array at: 1 put: LastClockTick]] .
[#monotonicForceMicrosecondIncrement] -> [
posixUtcValue > LastClockTick
ifTrue: [LastClockTick := posixUtcValue]
ifFalse: [LastClockTick := LastClockTick + 1. "add one microsecond"
array at: 1 put: LastClockTick]] .
[#monotonicForceNanosecondIncrement] -> [
posixUtcValue > LastClockTick
ifTrue: [LastClockTick := posixUtcValue]
ifFalse: [LastClockTick := LastClockTick + (1 / 1000). "add one nanosecond"
array at: 1 put: LastClockTick]]
} otherwise: [].
^array!
Item was removed:
- ----- Method: Time class>>primPosixMicrosecondClockWithOffset (in category 'private') -----
- primPosixMicrosecondClockWithOffset
- "Answer an array with UTC microseconds since the Posix epoch and the
- current seconds offset from GMT in the local time zone. If the primitive is
- not available, then answer the time and offset of Posix epoch GMT. This enables
- the image to continue running in the absence of #primitiveUtcWithOffset, thus
- avoiding the need to fallback code based on the earlier local microsecond clock
- mechanism."
-
- <primitive: 'primitiveUtcWithOffset'>
- ^{0. 0}!
Item was changed:
+ ----- Method: Time class>>primPosixMicrosecondClockWithOffset: (in category 'clock') -----
- ----- Method: Time class>>primPosixMicrosecondClockWithOffset: (in category 'private') -----
primPosixMicrosecondClockWithOffset: arrayOrObjectWithTwoSlots
"Answer an array with UTC microseconds since the Posix epoch and the
current seconds offset from GMT in the local time zone. If the primitive is
not available, then answer the time and offset of Posix epoch GMT. This enables
the image to continue running in the absence of #primitiveUtcWithOffset, thus
avoiding the need to fallback code based on the earlier local microsecond clock
mechanism.
The parameter may be a two element array, or an object whose first two instance
variables are expected to be UTC microseconds and seconds offset from GMT."
<primitive: 'primitiveUtcWithOffset'>
(arrayOrObjectWithTwoSlots instVarAt: 1)
ifNil: [arrayOrObjectWithTwoSlots instVarAt: 1 put: 0].
(arrayOrObjectWithTwoSlots instVarAt: 2)
ifNil: [arrayOrObjectWithTwoSlots instVarAt: 2 put: 0]!
Item was changed:
+ (PackageInfo named: 'Chronology-Core') postscript: 'Smalltalk removeFromStartUpList: DateAndTime'!
- (PackageInfo named: 'Chronology-Core') postscript: '"Make sure UpdateVMTimeZoneCacheAt of Time is initialized."
- Time classPool at: #UpdateVMTimeZoneCacheAt put: 0.
- "Separated Time''s startup duties from DateAndTime."
- Smalltalk addToStartUpList: Time before: DateAndTime'!
David T. Lewis uploaded a new version of Chronology-Core to project The Trunk:
http://source.squeak.org/trunk/Chronology-Core-dtl.67.mcz
==================== Summary ====================
Name: Chronology-Core-dtl.67
Author: dtl
Time: 3 July 2021, 5:30:52.505882 pm
UUID: d25ed490-226f-4216-b39d-29880e215059
Ancestors: Chronology-Core-dtl.66
Cruft removal. DateAndTime no longer needs to be in the startUp list. The canInitializeFromPrimitive workaround is no longer needed. Do not use the no-argument call to primitiveUtcWithOffset, which works fine but is easier to understand in the image if we always use a single primitive interface.
=============== Diff against Chronology-Core-dtl.66 ===============
Item was changed:
Magnitude subclass: #DateAndTime
instanceVariableNames: 'utcMicroseconds localOffsetSeconds'
+ classVariableNames: 'AutomaticTimezone ClockProvider LocalTimeZone PosixEpochJulianDays'
- classVariableNames: 'AutomaticTimezone ClockProvider InitializeFromPrimitive LocalTimeZone PosixEpochJulianDays'
poolDictionaries: 'ChronologyConstants'
category: 'Chronology-Core'!
!DateAndTime commentStamp: 'dtl 3/12/2016 10:32' prior: 0!
I represent a point in UTC time as defined by ISO 8601. I have zero duration.
My implementation uses variables utcMicroseconds and localOffsetSeconds. This represents time magnitude as elapsed microseconds since the Posix epoch, with localOffsetSeconds representing local offset from UTC. The magnitude is used for comparison and duration calculations, and the local offset is used for displaying this magnitude in the context of a local time zone.
The implementation ignores leap seconds, which are adjustments made to maintain earth rotational clock time in synchronization with elapsed seconds.
DateAndTime class>>now will use #primitiveUtcWithOffset to obtain current time in UTC microseconds with current local offset in seconds. The primitive provides an atomic query for UTC time and local offset as measured by the OS platform. If primitiveUtcWithOffset is not available, the traditional implementation is used, which relies on a primitive for microseconds in the local time zone and derives UTC based on the TimeZone setting.
!
Item was removed:
- ----- Method: DateAndTime class>>canInitializeFromPrimitive (in category 'system startup') -----
- canInitializeFromPrimitive
- "Some implementations of primitiveUtcWithOffset do not support passing the
- DateAndTime instance as a parameter to the primitive."
-
- ^self basicNew initializeFromPrimitive utcMicroseconds notNil!
Item was changed:
----- Method: DateAndTime class>>initialize (in category 'initialize-release') -----
initialize
ClockProvider := Time.
PosixEpochJulianDays := 2440588.
- InitializeFromPrimitive := self canInitializeFromPrimitive.
Smalltalk addToStartUpList: self.
self startUp: true
!
Item was changed:
----- Method: DateAndTime class>>now (in category 'ansi protocol') -----
now
"Answer time now as reported by #primitiveUtcWithOffset. If the primitive is not
available, answer the Posix epoch GMT."
self automaticTimezone
+ ifTrue: [ ^ self basicNew initializeFromPrimitive ]
- ifTrue: [ InitializeFromPrimitive
- ifTrue: [ ^ self basicNew initializeFromPrimitive ]
- ifFalse: [ | timeArray |
- timeArray := Time posixMicrosecondClockWithOffset.
- ^ self utcMicroseconds: timeArray first offset: timeArray second ] ]
ifFalse: [ | timeArray |
timeArray := Time posixMicrosecondClockWithOffset.
^ self utcMicroseconds: timeArray first offset: self localOffsetSeconds ]
!
Item was removed:
- ----- Method: DateAndTime class>>startUp: (in category 'system startup') -----
- startUp: startingAfresh
- "Set local timezone"
- startingAfresh
- ifTrue: [InitializeFromPrimitive := self canInitializeFromPrimitive.
- Time initialize. "set LastClockTick to 0".
- self now]!
Item was changed:
----- Method: Time class>>posixMicrosecondClockWithOffset (in category 'clock') -----
posixMicrosecondClockWithOffset
"Answer an array with local microseconds since the Posix epoch and the
current seconds offset from GMT in the local time zone."
| array posixUtcValue |
+ array := self primPosixMicrosecondClockWithOffset: (Array new: 2).
- array := self primPosixMicrosecondClockWithOffset.
posixUtcValue := array at: 1.
(self updateTimeZoneCacheAt: posixUtcValue) ifTrue: [ "Time zone may have changed: fetch again."
self primPosixMicrosecondClockWithOffset: array.
posixUtcValue := array at: 1 ].
ClockPolicy caseOf: {
[#acceptPlatformTime] -> [^ array] .
[#monotonicAllowDuplicates] -> [
posixUtcValue > LastClockTick
ifTrue: [LastClockTick := posixUtcValue]
ifFalse: [array at: 1 put: LastClockTick]] .
[#monotonicForceMicrosecondIncrement] -> [
posixUtcValue > LastClockTick
ifTrue: [LastClockTick := posixUtcValue]
ifFalse: [LastClockTick := LastClockTick + 1. "add one microsecond"
array at: 1 put: LastClockTick]] .
[#monotonicForceNanosecondIncrement] -> [
posixUtcValue > LastClockTick
ifTrue: [LastClockTick := posixUtcValue]
ifFalse: [LastClockTick := LastClockTick + (1 / 1000). "add one nanosecond"
array at: 1 put: LastClockTick]]
} otherwise: [].
^array!
Item was removed:
- ----- Method: Time class>>primPosixMicrosecondClockWithOffset (in category 'private') -----
- primPosixMicrosecondClockWithOffset
- "Answer an array with UTC microseconds since the Posix epoch and the
- current seconds offset from GMT in the local time zone. If the primitive is
- not available, then answer the time and offset of Posix epoch GMT. This enables
- the image to continue running in the absence of #primitiveUtcWithOffset, thus
- avoiding the need to fallback code based on the earlier local microsecond clock
- mechanism."
-
- <primitive: 'primitiveUtcWithOffset'>
- ^{0. 0}!
Item was changed:
+ ----- Method: Time class>>primPosixMicrosecondClockWithOffset: (in category 'clock') -----
- ----- Method: Time class>>primPosixMicrosecondClockWithOffset: (in category 'private') -----
primPosixMicrosecondClockWithOffset: arrayOrObjectWithTwoSlots
"Answer an array with UTC microseconds since the Posix epoch and the
current seconds offset from GMT in the local time zone. If the primitive is
not available, then answer the time and offset of Posix epoch GMT. This enables
the image to continue running in the absence of #primitiveUtcWithOffset, thus
avoiding the need to fallback code based on the earlier local microsecond clock
mechanism.
The parameter may be a two element array, or an object whose first two instance
variables are expected to be UTC microseconds and seconds offset from GMT."
<primitive: 'primitiveUtcWithOffset'>
(arrayOrObjectWithTwoSlots instVarAt: 1)
ifNil: [arrayOrObjectWithTwoSlots instVarAt: 1 put: 0].
(arrayOrObjectWithTwoSlots instVarAt: 2)
ifNil: [arrayOrObjectWithTwoSlots instVarAt: 2 put: 0]!
Item was changed:
+ (PackageInfo named: 'Chronology-Core') postscript: 'Smalltalk removeFromStartUpList: DateAndTime'!
- (PackageInfo named: 'Chronology-Core') postscript: '"Make sure UpdateVMTimeZoneCacheAt of Time is initialized."
- Time classPool at: #UpdateVMTimeZoneCacheAt put: 0.
- "Separated Time''s startup duties from DateAndTime."
- Smalltalk addToStartUpList: Time before: DateAndTime'!
Eliot Miranda uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-eem.1237.mcz
==================== Summary ====================
Name: System-eem.1237
Author: eem
Time: 2 July 2021, 6:13:21.540315 am
UUID: 30d3cf8e-708e-4830-86da-21d106f44ba8
Ancestors: System-eem.1236
Fix MessageTally class>>#tallySends:
=============== Diff against System-eem.1236 ===============
Item was changed:
----- Method: MessageTally class>>tallySendsTo:inBlock:showTree: (in category 'spying') -----
tallySendsTo: receiver inBlock: aBlock showTree: treeOption
"
MessageTally tallySends: [3.14159 printString]
"
"This method uses the simulator to count the number of calls on each method
invoked in evaluating aBlock. If receiver is not nil, then only sends
to that receiver are tallied.
Results are presented as leaves, sorted by frequency,
preceded, optionally, by the whole tree."
| prev tallies startTime totalTime |
startTime := Time millisecondClockValue.
tallies := MessageTally new class: aBlock receiver class method: aBlock method.
tallies reportOtherProcesses: true. "Do NOT filter nodes with nil process"
prev := aBlock.
+ thisContext
- thisContext sender
runSimulated: aBlock
contextAtEachStep: [ :current |
current == prev ifFalse: [ "call or return"
prev sender == nil ifFalse: [ "call only"
(receiver == nil or: [ current receiver == receiver ])
ifTrue: [ tallies tally: current by: 1 ] ].
prev := current ] ].
totalTime := Time millisecondClockValue - startTime // 1000.0.
(StringHolder new contents:
(String streamContents:
[:s |
s nextPutAll: 'This simulation took ' , (totalTime printShowingMaxDecimalPlaces: 2)
, ' seconds.'; cr.
treeOption
ifTrue: [ tallies fullPrintExactOn: s ]
ifFalse: [ tallies leavesPrintExactOn: s ] ]))
openLabel: 'Spy Results'!
Eliot Miranda uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-eem.1060.mcz
==================== Summary ====================
Name: Tools-eem.1060
Author: eem
Time: 1 July 2021, 2:40:56.604268 pm
UUID: 812128d2-6043-4a23-b5ad-307b59d7063a
Ancestors: Tools-eem.1059
Use a much more straight-0forward and accurate way to determine if the debugger is at an initial break in toggle break on entry. Also remember to test the result of the determination ;-)
=============== Diff against Tools-eem.1059 ===============
Item was changed:
----- Method: Debugger>>toggleBreakOnEntry (in category 'breakpoints') -----
toggleBreakOnEntry
"Override to rset to the new breakless method if stopped at a break point.
N.B. does not (yet) do the reverse."
+ | ctxt prevPC atInitialBreak newMethod |
- | ctxt prevPC bytecodeMessage atInitialBreak newMethod |
((ctxt := self selectedContext) isNil
or: [(prevPC := ctxt previousPc) isNil]) ifTrue:
[^super toggleBreakOnEntry].
+ atInitialBreak := ctxt selectorJustSentOrSelf == #break
+ and: [(ctxt method pcPreviousTo: ctxt previousPc) = ctxt method initialPC].
- bytecodeMessage := ctxt method abstractBytecodeMessageAt: ctxt previousPc.
- atInitialBreak := bytecodeMessage selector = #send:super:numArgs:
- and: [bytecodeMessage arguments = #(break false 0)].
super toggleBreakOnEntry.
+ newMethod := ctxt method methodReference compiledMethod.
+ (atInitialBreak
+ and: [newMethod isCompiledCode
+ and: [newMethod ~~ ctxt method]]) ifTrue:
- ((newMethod := ctxt method methodReference compiledMethod) notNil
- and: [newMethod ~~ ctxt method]) ifTrue:
[ctxt privRefreshWith: newMethod.
self resetContext: ctxt.
self debug]!
Eliot Miranda uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-eem.1059.mcz
==================== Summary ====================
Name: Tools-eem.1059
Author: eem
Time: 1 July 2021, 2:33:26.752346 pm
UUID: 5344c155-ba05-4999-b9de-58c6c31c2aa7
Ancestors: Tools-mt.1058
Have the Debugger reset the context to the new method when doing toggle bre4ak on entry when stopped at a break.
Hack MessageTrace to display Stores into foo when browsing assignments, rather than Senders of foo.
=============== Diff against Tools-mt.1058 ===============
Item was added:
+ ----- Method: Debugger>>toggleBreakOnEntry (in category 'breakpoints') -----
+ toggleBreakOnEntry
+ "Override to rset to the new breakless method if stopped at a break point.
+ N.B. does not (yet) do the reverse."
+ | ctxt prevPC bytecodeMessage atInitialBreak newMethod |
+ ((ctxt := self selectedContext) isNil
+ or: [(prevPC := ctxt previousPc) isNil]) ifTrue:
+ [^super toggleBreakOnEntry].
+
+ bytecodeMessage := ctxt method abstractBytecodeMessageAt: ctxt previousPc.
+ atInitialBreak := bytecodeMessage selector = #send:super:numArgs:
+ and: [bytecodeMessage arguments = #(break false 0)].
+ super toggleBreakOnEntry.
+ ((newMethod := ctxt method methodReference compiledMethod) notNil
+ and: [newMethod ~~ ctxt method]) ifTrue:
+ [ctxt privRefreshWith: newMethod.
+ self resetContext: ctxt.
+ self debug]!
Item was changed:
----- Method: MessageTrace>>windowLabelAt: (in category 'private accessing') -----
windowLabelAt: anInteger
"return a suitable window label when there is an actual list item selected; work out what it should be based upon the array of autoSelectStrings or the current selection"
^(autoSelectStrings at: anInteger)
+ ifNil:
+ ['Implementors of ',
- ifNil: [ 'Implementors of ',
(self class
parse: self selection
+ toClassAndSelector: [ :class :selector | selector ])]
+ ifNotNil:
+ [:str| (windowLabel endsWith: str)
+ ifTrue: [windowLabel]
+ ifFalse: ['Senders of ', str]]!
- toClassAndSelector: [ :class :selector | selector ])
- ]
- ifNotNil: [:str| 'Senders of ', str ]
- !