Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
375ab889
Commit
375ab889
authored
Apr 24, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 24, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Store source code range in function_code_t.
parent
8c533d10
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
13 deletions
+15
-13
compile.c
dlls/jscript/compile.c
+5
-0
engine.c
dlls/jscript/engine.c
+2
-2
engine.h
dlls/jscript/engine.h
+4
-1
function.c
dlls/jscript/function.c
+3
-9
jscript.c
dlls/jscript/jscript.c
+1
-1
No files found.
dlls/jscript/compile.c
View file @
375ab889
...
...
@@ -1804,6 +1804,11 @@ static HRESULT compile_function(compiler_ctx_t *ctx, source_elements_t *source,
return
E_OUTOFMEMORY
;
}
if
(
func_expr
)
{
func
->
source
=
func_expr
->
src_str
;
func
->
source_len
=
func_expr
->
src_len
;
}
func
->
source_elements
=
source
;
func
->
expr
=
func_expr
;
...
...
dlls/jscript/engine.c
View file @
375ab889
...
...
@@ -814,7 +814,7 @@ static HRESULT interp_func(exec_ctx_t *ctx)
expr
=
ctx
->
func_code
->
funcs
[
func_idx
].
expr
;
hres
=
create_source_function
(
ctx
->
script
,
ctx
->
code
,
expr
->
parameter_list
,
ctx
->
func_code
->
funcs
+
func_idx
,
ctx
->
scope_chain
,
expr
->
src_str
,
expr
->
src_len
,
&
dispex
);
ctx
->
scope_chain
,
&
dispex
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -2629,7 +2629,7 @@ HRESULT exec_source(exec_ctx_t *ctx, bytecode_t *code, function_code_t *func, BO
expr
=
func
->
funcs
[
i
].
expr
;
hres
=
create_source_function
(
ctx
->
script
,
code
,
expr
->
parameter_list
,
func
->
funcs
+
i
,
ctx
->
scope_chain
,
expr
->
src_str
,
expr
->
src_len
,
&
func_obj
);
ctx
->
scope_chain
,
&
func_obj
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/jscript/engine.h
View file @
375ab889
...
...
@@ -173,6 +173,9 @@ typedef struct _function_code_t {
function_expression_t
*
expr
;
/* FIXME */
source_elements_t
*
source_elements
;
/* FIXME */
const
WCHAR
*
source
;
unsigned
source_len
;
unsigned
func_cnt
;
struct
_function_code_t
*
funcs
;
}
function_code_t
;
...
...
@@ -268,7 +271,7 @@ HRESULT exec_source(exec_ctx_t*,bytecode_t*,function_code_t*,BOOL,jsexcept_t*,VA
typedef
struct
_parameter_t
parameter_t
;
HRESULT
create_source_function
(
script_ctx_t
*
,
bytecode_t
*
,
parameter_t
*
,
function_code_t
*
,
scope_chain_t
*
,
const
WCHAR
*
,
DWORD
,
jsdisp_t
**
)
DECLSPEC_HIDDEN
;
jsdisp_t
**
)
DECLSPEC_HIDDEN
;
typedef
enum
{
LT_INT
,
...
...
dlls/jscript/function.c
View file @
375ab889
...
...
@@ -32,8 +32,6 @@ typedef struct {
scope_chain_t
*
scope_chain
;
bytecode_t
*
code
;
function_code_t
*
func_code
;
const
WCHAR
*
src_str
;
DWORD
src_len
;
DWORD
length
;
jsdisp_t
*
arguments
;
}
FunctionInstance
;
...
...
@@ -303,7 +301,7 @@ static HRESULT function_to_string(FunctionInstance *function, BSTR *ret)
memcpy
(
str
+
sizeof
(
native_prefixW
)
/
sizeof
(
WCHAR
),
function
->
name
,
name_len
*
sizeof
(
WCHAR
));
memcpy
(
str
+
sizeof
(
native_prefixW
)
/
sizeof
(
WCHAR
)
+
name_len
,
native_suffixW
,
sizeof
(
native_suffixW
));
}
else
{
str
=
SysAllocStringLen
(
function
->
src_str
,
function
->
src
_len
);
str
=
SysAllocStringLen
(
function
->
func_code
->
source
,
function
->
func_code
->
source
_len
);
if
(
!
str
)
return
E_OUTOFMEMORY
;
}
...
...
@@ -661,7 +659,7 @@ HRESULT create_builtin_function(script_ctx_t *ctx, builtin_invoke_t value_proc,
}
HRESULT
create_source_function
(
script_ctx_t
*
ctx
,
bytecode_t
*
code
,
parameter_t
*
parameters
,
function_code_t
*
func_code
,
scope_chain_t
*
scope_chain
,
const
WCHAR
*
src_str
,
DWORD
src_len
,
jsdisp_t
**
ret
)
scope_chain_t
*
scope_chain
,
jsdisp_t
**
ret
)
{
FunctionInstance
*
function
;
jsdisp_t
*
prototype
;
...
...
@@ -698,9 +696,6 @@ HRESULT create_source_function(script_ctx_t *ctx, bytecode_t *code, parameter_t
length
++
;
function
->
length
=
length
;
function
->
src_str
=
src_str
;
function
->
src_len
=
src_len
;
*
ret
=
&
function
->
dispex
;
return
S_OK
;
}
...
...
@@ -786,8 +781,7 @@ static HRESULT construct_function(script_ctx_t *ctx, DISPPARAMS *dp, jsexcept_t
}
expr
=
code
->
global_code
.
funcs
[
0
].
expr
;
hres
=
create_source_function
(
ctx
,
code
,
expr
->
parameter_list
,
code
->
global_code
.
funcs
,
NULL
,
expr
->
src_str
,
expr
->
src_len
,
&
function
);
hres
=
create_source_function
(
ctx
,
code
,
expr
->
parameter_list
,
code
->
global_code
.
funcs
,
NULL
,
&
function
);
release_bytecode
(
code
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/jscript/jscript.c
View file @
375ab889
...
...
@@ -836,7 +836,7 @@ static HRESULT WINAPI JScriptParseProcedure_ParseProcedureText(IActiveScriptPars
return
hres
;
}
hres
=
create_source_function
(
This
->
ctx
,
code
,
NULL
,
&
code
->
global_code
,
NULL
,
NULL
,
0
,
&
dispex
);
hres
=
create_source_function
(
This
->
ctx
,
code
,
NULL
,
&
code
->
global_code
,
NULL
,
&
dispex
);
release_bytecode
(
code
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment