VM Maker: VMMaker.oscog-cb.2154.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-cb.2154.mcz

commits-2
 
ClementBera uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-cb.2154.mcz

==================== 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
  <api>
  "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!