Skip to content

VM: enable OSR in block expressions #36421

Closed
@aartbik

Description

@aartbik

The current VM implementation of block expressions disables OSR while inside a block expression to avoid some issues with temps on expression stack. This is okay for a first implementation, since widget loops inside control flow collections can be expected to be short running. However, for a high quality implementation, we should enable OSR even inside those blocks, since it is always possible to write a contrived long running loop. This bug tracks the progress of that work.

Probably biggest VM item left to be explored is enabling OSR points inside control flow collection for loops. Alex notes we should ensure that temporaries on the expression stack are preserved when OSR happens.

Consider a more complex expression like

var x = x.bar(42, bazz(), 'abc', [more_bazz(), for (int i = 0; i < n; i++) 2*i ]);

In this case x, 42, bazz() and 'abc' should be on the expression stack unless CFE introduces temporary variables for them. Let's:
(1) test if the above example works;
(2) dump kernel to see how CFE generates this;
(3) print flowgraph of a function compiled for OSR and check that it loads captured values correctly.

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