[Vm-dev] VM Maker: VMMaker.oscog-eem.2620.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Dec 18 18:52:22 UTC 2019


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

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

Name: VMMaker.oscog-eem.2620
Author: eem
Time: 18 December 2019, 10:51:53.632178 am
UUID: 85f60967-a060-4ff2-9758-3606ca854f60
Ancestors: VMMaker.oscog-eem.2619

Simulation:
Fix click step now there are subclasses of Debugger.
Reposition a generation pc breakpoint check to a slightly more useful place.

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

Item was changed:
  ----- Method: Cogit>>setClickStepBreakBlock (in category 'simulation only') -----
  setClickStepBreakBlock
  	"Set the break block to present a confirmer, breaking if true, and restoring the previous break block.
  	 If an open debugger on the receiver can be found, proceed it."
  	<doNotGenerate>
  	| previousBreakBlock previousAtEachStepBlock previousBreakPC previousSingleStep previousClickConfirm |
  	(breakBlock isNil or: [breakBlock method ~~ thisContext method]) ifTrue:
  		[previousBreakBlock := breakBlock.
  		 previousAtEachStepBlock := coInterpreter atEachStepBlock.
  		 previousBreakPC := breakPC.
  		 previousSingleStep := singleStep.
  		 previousClickConfirm := clickConfirm.
  		 breakBlock := [:ign|
  						(processor pc ~= previousBreakPC
  						 and: [UIManager confirm: 'step?'])
  							ifTrue: [false]
  							ifFalse: [breakBlock := previousBreakBlock.
  									coInterpreter atEachStepBlock: previousAtEachStepBlock.
  									breakPC := previousBreakPC.
  									singleStep := previousSingleStep.
  									clickConfirm := previousClickConfirm.
  									true]].
  		 coInterpreter atEachStepBlock:
  								[previousAtEachStepBlock value.
  								 (coInterpreter localIP ~= previousBreakPC
  								  and: [UIManager confirm: 'step?']) ifFalse:
  									[breakBlock := previousBreakBlock.
  									coInterpreter atEachStepBlock: previousAtEachStepBlock.
  									breakPC := previousBreakPC.
  									singleStep := previousSingleStep.
  									clickConfirm := previousClickConfirm.
  									self halt]].
  		 singleStep := breakPC := clickConfirm := true].
  	(World submorphs
  		detect:
  			[:m|
+ 			 m model isDebugger
- 			 m model class == Debugger
  			 and: [(m model interruptedProcess suspendedContext findContextSuchThat:
  					[:ctxt|
  					(ctxt receiver == self
  					 and: [ctxt selector == #simulateCogCodeAt:])
  					or: [ctxt receiver == coInterpreter
  					 and: [ctxt selector == #interpret]]]) notNil]]
  		ifNone: []) ifNotNil:
  			[:debuggerWindow|
  			 WorldState addDeferredUIMessage:
  				[debuggerWindow model proceed]]!

Item was added:
+ ----- Method: Debugger>>isDebugger (in category '*VMMaker-testing') -----
+ isDebugger
+ 	^true!

Item was added:
+ ----- Method: Object>>isDebugger (in category '*VMMaker-testing') -----
+ isDebugger
+ 	^false!

Item was changed:
  ----- Method: StackInterpreterSimulator>>setClickStepBreakBlock (in category 'UI') -----
  setClickStepBreakBlock
  	"Set the break block to present a confirmer, breaking if true, and restoring the previous break block.
  	 If an open debugger on the receiver can be found, proceed it."
  	<doNotGenerate>
  	| previousAtEachStepBlock |
  	(atEachStepBlock isNil or: [atEachStepBlock method ~~ thisContext method]) ifTrue:
  		[previousAtEachStepBlock := atEachStepBlock.
  		 atEachStepBlock :=
  							[previousAtEachStepBlock value.
  							 self changed: #byteCountText.
  							 (UIManager confirm: 'step?') ifFalse:
  								[atEachStepBlock := previousAtEachStepBlock.
  								 self halt]]].
  	(World submorphs
  		detect:
  			[:m|
+ 			 m model isDebugger
- 			 m model class == Debugger
  			 and: [(m model interruptedProcess suspendedContext findContextSuchThat:
  					[:ctxt|
  					 ctxt receiver == self
  					 and: [ctxt selector == #run]]) notNil]]
  		ifNone: []) ifNotNil:
  			[:debuggerWindow|
  			 WorldState addDeferredUIMessage:
  				[debuggerWindow model proceed]]!

Item was changed:
  ----- Method: StackToRegisterMappingCogit>>generateInstructionsAt: (in category 'generate machine code') -----
  generateInstructionsAt: eventualAbsoluteAddress
  	"Size pc-dependent instructions and assign eventual addresses to all instructions.
  	 Answer the size of the code.
  	 Compute forward branches based on virtual address (abstract code starts at 0),
  	 assuming that any branches branched over are long.
  	 Compute backward branches based on actual address.
  	 Reuse the fixups array to record the pc-dependent instructions that need to have
  	 their code generation postponed until after the others.
  
  	 Override to andd handling for null branches (branches to the immediately following
  	 instruction) occasioned by StackToRegisterMapping's following of jumps."
  	| absoluteAddress pcDependentIndex abstractInstruction fixup |
  	<var: #abstractInstruction type: #'AbstractInstruction *'>
  	<var: #fixup type: #'BytecodeFixup *'>
  	absoluteAddress := eventualAbsoluteAddress.
  	pcDependentIndex := 0.
  	0 to: opcodeIndex - 1 do:
  		[:i|
- 		self maybeBreakGeneratingAt: absoluteAddress.
  		abstractInstruction := self abstractInstructionAt: i.
+ 		self maybeBreakGeneratingAt: absoluteAddress.
  		abstractInstruction isPCDependent
  			ifTrue:
  				[abstractInstruction sizePCDependentInstructionAt: absoluteAddress.
  				 (abstractInstruction isJump
  				  and: [(i + 1 < opcodeIndex
  				  		and: [abstractInstruction getJmpTarget == (self abstractInstructionAt: i + 1)])
  					or: [i + 2 < opcodeIndex
  						and: [abstractInstruction getJmpTarget == (self abstractInstructionAt: i + 2)
  						and: [(self abstractInstructionAt: i + 1) opcode = Nop]]]])
  					ifTrue:
  						[abstractInstruction
  							opcode: Nop;
  							concretizeAt: absoluteAddress]
  					ifFalse:
  						[fixup := self fixupAtIndex: pcDependentIndex.
  						 pcDependentIndex := pcDependentIndex + 1.
  						 fixup instructionIndex: i].
  				 absoluteAddress := absoluteAddress + abstractInstruction machineCodeSize]
  			ifFalse:
  				[absoluteAddress := abstractInstruction concretizeAt: absoluteAddress.
  				 self assert: abstractInstruction machineCodeSize = abstractInstruction maxSize]].
  	0 to: pcDependentIndex - 1 do:
  		[:j|
  		fixup := self fixupAtIndex: j.
  		abstractInstruction := self abstractInstructionAt: fixup instructionIndex.
  		self maybeBreakGeneratingAt: abstractInstruction address.
  		abstractInstruction concretizeAt: abstractInstruction address].
  	^absoluteAddress - eventualAbsoluteAddress!



More information about the Vm-dev mailing list