Execution context generalization#779
Conversation
Codecov Report
@@ Coverage Diff @@
## master #779 +/- ##
=======================================
Coverage 99.24% 99.24%
=======================================
Files 78 79 +1
Lines 11962 11962
=======================================
Hits 11872 11872
Misses 90 90
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Nit: the commit message |
| const auto& code = instance.module->get_code(func_idx); | ||
| auto* const memory = instance.memory.get(); | ||
|
|
||
| const auto local_ctx = ctx.create_local_context(); |
There was a problem hiding this comment.
Does moving this action from invoke to execute change the depth that host functions see?
There was a problem hiding this comment.
No. We record the value in many tests:
.There was a problem hiding this comment.
I thought so, but why?
Before: call opcode calls invoke_function, it increments depth, calls execute, it calls host function.
After: call opcode calls invoke_function, calls execute, it calls host function. (increment only if it's not imported)
There was a problem hiding this comment.
Before: execute(depth: D), call opcode, invoke_function(): increment depth, execute(depth: D+1).
After: execute(depth: D): increment depth, call opcode, invoke_function(), execute(depth: D+1).
So this changes the value of the depth only inside the execute().
This is needed because later I want to get access the ExecutionContext shared stack space in the same place where depth is incremented.
I was not able to also move the depth check to the same place easily. This may be handled later, e.g. by trapping inside the invoke_function().
To my understanding, move constructor is not implicitly generated if you declare a copy constructor. |
I think only if you define a custom one, but I might be wrong. |
|
I would add explicit deletions of move contructor and move assignment then. |
OK. |
5ad956b to
524e5aa
Compare
Before #777 lands I propose to generalize
ExecutionContext:execution_context.hpp,Guardto something likeLocalContext,increment_call_depth()to something likecreate_local_context().