Module: wine Branch: master Commit: c70c10564a61221be5a519dbcf360e44eb18c19b URL: https://source.winehq.org/git/wine.git/?a=commit;h=c70c10564a61221be5a519dbc... Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Wed Dec 11 16:08:22 2019 +0200 jscript: Keep a pointer to the bytecode in function_code_t. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/compile.c | 1 + dlls/jscript/engine.h | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index db05d3c360..a530e87d8e 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -2279,6 +2279,7 @@ static HRESULT compile_function(compiler_ctx_t *ctx, source_elements_t *source, TRACE("\n"); + func->bytecode = ctx->code; ctx->func_head = ctx->func_tail = NULL; ctx->from_eval = from_eval; ctx->func = func; diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index 955c315ff9..48cc9529f4 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -103,6 +103,8 @@ OP_LIST OP_LAST } jsop_t; +typedef struct _bytecode_t bytecode_t; + typedef union { BSTR bstr; LONG lng; @@ -163,11 +165,13 @@ typedef struct _function_code_t { unsigned locals_cnt; local_ref_t *locals; + + bytecode_t *bytecode; } function_code_t; local_ref_t *lookup_local(const function_code_t*,const WCHAR*) DECLSPEC_HIDDEN; -typedef struct _bytecode_t { +struct _bytecode_t { LONG ref; BOOL is_persistent; @@ -187,7 +191,7 @@ typedef struct _bytecode_t { unsigned str_cnt; struct list entry; -} bytecode_t; +}; HRESULT compile_script(script_ctx_t*,const WCHAR*,const WCHAR*,const WCHAR*,BOOL,BOOL,bytecode_t**) DECLSPEC_HIDDEN; void release_bytecode(bytecode_t*) DECLSPEC_HIDDEN;