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

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

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

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

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

Name: VMMaker.oscog-eem.2645
Author: eem
Time: 28 December 2019, 8:11:54.164952 pm
UUID: 105caa36-0060-44f6-b8a2-200d7eb9d78e
Ancestors: VMMaker.oscog-eem.2644

Cogit:
Fix bug in genAlignCStackSavingRegisters:numArgs:wordAlignment:.  Must ignore register arguments.

No need to flush the cache on rewriting prim invocaton if out-of-line literals are used.

Simulation:
Allow the break block to be easily cancelled.

=============== Diff against VMMaker.oscog-eem.2644 ===============

Item was changed:
  ----- Method: CogAbstractInstruction>>genAlignCStackSavingRegisters:numArgs:wordAlignment: (in category 'abi') -----
  genAlignCStackSavingRegisters: regMask numArgs: numArgs wordAlignment: alignment
  <inline: true>
  | regMaskCopy numRegsPushed wordsPushedModAlignment delta |
  <var: 'regMaskCopy' type: #usqInt>
  regMaskCopy := regMask asUnsignedInteger.
  numRegsPushed := 0.
  [regMaskCopy ~= 0] whileTrue:
  [numRegsPushed := numRegsPushed + (regMaskCopy bitAnd: 1).
  regMaskCopy := regMaskCopy bitShift: -1].
  (numRegsPushed = 0
  and: [self numIntRegArgs >= numArgs]) ifTrue:
  [^0].
+ wordsPushedModAlignment := numRegsPushed + (numArgs - self numIntRegArgs max: 0) \\ alignment.
- wordsPushedModAlignment := numRegsPushed + numArgs \\ alignment.
  wordsPushedModAlignment ~= 0 ifTrue:
  [delta := alignment - wordsPushedModAlignment.
  cogit SubCq: delta * objectMemory wordSize R: SPReg].
  ^0!

Item was changed:
  ----- Method: CogVMSimulator>>setBreakBlockFromString: (in category 'UI') -----
  setBreakBlockFromString: aString
  | bString block |
  bString := aString withBlanksTrimmed.
+ bString first = $- ifTrue:
+ [^cogit breakBlock: nil].
  bString first ~= $[ ifTrue:
  [bString := '[:ct|', bString, ']'].
  block := [Compiler evaluate: bString for: self logged: false]
  on: Error
  do: [:ex|
  UIManager default warn: ex messageText.
  ^self].
  cogit breakBlock: block!

Item was changed:
  ----- Method: Cogit>>breakBlock: (in category 'simulation only') -----
  breakBlock: aBlock
  <doNotGenerate>
+ (breakBlock := aBlock) ifNil:
+ [breakPC == true ifTrue: [breakPC := nil].
+ ^self].
- breakBlock := aBlock.
  breakPC ifNil: [breakPC := true].
  singleStep := singleStep or: [breakPC singleStepRequiredToTriggerIn: self]!

Item was changed:
  ----- Method: SimpleStackBasedCogit>>rewritePrimInvocationIn:to: (in category 'external primitive support') -----
  rewritePrimInvocationIn: cogMethod to: primFunctionPointer
  <api>
  <var: #cogMethod type: #'CogMethod *'>
  <var: #primFunctionPointer declareC: #'void (*primFunctionPointer)(void)'>
  | primIndex flags address extent |
  self cCode: [] inSmalltalk:
  [primFunctionPointer isInteger ifFalse:
  [^self rewritePrimInvocationIn: cogMethod to: (self simulatedTrampolineFor: primFunctionPointer)]].
  self assert: cogMethod cmType = CMMethod.
  primIndex := coInterpreter
  primitiveIndexOfMethod: cogMethod methodObject
  header: cogMethod methodHeader.
  flags := coInterpreter primitivePropertyFlags: primIndex.
  (flags anyMask: PrimCallNeedsPrimitiveFunction) ifTrue:
  [backEnd
  storeLiteral: primFunctionPointer asUnsignedInteger
  beforeFollowingAddress: cogMethod asUnsignedInteger
  + (externalSetPrimOffsets at: cogMethod cmNumArgs)].
  "See compileInterpreterPrimitive:"
  (flags anyMask: PrimCallMayCallBack)
  ifTrue:
  [address := cogMethod asUnsignedInteger
  + (externalPrimJumpOffsets at: cogMethod cmNumArgs).
  extent := backEnd
  rewriteJumpFullAt: address
  target: primFunctionPointer asUnsignedInteger]
  ifFalse:
  [address := cogMethod asUnsignedInteger
  + (externalPrimCallOffsets at: cogMethod cmNumArgs).
  extent := backEnd
  rewriteCallFullAt: address
  target: primFunctionPointer asUnsignedInteger].
+ extent > 0 ifTrue:
+ [processor
+ flushICacheFrom: cogMethod asUnsignedInteger + cmNoCheckEntryOffset
+ to: address asUnsignedInteger + extent]!
- processor
- flushICacheFrom: cogMethod asUnsignedInteger + cmNoCheckEntryOffset
- to: address asUnsignedInteger + extent!