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

commits at source.squeak.org commits at source.squeak.org
Mon Feb 20 19:44:07 UTC 2012


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

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

Name: VMMaker.oscog-eem.148
Author: eem
Time: 20 February 2012, 11:41:41.038 am
UUID: bb53aa60-4173-48ed-874b-dc0ff5a48992
Ancestors: VMMaker.oscog-eem.147

Make multiple bytecode sets code cope with nilling of method during
initialization, GC, etc.

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

Item was changed:
  ----- Method: CoInterpreter>>ceStackOverflow: (in category 'trampolines') -----
  ceStackOverflow: contextSwitchIfNotNil
  	"If contextSwitchIfNotNil is nil we can't context switch.
  	 contextSwitchIfNotNil is set to nil by
  		- the special primitiveClosureValueNoContextSwitch entry-point in block dispatch
  		- the stack check in methods with primitive 198.
  	 In a normal method contextSwitchIfNotNil will be the method (see e.g.
  	 SimpleStackBasedCogit>>compileFrameBuild).  In a block it will be the
  	 closure (see e.g. SimpleStackBasedCogit>>compileMethodBody)."
  	<api>
  	| cogMethod switched cesoRetAddr |
  	<var: #cogMethod type: #'CogBlockMethod *'>
  	cesoRetAddr := self popStack. "discard the ceStackOverflow call return address."
  	cogMethod := self mframeCogMethod: framePointer.
  	self assert: cesoRetAddr - cogit abortOffset = (self asCogHomeMethod: cogMethod) asInteger.
  	instructionPointer := cogMethod asInteger + cogMethod stackCheckOffset.
  	self assertValidExecutionPointe: instructionPointer r: framePointer s: stackPointer imbar: false.
+ 	method := newMethod := messageSelector := lkupClass := objectMemory nilObject.
- 	self setMethod: (newMethod := messageSelector := lkupClass := objectMemory nilObject).
  	switched := self handleStackOverflowOrEventAllowContextSwitch: contextSwitchIfNotNil ~= 0.
  	self returnToExecutive: false postContextSwitch: switched.
  	self error: 'should not be reached'
  !

Item was changed:
  ----- Method: StackInterpreter>>initializeInterpreter: (in category 'initialization') -----
  initializeInterpreter: bytesToShift 
  	"Initialize Interpreter state before starting execution of a new image."
  	interpreterProxy := self sqGetInterpreterProxy.
  	self dummyReferToProxy.
  	objectMemory initializeObjectMemory: bytesToShift.
  	self checkAssumedCompactClasses.
  	primFailCode := 0.
  	self initializeExtraClassInstVarIndices.
  	stackLimit := 0. "This is also the initialization flag for the stack system."
  	stackPage := overflowedPage := 0.
  	extraFramesToMoveOnOverflow := 0.
+ 	method := objectMemory nilObject.
+ 	self cCode: [self cppIf: MULTIPLEBYTECODESETS ifTrue: [bytecodeSetSelector := 0]]
+ 		inSmalltalk: [bytecodeSetSelector := 0].
- 	self setMethod: objectMemory nilObject.
  	messageSelector := objectMemory nilObject.
  	newMethod := objectMemory nilObject.
  	lkupClass := objectMemory nilObject.
  	self flushMethodCache.
  	self flushAtCache.
  	self initialCleanup.
  	highestRunnableProcessPriority := 0.
  	nextProfileTick := 0.
  	profileSemaphore := objectMemory nilObject.
  	profileProcess := objectMemory nilObject.
  	profileMethod := objectMemory nilObject.
  	nextPollUsecs := 0.
  	nextWakeupUsecs := 0.
  	tempOop := 0.
  	interruptKeycode := 2094. "cmd-. as used for Mac but no other OS"
  	interruptPending := false.
  	inIOProcessEvents := 0.
  	deferDisplayUpdates := false.
  	pendingFinalizationSignals := statPendingFinalizationSignals := 0.
  	globalSessionID := 0.
  	[globalSessionID = 0]
  		whileTrue: [globalSessionID := self
  						cCode: 'time(NULL) + ioMSecs()'
  						inSmalltalk: [(Random new next * SmallInteger maxVal) asInteger]].
  	jmpDepth := 0.
  	longRunningPrimitiveStartUsecs :=
  	longRunningPrimitiveStopUsecs := 0.
  	maxExtSemTabSizeSet := false.
  	statForceInterruptCheck := 0.
  	statStackOverflow := 0.
  	statCheckForEvents := 0.
  	statProcessSwitch := 0.
  	statIOProcessEvents := 0.
  	statStackPageDivorce := 0!

Item was changed:
  ----- Method: StackInterpreter>>setMethod: (in category 'internal interpreter access') -----
  setMethod: aMethodObj
  	"Set the method and determine the bytecode set based on the method header's sign.
  	 If MULTIPLEBYTECODESETS then a negative header selects the alternate bytecode set.
  	 Conditionalizing the code on MULTIPLEBYTECODESETS allows the header sign bit to be
  	 used for other experiments."
  	<inline: true>
  	method := aMethodObj.
+ 	self assert: (objectMemory isOopCompiledMethod: method).
  	self cppIf: MULTIPLEBYTECODESETS
+ 		ifTrue: [bytecodeSetSelector := (self methodUsesAlternateBytecodeSet: method)
+ 											ifTrue: [256]
+ 											ifFalse: [0]]!
- 		ifTrue:
- 			[bytecodeSetSelector := (self methodUsesAlternateBytecodeSet: method)
- 										ifTrue: [256]
- 										ifFalse: [0]]!



More information about the Vm-dev mailing list