VM Maker: VMMaker.oscog-eem.2773.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.2773.mcz

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

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

Name: VMMaker.oscog-eem.2773
Author: eem
Time: 9 July 2020, 10:46:46.555474 am
UUID: 3c51054d-e839-4959-b3e1-562845a4fa54
Ancestors: VMMaker.oscog-eem.2772

Cogit:
Fix the use of the undefined ceFlushDCache function when DUAL_WRITE_CODE_ZONE is not defined and flushDCacheFrom:to: is not a no-op.
Make sure any generated check features, and the generated run-time are cache flushed before use.
Move maybeGenerateCheckLZCNT later initializeCodeZoneFrom:upTo:; its result is not used until compiling primitives.

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

Item was added:
+ ----- Method: CogIA32Compiler>>initialFlushICacheFrom:to: (in category 'inline cacheing') -----
+ initialFlushICacheFrom: startAddress "<Integer>" to: endAddress "<Integer>"
+ "This must be implemented only if a back end defines any of the following as non-zero:
+ numCheckFeaturesOpcodes
+ numDCacheFlushOpcodes
+ numICacheFlushOpcode.
+
+ This is a no-op on IA32."
+ <cmacro: '(me,startAddress,endAddress) 0'>!

Item was changed:
  ----- Method: Cogit>>initializeCodeZoneFrom:upTo: (in category 'initialization') -----
  initializeCodeZoneFrom: startAddress upTo: endAddress
  <api>
  self initializeBackend.
  self sqMakeMemoryExecutableFrom: startAddress
  To: endAddress
  CodeToDataDelta: (self cppIf: #DUAL_MAPPED_CODE_ZONE
  ifTrue: [self addressOf: codeToDataDelta put: [:v| codeToDataDelta := v]]
  ifFalse: [nil]).
  backEnd stopsFrom: startAddress to: endAddress - 1.
  self cCode: '' inSmalltalk:
  [self initializeProcessor.
  backEnd stopsFrom: 0 to: guardPageSize - 1].
  codeBase := methodZoneBase := startAddress.
  minValidCallAddress := (codeBase min: coInterpreter interpretAddress)
  min: coInterpreter primitiveFailAddress.
  methodZone manageFrom: methodZoneBase to: endAddress.
  self assertValidDualZone.
  self maybeGenerateCheckFeatures.
- self maybeGenerateCheckLZCNT.
  self maybeGenerateCacheFlush.
+ self maybeGenerateCheckLZCNT.
  self generateVMOwnerLockFunctions.
  self genGetLeafCallStackPointers.
  self generateStackPointerCapture.
  self generateTrampolines.
  self computeEntryOffsets.
  self computeFullBlockEntryOffsets.
  self generateClosedPICPrototype.
  self alignMethodZoneBase.
 
+ "None of the above is executed beyond ceCheckFeatures, so a bulk flush now is the leanest thing to do."
+ backEnd flushICacheFrom: startAddress to: methodZoneBase asUnsignedInteger.
- "None of the above is executed beyond ceCheckFeatures & ceCheckLZCNTFunction,
- so a bulk flush now is the leanest thing to do."
  self maybeFlushWritableZoneFrom: startAddress to: methodZoneBase asUnsignedInteger.
+ "Repeat so that now the methodZone ignores the generated run-time."
- "repeat so that now the methodZone ignores the generated run-time"
  methodZone manageFrom: methodZoneBase to: endAddress.
+ "N.B. this is assumed to be the last thing done in initialization; see Cogit>>initialized.
+ This is done only to compute openPICSize; the generated code is discarded."
- "N.B. this is assumed to be the last thing done in initialization; see Cogit>>initialized"
  self generateOpenPICPrototype!

Item was changed:
  ----- Method: Cogit>>maybeFlushWritableZoneFrom:to: (in category 'generate machine code - dual mapped zone support') -----
  maybeFlushWritableZoneFrom: startAddress to: endAddress
  "If there is a dual mapped code zone (the normal zone but marked with read/execute,
  and a read/write zone codeToDataDelta bytes away) then the data cache for the read/write
  zone must be flushed, and the data cache for the read/execute zone must be invalidated,
  for the Cogit to see the same values in both zones after a write to the read/write zone."
  <var: 'startAddress' type: #usqInt>
  <var: 'endAddress' type: #usqInt>
+ <inline: #always>
+ self cppIf: #DUAL_MAPPED_CODE_ZONE
+ ifTrue:
+ [codeToDataDelta > 0 ifTrue:
+ [backEnd flushDCacheFrom: startAddress to: endAddress]]!
- codeToDataDelta > 0 ifTrue:
- [backEnd flushDCacheFrom: startAddress to: endAddress]!

Item was changed:
  ----- Method: Cogit>>maybeGenerateCheckFeatures (in category 'initialization') -----
  maybeGenerateCheckFeatures
  | startAddress |
  <inline: true>
  backEnd numCheckFeaturesOpcodes > 0 ifTrue:
  [self allocateOpcodes: backEnd numCheckFeaturesOpcodes bytecodes: 0.
  startAddress := methodZoneBase.
  backEnd generateCheckFeatures.
  self outputInstructionsForGeneratedRuntimeAt: startAddress.
  self recordGeneratedRunTime: 'ceCheckFeaturesFunction' address: startAddress.
+ ceCheckFeaturesFunction := self cCoerceSimple: startAddress to: #'usqIntptr_t (*)(void)'.
+ backEnd initialFlushICacheFrom: startAddress to: methodZoneBase]!
- ceCheckFeaturesFunction := self cCoerceSimple: startAddress to: #'usqIntptr_t (*)(void)']!

Item was removed:
- ----- Method: Cogit>>processorHasLZCNTSupport (in category 'initialization') -----
- processorHasLZCNTSupport
- <option: #DPFPReg0>
- <inline: true>
- ^backEnd hasLZCNTInstructions!