Eliot Miranda uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-eem.453.mcz
==================== Summary ====================
Name: Compiler-eem.453
Author: eem
Time: 26 December 2020, 7:30:51.52735 pm
UUID: 1a90195c-0773-4f16-bc29-08b718ad4d66
Ancestors: Compiler-eem.452
Fix a spelling error, preceed => precede, etc
=============== Diff against Compiler-eem.452 ===============
Item was changed:
----- Method: BytecodeEncoder class>>extensionsFor:in:into: (in category 'instruction stream support') -----
extensionsFor: pc in: aCompiledMethod into: trinaryBlock
+ "If the bytecode at pc is an extension, or if the bytecode at pc is preceded by extensions,
- "If the bytecode at pc is an extension, or if the bytecode at pc is preceeded by extensions,
then evaluate aTrinaryBlock with the values of extA and extB and number of extension *bytes*.
If the bytecode at pc is neither an extension or extended then evaluate with 0, 0, 0."
| prevPC |
"If there is what appears to be an extension bytecode before this bytecode
then scan for the previous pc to confirm."
(pc - 2 >= aCompiledMethod initialPC
and: [self isExtension: (aCompiledMethod at: pc - 2)]) ifTrue:
[prevPC := aCompiledMethod pcPreviousTo: pc.
(self nonExtensionPcAt: prevPC in: aCompiledMethod) = pc ifTrue:
[^self extensionsAt: prevPC in: aCompiledMethod into: trinaryBlock]].
^self extensionsAt: pc in: aCompiledMethod into: trinaryBlock!
Item was changed:
----- Method: BytecodeEncoder class>>nonExtensionBytecodeAt:in: (in category 'instruction stream support') -----
nonExtensionBytecodeAt: pc in: method
+ "Answer the actual bytecode at pc in method, skipping past any preceding extensions."
- "Answer the actual bytecode at pc in method, skipping past any preceeding extensions."
self subclassResponsibility!
Item was changed:
----- Method: BytecodeEncoder class>>nonExtensionPcAt:in: (in category 'instruction stream support') -----
nonExtensionPcAt: pc in: method
+ "Answer the pc of the actual bytecode at pc in method, skipping past any preceding extensions."
- "Answer the pc of the actual bytecode at pc in method, skipping past any preceeding extensions."
| thePC bytecode |
thePC := pc.
[self isExtension: (bytecode := method at: thePC)] whileTrue:
[thePC := thePC + (self bytecodeSize: bytecode)].
^thePC!
Item was changed:
----- Method: EncoderForSistaV1 class>>blockMethodOrNilFor:in:at: (in category 'instruction stream support') -----
blockMethodOrNilFor: anInstructionStream in: method at: pc
"If anInstructionStream is at a block creation bytecode then answer the block's
CompiledBlock, otherwise answer nil.
The complication is that for convenience we allow the pc to point to the
+ raw send bytecode after its extension(s), or at the extension(s) preceding it.
- raw send bytecode after its extension(s), or at the extension(s) preceeding it.
249 11111001 xxxxxxxx siyyyyyy push Closure Compiled block literal index xxxxxxxx (+ Extend A * 256) numCopied yyyyyy receiverOnStack: s = 1 ignoreOuterContext: i = 1"
| byte |
byte := method at: pc.
byte = 249 ifTrue:
["it could be extended..."
^self extensionsFor: pc in: method into:
[:extA :extB :nExtBytes|
method literalAt: (method at: pc + nExtBytes + 1) + (extA bitShift: 8) + 1]].
^byte = 16rE0 ifTrue:
[self extensionsAt: pc in: method into:
[:extA :extB :nExtBytes|
(method at: pc + nExtBytes) = 249 ifTrue:
[method literalAt: (method at: pc + nExtBytes + 1) + (extA bitShift: 8) + 1]]]!
Item was changed:
----- Method: EncoderForSistaV1 class>>nonExtensionBytecodeAt:in: (in category 'instruction stream support') -----
nonExtensionBytecodeAt: pc in: method
+ "Answer the actual bytecode at pc in method, skipping past any preceding extensions."
- "Answer the actual bytecode at pc in method, skipping past any preceeding extensions."
| thePC bytecode |
thePC := pc.
[self isExtension: (bytecode := method at: thePC)] whileTrue:
[thePC := thePC + (self bytecodeSize: bytecode)].
^bytecode!
Item was changed:
----- Method: EncoderForSistaV1 class>>selectorToSendOrItselfFor:in:at: (in category 'instruction stream support') -----
selectorToSendOrItselfFor: anInstructionStream in: method at: pc
"If anInstructionStream is at a send bytecode then answer the send's selector,
otherwise answer anInstructionStream itself. The rationale for answering
anInstructionStream instead of, say, nil, is that potentially any existing object
can be used as a selector, but since anInstructionStream postdates the method,
it can't be one of them.
The complication is that for convenience we allow the pc to point to the
+ raw send bytecode after its extension(s), or at the extension(s) preceding it.
- raw send bytecode after its extension(s), or at the extension(s) preceeding it.
96-111 0110 iiii Send Arithmetic Message #iiii (+ - < > <= >= = ~= * / \\ @ bitShift: // bitAnd: bitOr:)
112-119 01110 iii Send Special Message #iii + 0 (at: at:put: size next nextPut: atEnd == class)
120-127 01111 iii Send Special Message #iii + 8 (~~ value value: do: new new: x y)
128-143 1000 iiii Send Literal Selector #iiii With 0 Argument
144-159 1001 iiii Send Literal Selector #iiii With 1 Arguments
160-175 1010 iiii Send Literal Selector #iiii With 2 Arguments
* 224 11100000 aaaaaaaa Extend A (Ext A = Ext A prev * 256 + Ext A)
* 225 11100001 bbbbbbbb Extend B (Ext B = Ext B prev * 256 + Ext B)
** 234 11101010 iiiiijjj Send Literal Selector #iiiii (+ Extend A * 32) with jjj (+ Extend B * 8) Arguments
** 235 11101011 iiiiijjj ExtendB < 64
ifTrue: [Send To Superclass Literal Selector #iiiii (+ Extend A * 32) with jjj (+ Extend B * 8) Arguments]
+ ifFalse: [Send To Superclass of Stacked Class Literal Selector #iiiii (+ Extend A * 32) with jjj (+ (Extend B bitAnd: 63) * 8) Arguments"
- ifFalse: [Send To Superclass of Stacked Class Literal Selector #iiiii (+ Extend A * 32) with jjj (+ (Extend B "
| byte |
byte := method at: pc.
byte < 96 ifTrue:
[^anInstructionStream].
byte <= 175 ifTrue:
["special byte or short send"
^byte >= 128
ifTrue: [method literalAt: (byte bitAnd: 15) + 1]
ifFalse: [Smalltalk specialSelectorAt: byte - 95]].
+ byte < 234 ifTrue: "need to check for either extension cuz order of extensions is not restricted. so extB could precede extA"
- byte < 234 ifTrue: "need to check for either extension cuz order of extensions is not restricted. so extB could preceed extA"
[(byte >= 224 and: [byte <= 225]) ifTrue:
[^self extensionsAt: pc in: method into:
[:extA :extB :nExtBytes| | byteAfter index |
byteAfter := method at: pc + nExtBytes.
(byteAfter >= 234 and: [byteAfter <= 235])
ifTrue:
[index := ((method at: pc + nExtBytes + 1) bitShift: -3) + (extA bitShift: 5).
method literalAt: index + 1]
ifFalse: [anInstructionStream]]].
^anInstructionStream].
byte > 235 ifTrue:
[^anInstructionStream].
"they could be extended..."
^self extensionsFor: pc in: method into:
[:extA :extB :nExtBytes| | index |
index := ((method at: pc + 1) bitShift: -3) + (extA bitShift: 5).
method literalAt: index + 1]!
Item was changed:
----- Method: EncoderForV3 class>>extensionsFor:in:into: (in category 'instruction stream support') -----
extensionsFor: pc in: aCompiledMethod into: trinaryBlock
+ "If the bytecode at pc is an extension, or if the bytecode at pc is preceded by extensions,
- "If the bytecode at pc is an extension, or if the bytecode at pc is preceeded by extensions,
then evaluate aTrinaryBlock with the values of extA and extB and number of extension *bytes*.
If the bytecode at pc is neither an extension or extended then evaluate with 0, 0, 0.
There are no extensions in the SqueakV3/Smalltalk-80 bytecode set, so..."
^trinaryBlock value: 0 value: 0 value: 0!
Item was changed:
----- Method: EncoderForV3 class>>nonExtensionBytecodeAt:in: (in category 'instruction stream support') -----
nonExtensionBytecodeAt: pc in: method
+ "Answer the actual bytecode at pc in method, skipping past any preceding extensions."
- "Answer the actual bytecode at pc in method, skipping past any preceeding extensions."
^method at: pc!
Item was changed:
----- Method: MethodNode>>preenableNodes (in category 'converting-private') -----
preenableNodes
"Answer a Dictionary from node or sequence of nodes to preen method selector for nodes
in the tree that require post-processing after either a format or a decompile. Such issues
are the variable for an ifNotNil: which is local to the ifNotNil: block but, due to the inlining
of ifNotNil: appears to be declared at the outer level, and, similarly, a temporary variable
that conflicts with one of the same name in a block when, were the variable declared
local to some inlined block it would no longer conflict. The resulting dictionary is used to
perform the value with the key (node or array) as argument to preen the tree."
| preenableNodes priorBlocks priorVariables |
preenableNodes := Dictionary new.
priorBlocks := OrderedCollection new.
priorVariables := Set new.
self nodesWithPrecedingStatementsDo:
+ [:node :precedingStatementOrNil| | variable temps |
- [:node :preceedingStatementOrNil| | variable temps |
(node isMessageNode
and: [node macroPrinter == #printIfNilNotNil:indent:
and: [node receiver isMessageNode
and: [node receiver selector key == #==
and: [node receiver receiver isAssignmentNode
and: [(variable := node receiver receiver variable) isTemp
and: [variable isRemote not
and: [variable isOnlySubnodeOf: node in: self]]]]]]]) ifTrue:
[preenableNodes at: node put: #preenIfNotNilNode:.
priorVariables add: variable].
node isBlockNode ifTrue:
[temps := OrderedCollection new.
node temporaries do:
[:temp|
priorBlocks do:
[:aBlock|
aBlock temporaries do:
[:priorTemp|
(priorVariables includes: priorTemp) ifFalse:
[priorTemp key = temp key ifTrue:
[temps addLast: priorTemp]]]]].
temps isEmpty ifFalse:
[preenableNodes at: temps put: #preenTempsConflictingWithBlockNode:].
priorBlocks addLast: node].
(node == NodeNil
+ and: [precedingStatementOrNil notNil
+ and: [precedingStatementOrNil isMessageNode
+ and: [precedingStatementOrNil isNilIf]]]) ifTrue:
+ [preenableNodes at: precedingStatementOrNil put: #preenNilNodeFollowingNilIfNode:]].
- and: [preceedingStatementOrNil notNil
- and: [preceedingStatementOrNil isMessageNode
- and: [preceedingStatementOrNil isNilIf]]]) ifTrue:
- [preenableNodes at: preceedingStatementOrNil put: #preenNilNodeFollowingNilIfNode:]].
^preenableNodes!
Eliot Miranda uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-eem.1207.mcz
==================== Summary ====================
Name: System-eem.1207
Author: eem
Time: 22 December 2020, 6:25:35.535409 pm
UUID: 307e584e-0a0c-422b-8f92-2acd43a29ff7
Ancestors: System-dtl.1206
Update vmParameterAt: doc with the event trace mask.
Fix ResourceManager>>#convertMapNameForBackwardcompatibilityFrom: for the 10.x => 11.x MacOS version name issue.
=============== Diff against System-dtl.1206 ===============
Item was changed:
----- Method: ResourceManager>>convertMapNameForBackwardcompatibilityFrom: (in category 'backward-compatibility') -----
convertMapNameForBackwardcompatibilityFrom: aString
(Smalltalk platformName = 'Mac OS'
+ and: [(Smalltalk osVersion indexOf: $.) > 4 "i.e. not 9xx.n, but 10xx.n, 11xx.n etc"])
+ ifTrue: [^aString convertFromWithConverter: ShiftJISTextConverter new].
- and: ['10*' match: Smalltalk osVersion])
- ifTrue: [^aString convertFromWithConverter: ShiftJISTextConverter new].
^aString convertFromSystemString!
Item was changed:
----- Method: SmalltalkImage>>vmParameterAt: (in category 'vm parameters') -----
vmParameterAt: parameterIndex
"parameterIndex is a positive integer corresponding to one of the VM's internal parameter/metric registers.
Answer with the current value of that register. Fail if parameterIndex has no corresponding register.
VM parameters are numbered as follows:
1 byte size of old-space (read-only)
2 byte size of young-space (read-only)
3 byte size of object memory (read-only)
4 allocationCount (read-only; nil in Cog VMs)
5 allocations between GCs (read-write; nil in Cog VMs)
6 survivor count tenuring threshold (read-write)
7 full GCs since startup (read-only)
8 total milliseconds in full GCs since startup (read-only)
9 incremental GCs since startup (read-only; scavenging GCs on Spur)
10 total milliseconds in incremental/scavenging GCs since startup (read-only)
+ 11 tenures of surving objects since startup/last write (read-write)
+ 12 event trace mask; if 1 << eventType is set in the mask then event received by primGetNextEvent: will be printed to stderr.
+ 13-15 specific to the (o0bsolete) translating VM
- 11 tenures of surving objects since startup (read-only)
- 12-15 specific to the translating VM
16 total microseconds in idle since startup
17 proportion of code zone available for use (Sista VMs only; read-write)
18 total milliseconds in full GC compaction since startup (a portion of parameter 8)
19 scavenge threshold; the effective size of eden
20 utc microseconds at VM start-up (actually at time initialization, which precedes image load) (newer Cog VMs only).
21 root (remembered) table size (read-only)
22 root (remembered) table overflows since startup (read-only)
23 bytes of extra memory to reserve for VM buffers, plugins, etc.
24 memory threshold above which to shrink object memory (read-write)
25 ammount to grow by when growing object memory (read-write)
26 interruptChecksEveryNms - force an ioProcessEvents every N milliseconds (read-write)
27 number of times mark loop iterated for current IGC/FGC (read-only) includes ALL marking
28 number of times sweep loop iterated for current IGC/FGC (read-only)
29 number of times make forward loop iterated for current IGC/FGC (read-only)
30 number of times compact move loop iterated for current IGC/FGC (read-only)
31 number of grow memory requests (read-only)
32 number of shrink memory requests (read-only)
33 number of root table entries used for current IGC/FGC (read-only)
34 bytes allocated in total since start-up or reset (read-write)
35 number of survivor objects after current IGC/FGC (read-only)
36 millisecond clock when current IGC/FGC completed (read-only)
37 number of marked objects for Roots of the world, not including Root Table entries for current IGC/FGC (read-only)
38 milliseconds taken by current IGC (read-only)
39 Number of finalization signals for Weak Objects pending when current IGC/FGC completed (read-only)
40 BytesPerWord for this image
41 imageFormatVersion for the VM
42 number of stack pages in use (Cog Stack VM only, otherwise nil)
43 desired number of stack pages (stored in image file header, max 65535; Cog VMs only, otherwise nil)
44 size of eden, in bytes (Cog VMs only, otherwise nil)
45 desired size of eden, in bytes (stored in image file header; Cog VMs only, otherwise nil)
46 size of machine code zone, in bytes (stored in image file header; Cog JIT VM only, otherwise nil)
47 desired size of machine code zone, in bytes (applies at startup only, stored in image file header; Cog JIT VM only)
48 various properties stored in the image header (that instruct the VM) as an integer encoding an array of bit flags.
Bit 0: tells the VM that the image's Process class has threadId as its 5th inst var (after nextLink, suspendedContext, priority & myList)
Bit 1: on Cog JIT VMs asks the VM to set the flag bit in interpreted methods
Bit 2: if set, preempting a process puts it to the head of its run queue, not the back,
i.e. preempting a process by a higher priority one will not cause the preempted process to yield
to others at the same priority.
Bit 3: in a muilt-threaded VM, if set, the Window system will only be accessed from the first VM thread
Bit 4: in a Spur vm, if set, causes weaklings and ephemerons to be queued individually for finalization
Bit 5: if set, implies wheel events will be delivered as such and not mapped to arrow key events
Bit 6: if set, implies arithmetic primitives will fail if given arguments of different types (float vs int)
49 the size of the external semaphore table (read-write; Cog VMs only)
50-51 reserved for VM parameters that persist in the image (such as eden above)
52 root (remembered) table maximum size (read-only)
53 the number of oldSpace segments (Spur only, otherwise nil)
54 total size of free old space (Spur only, otherwise nil)
55 ratio of growth and image size at or above which a GC will be performed post scavenge (Spur only, otherwise nil)
56 number of process switches since startup (read-only)
57 number of ioProcessEvents calls since startup (read-only)
58 number of forceInterruptCheck (Cog VMs) or quickCheckInterruptCalls (non-Cog VMs) calls since startup (read-only)
59 number of check event calls since startup (read-only)
60 number of stack page overflows since startup (read-only; Cog VMs only)
61 number of stack page divorces since startup (read-only; Cog VMs only)
62 number of machine code zone compactions since startup (read-only; Cog VMs only)
63 milliseconds taken by machine code zone compactions since startup (read-only; Cog VMs only)
64 current number of machine code methods (read-only; Cog VMs only)
65 In newer Cog VMs a set of flags describing VM features,
if non-zero bit 0 implies multiple bytecode set support;
if non-zero bit 1 implies read-only object support;
if non-zero bit 2 implies the VM suffers from using an ITIMER heartbeat (if 0 it has a thread that provides the heartbeat)
(read-only; Cog VMs only; nil in older Cog VMs, a boolean answering multiple bytecode support in not so old Cog VMs)
66 the byte size of a stack page in the stack zone (read-only; Cog VMs only)
67 the maximum allowed size of old space in bytes, 0 implies no internal limit (Spur VMs only).
68 the average number of live stack pages when scanned by GC (at scavenge/gc/become et al)
69 the maximum number of live stack pages when scanned by GC (at scavenge/gc/become et al)
70 the value of VM_PROXY_MAJOR (the interpreterProxy major version number)
71 the value of VM_PROXY_MINOR (the interpreterProxy minor version number)
72 total milliseconds in full GCs Mark phase since startup (read-only)
73 total milliseconds in full GCs Sweep phase since startup (read-only, can be 0 depending on compactors)
+ 74 maximum pause time due to segment allocation
+ 75 whether arithmetic primitives will do mixed type arithmetic; if false they fail for different receiver and argument types"
- 74 maximum pause time due to segment allocation"
<primitive: 254>
self primitiveFailed!
Item was changed:
----- Method: SmalltalkImage>>vmParameterAt:put: (in category 'vm parameters') -----
vmParameterAt: parameterIndex put: newValue
"parameterIndex is a positive integer corresponding to one of the VM's internal
parameter/metric registers. Store newValue (a positive integer) into that
register and answer with the previous value that was stored there.
Fail if newValue is out of range, if parameterIndex has no corresponding
register, or if the corresponding register is read-only.
+ As of late 2020 the parameters which can be set are
- As of mid 2017 the parameters which can be set are
5 allocations between GCs (read-write; nil in Cog VMs)
6 survivor count tenuring threshold (read-write)
+ 11 tenures of surving objects since startup/last write (read-write)
+ 12 event trace mask; if 1 << eventType is set in the mask then event received by primGetNextEvent: will be printed to stderr.
17 proportion of code zone available for use (Sista VMs only)
23 bytes of extra memory to reserve for VM buffers, plugins, etc.
24 memory threshold above whichto shrink object memory (read-write)
25 memory headroom when growing object memory (read-write)
26 interruptChecksEveryNms - force an ioProcessEvents every N milliseconds (read-write)
34 bytes allocated in total since start-up or reset (read-write)
43 desired number of stack pages (stored in image file header, max 65535; Cog VMs only, otherwise nil)
45 desired size of eden, in bytes (stored in image file header; Cog VMs only, otherwise nil)
47 desired size of machine code zone, in bytes (applies at startup only, stored in image file header; Cog JIT VM only)
48 various properties of the Cog VM as an integer encoding an array of bit flags.
Bit 0: tells the VM that the image's Process class has threadId as its 5th inst var (after nextLink, suspendedContext, priority & myList)
Bit 1: on Cog JIT VMs asks the VM to set the flag bit in interpreted methods
Bit 2: if set, preempting a process puts it to the head of its run queue, not the back,
i.e. preempting a process by a higher priority one will not cause the preempted process to yield
to others at the same priority.
Bit 3: in a muilt-threaded VM, if set, the Window system will only be accessed from the first VM thread
Bit 4: in a Spur vm, if set, causes weaklings and ephemerons to be queued individually for finalization
49 the size of the external semaphore table (read-write; Cog VMs only)
55 ratio of growth and image size at or above which a GC will be performed post scavenge (Spur only, otherwise nil)
+ 67 the maximum allowed size of old space in bytes, 0 implies no internal limit (Spur only).
+ 68 the average number of live stack pages when scanned by GC (at scavenge/gc/become et al)
+ 69 the maximum number of live stack pages when scanned by GC (at scavenge/gc/become et al)
+ 74 maximum pause time due to segment allocation
+ 75 whether arithmetic primitives will do mixed type arithmetic; if false they fail for different receiver and argument types"
- 67 the maximum allowed size of old space in bytes, 0 implies no internal limit (Spur only)."
+
<primitive: 254>
self primitiveFailed!
Vanessa Freudenberg uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-codefrau.1205.mcz
==================== Summary ====================
Name: System-codefrau.1205
Author: codefrau
Time: 20 December 2020, 10:23:10.790782 pm
UUID: f94486f3-3743-4300-a495-c2a89089e122
Ancestors: System-dtl.1204
Update platformName for SqueakJS 1.0
=============== Diff against System-dtl.1204 ===============
Item was changed:
----- Method: SmalltalkImage>>isLowerPerformance (in category 'system attributes') -----
isLowerPerformance
"Some operations - TestCases for example - need an idea of the typical performance of the system on which they are being performed. For now we will simply assert that running on an ARM cpu or as a SqueakJS instance is enough of a discriminator. Options for the future might also involve whether the vm is a full Cog or Sisata system, even actually measuring the performance at some point to be sure"
^ (self platformSubtype beginsWith: 'arm') "Raspberry PI for example"
+ or: [self platformName = 'JS'] "SqueakJS"!
- or: [self platformName = 'Web'] "SqueakJS"!
Marcel Taeumel uploaded a new version of HelpSystem-Core to project The Trunk:
http://source.squeak.org/trunk/HelpSystem-Core-ct.118.mcz
==================== Summary ====================
Name: HelpSystem-Core-ct.118
Author: ct
Time: 20 September 2019, 7:57:28.579726 pm
UUID: 25ce7919-9959-4c4f-a69d-bd267af4d4fe
Ancestors: HelpSystem-Core-mt.116
HelpBrowser: Add + refactor instance creation methods
=============== Diff against HelpSystem-Core-mt.116 ===============
Item was added:
+ ----- Method: HelpBrowser class>>on: (in category 'instance creation') -----
+ on: aHelpTopic
+
+ ^ self defaultHelpBrowser new
+ rootTopic: aHelpTopic;
+ yourself!
Item was changed:
----- Method: HelpBrowser class>>openForCodeOn: (in category 'instance creation') -----
openForCodeOn: aHelpTopic
+ ^ ToolBuilder open: ((self on: aHelpTopic)
+ buildForCodeWith: ToolBuilder default)!
- | browser window |
- browser := (self defaultHelpBrowser new)
- rootTopic: aHelpTopic;
- yourself.
- window := ToolBuilder open: (browser buildForCodeWith: ToolBuilder default).
-
- ^ window!
Item was changed:
----- Method: HelpBrowser class>>openOn: (in category 'instance creation') -----
openOn: aHelpTopic
+ "Open the receiver on the given help topic or any other object that can be transformed into
+ a help topic by sending #asHelpTopic."
+
+ ^ (self on: aHelpTopic)
+ open!
- "Open the receiver on the given help topic or any other object that can be transformed into
- a help topic by sending #asHelpTopic."
-
- ^(self defaultHelpBrowser new)
- rootTopic: aHelpTopic;
- open!