winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
March 2016
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
722 discussions
Start a n
N
ew thread
Alexandre Julliard : makedep: Sort makefile variables.
by Alexandre Julliard
29 Mar '16
29 Mar '16
Module: wine Branch: master Commit: 512c686be9b3eb952a8d6e49abae032f335bc1b8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=512c686be9b3eb952a8d6e49a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Mar 29 12:27:17 2016 +0900 makedep: Sort makefile variables. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/makedep.c | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/tools/makedep.c b/tools/makedep.c index 9ad6e39..2a9782a 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -413,10 +413,15 @@ static void strarray_add_uniq( struct strarray *array, const char *str ) */ static const char *strarray_get_value( const struct strarray *array, const char *name ) { - unsigned int i; + int pos, res, min = 0, max = array->count / 2 - 1; - for (i = 0; i < array->count; i += 2) - if (!strcmp( array->str[i], name )) return array->str[i + 1]; + while (min <= max) + { + pos = (min + max) / 2; + if (!(res = strcmp( array->str[pos * 2], name ))) return array->str[pos * 2 + 1]; + if (res < 0) min = pos + 1; + else max = pos - 1; + } return NULL; } @@ -428,17 +433,25 @@ static const char *strarray_get_value( const struct strarray *array, const char */ static void strarray_set_value( struct strarray *array, const char *name, const char *value ) { - unsigned int i; + int i, pos, res, min = 0, max = array->count / 2 - 1; - /* redefining a variable replaces the previous value */ - for (i = 0; i < array->count; i += 2) + while (min <= max) { - if (strcmp( array->str[i], name )) continue; - array->str[i + 1] = value; - return; + pos = (min + max) / 2; + if (!(res = strcmp( array->str[pos * 2], name ))) + { + /* redefining a variable replaces the previous value */ + array->str[pos * 2 + 1] = value; + return; + } + if (res < 0) min = pos + 1; + else max = pos - 1; } - strarray_add( array, name ); - strarray_add( array, value ); + strarray_add( array, NULL ); + strarray_add( array, NULL ); + for (i = array->count - 1; i > min * 2 + 1; i--) array->str[i] = array->str[i - 2]; + array->str[min * 2] = name; + array->str[min * 2 + 1] = value; }
1
0
0
0
Piotr Caban : msvcrt: Handle frames with CXX_FRAME_MAGIC_VC6 and CXX_FRAME_MAGIC_VC7 magic value.
by Alexandre Julliard
29 Mar '16
29 Mar '16
Module: wine Branch: master Commit: 953d6c88d1235548eaa54f1b450f5bba938c4f91 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=953d6c88d1235548eaa54f1b4…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Mon Mar 28 20:12:18 2016 +0200 msvcrt: Handle frames with CXX_FRAME_MAGIC_VC6 and CXX_FRAME_MAGIC_VC7 magic value. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcrt/except_x86_64.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/msvcrt/except_x86_64.c b/dlls/msvcrt/except_x86_64.c index 018554e..0379d30 100644 --- a/dlls/msvcrt/except_x86_64.c +++ b/dlls/msvcrt/except_x86_64.c @@ -177,7 +177,9 @@ static void dump_function_descr(const cxx_function_descr *descr, ULONG64 image_b TRACE(" %d: ip %x state %d\n", i, ipmap[i].ip, ipmap[i].state); } TRACE("unwind_help %d\n", descr->unwind_help); + if (descr->magic <= CXX_FRAME_MAGIC_VC6) return; TRACE("expect list: %x\n", descr->expect_list); + if (descr->magic <= CXX_FRAME_MAGIC_VC7) return; TRACE("flags: %08x\n", descr->flags); } @@ -444,7 +446,7 @@ static DWORD cxx_frame_handler(EXCEPTION_RECORD *rec, ULONG64 frame, { cxx_exception_type *exc_type; - if (descr->magic != CXX_FRAME_MAGIC_VC8) + if (descr->magic<CXX_FRAME_MAGIC_VC6 || descr->magic>CXX_FRAME_MAGIC_VC8) { FIXME("unhandled frame magic %x\n", descr->magic); return ExceptionContinueSearch;
1
0
0
0
Piotr Caban : msvcrt: Add x86_64 __CxxFrameHandler implementation.
by Alexandre Julliard
29 Mar '16
29 Mar '16
Module: wine Branch: master Commit: 63aea551ca6193e62a711d7caa3a82f0f9405d86 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=63aea551ca6193e62a711d7ca…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Mon Mar 28 20:12:10 2016 +0200 msvcrt: Add x86_64 __CxxFrameHandler implementation. Known issues: - exceptions are destroyed too late in case of rethrow - no longer used cxx_frame_info structures are freed incorrectly Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcrt/except_x86_64.c | 289 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 284 insertions(+), 5 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=63aea551ca6193e62a711…
1
0
0
0
Piotr Caban : msvcrt: Improve dump_function_descr helper.
by Alexandre Julliard
29 Mar '16
29 Mar '16
Module: wine Branch: master Commit: 776c4a1617eae0f6a50647614881d81c00be862d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=776c4a1617eae0f6a50647614…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Mon Mar 28 20:11:50 2016 +0200 msvcrt: Improve dump_function_descr helper. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcrt/except_x86_64.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/dlls/msvcrt/except_x86_64.c b/dlls/msvcrt/except_x86_64.c index f81bb95..820197d 100644 --- a/dlls/msvcrt/except_x86_64.c +++ b/dlls/msvcrt/except_x86_64.c @@ -73,7 +73,11 @@ typedef struct UINT type_info; int offset; UINT handler; + UINT frame; } catchblock_info; +#define TYPE_FLAG_CONST 1 +#define TYPE_FLAG_VOLATILE 2 +#define TYPE_FLAG_REFERENCE 8 typedef struct { @@ -84,6 +88,12 @@ typedef struct UINT catchblock; } tryblock_info; +typedef struct +{ + int ip; + int state; +} ipmap_info; + typedef struct __cxx_function_descr { UINT magic; @@ -133,6 +143,7 @@ static void dump_function_descr(const cxx_function_descr *descr, ULONG64 image_b { unwind_info *unwind_table = rva_to_ptr(descr->unwind_table, image_base); tryblock_info *tryblock = rva_to_ptr(descr->tryblock, image_base); + ipmap_info *ipmap = rva_to_ptr(descr->ipmap, image_base); UINT i, j; TRACE("magic %x\n", descr->magic); @@ -147,18 +158,24 @@ static void dump_function_descr(const cxx_function_descr *descr, ULONG64 image_b { catchblock_info *catchblock = rva_to_ptr(tryblock[i].catchblock, image_base); - TRACE(" %d: start %d end %d catchlevel %d catch%x(%p) %d\n", i, + TRACE(" %d: start %d end %d catchlevel %d catch %x(%p) %d\n", i, tryblock[i].start_level, tryblock[i].end_level, tryblock[i].catch_level, tryblock[i].catchblock, catchblock, tryblock[i].catchblock_count); for (j=0; j<tryblock[i].catchblock_count; j++) { - TRACE(" %d: flags %x offset %d handler %x(%p) type %x %s\n", - j, catchblock->flags, catchblock->offset, catchblock->handler, - rva_to_ptr(catchblock->handler, image_base), catchblock->type_info, - dbgstr_type_info(rva_to_ptr(catchblock->type_info, image_base))); + TRACE(" %d: flags %x offset %d handler %x(%p) frame %x type %x %s\n", + j, catchblock[j].flags, catchblock[j].offset, catchblock[j].handler, + rva_to_ptr(catchblock[j].handler, image_base), catchblock[j].frame, + catchblock[j].type_info, + dbgstr_type_info(rva_to_ptr(catchblock[j].type_info, image_base))); } } + TRACE("ipmap: %x(%p) %d\n", descr->ipmap, ipmap, descr->ipmap_count); + for (i=0; i<descr->ipmap_count; i++) + { + TRACE(" %d: ip %x state %d\n", i, ipmap[i].ip, ipmap[i].state); + } TRACE("unwind_help %d\n", descr->unwind_help); TRACE("expect list: %x\n", descr->expect_list); TRACE("flags: %08x\n", descr->flags);
1
0
0
0
Piotr Caban : msvcrt: Call C structured exception translator in x86_64 __CxxFrameHandler.
by Alexandre Julliard
29 Mar '16
29 Mar '16
Module: wine Branch: master Commit: bc71c7decb4d0d14a0a5d67e034557c5c3535c18 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bc71c7decb4d0d14a0a5d67e0…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Mon Mar 28 20:11:44 2016 +0200 msvcrt: Call C structured exception translator in x86_64 __CxxFrameHandler. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcrt/except_x86_64.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dlls/msvcrt/except_x86_64.c b/dlls/msvcrt/except_x86_64.c index d31bc69..f81bb95 100644 --- a/dlls/msvcrt/except_x86_64.c +++ b/dlls/msvcrt/except_x86_64.c @@ -207,9 +207,19 @@ static DWORD cxx_frame_handler(EXCEPTION_RECORD *rec, ULONG64 frame, } else { + thread_data_t *data = msvcrt_get_thread_data(); + exc_type = NULL; TRACE("handling C exception code %x rec %p frame %lx unwind_help %d descr %p\n", rec->ExceptionCode, rec, frame, *((INT*)(frame+descr->unwind_help)), descr); + + if (data->se_translator) { + EXCEPTION_POINTERS except_ptrs; + + except_ptrs.ExceptionRecord = rec; + except_ptrs.ContextRecord = context; + data->se_translator(rec->ExceptionCode, &except_ptrs); + } } return ExceptionContinueSearch;
1
0
0
0
Jacek Caban : jscript: Find Function.arguments on the stack instead of storing it in FunctionInstance object.
by Alexandre Julliard
29 Mar '16
29 Mar '16
Module: wine Branch: master Commit: 35133dbe58de3a3732e84cd4264e0c274c56fb1d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=35133dbe58de3a3732e84cd42…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 28 17:51:28 2016 +0200 jscript: Find Function.arguments on the stack instead of storing it in FunctionInstance object. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/engine.c | 6 +++++- dlls/jscript/engine.h | 4 +++- dlls/jscript/function.c | 18 +++++++++++------- dlls/jscript/global.c | 2 +- dlls/jscript/jscript.c | 4 ++-- dlls/jscript/tests/lang.js | 4 ++++ 6 files changed, 26 insertions(+), 12 deletions(-) diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 5a4d76f..e600e62 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -2388,6 +2388,8 @@ static void release_call_frame(call_frame_t *frame) jsdisp_propput_name(frame->variable_obj, argumentsW, jsval_undefined()); jsdisp_release(frame->arguments_obj); } + if(frame->function_instance) + jsdisp_release(frame->function_instance); if(frame->variable_obj) jsdisp_release(frame->variable_obj); if(frame->this_obj) @@ -2536,7 +2538,7 @@ static HRESULT bind_event_target(script_ctx_t *ctx, function_code_t *func, jsdis } HRESULT exec_source(script_ctx_t *ctx, DWORD flags, bytecode_t *bytecode, function_code_t *function, scope_chain_t *scope, - IDispatch *this_obj, jsdisp_t *variable_obj, jsdisp_t *arguments_obj, jsval_t *r) + IDispatch *this_obj, jsdisp_t *function_instance, jsdisp_t *variable_obj, jsdisp_t *arguments_obj, jsval_t *r) { call_frame_t *frame; unsigned i; @@ -2604,6 +2606,8 @@ HRESULT exec_source(script_ctx_t *ctx, DWORD flags, bytecode_t *bytecode, functi frame->this_obj = to_disp(ctx->global); IDispatch_AddRef(frame->this_obj); + if(function_instance) + frame->function_instance = jsdisp_addref(function_instance); if(arguments_obj) frame->arguments_obj = jsdisp_addref(arguments_obj); diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index e500ba4..4c29694 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -203,6 +203,7 @@ typedef struct _call_frame_t { jsval_t ret; IDispatch *this_obj; + jsdisp_t *function_instance; jsdisp_t *variable_obj; jsdisp_t *arguments_obj; DWORD flags; @@ -217,5 +218,6 @@ typedef struct _call_frame_t { #define EXEC_CONSTRUCTOR 0x0002 HRESULT exec_source(script_ctx_t*,DWORD,bytecode_t*,function_code_t*,scope_chain_t*,IDispatch*, - jsdisp_t*,jsdisp_t*,jsval_t*) DECLSPEC_HIDDEN; + jsdisp_t*,jsdisp_t*,jsdisp_t*,jsval_t*) DECLSPEC_HIDDEN; + HRESULT create_source_function(script_ctx_t*,bytecode_t*,function_code_t*,scope_chain_t*,jsdisp_t**) DECLSPEC_HIDDEN; diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index be1f29c..51d1060 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -34,7 +34,6 @@ typedef struct { bytecode_t *code; function_code_t *func_code; DWORD length; - jsdisp_t *arguments; } FunctionInstance; typedef struct { @@ -239,14 +238,11 @@ static HRESULT invoke_source(script_ctx_t *ctx, FunctionInstance *function, IDis hres = scope_push(function->scope_chain, var_disp, to_disp(var_disp), &scope); if(SUCCEEDED(hres)) { DWORD exec_flags = 0; - jsdisp_t *prev_args; if(is_constructor) exec_flags |= EXEC_CONSTRUCTOR; - prev_args = function->arguments; - function->arguments = arg_disp; - hres = exec_source(ctx, exec_flags, function->code, function->func_code, scope, this_obj, var_disp, arg_disp, r); - function->arguments = prev_args; + hres = exec_source(ctx, exec_flags, function->code, function->func_code, scope, this_obj, + &function->dispex, var_disp, arg_disp, r); scope_release(scope); } @@ -535,10 +531,18 @@ HRESULT Function_get_value(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) static HRESULT Function_get_arguments(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) { FunctionInstance *function = function_from_jsdisp(jsthis); + call_frame_t *frame; TRACE("\n"); - *r = function->arguments ? jsval_obj(jsdisp_addref(function->arguments)) : jsval_null(); + for(frame = ctx->call_ctx; frame; frame = frame->prev_frame) { + if(frame->function_instance == &function->dispex) { + *r = jsval_obj(jsdisp_addref(frame->arguments_obj)); + return S_OK; + } + } + + *r = jsval_null(); return S_OK; } diff --git a/dlls/jscript/global.c b/dlls/jscript/global.c index 24ec358..d473dc3 100644 --- a/dlls/jscript/global.c +++ b/dlls/jscript/global.c @@ -227,7 +227,7 @@ static HRESULT JSGlobal_eval(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, uns if(frame->flags & EXEC_GLOBAL) exec_flags |= EXEC_GLOBAL; hres = exec_source(ctx, exec_flags, code, &code->global_code, frame->scope, - frame->this_obj, frame->variable_obj, NULL, r); + frame->this_obj, NULL, frame->variable_obj, NULL, r); release_bytecode(code); return hres; } diff --git a/dlls/jscript/jscript.c b/dlls/jscript/jscript.c index 61fa400..2472c11 100644 --- a/dlls/jscript/jscript.c +++ b/dlls/jscript/jscript.c @@ -107,7 +107,7 @@ static HRESULT exec_global_code(JScript *This, bytecode_t *code) IActiveScriptSite_OnEnterScript(This->site); clear_ei(This->ctx); - hres = exec_source(This->ctx, EXEC_GLOBAL, code, &code->global_code, NULL, NULL, This->ctx->global, NULL, NULL); + hres = exec_source(This->ctx, EXEC_GLOBAL, code, &code->global_code, NULL, NULL, NULL, This->ctx->global, NULL, NULL); IActiveScriptSite_OnLeaveScript(This->site); return hres; @@ -773,7 +773,7 @@ static HRESULT WINAPI JScriptParse_ParseScriptText(IActiveScriptParse *iface, IActiveScriptSite_OnEnterScript(This->site); clear_ei(This->ctx); - hres = exec_source(This->ctx, EXEC_GLOBAL, code, &code->global_code, NULL, NULL, This->ctx->global, NULL, &r); + hres = exec_source(This->ctx, EXEC_GLOBAL, code, &code->global_code, NULL, NULL, NULL, This->ctx->global, NULL, &r); if(SUCCEEDED(hres)) { if(pvarResult) hres = jsval_to_variant(r, pvarResult); diff --git a/dlls/jscript/tests/lang.js b/dlls/jscript/tests/lang.js index 5b1b510..ae8e408 100644 --- a/dlls/jscript/tests/lang.js +++ b/dlls/jscript/tests/lang.js @@ -205,8 +205,12 @@ function argumentsTest() { eval('ok(arguments === save, "unexpected arguments");'); [1,2].sort(function() { ok(argumentsTest.arguments === save, "unexpected argumentsTest.arguments"); + return 1; }); } +/* FIXME: It seems that when function is called as an expression, instance object arguments is not set. + * We currently always set it in Wine. */ +argumentsTest(); tmp = (function() {1;})(); ok(tmp === undefined, "tmp = " + tmp);
1
0
0
0
Jacek Caban : jscript: Moved arguments object destuction to interpreter.
by Alexandre Julliard
29 Mar '16
29 Mar '16
Module: wine Branch: master Commit: 42e90ca5925324815958a430324faa2d47eb2f4e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=42e90ca5925324815958a4303…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 28 17:50:59 2016 +0200 jscript: Moved arguments object destuction to interpreter. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/engine.c | 12 +++++++++++- dlls/jscript/engine.h | 4 +++- dlls/jscript/function.c | 6 +----- dlls/jscript/global.c | 2 +- dlls/jscript/jscript.c | 4 ++-- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 4616853..5a4d76f 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -2381,6 +2381,13 @@ OP_LIST static void release_call_frame(call_frame_t *frame) { + if(frame->arguments_obj) { + /* Reset arguments value to cut the reference cycle. Note that since all activation contexts have + * their own arguments property, it's impossible to use prototype's one during name lookup */ + static const WCHAR argumentsW[] = {'a','r','g','u','m','e','n','t','s',0}; + jsdisp_propput_name(frame->variable_obj, argumentsW, jsval_undefined()); + jsdisp_release(frame->arguments_obj); + } if(frame->variable_obj) jsdisp_release(frame->variable_obj); if(frame->this_obj) @@ -2529,7 +2536,7 @@ static HRESULT bind_event_target(script_ctx_t *ctx, function_code_t *func, jsdis } HRESULT exec_source(script_ctx_t *ctx, DWORD flags, bytecode_t *bytecode, function_code_t *function, scope_chain_t *scope, - IDispatch *this_obj, jsdisp_t *variable_obj, jsval_t *r) + IDispatch *this_obj, jsdisp_t *variable_obj, jsdisp_t *arguments_obj, jsval_t *r) { call_frame_t *frame; unsigned i; @@ -2597,6 +2604,9 @@ HRESULT exec_source(script_ctx_t *ctx, DWORD flags, bytecode_t *bytecode, functi frame->this_obj = to_disp(ctx->global); IDispatch_AddRef(frame->this_obj); + if(arguments_obj) + frame->arguments_obj = jsdisp_addref(arguments_obj); + frame->flags = flags; frame->variable_obj = jsdisp_addref(variable_obj); diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index 4b3bba2..e500ba4 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -204,6 +204,7 @@ typedef struct _call_frame_t { IDispatch *this_obj; jsdisp_t *variable_obj; + jsdisp_t *arguments_obj; DWORD flags; bytecode_t *bytecode; @@ -215,5 +216,6 @@ typedef struct _call_frame_t { #define EXEC_GLOBAL 0x0001 #define EXEC_CONSTRUCTOR 0x0002 -HRESULT exec_source(script_ctx_t*,DWORD,bytecode_t*,function_code_t*,scope_chain_t*,IDispatch*,jsdisp_t*,jsval_t*) DECLSPEC_HIDDEN; +HRESULT exec_source(script_ctx_t*,DWORD,bytecode_t*,function_code_t*,scope_chain_t*,IDispatch*, + jsdisp_t*,jsdisp_t*,jsval_t*) DECLSPEC_HIDDEN; HRESULT create_source_function(script_ctx_t*,bytecode_t*,function_code_t*,scope_chain_t*,jsdisp_t**) DECLSPEC_HIDDEN; diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index bd85fda..be1f29c 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -245,16 +245,12 @@ static HRESULT invoke_source(script_ctx_t *ctx, FunctionInstance *function, IDis exec_flags |= EXEC_CONSTRUCTOR; prev_args = function->arguments; function->arguments = arg_disp; - hres = exec_source(ctx, exec_flags, function->code, function->func_code, scope, this_obj, var_disp, r); + hres = exec_source(ctx, exec_flags, function->code, function->func_code, scope, this_obj, var_disp, arg_disp, r); function->arguments = prev_args; scope_release(scope); } - /* Reset arguments value to cut the reference cycle. Note that since all activation contexts have - * their own arguments property, it's impossible to use prototype's one during name lookup */ - jsdisp_propput_name(var_disp, argumentsW, jsval_undefined()); - jsdisp_release(arg_disp); jsdisp_release(var_disp); return hres; diff --git a/dlls/jscript/global.c b/dlls/jscript/global.c index 33d1f3c..24ec358 100644 --- a/dlls/jscript/global.c +++ b/dlls/jscript/global.c @@ -227,7 +227,7 @@ static HRESULT JSGlobal_eval(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, uns if(frame->flags & EXEC_GLOBAL) exec_flags |= EXEC_GLOBAL; hres = exec_source(ctx, exec_flags, code, &code->global_code, frame->scope, - frame->this_obj, frame->variable_obj, r); + frame->this_obj, frame->variable_obj, NULL, r); release_bytecode(code); return hres; } diff --git a/dlls/jscript/jscript.c b/dlls/jscript/jscript.c index eb336fc..61fa400 100644 --- a/dlls/jscript/jscript.c +++ b/dlls/jscript/jscript.c @@ -107,7 +107,7 @@ static HRESULT exec_global_code(JScript *This, bytecode_t *code) IActiveScriptSite_OnEnterScript(This->site); clear_ei(This->ctx); - hres = exec_source(This->ctx, EXEC_GLOBAL, code, &code->global_code, NULL, NULL, This->ctx->global, NULL); + hres = exec_source(This->ctx, EXEC_GLOBAL, code, &code->global_code, NULL, NULL, This->ctx->global, NULL, NULL); IActiveScriptSite_OnLeaveScript(This->site); return hres; @@ -773,7 +773,7 @@ static HRESULT WINAPI JScriptParse_ParseScriptText(IActiveScriptParse *iface, IActiveScriptSite_OnEnterScript(This->site); clear_ei(This->ctx); - hres = exec_source(This->ctx, EXEC_GLOBAL, code, &code->global_code, NULL, NULL, This->ctx->global, &r); + hres = exec_source(This->ctx, EXEC_GLOBAL, code, &code->global_code, NULL, NULL, This->ctx->global, NULL, &r); if(SUCCEEDED(hres)) { if(pvarResult) hres = jsval_to_variant(r, pvarResult);
1
0
0
0
Jacek Caban : jscript: Moved more return object logic to enter_bytecode loop.
by Alexandre Julliard
29 Mar '16
29 Mar '16
Module: wine Branch: master Commit: cb317ed5b83012628a9386ecf24a2180e71c7489 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cb317ed5b83012628a9386ecf…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 28 17:50:39 2016 +0200 jscript: Moved more return object logic to enter_bytecode loop. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/engine.c | 64 ++++++++++++++++++++++----------------------------- 1 file changed, 28 insertions(+), 36 deletions(-) diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index b14ec2d..4616853 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -2392,7 +2392,7 @@ static void release_call_frame(call_frame_t *frame) heap_free(frame); } -static HRESULT unwind_exception(script_ctx_t *ctx) +static HRESULT unwind_exception(script_ctx_t *ctx, HRESULT exception_hres) { call_frame_t *frame = ctx->call_ctx; except_frame_t *except_frame; @@ -2400,6 +2400,17 @@ static HRESULT unwind_exception(script_ctx_t *ctx) BSTR ident; HRESULT hres; + if(!frame->except_frame) { + while(frame->scope != frame->base_scope) + scope_pop(&frame->scope); + + stack_popn(ctx, ctx->stack_top-frame->stack_base); + + ctx->call_ctx = frame->prev_frame; + release_call_frame(frame); + return exception_hres; + } + except_frame = frame->except_frame; frame->except_frame = except_frame->next; @@ -2444,7 +2455,7 @@ static HRESULT unwind_exception(script_ctx_t *ctx) return hres; } -static HRESULT enter_bytecode(script_ctx_t *ctx, jsval_t *ret) +static HRESULT enter_bytecode(script_ctx_t *ctx, jsval_t *r) { call_frame_t *frame; jsop_t op; @@ -2454,40 +2465,30 @@ static HRESULT enter_bytecode(script_ctx_t *ctx, jsval_t *ret) frame = ctx->call_ctx; - while(frame->ip != -1) { + while(1) { op = frame->bytecode->instrs[frame->ip].op; hres = op_funcs[op](ctx); if(FAILED(hres)) { TRACE("EXCEPTION %08x\n", hres); - if(!frame->except_frame) - break; - - hres = unwind_exception(ctx); + hres = unwind_exception(ctx, hres); if(FAILED(hres)) - break; + return hres; + }else if(frame->ip == -1) { + assert(ctx->stack_top == frame->stack_base); + assert(frame->scope == frame->base_scope); + + ctx->call_ctx = frame->prev_frame; + if(r) + *r = steal_ret(frame); + release_call_frame(frame); + break; }else { frame->ip += op_move[op]; } } - assert(ctx->call_ctx == frame); - - if(FAILED(hres)) { - while(frame->scope != frame->base_scope) - scope_pop(&frame->scope); - stack_popn(ctx, ctx->stack_top-frame->stack_base); - } - - assert(ctx->stack_top == frame->stack_base); - assert(frame->scope == frame->base_scope); - ctx->call_ctx = frame->prev_frame; - - if(SUCCEEDED(hres)) - *ret = steal_ret(frame); - - release_call_frame(frame); - return hres; + return S_OK; } static HRESULT bind_event_target(script_ctx_t *ctx, function_code_t *func, jsdisp_t *func_obj) @@ -2528,10 +2529,9 @@ static HRESULT bind_event_target(script_ctx_t *ctx, function_code_t *func, jsdis } HRESULT exec_source(script_ctx_t *ctx, DWORD flags, bytecode_t *bytecode, function_code_t *function, scope_chain_t *scope, - IDispatch *this_obj, jsdisp_t *variable_obj, jsval_t *ret) + IDispatch *this_obj, jsdisp_t *variable_obj, jsval_t *r) { call_frame_t *frame; - jsval_t val; unsigned i; HRESULT hres; @@ -2603,13 +2603,5 @@ HRESULT exec_source(script_ctx_t *ctx, DWORD flags, bytecode_t *bytecode, functi frame->prev_frame = ctx->call_ctx; ctx->call_ctx = frame; - hres = enter_bytecode(ctx, &val); - if(FAILED(hres)) - return hres; - - if(ret) - *ret = val; - else - jsval_release(val); - return S_OK; + return enter_bytecode(ctx, r); }
1
0
0
0
Jacek Caban : jscript: Keep reference to bytecode in call_frame_t.
by Alexandre Julliard
29 Mar '16
29 Mar '16
Module: wine Branch: master Commit: 8c1526a865280be7d713b21a1cca6c8e4c95c95a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8c1526a865280be7d713b21a1…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 28 17:50:18 2016 +0200 jscript: Keep reference to bytecode in call_frame_t. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/engine.c | 3 ++- dlls/jscript/engine.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 802e408..b14ec2d 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -2388,6 +2388,7 @@ static void release_call_frame(call_frame_t *frame) if(frame->scope) scope_release(frame->scope); jsval_release(frame->ret); + release_bytecode(frame->bytecode); heap_free(frame); } @@ -2579,7 +2580,7 @@ HRESULT exec_source(script_ctx_t *ctx, DWORD flags, bytecode_t *bytecode, functi if(!frame) return E_OUTOFMEMORY; - frame->bytecode = bytecode; + frame->bytecode = bytecode_addref(bytecode); frame->function = function; frame->ip = function->instr_off; frame->stack_base = ctx->stack_top; diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index 4915b60..4b3bba2 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -168,9 +168,10 @@ typedef struct _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; -static inline void bytecode_addref(bytecode_t *code) +static inline bytecode_t *bytecode_addref(bytecode_t *code) { code->ref++; + return code; } typedef struct _scope_chain_t {
1
0
0
0
Jacek Caban : jscript: Merge setup_call_frame into exec_source.
by Alexandre Julliard
29 Mar '16
29 Mar '16
Module: wine Branch: master Commit: db0fee5e9d3f8e1c3a9dbd7c98f3c952281ece39 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=db0fee5e9d3f8e1c3a9dbd7c9…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 28 17:50:08 2016 +0200 jscript: Merge setup_call_frame into exec_source. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/engine.c | 82 ++++++++++++++++++++++----------------------------- 1 file changed, 36 insertions(+), 46 deletions(-) diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 4d7c175..802e408 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -2443,7 +2443,7 @@ static HRESULT unwind_exception(script_ctx_t *ctx) return hres; } -static HRESULT enter_bytecode(script_ctx_t *ctx, function_code_t *func, jsval_t *ret) +static HRESULT enter_bytecode(script_ctx_t *ctx, jsval_t *ret) { call_frame_t *frame; jsop_t op; @@ -2526,10 +2526,42 @@ static HRESULT bind_event_target(script_ctx_t *ctx, function_code_t *func, jsdis return hres; } -static HRESULT setup_call_frame(script_ctx_t *ctx, DWORD flags, bytecode_t *bytecode, function_code_t *function, scope_chain_t *scope, - IDispatch *this_obj, jsdisp_t *variable_obj) +HRESULT exec_source(script_ctx_t *ctx, DWORD flags, bytecode_t *bytecode, function_code_t *function, scope_chain_t *scope, + IDispatch *this_obj, jsdisp_t *variable_obj, jsval_t *ret) { call_frame_t *frame; + jsval_t val; + unsigned i; + HRESULT hres; + + for(i = 0; i < function->func_cnt; i++) { + jsdisp_t *func_obj; + + if(!function->funcs[i].name) + continue; + + hres = create_source_function(ctx, bytecode, function->funcs+i, scope, &func_obj); + if(FAILED(hres)) + return hres; + + if(function->funcs[i].event_target) + hres = bind_event_target(ctx, function->funcs+i, func_obj); + else + hres = jsdisp_propput_name(variable_obj, function->funcs[i].name, jsval_obj(func_obj)); + jsdisp_release(func_obj); + if(FAILED(hres)) + return hres; + } + + for(i=0; i < function->var_cnt; i++) { + if(!(flags & EXEC_GLOBAL) || !lookup_global_members(ctx, function->variables[i], NULL)) { + DISPID id = 0; + + hres = jsdisp_get_id(variable_obj, function->variables[i], fdexNameEnsure, &id); + if(FAILED(hres)) + return hres; + } + } /* ECMA-262 3rd Edition 11.2.3.7 */ if(this_obj) { @@ -2569,50 +2601,8 @@ static HRESULT setup_call_frame(script_ctx_t *ctx, DWORD flags, bytecode_t *byte frame->prev_frame = ctx->call_ctx; ctx->call_ctx = frame; - return S_OK; -} - -HRESULT exec_source(script_ctx_t *ctx, DWORD flags, bytecode_t *code, function_code_t *func, scope_chain_t *scope, - IDispatch *this_obj, jsdisp_t *variable_obj, jsval_t *ret) -{ - jsval_t val; - unsigned i; - HRESULT hres = S_OK; - - for(i = 0; i < func->func_cnt; i++) { - jsdisp_t *func_obj; - - if(!func->funcs[i].name) - continue; - - hres = create_source_function(ctx, code, func->funcs+i, scope, &func_obj); - if(FAILED(hres)) - return hres; - - if(func->funcs[i].event_target) - hres = bind_event_target(ctx, func->funcs+i, func_obj); - else - hres = jsdisp_propput_name(variable_obj, func->funcs[i].name, jsval_obj(func_obj)); - jsdisp_release(func_obj); - if(FAILED(hres)) - return hres; - } - - for(i=0; i < func->var_cnt; i++) { - if(!(flags & EXEC_GLOBAL) || !lookup_global_members(ctx, func->variables[i], NULL)) { - DISPID id = 0; - - hres = jsdisp_get_id(variable_obj, func->variables[i], fdexNameEnsure, &id); - if(FAILED(hres)) - return hres; - } - } - - hres = setup_call_frame(ctx, flags, code, func, scope, this_obj, variable_obj); - if(FAILED(hres)) - return hres; - hres = enter_bytecode(ctx, func, &val); + hres = enter_bytecode(ctx, &val); if(FAILED(hres)) return hres;
1
0
0
0
← Newer
1
...
7
8
9
10
11
12
13
...
73
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Results per page:
10
25
50
100
200