[PATCH v3 01/11] jscript: Keep a pointer to the bytecode in function_code_t.

Gabriel Ivăncescu gabrielopcode at gmail.com
Wed Dec 11 08:08:22 CST 2019


Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
---
 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 db05d3c..a530e87 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 955c315..48cc952 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;
-- 
2.21.0




More information about the wine-devel mailing list