[Vm-dev] VM Maker: Cog-eem.199.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Aug 27 15:56:13 UTC 2014

Eliot Miranda uploaded a new version of Cog to project VM Maker:

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

Name: Cog-eem.199
Author: eem
Time: 27 August 2014, 4:55:58.736 pm
UUID: 0291b9f2-a3b9-4b87-ae19-873bec4af1d0
Ancestors: Cog-eem.198

Spur bootstrap:
Add a stack depth check to interpreter:object:perform:
withArguments: to catch errors before invoking a GC etc.

=============== Diff against Cog-eem.198 ===============

Item was changed:
  ----- Method: SimulatorHarness>>interpreter:object:perform:withArguments: (in category 'bootstrap methods') -----
  interpreter: sim object: receiver perform: selector withArguments: arguments
  	"Interpret an expression in oldHeap using oldInterpreter.
  	 Answer the result."
+ 	| fp savedpc savedsp savedStackPages result startByteCount |
- 	| fp savedpc savedsp result startByteCount |
  	self assert: ({receiver. selector}, arguments allSatisfy:
  					[:oop| oop isInteger and: [sim objectMemory addressCouldBeOop: oop]]).
  	savedpc := sim localIP.
  	savedsp := sim localSP.
+ 	savedStackPages := Set with: sim stackPage.
  	sim internalPush: receiver.
  	arguments do: [:arg| sim internalPush: arg].
  		argumentCount: arguments size;
  		messageSelector: selector.
  	fp := sim localFP.
  	startByteCount := sim byteCount.
  	"sim byteCount = 66849 ifTrue: [self halt]."
  	sim normalSend.
  	sim incrementByteCount. "otherwise, send is not counted"
  	["sim printFrame: sim localFP WithSP: sim localSP"
  	 "sim setBreakSelector: #elementsForwardIdentityTo:"
  	 "sim byteCount = 66849 ifTrue: [self halt]."
  	 "(sim byteCount > 7508930 and: [sim localFP = -16r27894]) ifTrue:
  		[self halt]."
  	 fp = sim localFP] whileFalse:
+ 		[sim singleStep.
+ 		 (savedStackPages includes: sim stackPage) ifFalse: "If the stack gets deep something has probably gone wrong..."
+ 			[savedStackPages size > 3 ifTrue: [self halt].
+ 			 savedStackPages add: sim stackPage]].
- 		[sim singleStep].
  	result := sim internalPopStack.
  	self assert: savedsp = sim localSP.
  	self assert: sim localIP - 1 = savedpc.
  	sim localIP: savedpc.

More information about the Vm-dev mailing list