[Vm-dev] VM Maker: VMMaker.oscog-eem.1022.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Jan 15 21:31:37 UTC 2015
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1022.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.1022
Author: eem
Time: 15 January 2015, 1:30:22.147 pm
UUID: 69a59ffb-cfbd-4b9e-af74-7c2eb662beac
Ancestors: VMMaker.oscog-eem.1021
Cope with the funky primitives generated from
Smalltalk methods in computing accessor depths.
=============== Diff against VMMaker.oscog-eem.1021 ===============
Item was changed:
----- Method: CCodeGenerator>>accessorDepthForMethod: (in category 'spur primitive compilation') -----
accessorDepthForMethod: method
"Compute the depth the method traverses object structure, assuming it is a primitive.
This is in support of Spur's lazy become. A primitive may fail because it may encounter
a forwarder. The primitive failure code needs to know to what depth it must follow
arguments to follow forwarders and, if any are found and followed, retry the primitive.
This method determines that depth. It starts by collecting references to the stack and
then follows these through assignments to variables and use of accessor methods
such as fetchPointer:ofObject:. For example
| obj field |
obj := self stackTop.
field := objectMemory fetchPointer: 1 ofObject: obj.
self storePointer: 1 ofObject: field withValue: (self stackValue: 1)
has depth 2, since field is accessed, and field is an element of obj."
+ ^((method definingClass includesSelector: method selector) ifTrue:
+ [(method definingClass >> method selector) pragmaAt: #accessorDepth:])
- ^((method definingClass >> method selector) pragmaAt: #accessorDepth:)
ifNil:
[((self
accessorChainsForMethod: method
interpreterClass: (vmClass ifNil: [StackInterpreter]))
inject: 0
into: [:length :chain| length max: (self accessorDepthForChain: chain)]) - 1]
ifNotNil: [:pragma| pragma arguments first]!
More information about the Vm-dev
mailing list