[Vm-dev] VM Maker: VMMaker.oscog-eem.3016.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Aug 3 00:57:29 UTC 2021
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.3016.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.3016
Author: eem
Time: 2 August 2021, 5:57:04.740407 pm
UUID: 97c19fe4-c1e8-4d60-866f-eb979d499a5d
Ancestors: VMMaker.oscog-eem.3015
Slang: Fix a regression with plugin generation on simplifying emitExportsOn: now that accessor depths are computed earlier.
=============== Diff against VMMaker.oscog-eem.3015 ===============
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.
The information is cached since it needs to be computed *before* inlining"
^accessorDepthCache
at: method smalltalkSelector
ifAbsentPut:
[beganInlining
ifTrue:
+ [(method export
+ or: [vmClass notNil or: [vmClass primitiveTable includes: method smalltalkSelector]])
- [((vmClass primitiveTable includes: method smalltalkSelector)
- or: [method export])
ifTrue: [-1]
ifFalse: [self error: 'it is too late to compute accessor depths!!']]
ifFalse:
[((method definingClass includesSelector: method smalltalkSelector) ifTrue:
[(method definingClass >> method smalltalkSelector) 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