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
December 2011
----- 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
810 discussions
Start a n
N
ew thread
Matteo Bruni : d3d9/tests: More D3DTSS_TEXTURETRANSFORMFLAGS projection tests.
by Alexandre Julliard
28 Dec '11
28 Dec '11
Module: wine Branch: master Commit: 8dee7989f242b8ea624abc3b1fe929494d1fd329 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8dee7989f242b8ea624abc3b1…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Tue Dec 27 17:28:59 2011 +0100 d3d9/tests: More D3DTSS_TEXTURETRANSFORMFLAGS projection tests. --- dlls/d3d9/tests/visual.c | 388 ++++++++++++++++++++++++++++++++-------------- 1 files changed, 269 insertions(+), 119 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=8dee7989f242b8ea624ab…
1
0
0
0
Matteo Bruni : wined3d: Improve projection TEXTURETRANSFORMFLAGS handling in the ARB fragment ffp implementation .
by Alexandre Julliard
28 Dec '11
28 Dec '11
Module: wine Branch: master Commit: fb38bad0c41359b97923b3a33e1fb65c36db5b4d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fb38bad0c41359b97923b3a33…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Tue Dec 27 17:28:58 2011 +0100 wined3d: Improve projection TEXTURETRANSFORMFLAGS handling in the ARB fragment ffp implementation. --- dlls/wined3d/utils.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 7786788..a521f4b 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -3035,14 +3035,14 @@ void gen_ffp_frag_op(const struct wined3d_device *device, const struct wined3d_s { ttff = state->texture_states[i][WINED3DTSS_TEXTURETRANSFORMFLAGS]; if (ttff == (WINED3DTTFF_PROJECTED | WINED3DTTFF_COUNT3)) - { settings->op[i].projected = proj_count3; - } else if(ttff == (WINED3DTTFF_PROJECTED | WINED3DTTFF_COUNT4)) { + else if (ttff & WINED3DTTFF_PROJECTED) settings->op[i].projected = proj_count4; - } else { + else settings->op[i].projected = proj_none; - } - } else { + } + else + { settings->op[i].projected = proj_none; }
1
0
0
0
Matteo Bruni : wined3d: Improve invalid TEXTURETRANSFORMFLAGS handling.
by Alexandre Julliard
28 Dec '11
28 Dec '11
Module: wine Branch: master Commit: 472fed41dd6238f9aead069da1d46f609daf425c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=472fed41dd6238f9aead069da…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Tue Dec 27 17:28:57 2011 +0100 wined3d: Improve invalid TEXTURETRANSFORMFLAGS handling. --- dlls/wined3d/shader.c | 37 ++++++++++++++++++++++++++++++++----- 1 files changed, 32 insertions(+), 5 deletions(-) diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index 313ed9b..b3d2f7f 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -1911,20 +1911,46 @@ void find_ps_compile_args(const struct wined3d_state *state, for (i = 0; i < 4; ++i) { DWORD flags = state->texture_states[i][WINED3DTSS_TEXTURETRANSFORMFLAGS]; - DWORD count, tex_transform; + DWORD count, tex_transform = 0; /* Filter some invalid flags */ count = flags & ~WINED3DTTFF_PROJECTED; - if (count > WINED3DTTFF_COUNT4) + if (count > WINED3DTTFF_COUNT4 || (!(flags & WINED3DTTFF_PROJECTED) && count != 0)) { - WARN("The application set an invalid TEXTURETRANSFORMFLAGS value.\n"); - flags = count = 0; + WARN("The application set an invalid %#x TEXTURETRANSFORMFLAGS value.\n", flags); + count = 0; } - tex_transform = count; if (flags & WINED3DTTFF_PROJECTED) { enum wined3d_sampler_texture_type sampler_type = shader->reg_maps.sampler_type[i]; + DWORD max_valid = WINED3DTTFF_COUNT4; + + if (!count) + count = WINED3DTTFF_COUNT4; + + if (!state->vertex_shader) + { + unsigned int j; + unsigned int index = state->texture_states[i][WINED3DTSS_TEXCOORDINDEX]; + for (j = 0; j < state->vertex_declaration->element_count; ++j) + { + struct wined3d_vertex_declaration_element *element = + &state->vertex_declaration->elements[j]; + + if (element->usage == WINED3DDECLUSAGE_TEXCOORD + && element->usage_idx == index) + { + max_valid = element->format->component_count; + break; + } + } + } + + tex_transform = min(count, max_valid); + if (tex_transform != (flags & ~WINED3DTTFF_PROJECTED)) + WARN("Fixing up %#x projected texture transform flag to %#x.\n", + flags & ~WINED3DTTFF_PROJECTED, tex_transform); if ((sampler_type == WINED3DSTT_1D && tex_transform > WINED3DTTFF_COUNT1) || (sampler_type == WINED3DSTT_2D && tex_transform > WINED3DTTFF_COUNT2) @@ -1933,6 +1959,7 @@ void find_ps_compile_args(const struct wined3d_state *state, else WARN("Application requested projected texture with unsuitable texture coordinates.\n"); } + tex_transform &= WINED3D_PSARGS_TEXTRANSFORM_MASK; args->tex_transform |= tex_transform << i * WINED3D_PSARGS_TEXTRANSFORM_SHIFT; } }
1
0
0
0
Nikolay Sivov : msxml3: Implement element stack and use it in related callbacks.
by Alexandre Julliard
28 Dec '11
28 Dec '11
Module: wine Branch: master Commit: 9d662928f5ea228a8dbcd1fd1283309a06d8d3e1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9d662928f5ea228a8dbcd1fd1…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sat Dec 24 16:10:33 2011 +0300 msxml3: Implement element stack and use it in related callbacks. --- dlls/msxml3/saxreader.c | 415 ++++++++++++++++++++--------------------- dlls/msxml3/tests/saxreader.c | 15 +- 2 files changed, 218 insertions(+), 212 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=9d662928f5ea228a8dbcd…
1
0
0
0
Piotr Caban : msvcrt: NULL terminate strings returned by _Getdays and _Getmonths.
by Alexandre Julliard
28 Dec '11
28 Dec '11
Module: wine Branch: master Commit: 17f0ee46220ada879b101433f6cbdd507cc8728f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=17f0ee46220ada879b101433f…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Dec 28 16:29:07 2011 +0100 msvcrt: NULL terminate strings returned by _Getdays and _Getmonths. --- dlls/msvcrt/locale.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c index 60ea424..699b028 100644 --- a/dlls/msvcrt/locale.c +++ b/dlls/msvcrt/locale.c @@ -444,6 +444,7 @@ char* CDECL _Getdays(void) memcpy(&out[size], cur->str[7+i], len); size += len; } + out[size] = '\0'; return out; } @@ -478,6 +479,7 @@ char* CDECL _Getmonths(void) memcpy(&out[size], cur->str[months_offset+12+i], len); size += len; } + out[size] = '\0'; return out; }
1
0
0
0
Jacek Caban : mshtml: Use IURi for IHTMLLocation::get_hash implementation.
by Alexandre Julliard
28 Dec '11
28 Dec '11
Module: wine Branch: master Commit: dfeec5a2bf834ed2e6cc346973ba11d8923a978c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dfeec5a2bf834ed2e6cc34697…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Dec 28 13:09:51 2011 +0100 mshtml: Use IURi for IHTMLLocation::get_hash implementation. --- dlls/mshtml/htmllocation.c | 28 ++++++++++++---------------- 1 files changed, 12 insertions(+), 16 deletions(-) diff --git a/dlls/mshtml/htmllocation.c b/dlls/mshtml/htmllocation.c index b3354f0..cd24f12 100644 --- a/dlls/mshtml/htmllocation.c +++ b/dlls/mshtml/htmllocation.c @@ -504,9 +504,7 @@ static HRESULT WINAPI HTMLLocation_put_hash(IHTMLLocation *iface, BSTR v) static HRESULT WINAPI HTMLLocation_get_hash(IHTMLLocation *iface, BSTR *p) { HTMLLocation *This = impl_from_IHTMLLocation(iface); - URL_COMPONENTSW url = {sizeof(URL_COMPONENTSW)}; - const WCHAR hash[] = {'#',0}; - DWORD hash_pos = 0; + BSTR hash; HRESULT hres; TRACE("(%p)->(%p)\n", This, p); @@ -514,23 +512,21 @@ static HRESULT WINAPI HTMLLocation_get_hash(IHTMLLocation *iface, BSTR *p) if(!p) return E_POINTER; - url.dwExtraInfoLength = 1; - hres = get_url_components(This, &url); - if(FAILED(hres)) - return hres; + if(!This->window || !This->window->uri) { + FIXME("No current URI\n"); + return E_NOTIMPL; + } - if(!url.dwExtraInfoLength){ + hres = IUri_GetFragment(This->window->uri, &hash); + if(hres == S_OK) { + *p = hash; + }else if(hres == S_FALSE) { + SysFreeString(hash); *p = NULL; - return S_OK; + }else { + return hres; } - hash_pos = strcspnW(url.lpszExtraInfo, hash); - url.dwExtraInfoLength -= hash_pos; - - *p = SysAllocStringLen(url.lpszExtraInfo + hash_pos, url.dwExtraInfoLength); - - if(!*p) - return E_OUTOFMEMORY; return S_OK; }
1
0
0
0
Jacek Caban : jscript: Added more control flow tests.
by Alexandre Julliard
28 Dec '11
28 Dec '11
Module: wine Branch: master Commit: d7fd00fdab1ab00b1d1fa2b58e4d431c6110e2be URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d7fd00fdab1ab00b1d1fa2b58…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Dec 28 12:07:15 2011 +0100 jscript: Added more control flow tests. --- dlls/jscript/tests/lang.js | 58 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 58 insertions(+), 0 deletions(-) diff --git a/dlls/jscript/tests/lang.js b/dlls/jscript/tests/lang.js index 7eabdcf..d7182c6 100644 --- a/dlls/jscript/tests/lang.js +++ b/dlls/jscript/tests/lang.js @@ -839,6 +839,64 @@ for(tmp in obj1.nonexistent) ok(false, "for(tmp in obj1.nonexistent) called with tmp = " + tmp); ok(!("nonexistent" in obj1), "nonexistent added to obj1 by for..in loop"); +var i, j; + + +tmp = ""; +i = 0; +while(true) { + tmp += "1"; + for(i = 1; i < 3; i++) { + switch(i) { + case 1: + tmp += "2"; + continue; + case 2: + tmp += "3"; + try { + throw null; + }finally { + tmp += "4"; + break; + } + default: + ok(false, "unexpected state"); + } + tmp += "5"; + } + with({prop: "6"}) { + tmp += prop; + break; + } +} +ok(tmp === "123456", "tmp = " + tmp); + +tmp = ""; +i = 0; +for(j in [1,2,3]) { + tmp += "1"; + for(;;) { + with({prop: "2"}) { + tmp += prop; + try { + throw "3"; + }catch(e) { + tmp += e; + with([0]) + break; + } + } + ok(false, "unexpected state"); + } + while(true) { + tmp += "4"; + break; + } + break; +} +ok(tmp === "1234", "tmp = " + tmp); + + ok((void 1) === undefined, "(void 1) !== undefined"); var inobj = new Object();
1
0
0
0
Jacek Caban : jscript: Get rid of no longer needed no_fallback hack.
by Alexandre Julliard
28 Dec '11
28 Dec '11
Module: wine Branch: master Commit: 8f8c8528972c8c371335663f78657811aecacd49 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8f8c8528972c8c371335663f7…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Dec 28 12:07:06 2011 +0100 jscript: Get rid of no longer needed no_fallback hack. --- dlls/jscript/compile.c | 33 --------------------------------- dlls/jscript/engine.c | 6 ++++-- 2 files changed, 4 insertions(+), 35 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index bf2d3dd..9d1081e 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -49,8 +49,6 @@ struct _compiler_ctx_t { unsigned labels_cnt; statement_ctx_t *stat_ctx; - - BOOL no_fallback; }; static const struct { @@ -483,9 +481,6 @@ static HRESULT compile_interp_fallback(compiler_ctx_t *ctx, statement_t *stat) { unsigned instr; - if(ctx->no_fallback) - return E_NOTIMPL; - instr = push_instr(ctx, OP_tree); if(instr == -1) return E_OUTOFMEMORY; @@ -1021,7 +1016,6 @@ static HRESULT compile_while_statement(compiler_ctx_t *ctx, while_statement_t *s { statement_ctx_t stat_ctx = {0, FALSE, FALSE}; unsigned off_backup, jmp_off; - BOOL prev_no_fallback; HRESULT hres; off_backup = ctx->code_off; @@ -1055,10 +1049,7 @@ static HRESULT compile_while_statement(compiler_ctx_t *ctx, while_statement_t *s jmp_off = ctx->code_off; } - prev_no_fallback = ctx->no_fallback; - ctx->no_fallback = TRUE; hres = compile_statement(ctx, &stat_ctx, stat->statement); - ctx->no_fallback = prev_no_fallback; if(hres == E_NOTIMPL) { ctx->code_off = off_backup; stat->stat.eval = while_statement_eval; @@ -1094,7 +1085,6 @@ static HRESULT compile_for_statement(compiler_ctx_t *ctx, for_statement_t *stat) { statement_ctx_t stat_ctx = {0, FALSE, FALSE}; unsigned off_backup, expr_off; - BOOL prev_no_fallback; HRESULT hres; off_backup = ctx->code_off; @@ -1140,10 +1130,7 @@ static HRESULT compile_for_statement(compiler_ctx_t *ctx, for_statement_t *stat) if(push_instr(ctx, OP_pop) == -1) return E_OUTOFMEMORY; - prev_no_fallback = ctx->no_fallback; - ctx->no_fallback = TRUE; hres = compile_statement(ctx, &stat_ctx, stat->statement); - ctx->no_fallback = prev_no_fallback; if(hres == E_NOTIMPL) { ctx->code_off = off_backup; stat->stat.eval = for_statement_eval; @@ -1178,7 +1165,6 @@ static HRESULT compile_forin_statement(compiler_ctx_t *ctx, forin_statement_t *s { statement_ctx_t stat_ctx = {4, FALSE, FALSE}; unsigned off_backup = ctx->code_off; - BOOL prev_no_fallback; HRESULT hres; if(stat->variable) { @@ -1229,10 +1215,7 @@ static HRESULT compile_forin_statement(compiler_ctx_t *ctx, forin_statement_t *s if(FAILED(hres)) return E_OUTOFMEMORY; - prev_no_fallback = ctx->no_fallback; - ctx->no_fallback = TRUE; hres = compile_statement(ctx, &stat_ctx, stat->statement); - ctx->no_fallback = prev_no_fallback; if(hres == E_NOTIMPL) { ctx->code_off = off_backup; stat->stat.eval = forin_statement_eval; @@ -1331,7 +1314,6 @@ static HRESULT compile_with_statement(compiler_ctx_t *ctx, with_statement_t *sta { statement_ctx_t stat_ctx = {0, TRUE, FALSE, -1, -1}; unsigned off_backup; - BOOL prev_no_fallback; HRESULT hres; off_backup = ctx->code_off; @@ -1343,10 +1325,7 @@ static HRESULT compile_with_statement(compiler_ctx_t *ctx, with_statement_t *sta if(push_instr(ctx, OP_push_scope) == -1) return E_OUTOFMEMORY; - prev_no_fallback = ctx->no_fallback; - ctx->no_fallback = TRUE; hres = compile_statement(ctx, &stat_ctx, stat->statement); - ctx->no_fallback = prev_no_fallback; if(hres == E_NOTIMPL) { ctx->code_off = off_backup; stat->stat.eval = with_statement_eval; @@ -1370,7 +1349,6 @@ static HRESULT compile_switch_statement(compiler_ctx_t *ctx, switch_statement_t statement_t *stat_iter; case_clausule_t *iter; unsigned off_backup; - BOOL prev_no_fallback; HRESULT hres; off_backup = ctx->code_off; @@ -1436,10 +1414,7 @@ static HRESULT compile_switch_statement(compiler_ctx_t *ctx, switch_statement_t instr_ptr(ctx, iter->expr ? case_jmps[i++] : default_jmp)->arg1.uint = ctx->code_off; for(stat_iter = iter->stat; stat_iter && (!iter->next || iter->next->stat != stat_iter); stat_iter = stat_iter->next) { - prev_no_fallback = ctx->no_fallback; - ctx->no_fallback = TRUE; hres = compile_statement(ctx, &stat_ctx, stat_iter); - ctx->no_fallback = prev_no_fallback; if(hres == E_NOTIMPL) { ctx->code_off = off_backup; stat->stat.eval = switch_statement_eval; @@ -1487,12 +1462,10 @@ static HRESULT compile_try_statement(compiler_ctx_t *ctx, try_statement_t *stat) statement_ctx_t try_ctx = {0, FALSE, TRUE, -1, -1}, catch_ctx = {0, TRUE, FALSE, -1, -1}; statement_ctx_t finally_ctx = {2, FALSE, FALSE, -1, -1}; unsigned off_backup, push_except; - BOOL prev_no_fallback; BSTR ident; HRESULT hres; off_backup = ctx->code_off; - prev_no_fallback = ctx->no_fallback; push_except = push_instr(ctx, OP_push_except); if(push_except == -1) @@ -1511,9 +1484,7 @@ static HRESULT compile_try_statement(compiler_ctx_t *ctx, try_statement_t *stat) if(!stat->catch_block) try_ctx.stack_use = 2; - ctx->no_fallback = TRUE; hres = compile_statement(ctx, &try_ctx, stat->try_statement); - ctx->no_fallback = prev_no_fallback; if(hres == E_NOTIMPL) { ctx->code_off = off_backup; stat->stat.eval = try_statement_eval; @@ -1534,9 +1505,7 @@ static HRESULT compile_try_statement(compiler_ctx_t *ctx, try_statement_t *stat) instr_ptr(ctx, push_except)->arg1.uint = ctx->code_off; - ctx->no_fallback = TRUE; hres = compile_statement(ctx, &catch_ctx, stat->catch_block->statement); - ctx->no_fallback = prev_no_fallback; if(hres == E_NOTIMPL) { ctx->code_off = off_backup; stat->stat.eval = try_statement_eval; @@ -1558,9 +1527,7 @@ static HRESULT compile_try_statement(compiler_ctx_t *ctx, try_statement_t *stat) if(push_instr(ctx, OP_pop) == -1) return E_OUTOFMEMORY; - ctx->no_fallback = TRUE; hres = compile_statement(ctx, stat->catch_block ? NULL : &finally_ctx, stat->finally_statement); - ctx->no_fallback = prev_no_fallback; if(hres == E_NOTIMPL) { ctx->code_off = off_backup; stat->stat.eval = try_statement_eval; diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index bbf4fbd..0d97765 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -3265,10 +3265,12 @@ HRESULT compiled_statement_eval(script_ctx_t *ctx, statement_t *stat, return_typ exec_ctx->ei = prev_ei; exec_ctx->except_frame = prev_except_frame; - if(FAILED(hres)) { - stack_popn(exec_ctx, exec_ctx->top-prev_top); + if(FAILED(hres) || rt->type != RT_NORMAL) { while(exec_ctx->scope_chain != prev_scope) scope_pop(&exec_ctx->scope_chain); + } + if(FAILED(hres)) { + stack_popn(exec_ctx, exec_ctx->top-prev_top); return hres; }
1
0
0
0
Jacek Caban : jscript: Added bytecode versions of break and continue statements.
by Alexandre Julliard
28 Dec '11
28 Dec '11
Module: wine Branch: master Commit: c5c2276a9f427825e5ce896f8f37cd2c3fdd9fb3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c5c2276a9f427825e5ce896f8…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Dec 28 12:06:55 2011 +0100 jscript: Added bytecode versions of break and continue statements. --- dlls/jscript/compile.c | 113 +++++++++++++++++++++++++++++++++++++++++++++--- dlls/jscript/parser.y | 4 +- 2 files changed, 109 insertions(+), 8 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index fa793ce..bf2d3dd 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -32,6 +32,7 @@ typedef struct _statement_ctx_t { BOOL using_except; unsigned break_label; + unsigned continue_label; struct _statement_ctx_t *next; } statement_ctx_t; @@ -1029,12 +1030,17 @@ static HRESULT compile_while_statement(compiler_ctx_t *ctx, while_statement_t *s if(stat_ctx.break_label == -1) return E_OUTOFMEMORY; + stat_ctx.continue_label = alloc_label(ctx); + if(stat_ctx.continue_label == -1) + return E_OUTOFMEMORY; + if(!stat->do_while) { /* FIXME: avoid */ if(push_instr(ctx, OP_undefined) == -1) return E_OUTOFMEMORY; jmp_off = ctx->code_off; + label_set_addr(ctx, stat_ctx.continue_label); hres = compile_expression(ctx, stat->expr); if(FAILED(hres)) return hres; @@ -1062,6 +1068,7 @@ static HRESULT compile_while_statement(compiler_ctx_t *ctx, while_statement_t *s return hres; if(stat->do_while) { + label_set_addr(ctx, stat_ctx.continue_label); hres = compile_expression(ctx, stat->expr); if(FAILED(hres)) return hres; @@ -1110,6 +1117,10 @@ static HRESULT compile_for_statement(compiler_ctx_t *ctx, for_statement_t *stat) if(stat_ctx.break_label == -1) return E_OUTOFMEMORY; + stat_ctx.continue_label = alloc_label(ctx); + if(stat_ctx.continue_label == -1) + return E_OUTOFMEMORY; + /* FIXME: avoid */ if(push_instr(ctx, OP_undefined) == -1) return E_OUTOFMEMORY; @@ -1141,6 +1152,8 @@ static HRESULT compile_for_statement(compiler_ctx_t *ctx, for_statement_t *stat) if(FAILED(hres)) return hres; + label_set_addr(ctx, stat_ctx.continue_label); + if(stat->end_expr) { BOOL no_ret = FALSE; @@ -1164,7 +1177,7 @@ static HRESULT compile_for_statement(compiler_ctx_t *ctx, for_statement_t *stat) static HRESULT compile_forin_statement(compiler_ctx_t *ctx, forin_statement_t *stat) { statement_ctx_t stat_ctx = {4, FALSE, FALSE}; - unsigned loop_addr, off_backup = ctx->code_off; + unsigned off_backup = ctx->code_off; BOOL prev_no_fallback; HRESULT hres; @@ -1178,6 +1191,10 @@ static HRESULT compile_forin_statement(compiler_ctx_t *ctx, forin_statement_t *s if(stat_ctx.break_label == -1) return E_OUTOFMEMORY; + stat_ctx.continue_label = alloc_label(ctx); + if(stat_ctx.continue_label == -1) + return E_OUTOFMEMORY; + hres = compile_expression(ctx, stat->in_expr); if(FAILED(hres)) return hres; @@ -1207,7 +1224,7 @@ static HRESULT compile_forin_statement(compiler_ctx_t *ctx, forin_statement_t *s if(push_instr(ctx, OP_undefined) == -1) return E_OUTOFMEMORY; - loop_addr = ctx->code_off; + label_set_addr(ctx, stat_ctx.continue_label); hres = push_instr_uint(ctx, OP_forin, stat_ctx.break_label); if(FAILED(hres)) return E_OUTOFMEMORY; @@ -1224,7 +1241,7 @@ static HRESULT compile_forin_statement(compiler_ctx_t *ctx, forin_statement_t *s if(FAILED(hres)) return hres; - hres = push_instr_uint(ctx, OP_jmp, loop_addr); + hres = push_instr_uint(ctx, OP_jmp, stat_ctx.continue_label); if(FAILED(hres)) return hres; @@ -1232,10 +1249,87 @@ static HRESULT compile_forin_statement(compiler_ctx_t *ctx, forin_statement_t *s return S_OK; } +static HRESULT pop_to_stat(compiler_ctx_t *ctx, statement_ctx_t *stat_ctx) +{ + statement_ctx_t *iter = ctx->stat_ctx; + unsigned stack_pop = 0; + + while(1) { + if(iter->using_scope && push_instr(ctx, OP_pop_scope) == -1) + return E_OUTOFMEMORY; + if(iter->using_except && push_instr(ctx, OP_pop_except) == -1) + return E_OUTOFMEMORY; + stack_pop += iter->stack_use; + if(iter == stat_ctx) + break; + iter = iter->next; + } + + /* FIXME: optimize */ + while(stack_pop--) { + if(push_instr(ctx, OP_pop) == -1) + return E_OUTOFMEMORY; + } + + return S_OK; +} + +/* ECMA-262 3rd Edition 12.7 */ +static HRESULT compile_continue_statement(compiler_ctx_t *ctx, branch_statement_t *stat) +{ + statement_ctx_t *pop_ctx; + HRESULT hres; + + for(pop_ctx = ctx->stat_ctx; pop_ctx; pop_ctx = pop_ctx->next) { + if(pop_ctx->continue_label != -1) + break; + } + + if(!pop_ctx || stat->identifier) { + stat->stat.eval = continue_statement_eval; + return compile_interp_fallback(ctx, &stat->stat); + } + + hres = pop_to_stat(ctx, pop_ctx); + if(FAILED(hres)) + return hres; + + if(push_instr(ctx, OP_undefined) == -1) + return E_OUTOFMEMORY; + + return push_instr_uint(ctx, OP_jmp, pop_ctx->continue_label); +} + +/* ECMA-262 3rd Edition 12.8 */ +static HRESULT compile_break_statement(compiler_ctx_t *ctx, branch_statement_t *stat) +{ + statement_ctx_t *pop_ctx; + HRESULT hres; + + for(pop_ctx = ctx->stat_ctx; pop_ctx; pop_ctx = pop_ctx->next) { + if(pop_ctx->break_label != -1) + break; + } + + if(!pop_ctx || stat->identifier) { + stat->stat.eval = break_statement_eval; + return compile_interp_fallback(ctx, &stat->stat); + } + + hres = pop_to_stat(ctx, pop_ctx); + if(FAILED(hres)) + return hres; + + if(push_instr(ctx, OP_undefined) == -1) + return E_OUTOFMEMORY; + + return push_instr_uint(ctx, OP_jmp, pop_ctx->break_label); +} + /* ECMA-262 3rd Edition 12.10 */ static HRESULT compile_with_statement(compiler_ctx_t *ctx, with_statement_t *stat) { - statement_ctx_t stat_ctx = {0, TRUE, FALSE, -1}; + statement_ctx_t stat_ctx = {0, TRUE, FALSE, -1, -1}; unsigned off_backup; BOOL prev_no_fallback; HRESULT hres; @@ -1270,8 +1364,8 @@ static HRESULT compile_with_statement(compiler_ctx_t *ctx, with_statement_t *sta /* ECMA-262 3rd Edition 12.13 */ static HRESULT compile_switch_statement(compiler_ctx_t *ctx, switch_statement_t *stat) { + statement_ctx_t stat_ctx = {0, FALSE, FALSE, -1, -1}; unsigned case_cnt = 0, *case_jmps, i, default_jmp; - statement_ctx_t stat_ctx = {0, FALSE, FALSE}; BOOL have_default = FALSE; statement_t *stat_iter; case_clausule_t *iter; @@ -1390,7 +1484,8 @@ static HRESULT compile_throw_statement(compiler_ctx_t *ctx, expression_statement /* ECMA-262 3rd Edition 12.14 */ static HRESULT compile_try_statement(compiler_ctx_t *ctx, try_statement_t *stat) { - statement_ctx_t try_ctx = {0, FALSE, TRUE, -1}, catch_ctx = {0, TRUE, FALSE, -1}, finally_ctx = {2, FALSE, FALSE, -1}; + statement_ctx_t try_ctx = {0, FALSE, TRUE, -1, -1}, catch_ctx = {0, TRUE, FALSE, -1, -1}; + statement_ctx_t finally_ctx = {2, FALSE, FALSE, -1, -1}; unsigned off_backup, push_except; BOOL prev_no_fallback; BSTR ident; @@ -1494,6 +1589,12 @@ static HRESULT compile_statement(compiler_ctx_t *ctx, statement_ctx_t *stat_ctx, case STAT_BLOCK: hres = compile_block_statement(ctx, ((block_statement_t*)stat)->stat_list); break; + case STAT_BREAK: + hres = compile_break_statement(ctx, (branch_statement_t*)stat); + break; + case STAT_CONTINUE: + hres = compile_continue_statement(ctx, (branch_statement_t*)stat); + break; case STAT_EMPTY: hres = push_instr(ctx, OP_undefined) == -1 ? E_OUTOFMEMORY : S_OK; /* FIXME */ break; diff --git a/dlls/jscript/parser.y b/dlls/jscript/parser.y index f9b2ca3..5cf0412 100644 --- a/dlls/jscript/parser.y +++ b/dlls/jscript/parser.y @@ -837,8 +837,8 @@ static BOOL allow_auto_semicolon(parser_ctx_t *ctx) static const statement_eval_t stat_eval_table[] = { compiled_statement_eval, - break_statement_eval, - continue_statement_eval, + compiled_statement_eval, + compiled_statement_eval, compiled_statement_eval, compiled_statement_eval, compiled_statement_eval,
1
0
0
0
Jacek Caban : jscript: Use labels in compiler for ending loops.
by Alexandre Julliard
28 Dec '11
28 Dec '11
Module: wine Branch: master Commit: 80113b5c5cfec2fdd9b9b33a46c1df361546b055 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=80113b5c5cfec2fdd9b9b33a4…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Dec 28 12:06:41 2011 +0100 jscript: Use labels in compiler for ending loops. --- dlls/jscript/compile.c | 216 +++++++++++++++++++++++++++++++++++++---------- dlls/jscript/engine.c | 7 +- dlls/jscript/engine.h | 8 +- 3 files changed, 180 insertions(+), 51 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=80113b5c5cfec2fdd9b9b…
1
0
0
0
← Newer
1
...
8
9
10
11
12
13
14
...
81
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
74
75
76
77
78
79
80
81
Results per page:
10
25
50
100
200