[Vm-dev] VM Maker: VMMaker.oscog-eem.2772.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Jul 6 17:09:52 UTC 2020
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2772.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.2772
Author: eem
Time: 6 July 2020, 10:09:36.962415 am
UUID: 925a3892-829d-4417-bd5b-1a6a26678025
Ancestors: VMMaker.oscog-eem.2771
VM Parameters primitive(s). Fix the issue with the allocation failure test on 32-bit systems. It really is a Vm bug that parameter #67 must be a SmallInteger. It should be a positive machine integer.
=============== Diff against VMMaker.oscog-eem.2771 ===============
Item was changed:
----- Method: StackInterpreterPrimitives>>primitiveAllVMParameters: (in category 'system control primitives') -----
primitiveAllVMParameters: paramsArraySize
+ "See primitiveVMParameter method comment.
+ N.B. use storePointerUnchecked:and finally beRootIfOld: to save size and time"
- "See primitiveVMParameter method comment"
| result |
result := objectMemory instantiateClass: (objectMemory splObj: ClassArray) indexableSize: paramsArraySize.
objectMemory storePointerUnchecked: 0 ofObject: result withValue: (self positiveMachineIntegerFor: objectMemory oldSpaceSize).
objectMemory storePointerUnchecked: 1 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory newSpaceSize).
objectMemory storePointerUnchecked: 2 ofObject: result withValue: (self positiveMachineIntegerFor: objectMemory totalMemorySize).
"objectMemory storePointerUnchecked: 3 ofObject: result withValue: objectMemory nilObject was allocationCount".
"objectMemory storePointerUnchecked: 4 ofObject: result withValue: objectMemory nilObject allocationsBetweenGCs".
objectMemory storePointerUnchecked: 5 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory tenuringThreshold).
objectMemory storePointerUnchecked: 6 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory statFullGCs).
objectMemory storePointerUnchecked: 7 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory statFullGCUsecs + 500 // 1000).
objectMemory
storePointerUnchecked: 8
ofObject: result
withValue: (objectMemory integerObjectOf: (objectMemory hasSpurMemoryManagerAPI
ifTrue: [objectMemory statScavenges]
ifFalse: [objectMemory statIncrGCs])).
objectMemory
storePointerUnchecked: 9
ofObject: result
withValue: (objectMemory integerObjectOf: (objectMemory hasSpurMemoryManagerAPI
ifTrue: [objectMemory statScavengeGCUsecs]
ifFalse: [objectMemory statIncrGCUsecs]) + 500 // 1000).
objectMemory storePointerUnchecked: 10 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory statTenures).
"JITTER VM info unused; 11 - 14/12 - 15 available for reuse"
11 to: 18 do:
[:i | objectMemory storePointerUnchecked: i ofObject: result withValue: ConstZero].
objectMemory storePointerUnchecked: 15 ofObject: result withValue: (objectMemory positive64BitIntegerFor: statIdleUsecs).
(SistaVM and: [self isCog]) ifTrue:
[objectMemory storePointerUnchecked: 16 ofObject: result withValue: (objectMemory floatObjectOf: self getCogCodeZoneThreshold)].
objectMemory hasSpurMemoryManagerAPI ifTrue:
[objectMemory
storePointerUnchecked: 17 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory statCompactionUsecs + 500 // 1000);
storePointerUnchecked: 18 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory scavengeThresholdAsExtent)].
objectMemory storePointerUnchecked: 19 ofObject: result withValue: (objectMemory positive64BitIntegerFor: self ioUTCStartMicroseconds).
objectMemory storePointerUnchecked: 20 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory rootTableCount).
objectMemory storePointerUnchecked: 21 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory statRootTableOverflows).
objectMemory storePointerUnchecked: 22 ofObject: result withValue: (objectMemory integerObjectOf: extraVMMemory).
objectMemory storePointerUnchecked: 23 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory shrinkThreshold).
objectMemory storePointerUnchecked: 24 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory growHeadroom).
objectMemory storePointerUnchecked: 25 ofObject: result withValue: (objectMemory integerObjectOf: self ioHeartbeatMilliseconds).
objectMemory storePointerUnchecked: 26 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory statMarkCount).
objectMemory storePointerUnchecked: 27 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory statSweepCount).
objectMemory storePointerUnchecked: 28 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory statMkFwdCount).
objectMemory storePointerUnchecked: 29 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory statCompMoveCount).
objectMemory storePointerUnchecked: 30 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory statGrowMemory).
objectMemory storePointerUnchecked: 31 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory statShrinkMemory).
objectMemory storePointerUnchecked: 32 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory statRootTableCount).
objectMemory hasSpurMemoryManagerAPI ifTrue: "was statAllocationCount"
[objectMemory storePointerUnchecked: 33 ofObject: result withValue: (objectMemory positive64BitIntegerFor: objectMemory currentAllocatedBytes)].
objectMemory storePointerUnchecked: 34 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory statSurvivorCount).
objectMemory storePointerUnchecked: 35 ofObject: result withValue: (objectMemory integerObjectOf: (self microsecondsToMilliseconds: objectMemory statGCEndUsecs)).
objectMemory storePointerUnchecked: 36 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory statSpecialMarkCount).
objectMemory storePointerUnchecked: 37 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory statIGCDeltaUsecs + 500 // 1000).
objectMemory storePointerUnchecked: 38 ofObject: result withValue: (objectMemory integerObjectOf: statPendingFinalizationSignals).
objectMemory storePointerUnchecked: 39 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory wordSize).
objectMemory storePointerUnchecked: 40 ofObject: result withValue: (objectMemory integerObjectOf: self imageFormatVersion).
objectMemory storePointerUnchecked: 41 ofObject: result withValue: (objectMemory integerObjectOf: numStackPages).
objectMemory storePointerUnchecked: 42 ofObject: result withValue: (objectMemory integerObjectOf: desiredNumStackPages).
objectMemory storePointerUnchecked: 43 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory edenBytes).
objectMemory storePointerUnchecked: 44 ofObject: result withValue: (objectMemory integerObjectOf: desiredEdenBytes).
objectMemory storePointerUnchecked: 45 ofObject: result withValue: self getCogCodeSize.
objectMemory storePointerUnchecked: 46 ofObject: result withValue: self getDesiredCogCodeSize.
objectMemory storePointerUnchecked: 47 ofObject: result withValue: self getCogVMFlags.
objectMemory storePointerUnchecked: 48 ofObject: result withValue: (objectMemory integerObjectOf: self ioGetMaxExtSemTableSize).
"50 & 51 (49 & 50) reserved for parameters that persist in the image"
objectMemory storePointerUnchecked: 51 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory rootTableCapacity).
objectMemory hasSpurMemoryManagerAPI ifTrue:
[objectMemory
storePointerUnchecked: 52 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory numSegments);
storePointerUnchecked: 53 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory freeSize);
storePointerUnchecked: 54 ofObject: result withValue: (objectMemory floatObjectOf: objectMemory getHeapGrowthToSizeGCRatio)].
+ objectMemory storePointerUnchecked: 55 ofObject: result withValue: (self positive64BitIntegerFor: statProcessSwitch).
+ objectMemory storePointerUnchecked: 56 ofObject: result withValue: (self positive64BitIntegerFor: statIOProcessEvents).
+ objectMemory storePointerUnchecked: 57 ofObject: result withValue: (self positive64BitIntegerFor: statForceInterruptCheck).
+ objectMemory storePointerUnchecked: 58 ofObject: result withValue: (self positive64BitIntegerFor: statCheckForEvents).
+ objectMemory storePointerUnchecked: 59 ofObject: result withValue: (self positive64BitIntegerFor: statStackOverflow).
+ objectMemory storePointerUnchecked: 60 ofObject: result withValue: (self positive64BitIntegerFor: statStackPageDivorce).
+ objectMemory storePointerUnchecked: 61 ofObject: result withValue: self getCodeCompactionCount.
+ objectMemory storePointerUnchecked: 62 ofObject: result withValue: self getCodeCompactionMSecs.
+ objectMemory storePointerUnchecked: 63 ofObject: result withValue: self getCogMethodCount.
+ objectMemory storePointerUnchecked: 64 ofObject: result withValue: self getCogVMFeatureFlags.
+ objectMemory storePointerUnchecked: 65 ofObject: result withValue: (objectMemory integerObjectOf: self stackPageByteSize).
- objectMemory storePointerUnchecked: 55 ofObject: result withValue: (self positive64BitIntegerFor: statProcessSwitch).
- objectMemory storePointerUnchecked: 56 ofObject: result withValue: (self positive64BitIntegerFor: statIOProcessEvents).
- objectMemory storePointerUnchecked: 57 ofObject: result withValue: (self positive64BitIntegerFor: statForceInterruptCheck).
- objectMemory storePointerUnchecked: 58 ofObject: result withValue: (self positive64BitIntegerFor: statCheckForEvents).
- objectMemory storePointerUnchecked: 59 ofObject: result withValue: (self positive64BitIntegerFor: statStackOverflow).
- objectMemory storePointerUnchecked: 60 ofObject: result withValue: (self positive64BitIntegerFor: statStackPageDivorce).
- objectMemory storePointerUnchecked: 61 ofObject: result withValue: self getCodeCompactionCount.
- objectMemory storePointerUnchecked: 62 ofObject: result withValue: self getCodeCompactionMSecs.
- objectMemory storePointerUnchecked: 63 ofObject: result withValue: self getCogMethodCount.
- objectMemory storePointerUnchecked: 64 ofObject: result withValue: self getCogVMFeatureFlags.
- objectMemory storePointerUnchecked: 65 ofObject: result withValue: (objectMemory integerObjectOf: self stackPageByteSize).
objectMemory hasSpurMemoryManagerAPI ifTrue:
[objectMemory
+ storePointerUnchecked: 66 ofObject: result withValue: (self positiveMachineIntegerFor: objectMemory maxOldSpaceSize)].
- storePointerUnchecked: 66 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory maxOldSpaceSize)].
objectMemory storePointerUnchecked: 67 ofObject: result withValue: (objectMemory floatObjectOf: stackPages statAverageLivePagesWhenMapping).
objectMemory storePointerUnchecked: 68 ofObject: result withValue: (objectMemory integerObjectOf: stackPages statMaxPageCountWhenMapping).
objectMemory storePointerUnchecked: 69 ofObject: result withValue: (objectMemory integerObjectOf: self vmProxyMajorVersion).
objectMemory storePointerUnchecked: 70 ofObject: result withValue: (objectMemory integerObjectOf: self vmProxyMinorVersion).
+ objectMemory storePointerUnchecked: 71 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory statMarkUsecs + 500 // 1000).
+ objectMemory storePointerUnchecked: 72 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory statSweepUsecs + 500 // 1000).
- objectMemory storePointerUnchecked: 71 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory statMarkUsecs + 500 // 1000).
- objectMemory storePointerUnchecked: 72 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory statSweepUsecs + 500 // 1000).
objectMemory hasSpurMemoryManagerAPI ifTrue:
[objectMemory
storePointerUnchecked: 73 ofObject: result withValue: (objectMemory integerObjectOf: objectMemory statMaxAllocSegmentTime + 500 // 1000)].
+ objectMemory storePointerUnchecked: 74 ofObject: result withValue: (objectMemory booleanObjectOf: self primitiveDoMixedArithmetic).
- objectMemory storePointerUnchecked: 74 ofObject: result withValue: (objectMemory booleanObjectOf: self primitiveDoMixedArithmetic).
objectMemory beRootIfOld: result.
self methodReturnValue: result!
Item was changed:
----- Method: StackInterpreterPrimitives>>primitiveGetVMParameter: (in category 'system control primitives') -----
primitiveGetVMParameter: arg
"See primitiveVMParameter method comment.
N.B. written as a returning case to avoid branch limits in the V3 bytecode set."
arg caseOf: {
[1] -> [^self positiveMachineIntegerFor: objectMemory oldSpaceSize].
[2] -> [^objectMemory integerObjectOf: objectMemory newSpaceSize].
[3] -> [^self positiveMachineIntegerFor: objectMemory totalMemorySize].
[6] -> [^objectMemory integerObjectOf: objectMemory tenuringThreshold].
[7] -> [^objectMemory integerObjectOf: objectMemory statFullGCs].
[8] -> [^objectMemory integerObjectOf: objectMemory statFullGCUsecs + 500 // 1000].
[9] -> [^objectMemory integerObjectOf: (objectMemory hasSpurMemoryManagerAPI
ifTrue: [objectMemory statScavenges]
ifFalse: [objectMemory statIncrGCs])].
[10] -> [^objectMemory integerObjectOf: (objectMemory hasSpurMemoryManagerAPI
ifTrue: [objectMemory statScavengeGCUsecs]
ifFalse: [objectMemory statIncrGCUsecs]) + 500 // 1000].
[11] -> [^objectMemory integerObjectOf: objectMemory statTenures].
[12] -> [^ConstZero]. "Was JITTER VM info"
[13] -> [^ConstZero]. "Was JITTER VM info"
[14] -> [^ConstZero]. "Was JITTER VM info"
[15] -> [^ConstZero]. "Was JITTER VM info"
[16] -> [^self positive64BitIntegerFor: statIdleUsecs].
[17] -> [^(SistaVM and: [self isCog])
ifTrue: [objectMemory floatObjectOf: self getCogCodeZoneThreshold]
ifFalse: [ConstZero]].
[18] -> [^objectMemory hasSpurMemoryManagerAPI
ifTrue: [objectMemory integerObjectOf: objectMemory statCompactionUsecs + 500 // 1000]
ifFalse: [ConstZero]].
[19] -> [^objectMemory hasSpurMemoryManagerAPI
ifTrue: [objectMemory integerObjectOf: objectMemory scavengeThresholdAsExtent]
ifFalse: [ConstZero]].
[20] -> [^objectMemory positive64BitIntegerFor: self ioUTCStartMicroseconds].
[21] -> [^objectMemory integerObjectOf: objectMemory rootTableCount].
[22] -> [^objectMemory integerObjectOf: objectMemory statRootTableOverflows].
[23] -> [^objectMemory integerObjectOf: extraVMMemory].
[24] -> [^objectMemory integerObjectOf: objectMemory shrinkThreshold].
[25] -> [^objectMemory integerObjectOf: objectMemory growHeadroom].
[26] -> [^objectMemory integerObjectOf: self ioHeartbeatMilliseconds].
[27] -> [^objectMemory integerObjectOf: objectMemory statMarkCount].
[28] -> [^objectMemory integerObjectOf: objectMemory statSweepCount].
[29] -> [^objectMemory integerObjectOf: objectMemory statMkFwdCount].
[30] -> [^objectMemory integerObjectOf: objectMemory statCompMoveCount].
[31] -> [^objectMemory integerObjectOf: objectMemory statGrowMemory].
[32] -> [^objectMemory integerObjectOf: objectMemory statShrinkMemory].
[33] -> [^objectMemory integerObjectOf: objectMemory statRootTableCount].
[34] -> [^objectMemory hasSpurMemoryManagerAPI ifTrue:"was statAllocationCount"
[objectMemory positive64BitIntegerFor: objectMemory currentAllocatedBytes]].
[35] -> [^objectMemory integerObjectOf: objectMemory statSurvivorCount].
[36] -> [^objectMemory integerObjectOf: (self microsecondsToMilliseconds: objectMemory statGCEndUsecs)].
[37] -> [^objectMemory integerObjectOf: objectMemory statSpecialMarkCount].
[38] -> [^objectMemory integerObjectOf: objectMemory statIGCDeltaUsecs + 500 // 1000].
[39] -> [^objectMemory integerObjectOf: statPendingFinalizationSignals].
[40] -> [^objectMemory integerObjectOf: objectMemory wordSize].
[41] -> [^objectMemory integerObjectOf: self imageFormatVersion].
[42] -> [^objectMemory integerObjectOf: numStackPages].
[43] -> [^objectMemory integerObjectOf: desiredNumStackPages].
[44] -> [^objectMemory integerObjectOf: objectMemory edenBytes].
[45] -> [^objectMemory integerObjectOf: desiredEdenBytes].
[46] -> [^self getCogCodeSize].
[47] -> [^self getDesiredCogCodeSize].
[48] -> [^self getCogVMFlags].
[49] -> [^objectMemory integerObjectOf: self ioGetMaxExtSemTableSize].
[52] -> [^objectMemory integerObjectOf: objectMemory rootTableCapacity].
[53] -> [^objectMemory hasSpurMemoryManagerAPI ifTrue:
[objectMemory integerObjectOf: objectMemory numSegments]].
[54] -> [^objectMemory hasSpurMemoryManagerAPI ifTrue:
[objectMemory integerObjectOf: objectMemory freeSize]].
[55] -> [^objectMemory hasSpurMemoryManagerAPI ifTrue:
[objectMemory floatObjectOf: objectMemory getHeapGrowthToSizeGCRatio]].
[56] -> [^self positive64BitIntegerFor: statProcessSwitch].
[57] -> [^self positive64BitIntegerFor: statIOProcessEvents].
[58] -> [^self positive64BitIntegerFor: statForceInterruptCheck].
[59] -> [^self positive64BitIntegerFor: statCheckForEvents].
[60] -> [^self positive64BitIntegerFor: statStackOverflow].
[61] -> [^self positive64BitIntegerFor: statStackPageDivorce].
[62] -> [^self getCodeCompactionCount].
[63] -> [^self getCodeCompactionMSecs].
[64] -> [^self getCogMethodCount].
[65] -> [^self getCogVMFeatureFlags].
[66] -> [^objectMemory integerObjectOf: self stackPageByteSize].
[67] -> [^objectMemory hasSpurMemoryManagerAPI ifTrue:
+ [self positiveMachineIntegerFor: objectMemory maxOldSpaceSize]].
- [objectMemory integerObjectOf: objectMemory maxOldSpaceSize]].
[68] -> [^objectMemory floatObjectOf: stackPages statAverageLivePagesWhenMapping].
[69] -> [^objectMemory integerObjectOf: stackPages statMaxPageCountWhenMapping].
[70] -> [^objectMemory integerObjectOf: self vmProxyMajorVersion].
[71] -> [^objectMemory integerObjectOf: self vmProxyMinorVersion].
[72] -> [^objectMemory integerObjectOf: objectMemory statMarkUsecs + 500 // 1000].
[73] -> [^objectMemory integerObjectOf: objectMemory statSweepUsecs + 500 // 1000].
[74] -> [^objectMemory hasSpurMemoryManagerAPI ifTrue:
[objectMemory integerObjectOf: objectMemory statMaxAllocSegmentTime + 500 // 1000]].
[75] -> [^objectMemory booleanObjectOf: self primitiveDoMixedArithmetic] }
otherwise: [^nil]!
Item was changed:
----- Method: StackInterpreterPrimitives>>primitiveSetVMParameter:arg: (in category 'system control primitives') -----
primitiveSetVMParameter: index arg: argOop
"See primitiveVMParameter method comment"
| arg result |
+ "argOop read & checks; in most cases this is an integer parameter. Handle the exceptions."
+ index
+ caseOf: {
+ [17] -> [((objectMemory isFloatInstance: argOop)
+ or: [objectMemory isIntegerObject: argOop]) ifFalse:
+ [primFailCode := PrimErrBadArgument]].
+ [55] -> [((objectMemory isFloatInstance: argOop)
+ or: [objectMemory isIntegerObject: argOop]) ifFalse:
+ [primFailCode := PrimErrBadArgument]].
+ [68] -> [((objectMemory isFloatInstance: argOop)
+ or: [objectMemory isIntegerObject: argOop]) ifFalse:
+ [primFailCode := PrimErrBadArgument]].
+ [67] -> [arg := self positiveMachineIntegerValueOf: argOop].
+ [75] -> [arg := objectMemory booleanValueOf: argOop] }
+ otherwise: [arg := objectMemory integerValueOf: argOop].
+ self failed ifTrue:
+ [^self primitiveFailFor: PrimErrBadArgument].
- "argOop read & checks; in most cases this is an integer parameter. In some it is either an integer or a Float"
- index = 75
- ifTrue:
- [ arg := objectMemory booleanValueOf: argOop.
- self failed ifTrue: [^self primitiveFailFor: PrimErrBadArgument]]
- ifFalse: [(index = 17 or: [index = 55 or: [index = 68]])
- ifTrue:
- [((objectMemory isFloatInstance: argOop)
- or: [objectMemory isIntegerObject: argOop]) ifFalse:
- [^self primitiveFailFor: PrimErrBadArgument]]
- ifFalse: [(objectMemory isIntegerObject: argOop) ifFalse:
- [^self primitiveFailFor: PrimErrBadArgument].
- arg := objectMemory integerValueOf: argOop]].
"assume failure, then set success for handled indices"
self primitiveFailFor: PrimErrBadArgument.
index caseOf: {
[5] -> [objectMemory hasSpurMemoryManagerAPI ifFalse:
["Was:
result := allocationsBetweenGCs.
allocationsBetweenGCs := arg."
"Ignore for now, because old images won't start up otherwise.
See 45 for eden size setting."
result := objectMemory nilObject.
self initPrimCall]].
[6] -> [result := objectMemory integerObjectOf: objectMemory tenuringThreshold.
primFailCode := objectMemory tenuringThreshold: arg].
[11] -> [arg >= 0 ifTrue:
[result := objectMemory integerObjectOf: objectMemory statTenures.
objectMemory statTenures: arg.
self initPrimCall]].
[17] -> [(SistaVM and: [self isCog]) ifTrue:
[result := objectMemory floatObjectOf: self getCogCodeZoneThreshold.
primFailCode := self setCogCodeZoneThreshold: (self noInlineLoadFloatOrIntFrom: argOop)]].
[23] -> [result := objectMemory integerObjectOf: extraVMMemory.
extraVMMemory := arg.
self initPrimCall].
[24] -> [arg > 0 ifTrue:
[result := objectMemory integerObjectOf: objectMemory shrinkThreshold.
objectMemory shrinkThreshold: arg.
self initPrimCall]].
[25] -> [arg > 0 ifTrue:
[result := objectMemory integerObjectOf: objectMemory growHeadroom.
objectMemory growHeadroom: arg.
self initPrimCall]].
[26] -> [arg >= 0 ifTrue: "0 turns off the heartbeat"
[result := objectMemory integerObjectOf: self ioHeartbeatMilliseconds.
self ioSetHeartbeatMilliseconds: arg.
self initPrimCall]].
[34] -> [(objectMemory hasSpurMemoryManagerAPI "was statAllocationCount; now statAllocatedBytes"
and: [arg >= 0]) ifTrue:
[result := objectMemory positive64BitIntegerFor: objectMemory currentAllocatedBytes.
objectMemory setCurrentAllocatedBytesTo: arg.
self initPrimCall]].
[43] -> [(arg between: 0 and: 65535) ifTrue:
[result := objectMemory integerObjectOf: desiredNumStackPages.
desiredNumStackPages := arg.
self initPrimCall]].
[45] -> [arg >= 0 ifTrue:
[result := objectMemory integerObjectOf: desiredEdenBytes.
desiredEdenBytes := arg.
self initPrimCall]].
[47] -> [(self isCog
and: [arg between: 0 and: self maxCogCodeSize]) ifTrue:
[result := objectMemory integerObjectOf: self getDesiredCogCodeSize.
self setDesiredCogCodeSize: arg.
self initPrimCall]].
[48] -> [arg >= 0 ifTrue:
[| oldPrimitiveDoMixedArithmetic |
oldPrimitiveDoMixedArithmetic := primitiveDoMixedArithmetic.
result := objectMemory integerObjectOf: self getCogVMFlags.
self initPrimCall. "i.e. setCogVMFlags: can fail"
self setCogVMFlags: arg.
(primFailCode = 0
and: [oldPrimitiveDoMixedArithmetic ~= primitiveDoMixedArithmetic]) ifTrue:
[self flushMethodCache.
self flushMethodsWithMachineCodePrimitivesAndContinueAnswering: result
"NOT REACHED (in CoInterpreter)"]]].
[49] -> [(arg between: 0 and: 65535) ifTrue:
[result := objectMemory integerObjectOf: self ioGetMaxExtSemTableSize.
self initPrimCall. "i.e. ioSetMaxExtSemTableSize: is allowed to fail"
self setMaxExtSemSizeTo: arg]].
[55] -> [objectMemory hasSpurMemoryManagerAPI ifTrue:
[result := objectMemory floatObjectOf: objectMemory getHeapGrowthToSizeGCRatio.
primFailCode := objectMemory setHeapGrowthToSizeGCRatio: (self noInlineLoadFloatOrIntFrom: argOop)]].
[67] -> [(arg >= 0
and: [objectMemory hasSpurMemoryManagerAPI]) ifTrue:
+ [result := self positiveMachineIntegerFor: objectMemory maxOldSpaceSize.
- [result := objectMemory integerObjectOf: objectMemory maxOldSpaceSize.
primFailCode := objectMemory setMaxOldSpaceSize: arg]].
[68] -> [result := objectMemory floatObjectOf: stackPages statAverageLivePagesWhenMapping.
self initPrimCall. "i.e. statAverageLivePagesWhenMapping: is allowed to fail"
stackPages statAverageLivePagesWhenMapping: (self noInlineLoadFloatOrIntFrom: argOop)].
[69] -> [arg >= 0 ifTrue:
[result := objectMemory integerObjectOf: stackPages statMaxPageCountWhenMapping.
stackPages statMaxPageCountWhenMapping: arg.
self initPrimCall]].
[74] -> [(arg >= 0
and: [objectMemory hasSpurMemoryManagerAPI]) ifTrue:
[result := objectMemory integerObjectOf: objectMemory statMaxAllocSegmentTime + 500 // 1000.
stackPages statMaxAllocSegmentTime: arg. "usually 0"
self initPrimCall]].
[75] -> [| mustFlush |
result := objectMemory booleanObjectOf: self primitiveDoMixedArithmetic.
self initPrimCall.
mustFlush := primitiveDoMixedArithmetic ~= arg.
primitiveDoMixedArithmetic := arg.
mustFlush ifTrue:
[self flushMethodCache.
self flushMethodsWithMachineCodePrimitivesAndContinueAnswering: result
"NOT REACHED (in CoInterpreter)"]] }
otherwise: [].
self successful
ifTrue: [self methodReturnValue: result] "return old value"
ifFalse: [self primitiveFailFor: PrimErrInappropriate] "attempting to write a read-only or non-existent parameter"!
More information about the Vm-dev
mailing list