Eliot Miranda uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-eem.1277.mcz
==================== Summary ====================
Name: System-eem.1277
Author: eem
Time: 1 January 2022, 5:41:21.359006 pm
UUID: f9ad3ac9-3c66-4e80-a0ec-a9484093e82f
Ancestors: System-mt.1276
Add processSuspensionUnblocks, the accessor that answers whether the VM's suspend primitive is fixed or not.
Streamline some of the other vmParameterAt: based accessors.
=============== Diff against System-mt.1276 ===============
Item was changed:
----- Method: SmalltalkImage>>isRunningCogit (in category 'system attributes') -----
isRunningCogit
"Answers if we're running on the Cog JIT"
+ ^(self vmParameterAt: 46 "machine code size in Cog VMs" ifAbsent: 0) > 0!
- ^(self vmParameterAt: 46 ifAbsent: nil)
- ifNil: [false]
- ifNotNil: [:machineCodeZoneSize| machineCodeZoneSize > 0]!
Item was changed:
----- Method: SmalltalkImage>>processPreemptionYields (in category 'system attributes') -----
processPreemptionYields
"Answer whether the VM causes a process to yield on process preemption,
i.e. to put a preempted process at the back of its run queue. If the parameter
is unavailable (non-Cog VMs) or bit 2 (4) is 0 then preemption yields."
+ ^(self vmParameterAt: 48 ifAbsent: 0) noMask: 4!
- ^((self vmParameterAt: 48 ifAbsent: [^true]) allMask: 4) not
- !
Item was added:
+ ----- Method: SmalltalkImage>>processSuspensionUnblocks (in category 'system attributes') -----
+ processSuspensionUnblocks
+ "Answer whether the suspend primitive backs up a process waiting on a
+ condition variable to before the send or not. The original behaviour was to
+ remove a process from its condition variable (Semaphore, Mutex; both kinds
+ of LinkedList). Hence resuming would allow the process past the condition
+ variable, and hence required special behaviour in Process>>signalException:.
+ The new behaviour is to back up a blocked process one bytecode so that if
+ and when resumed it enters the wait state. It also implies that the suspend
+ primitive answers nil if the process is blocked, and only answers a list when
+ suspending a runnable process that is not the active process.
+
+ To be clear, this method answers true on VMs with the old behaviour and
+ false on those with the new."
+
+ ^(self vmParameterAt: 65 ifAbsent: 0) noMask: 32!
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 is invalid or has no corresponding register.
Coerce positive integers for parameterIndices unknown to teh VM to nil.
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 VM ticker start microseconds (Croquet/QwaqVM only)
14 VM ticker count (Croquet/QwaqVM only)
15 VM ticker call count (Croquet/QwaqVM only)
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)
+ if non-zero bit 3 implies the VM supports cross-platform BIT_IDENTICAL_FLOATING_POINT arithmetic
+ if non-zero bit 4 implies the VM can catch exceptions in FFI calls and answer them as primitive failures
+ if non-zero bit 5 implies the VM's suspend primitive backs up the process to before the wait if it was waiting on a condition variable
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
76 the minimum unused headroom in all stack pages; Cog VMs only"
<primitive: 254>
(parameterIndex isInteger
and: [parameterIndex > 0]) ifTrue:
[^nil].
self primitiveFailed!