Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
131d0b9f
Commit
131d0b9f
authored
Sep 30, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 01, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Optimize GetDispID usage.
parent
b54f449e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
24 deletions
+26
-24
dispex.c
dlls/jscript/dispex.c
+19
-12
engine.c
dlls/jscript/engine.c
+6
-12
jscript.h
dlls/jscript/jscript.h
+1
-0
No files found.
dlls/jscript/dispex.c
View file @
131d0b9f
...
@@ -517,8 +517,6 @@ static HRESULT WINAPI DispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember,
...
@@ -517,8 +517,6 @@ static HRESULT WINAPI DispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember,
static
HRESULT
WINAPI
DispatchEx_GetDispID
(
IDispatchEx
*
iface
,
BSTR
bstrName
,
DWORD
grfdex
,
DISPID
*
pid
)
static
HRESULT
WINAPI
DispatchEx_GetDispID
(
IDispatchEx
*
iface
,
BSTR
bstrName
,
DWORD
grfdex
,
DISPID
*
pid
)
{
{
DispatchEx
*
This
=
DISPATCHEX_THIS
(
iface
);
DispatchEx
*
This
=
DISPATCHEX_THIS
(
iface
);
dispex_prop_t
*
prop
;
HRESULT
hres
;
TRACE
(
"(%p)->(%s %x %p)
\n
"
,
This
,
debugstr_w
(
bstrName
),
grfdex
,
pid
);
TRACE
(
"(%p)->(%s %x %p)
\n
"
,
This
,
debugstr_w
(
bstrName
),
grfdex
,
pid
);
...
@@ -527,16 +525,7 @@ static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DW
...
@@ -527,16 +525,7 @@ static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DW
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
hres
=
find_prop_name_prot
(
This
,
bstrName
,
(
grfdex
&
fdexNameEnsure
)
!=
0
,
&
prop
);
return
jsdisp_get_id
(
This
,
bstrName
,
grfdex
,
pid
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
prop
)
{
*
pid
=
prop_to_id
(
This
,
prop
);
return
S_OK
;
}
TRACE
(
"not found %s
\n
"
,
debugstr_w
(
bstrName
));
return
DISP_E_UNKNOWNNAME
;
}
}
static
HRESULT
WINAPI
DispatchEx_InvokeEx
(
IDispatchEx
*
iface
,
DISPID
id
,
LCID
lcid
,
WORD
wFlags
,
DISPPARAMS
*
pdp
,
static
HRESULT
WINAPI
DispatchEx_InvokeEx
(
IDispatchEx
*
iface
,
DISPID
id
,
LCID
lcid
,
WORD
wFlags
,
DISPPARAMS
*
pdp
,
...
@@ -800,6 +789,24 @@ DispatchEx *iface_to_jsdisp(IUnknown *iface)
...
@@ -800,6 +789,24 @@ DispatchEx *iface_to_jsdisp(IUnknown *iface)
return
ret
;
return
ret
;
}
}
HRESULT
jsdisp_get_id
(
DispatchEx
*
jsdisp
,
const
WCHAR
*
name
,
DWORD
flags
,
DISPID
*
id
)
{
dispex_prop_t
*
prop
;
HRESULT
hres
;
hres
=
find_prop_name_prot
(
jsdisp
,
name
,
(
flags
&
fdexNameEnsure
)
!=
0
,
&
prop
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
prop
)
{
*
id
=
prop_to_id
(
jsdisp
,
prop
);
return
S_OK
;
}
TRACE
(
"not found %s
\n
"
,
debugstr_w
(
name
));
return
DISP_E_UNKNOWNNAME
;
}
HRESULT
jsdisp_call_value
(
DispatchEx
*
disp
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
HRESULT
jsdisp_call_value
(
DispatchEx
*
disp
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
caller
)
jsexcept_t
*
ei
,
IServiceProvider
*
caller
)
{
{
...
...
dlls/jscript/engine.c
View file @
131d0b9f
...
@@ -203,13 +203,6 @@ void exec_release(exec_ctx_t *ctx)
...
@@ -203,13 +203,6 @@ void exec_release(exec_ctx_t *ctx)
heap_free
(
ctx
);
heap_free
(
ctx
);
}
}
static
HRESULT
dispex_get_id
(
IDispatchEx
*
dispex
,
BSTR
name
,
DWORD
flags
,
DISPID
*
id
)
{
*
id
=
0
;
return
IDispatchEx_GetDispID
(
dispex
,
name
,
flags
|
fdexNameCaseSensitive
,
id
);
}
static
HRESULT
disp_get_id
(
IDispatch
*
disp
,
BSTR
name
,
DWORD
flags
,
DISPID
*
id
)
static
HRESULT
disp_get_id
(
IDispatch
*
disp
,
BSTR
name
,
DWORD
flags
,
DISPID
*
id
)
{
{
IDispatchEx
*
dispex
;
IDispatchEx
*
dispex
;
...
@@ -223,7 +216,8 @@ static HRESULT disp_get_id(IDispatch *disp, BSTR name, DWORD flags, DISPID *id)
...
@@ -223,7 +216,8 @@ static HRESULT disp_get_id(IDispatch *disp, BSTR name, DWORD flags, DISPID *id)
return
IDispatch_GetIDsOfNames
(
disp
,
&
IID_NULL
,
&
name
,
1
,
0
,
id
);
return
IDispatch_GetIDsOfNames
(
disp
,
&
IID_NULL
,
&
name
,
1
,
0
,
id
);
}
}
hres
=
dispex_get_id
(
dispex
,
name
,
flags
,
id
);
*
id
=
0
;
hres
=
IDispatchEx_GetDispID
(
dispex
,
name
,
flags
|
fdexNameCaseSensitive
,
id
);
IDispatchEx_Release
(
dispex
);
IDispatchEx_Release
(
dispex
);
return
hres
;
return
hres
;
}
}
...
@@ -433,7 +427,7 @@ static HRESULT identifier_eval(exec_ctx_t *ctx, BSTR identifier, DWORD flags, ex
...
@@ -433,7 +427,7 @@ static HRESULT identifier_eval(exec_ctx_t *ctx, BSTR identifier, DWORD flags, ex
TRACE
(
"%s
\n
"
,
debugstr_w
(
identifier
));
TRACE
(
"%s
\n
"
,
debugstr_w
(
identifier
));
for
(
scope
=
ctx
->
scope_chain
;
scope
;
scope
=
scope
->
next
)
{
for
(
scope
=
ctx
->
scope_chain
;
scope
;
scope
=
scope
->
next
)
{
hres
=
dispex_get_id
(
_IDispatchEx_
(
scope
->
obj
)
,
identifier
,
0
,
&
id
);
hres
=
jsdisp_get_id
(
scope
->
obj
,
identifier
,
0
,
&
id
);
if
(
SUCCEEDED
(
hres
))
if
(
SUCCEEDED
(
hres
))
break
;
break
;
}
}
...
@@ -443,7 +437,7 @@ static HRESULT identifier_eval(exec_ctx_t *ctx, BSTR identifier, DWORD flags, ex
...
@@ -443,7 +437,7 @@ static HRESULT identifier_eval(exec_ctx_t *ctx, BSTR identifier, DWORD flags, ex
return
S_OK
;
return
S_OK
;
}
}
hres
=
dispex_get_id
(
_IDispatchEx_
(
ctx
->
parser
->
script
->
global
)
,
identifier
,
0
,
&
id
);
hres
=
jsdisp_get_id
(
ctx
->
parser
->
script
->
global
,
identifier
,
0
,
&
id
);
if
(
SUCCEEDED
(
hres
))
{
if
(
SUCCEEDED
(
hres
))
{
exprval_set_idref
(
ret
,
(
IDispatch
*
)
_IDispatchEx_
(
ctx
->
parser
->
script
->
global
),
id
);
exprval_set_idref
(
ret
,
(
IDispatch
*
)
_IDispatchEx_
(
ctx
->
parser
->
script
->
global
),
id
);
return
S_OK
;
return
S_OK
;
...
@@ -460,14 +454,14 @@ static HRESULT identifier_eval(exec_ctx_t *ctx, BSTR identifier, DWORD flags, ex
...
@@ -460,14 +454,14 @@ static HRESULT identifier_eval(exec_ctx_t *ctx, BSTR identifier, DWORD flags, ex
return
S_OK
;
return
S_OK
;
}
}
hres
=
dispex_get_id
(
_IDispatchEx_
(
ctx
->
parser
->
script
->
script_disp
)
,
identifier
,
0
,
&
id
);
hres
=
jsdisp_get_id
(
ctx
->
parser
->
script
->
script_disp
,
identifier
,
0
,
&
id
);
if
(
SUCCEEDED
(
hres
))
{
if
(
SUCCEEDED
(
hres
))
{
exprval_set_idref
(
ret
,
(
IDispatch
*
)
_IDispatchEx_
(
ctx
->
parser
->
script
->
script_disp
),
id
);
exprval_set_idref
(
ret
,
(
IDispatch
*
)
_IDispatchEx_
(
ctx
->
parser
->
script
->
script_disp
),
id
);
return
S_OK
;
return
S_OK
;
}
}
if
(
flags
&
EXPR_NEWREF
)
{
if
(
flags
&
EXPR_NEWREF
)
{
hres
=
dispex_get_id
(
_IDispatchEx_
(
ctx
->
var_disp
)
,
identifier
,
fdexNameEnsure
,
&
id
);
hres
=
jsdisp_get_id
(
ctx
->
var_disp
,
identifier
,
fdexNameEnsure
,
&
id
);
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
return
hres
;
return
hres
;
...
...
dlls/jscript/jscript.h
View file @
131d0b9f
...
@@ -127,6 +127,7 @@ HRESULT disp_propput(IDispatch*,DISPID,LCID,VARIANT*,jsexcept_t*,IServiceProvide
...
@@ -127,6 +127,7 @@ HRESULT disp_propput(IDispatch*,DISPID,LCID,VARIANT*,jsexcept_t*,IServiceProvide
HRESULT
jsdisp_propput_name
(
DispatchEx
*
,
const
WCHAR
*
,
LCID
,
VARIANT
*
,
jsexcept_t
*
,
IServiceProvider
*
);
HRESULT
jsdisp_propput_name
(
DispatchEx
*
,
const
WCHAR
*
,
LCID
,
VARIANT
*
,
jsexcept_t
*
,
IServiceProvider
*
);
HRESULT
jsdisp_propput_idx
(
DispatchEx
*
,
DWORD
,
LCID
,
VARIANT
*
,
jsexcept_t
*
,
IServiceProvider
*
);
HRESULT
jsdisp_propput_idx
(
DispatchEx
*
,
DWORD
,
LCID
,
VARIANT
*
,
jsexcept_t
*
,
IServiceProvider
*
);
HRESULT
jsdisp_propget_idx
(
DispatchEx
*
,
DWORD
,
LCID
,
VARIANT
*
,
jsexcept_t
*
,
IServiceProvider
*
);
HRESULT
jsdisp_propget_idx
(
DispatchEx
*
,
DWORD
,
LCID
,
VARIANT
*
,
jsexcept_t
*
,
IServiceProvider
*
);
HRESULT
jsdisp_get_id
(
DispatchEx
*
,
const
WCHAR
*
,
DWORD
,
DISPID
*
);
HRESULT
create_builtin_function
(
script_ctx_t
*
,
builtin_invoke_t
,
DWORD
,
DispatchEx
*
,
DispatchEx
**
);
HRESULT
create_builtin_function
(
script_ctx_t
*
,
builtin_invoke_t
,
DWORD
,
DispatchEx
*
,
DispatchEx
**
);
...
...
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