Support caching of next method in generators. (#3937)

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2020-06-26 12:09:36 +02:00
committed by GitHub
parent f88489beef
commit b7e3baeecb
14 changed files with 391 additions and 87 deletions
@@ -203,7 +203,9 @@ ecma_async_generator_run (vm_executable_object_t *async_generator_object_p) /**<
{
case ECMA_ASYNC_GENERATOR_DO_NEXT:
{
result = ecma_op_iterator_next (async_generator_object_p->frame_ctx.block_result, task_p->operation_value);
result = ecma_op_iterator_next (async_generator_object_p->frame_ctx.block_result,
async_generator_object_p->frame_ctx.stack_top_p[-1],
task_p->operation_value);
if (ECMA_IS_VALUE_ERROR (result))
{
@@ -256,6 +258,10 @@ ecma_async_generator_run (vm_executable_object_t *async_generator_object_p) /**<
async_generator_object_p->frame_ctx.block_result = ECMA_VALUE_UNDEFINED;
async_generator_object_p->frame_ctx.byte_code_p = opfunc_resume_executable_object_with_throw;
JERRY_ASSERT (async_generator_object_p->frame_ctx.stack_top_p[-1] == ECMA_VALUE_UNDEFINED
|| ecma_is_value_object (async_generator_object_p->frame_ctx.stack_top_p[-1]));
async_generator_object_p->frame_ctx.stack_top_p--;
result = jcontext_take_exception ();
}
else