[PATCH v4 2/4] jscript: Lookup host global object on demand instead of storing it in script context.
jacek at codeweavers.com
Thu Mar 5 10:48:11 CST 2020
On 05.03.2020 17:14, Gabriel Ivăncescu wrote:
> Hi Jacek,
> On 05/03/2020 17:37, Jacek Caban wrote:
>> Hi Gabriel,
>> On 02.03.2020 14:38, Gabriel Ivăncescu wrote:
>>> Signed-off-by: Gabriel Ivăncescu<gabrielopcode at gmail.com>
>>> dlls/jscript/engine.c | 21 +++++++++++++++++----
>>> dlls/jscript/engine.h | 1 +
>>> dlls/jscript/function.c | 4 +---
>>> dlls/jscript/jscript.c | 10 ----------
>>> dlls/jscript/jscript.h | 2 --
>>> 5 files changed, 19 insertions(+), 19 deletions(-)
>> How about storing this as NULL for global code and then do the lookup
>> in interp_this() when this_obj is NULL?
> It seems to be used in multiple places other than interp_this:
> interp_ret, pop_call_frame. And also for eval in global.c. Wouldn't
> that require to look it up in each of them every time?
It needs a review to be sure, but I think that JS this will never be
NULL when a function is called as a constructor, so interp_ret is not a
problem. pop_call_frame only releases the object, so it's not an issue.
Once you change the meaning of NULL, you may use just use NULL in eval()
for global code.
More information about the wine-devel