Skip to content

Create analogue to LoadNativeField for non-Object fields #42793

Open
@sstrickl

Description

@sstrickl

Currently, we can load <X>Ptr-typed fields in raw (e.g.,<Y>Layout) objects by using LoadNativeField. However, no analogue exists for fields that are not boxed types (e.g., uint32_t-typed fields).

This came up while working on #40813, where I needed to be able to inspect the number of fixed and optional parameters for a closure function where the closure function is not known statically, which requires extracting the value of the packed_fields_ field, which is of type uint32_t.

As a short-term workaround, I have added the right entries into the helper methods used by the LoadIndexed instruction to make the contents of a FunctionLayout object addressable as if the non-tagged portion was an external uint32_t array. A better solution for the long term would be to introduce another instruction (LoadUnboxedNativeField?) with appropriate Slot-like machinery for defining extractable unboxed fields from raw objects, and then remove the kFunctionCid hack in the various places it appears.

Metadata

Metadata

Assignees

Labels

area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions