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

Issue 10539156: Track fields which are known to be always set to integer constants (Closed)

Created:
8 years, 6 months ago by Søren Gjesse
Modified:
8 years, 6 months ago
Reviewers:
floitsch, ngeoffray
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Track fields which are known to be always set to integer constants For each field which is accessed directly in the generated JavaScript code track whether all the setters are setting the field to an integer constant. If that is the case the codegen will always generate === comparison when comparing to an integer constant. To know for sure that only integer constants are assigned the functions having the getters need to be recompiled. This gives ~10% on Delta Blue. R=ngeoffray@google.com, floitsch@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=8796

Patch Set 1 #

Total comments: 12

Patch Set 2 : Addressed review comment and addressed initializers #

Total comments: 6

Patch Set 3 : Addresed review comments from floitsch@ #

Patch Set 4 : Rebased to r8779 #

Patch Set 5 : Minor fix #

Total comments: 6

Patch Set 6 : Addressed second round of comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+151 lines, -7 lines) Patch
M lib/compiler/implementation/compiler.dart View 1 2 3 4 5 1 chunk +3 lines, -2 lines 0 comments Download
M lib/compiler/implementation/enqueue.dart View 1 2 3 2 chunks +8 lines, -1 line 0 comments Download
M lib/compiler/implementation/ssa/bailout.dart View 1 2 4 chunks +4 lines, -2 lines 0 comments Download
M lib/compiler/implementation/ssa/codegen.dart View 1 2 3 2 chunks +14 lines, -1 line 0 comments Download
M lib/compiler/implementation/ssa/nodes.dart View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M lib/compiler/implementation/ssa/optimize.dart View 1 2 3 4 5 2 chunks +66 lines, -1 line 0 comments Download
M lib/compiler/implementation/universe.dart View 1 2 3 4 5 3 chunks +54 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Søren Gjesse
I am not sure this is the right approach to achieve the desired result. The ...
8 years, 6 months ago (2012-06-14 12:38:58 UTC) #1
ngeoffray
Initial comments https://chromiumcodereview.appspot.com/10539156/diff/1/lib/compiler/implementation/ssa/codegen.dart File lib/compiler/implementation/ssa/codegen.dart (right): https://chromiumcodereview.appspot.com/10539156/diff/1/lib/compiler/implementation/ssa/codegen.dart#newcode1175 lib/compiler/implementation/ssa/codegen.dart:1175: if (node.left is HFieldGet && node.right is ...
8 years, 6 months ago (2012-06-14 13:01:21 UTC) #2
Søren Gjesse
Addressed the comments from Nicolas. I also added tracking of the type set for the ...
8 years, 6 months ago (2012-06-15 13:19:59 UTC) #3
floitsch
LGTM with comments. I don't see where you handle the case of dynamic-setters. class A ...
8 years, 6 months ago (2012-06-15 15:00:50 UTC) #4
Søren Gjesse
PTAL You where absolutely right about the dynamic-setters. Changed the patch to indicate a known ...
8 years, 6 months ago (2012-06-18 11:32:17 UTC) #5
floitsch
LGTM. https://chromiumcodereview.appspot.com/10539156/diff/15001/lib/compiler/implementation/compiler.dart File lib/compiler/implementation/compiler.dart (right): https://chromiumcodereview.appspot.com/10539156/diff/15001/lib/compiler/implementation/compiler.dart#newcode466 lib/compiler/implementation/compiler.dart:466: var oldCode = world.universe.generatedCode[work.element]; Please type your code. ...
8 years, 6 months ago (2012-06-18 13:20:40 UTC) #6
Søren Gjesse
8 years, 6 months ago (2012-06-19 14:35:00 UTC) #7
Forgot to post these comments yesterday.

https://chromiumcodereview.appspot.com/10539156/diff/15001/lib/compiler/imple...
File lib/compiler/implementation/compiler.dart (right):

https://chromiumcodereview.appspot.com/10539156/diff/15001/lib/compiler/imple...
lib/compiler/implementation/compiler.dart:466: var oldCode =
world.universe.generatedCode[work.element];
On 2012/06/18 13:20:40, floitsch wrote:
> Please type your code.

Done.

https://chromiumcodereview.appspot.com/10539156/diff/15001/lib/compiler/imple...
File lib/compiler/implementation/ssa/optimize.dart (right):

https://chromiumcodereview.appspot.com/10539156/diff/15001/lib/compiler/imple...
lib/compiler/implementation/ssa/optimize.dart:1220: // itselfalways sets an
integer in the fiels is still a strong
On 2012/06/18 13:20:40, floitsch wrote:
> itself always

Done.

https://chromiumcodereview.appspot.com/10539156/diff/15001/lib/compiler/imple...
File lib/compiler/implementation/universe.dart (right):

https://chromiumcodereview.appspot.com/10539156/diff/15001/lib/compiler/imple...
lib/compiler/implementation/universe.dart:90: bool
couldHaveFieldOnlyIntegerInitializer(Type type, SourceString name) {
On 2012/06/18 13:20:40, floitsch wrote:
> just call hasFieldOnlyIntegerInitializer.
> And shouldn't it be initializer*s* ?

Done.

Powered by Google App Engine
This is Rietveld 408576698