Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1073)

Issue 967093002: Avoid initialization checks when loading from an immutable context variable.

Created:
5 years, 9 months ago by dougc
Modified:
4 years, 2 months ago
Reviewers:
Michael Starzinger
CC:
v8-dev
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Avoid initialization checks when loading from an immutable context variable. This patch tries to address the issue by copying some code from the context specialization reduction. Sorry I am not yet familiar enough with the code to really write this, but it does avoid the initialization checks and a phi that frustrates further optimization, and it passes the checks, and looks plausible. This can make a significant performance improvement to asm.js style code that frequently references immutable module variables, and should help JS code in general. The Odin asm.js implementation optimizes a 'const' module variable, but with this patch v8 appears to also optimize an immutable 'var' well. Further, Odin compiles before the module variables have been initialized, but with this patch V8 can compile knowing the initialized variable values which is a very interesting feature. See https://bugzilla.mozilla.org/show_bug.cgi?id=1138132 for a request to add the later support to Odin and asm.js and some discussion. BUG=

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -3 lines) Patch
M src/compiler/ast-graph-builder.cc View 1 chunk +23 lines, -3 lines 0 comments Download

Messages

Total messages: 11 (3 generated)
dougc
Improves performance of loads from immutable context variables. Assistance with this would be appreciated, or ...
5 years, 9 months ago (2015-03-01 10:17:30 UTC) #2
titzer
As far as I can tell, this just duplicates the logic of context specialization in ...
5 years, 9 months ago (2015-03-05 19:44:45 UTC) #3
Michael Starzinger
I am highly opposed to doing such optimizations in the AstGraphBuilder. The logic for this ...
5 years, 9 months ago (2015-03-06 11:26:51 UTC) #5
dougc
On 2015/03/05 19:44:45, titzer wrote: > As far as I can tell, this just duplicates ...
5 years, 9 months ago (2015-03-06 14:20:35 UTC) #6
titzer
On 2015/03/06 14:20:35, dougc wrote: > On 2015/03/05 19:44:45, titzer wrote: > > As far ...
5 years, 9 months ago (2015-03-06 21:20:40 UTC) #7
dougc
On 2015/03/06 21:20:40, titzer wrote: > On 2015/03/06 14:20:35, dougc wrote: > > On 2015/03/05 ...
5 years, 9 months ago (2015-03-07 04:12:41 UTC) #8
Benedikt Meurer
Hey Douglas, I have uploaded a separate fix for this problem in https://codereview.chromium.org/1072353002/ which addresses ...
5 years, 8 months ago (2015-04-10 08:58:44 UTC) #9
dougc
5 years, 8 months ago (2015-04-19 14:20:55 UTC) #10
On 2015/04/10 08:58:44, Benedikt Meurer wrote:
> Hey Douglas,
> 
> I have uploaded a separate fix for this problem in
> https://codereview.chromium.org/1072353002/ which addresses the problem by
> turning the hole check diamond, that can only be removed during late control
> reduction, into a select that can be removed during typed lowering. That
should
> address all problems described above.

This does not address the problem of the type of the constant as seen after the
select when the typer runs, and it still has a lower bound of zero. Perhaps the
typer could be extended to derive the type of the select in this case? Otherwise
there still seems to be an issue here to remove the hole check earlier in the
pipeline, and before types are derived.

Powered by Google App Engine
This is Rietveld 408576698