[Vm-dev] VM Maker: VMMaker.oscog-cb.2154.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Mar 14 20:51:43 UTC 2017

ClementBera uploaded a new version of VMMaker to project VM Maker:

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

Name: VMMaker.oscog-cb.2154
Author: cb
Time: 14 March 2017, 1:50:51.748397 pm
UUID: aa9db09c-6dec-4cd3-8538-98776f7cde7d
Ancestors: VMMaker.oscog-eem.2153

Added extra condition in methodClassOf: to be able to ignore fullBlock last literal without assertion failures.

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

Item was changed:
  ----- Method: StackInterpreter>>methodClassOf: (in category 'compiled methods') -----
  methodClassOf: methodPointer
  	"Answer the method class of a method which is the value of an Association in the last literal,
  	 or answer nil if there isn't one.
  	 Using a read barrier here simplifies the become implementation and costs very little
  	 because the class index and ValueIndex of the association almost certainly share a cache line."
  	| literal |
  	literal := self followLiteral: (objectMemory literalCountOf: methodPointer) - 1 ofMethod: methodPointer.
+ 	^ (literal ~= objectMemory nilObject 
+ 		and: [objectMemory isPointers: literal]) "filters out fullBlock last literal"
+ 			ifTrue: 
+ 				[self assert: (objectMemory numSlotsOf: literal) > ValueIndex.
+ 			 	objectMemory followField: ValueIndex ofObject: literal]
+ 			ifFalse: [objectMemory nilObject]!
- 	literal ~= objectMemory nilObject ifTrue:
- 		[self assert: ((objectMemory isPointers: literal) and: [(objectMemory numSlotsOf: literal) > ValueIndex]).
- 		 literal := objectMemory followField: ValueIndex ofObject: literal].
- 	^literal!

More information about the Vm-dev mailing list