Bug 138637 - Use scope register when processing op_resolve_scope in LLInt and Baseline JIT
Summary: Use scope register when processing op_resolve_scope in LLInt and Baseline JIT
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 312.x
Hardware: All All
: P2 Normal
Assignee: Michael Saboff
URL:
Keywords:
Depends on:
Blocks: 136724
  Show dependency treegraph
 
Reported: 2014-11-11 15:44 PST by Michael Saboff
Modified: 2014-11-11 21:57 PST (History)
2 users (show)

See Also:


Attachments
Patch (10.80 KB, patch)
2014-11-11 16:17 PST, Michael Saboff
mark.lam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Saboff 2014-11-11 15:44:44 PST
The current code uses exec->scope(), but should be changed to use the scope register provided in the byte code.
Comment 1 Michael Saboff 2014-11-11 16:05:44 PST
This is for the LLInt and baseline JIT.  The DFG and FTL changes will be done separately.
Comment 2 Michael Saboff 2014-11-11 16:17:26 PST
Created attachment 241390 [details]
Patch
Comment 3 Mark Lam 2014-11-11 18:20:37 PST
Comment on attachment 241390 [details]
Patch

r=me
Comment 4 Michael Saboff 2014-11-11 18:33:49 PST
Committed r175998: <http://trac.webkit.org/changeset/175998>
Comment 5 Geoffrey Garen 2014-11-11 21:24:04 PST
Comment on attachment 241390 [details]
Patch

I think it would be better for the JIT to load the scope into a register, and pass it to its helper functions as a JSScope*.

It's awkward to ask a helper function to muck around in your stack in order to load things out. And it's not a viable strategy for our optimizing engines, which may choose not to store things back to the stack in simple ways.
Comment 6 Michael Saboff 2014-11-11 21:57:57 PST
(In reply to comment #5)
> Comment on attachment 241390 [details]
> Patch
> 
> I think it would be better for the JIT to load the scope into a register,
> and pass it to its helper functions as a JSScope*.
> 
> It's awkward to ask a helper function to muck around in your stack in order
> to load things out. And it's not a viable strategy for our optimizing
> engines, which may choose not to store things back to the stack in simple
> ways.

The helper operationResolveScope() is only used by the baseline JIT.

This is similar to the way operationPopScope() works, except that operationPopScope also writes the value back to the stack.  The operationPush* helpers also write to the stack.  Seems like we should change all to work the same way.