VM Maker: VMMaker.oscog-eem.2247.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

VM Maker: VMMaker.oscog-eem.2247.mcz

commits-2
 
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2247.mcz

==================== Summary ====================

Name: VMMaker.oscog-eem.2247
Author: eem
Time: 29 June 2017, 11:52:12.830814 am
UUID: f9a4c21f-d34c-427f-be76-00642ea8c338
Ancestors: VMMaker.oscog-rmacnak.2246

Allow primitiveBytesLeft to answer the largesdt free chunk if on Spur and the argument is nil.
Clean up needGCFlagAddress sender and nuke unnecessary indirection.
Fix SpurMemoryManager>>bytesLeft:'s comment.

=============== Diff against VMMaker.oscog-rmacnak.2246 ===============

Item was removed:
- ----- Method: CoInterpreter>>needGCFlagAddress (in category 'accessing') -----
- needGCFlagAddress
- <doNotGenerate>
- ^objectMemory needGCFlagAddress!

Item was changed:
  ----- Method: CogObjectRepresentationForSpur>>genSetGCNeeded (in category 'inline primitive support') -----
  genSetGCNeeded
  <inline: true>
  cogit
  MoveCq: 1 R: TempReg;
+ MoveR: TempReg Aw: objectMemory needGCFlagAddress!
- MoveR: TempReg Aw: coInterpreter needGCFlagAddress!

Item was changed:
  ----- Method: InterpreterPrimitives>>primitiveBytesLeft (in category 'memory space primitives') -----
  primitiveBytesLeft
+ "Answer bytes available at this moment. For more meaningful
+ results, calls to this primitive should be precedeed by a full
+ or incremental garbage collection."
- "Reports bytes available at this moment. For more meaningful
- results, calls to this primitive should be precedeed by a full
- or incremental garbage collection."
  | aBool |
+ self methodArgumentCount = 0 ifTrue: "old behavior - just return the size of free memory"
+ [^self pop: 1 thenPushInteger: objectMemory freeSize].
+ self methodArgumentCount = 1 ifTrue:
+ ["Spur behavior; if argument is nil answer size of largest free chunk in oldSpace."
+ (objectMemory hasSpurMemoryManagerAPI
+ and: [self stackTop = objectMemory nilObject]) ifTrue:
+ [^self pop: 2 thenPushInteger: objectMemory sizeOfLargestFreeChunk].
+ "new behaviour -including or excluding swap space depending on aBool"
+ aBool := self booleanValueOf: self stackTop.
+ self successful ifTrue:
+ [^self pop: 2 thenPushInteger: (objectMemory bytesLeft: aBool)]].
+ ^self primitiveFail!
- self methodArgumentCount = 0
- ifTrue: ["old behavior - just return the size of free memory"
- ^self pop: 1 thenPushInteger: objectMemory freeSize].
- self methodArgumentCount = 1
- ifTrue: ["new behaviour -including or excluding swap space depending on aBool"
- aBool := self booleanValueOf: self stackTop.
- self successful ifTrue:
- [^self pop: 2 thenPushInteger: (objectMemory bytesLeft: aBool)]].
- ^ self primitiveFail!

Item was changed:
  ----- Method: SpurMemoryManager>>bytesLeft: (in category 'free space') -----
  bytesLeft: includeSwapSpace
  "Answer the amount of available free space. If includeSwapSpace is true, include
  possibly available swap space. If includeSwapSpace is false, include possibly available
+ physical memory.  N.B. includeSwapSpace is ignored; answer total heap free space
+ minus the reserve available for flushing the tsack zone."
- physical memory. For a report on the largest free block currently availabe within
- Squeak memory but not counting extra memory use #primBytesLeft."
  ^totalFreeOldSpace
  + (scavenger eden limit - freeStart)
  + (scavenger pastSpace limit - pastSpaceStart)
  + (scavenger futureSpace limit - scavenger futureSpace limit)
  - coInterpreter interpreterAllocationReserveBytes!

Item was added:
+ ----- Method: SpurMemoryManager>>sizeOfLargestFreeChunk (in category 'free space') -----
+ sizeOfLargestFreeChunk
+ "Answer the size of largest free chunk in oldSpace."
+ | freeChunk |
+ freeChunk := self findLargestFreeChunk.
+ freeChunk ifNil:
+ [63 to: 1 by: -1 do:
+ [:i|
+ (freeLists at: i) ifNotNil:
+ [:chunk| ^self bytesInObject: chunk]].
+ ^0].
+ ^self bytesInObject: freeChunk!

Loading...