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

Issue 57873002: Build new IR for functions returning a constant (Closed)

Created:
7 years, 1 month ago by lukas
Modified:
7 years ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Build new IR for functions returning a constant. R=ngeoffray@google.com Committed: https://code.google.com/p/dart/source/detail?r=30613

Patch Set 1 #

Total comments: 23

Patch Set 2 : rename INode>IrNode. started working on inferencer #

Total comments: 10

Patch Set 3 : included feedback #

Patch Set 4 : rebase on current trunk, no functional changes #

Patch Set 5 : type inference and inlining for new ir nodes #

Total comments: 44

Patch Set 6 : include feedback, disable IR in --checked mode #

Patch Set 7 : no nested functions in ir #

Total comments: 22

Patch Set 8 : include feedback, don't build ir for intercepted methods #

Total comments: 2

Patch Set 9 : rebase on trunk that doesn't fail the tests #

Patch Set 10 : fix external functions, abort early for dart backend, measure IR builder time #

Total comments: 6

Patch Set 11 : hasIr / getIr in irBuilder, they also handle external functions #

Patch Set 12 : rebase on latest trunk #

Patch Set 13 : yet another rebase #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+883 lines, -128 lines) Patch
M sdk/lib/_internal/compiler/implementation/compiler.dart View 1 2 3 4 3 chunks +5 lines, -0 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/dart2jslib.dart View 1 1 chunk +1 line, -0 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/elements/modelx.dart View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -1 line 0 comments Download
A sdk/lib/_internal/compiler/implementation/inferrer/ir_type_inferrer.dart View 1 2 3 4 5 6 7 8 9 10 1 chunk +84 lines, -0 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +8 lines, -2 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/inferrer/type_graph_nodes.dart View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
A sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart View 1 2 3 4 5 6 7 8 9 10 1 chunk +317 lines, -0 lines 2 comments Download
A sdk/lib/_internal/compiler/implementation/ir/ir_nodes.dart View 1 2 3 4 5 6 7 1 chunk +76 lines, -0 lines 6 comments Download
M sdk/lib/_internal/compiler/implementation/js_backend/backend.dart View 1 2 3 4 5 6 7 8 9 10 3 chunks +5 lines, -2 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/source_map_builder.dart View 1 2 3 4 5 1 chunk +29 lines, -7 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/builder.dart View 1 2 3 4 5 6 7 8 9 10 11 12 11 chunks +124 lines, -98 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/codegen.dart View 1 2 3 4 5 6 7 8 9 10 1 chunk +26 lines, -16 lines 0 comments Download
A sdk/lib/_internal/compiler/implementation/ssa/from_ir_builder.dart View 1 2 3 4 5 6 7 8 9 10 1 chunk +127 lines, -0 lines 0 comments Download
A sdk/lib/_internal/compiler/implementation/ssa/from_ir_inliner.dart View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +76 lines, -0 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/interceptor_simplifier.dart View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/ssa.dart View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 22 (0 generated)
lukas
7 years, 1 month ago (2013-11-04 14:14:05 UTC) #1
ngeoffray
Initial comments. https://codereview.chromium.org/57873002/diff/1/sdk/lib/_internal/compiler/implementation/elements/modelx.dart File sdk/lib/_internal/compiler/implementation/elements/modelx.dart (right): https://codereview.chromium.org/57873002/diff/1/sdk/lib/_internal/compiler/implementation/elements/modelx.dart#newcode1535 sdk/lib/_internal/compiler/implementation/elements/modelx.dart:1535: () => !parseNode(compiler).hasBody()); We should make sure ...
7 years, 1 month ago (2013-11-05 12:58:35 UTC) #2
lukas
it's a bit hard to see the diff 1 -> 2 now because some files ...
7 years, 1 month ago (2013-11-05 17:10:49 UTC) #3
kasperl
First round of comments. https://codereview.chromium.org/57873002/diff/1/sdk/lib/_internal/compiler/implementation/compiler.dart File sdk/lib/_internal/compiler/implementation/compiler.dart (right): https://codereview.chromium.org/57873002/diff/1/sdk/lib/_internal/compiler/implementation/compiler.dart#newcode521 sdk/lib/_internal/compiler/implementation/compiler.dart:521: String message = 'The compiler ...
7 years, 1 month ago (2013-11-06 08:30:04 UTC) #4
karlklose
https://codereview.chromium.org/57873002/diff/80001/sdk/lib/_internal/compiler/implementation/elements/modelx.dart File sdk/lib/_internal/compiler/implementation/elements/modelx.dart (right): https://codereview.chromium.org/57873002/diff/80001/sdk/lib/_internal/compiler/implementation/elements/modelx.dart#newcode1534 sdk/lib/_internal/compiler/implementation/elements/modelx.dart:1534: if (modifiers.isExternal()) return false; You can remove this check ...
7 years, 1 month ago (2013-11-06 09:11:28 UTC) #5
lukas
https://codereview.chromium.org/57873002/diff/1/sdk/lib/_internal/compiler/implementation/compiler.dart File sdk/lib/_internal/compiler/implementation/compiler.dart (right): https://codereview.chromium.org/57873002/diff/1/sdk/lib/_internal/compiler/implementation/compiler.dart#newcode521 sdk/lib/_internal/compiler/implementation/compiler.dart:521: String message = 'The compiler crashed: ${tryToString(ex)}.\n${ex.stackTrace}'; On 2013/11/06 ...
7 years, 1 month ago (2013-11-06 11:36:08 UTC) #6
lukas
Added type inference and inlining (when building SSA from ASTs) for IR nodes. TODO: add ...
7 years, 1 month ago (2013-11-20 13:37:58 UTC) #7
ngeoffray
https://codereview.chromium.org/57873002/diff/640001/sdk/lib/_internal/compiler/implementation/elements/elements.dart File sdk/lib/_internal/compiler/implementation/elements/elements.dart (right): https://codereview.chromium.org/57873002/diff/640001/sdk/lib/_internal/compiler/implementation/elements/elements.dart#newcode183 sdk/lib/_internal/compiler/implementation/elements/elements.dart:183: bool hasIrNode(Compiler compiler); I wouldn't put those helpers here. ...
7 years, 1 month ago (2013-11-20 14:55:26 UTC) #8
lukas
Thanks, Nicolas! Two answers below, I will include the other comments. https://codereview.chromium.org/57873002/diff/640001/sdk/lib/_internal/compiler/implementation/elements/elements.dart File sdk/lib/_internal/compiler/implementation/elements/elements.dart (right): ...
7 years, 1 month ago (2013-11-20 15:13:25 UTC) #9
lukas
PTAL. For now I disabled the IR in --checked mode. https://codereview.chromium.org/57873002/diff/640001/sdk/lib/_internal/compiler/implementation/inferrer/ir_type_inferrer.dart File sdk/lib/_internal/compiler/implementation/inferrer/ir_type_inferrer.dart (right): https://codereview.chromium.org/57873002/diff/640001/sdk/lib/_internal/compiler/implementation/inferrer/ir_type_inferrer.dart#newcode28 ...
7 years, 1 month ago (2013-11-21 12:20:21 UTC) #10
ngeoffray
LGTM https://codereview.chromium.org/57873002/diff/900001/sdk/lib/_internal/compiler/implementation/inferrer/ir_type_inferrer.dart File sdk/lib/_internal/compiler/implementation/inferrer/ir_type_inferrer.dart (right): https://codereview.chromium.org/57873002/diff/900001/sdk/lib/_internal/compiler/implementation/inferrer/ir_type_inferrer.dart#newcode24 sdk/lib/_internal/compiler/implementation/inferrer/ir_type_inferrer.dart:24: InferrerEngine<T, TypeSystem<T>> inferrer) : Nit: ':' at the ...
7 years, 1 month ago (2013-11-21 15:02:04 UTC) #11
lukas
https://codereview.chromium.org/57873002/diff/900001/sdk/lib/_internal/compiler/implementation/inferrer/ir_type_inferrer.dart File sdk/lib/_internal/compiler/implementation/inferrer/ir_type_inferrer.dart (right): https://codereview.chromium.org/57873002/diff/900001/sdk/lib/_internal/compiler/implementation/inferrer/ir_type_inferrer.dart#newcode24 sdk/lib/_internal/compiler/implementation/inferrer/ir_type_inferrer.dart:24: InferrerEngine<T, TypeSystem<T>> inferrer) : On 2013/11/21 15:02:05, ngeoffray wrote: ...
7 years, 1 month ago (2013-11-21 17:14:26 UTC) #12
lukas
+Stephen
7 years, 1 month ago (2013-11-21 18:03:24 UTC) #13
ngeoffray
LGTM!
7 years, 1 month ago (2013-11-22 07:33:21 UTC) #14
karlklose
DBC: https://codereview.chromium.org/57873002/diff/970001/sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart File sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart (right): https://codereview.chromium.org/57873002/diff/970001/sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart#newcode86 sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart:86: if (backend.isInterceptedMethod(element)) return false; Consider storing compiler.backend in ...
7 years, 1 month ago (2013-11-22 08:01:06 UTC) #15
lukas
PTAL at changes in patch set 9: fix for external functions, abort IR building early ...
7 years, 1 month ago (2013-11-22 11:51:33 UTC) #16
ngeoffray
LGTM https://codereview.chromium.org/57873002/diff/1230001/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart File sdk/lib/_internal/compiler/implementation/js_backend/backend.dart (right): https://codereview.chromium.org/57873002/diff/1230001/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart#newcode1265 sdk/lib/_internal/compiler/implementation/js_backend/backend.dart:1265: HGraph graph = element.implementation.hasIrNode(compiler) Maybe put the implementation ...
7 years, 1 month ago (2013-11-22 12:21:04 UTC) #17
karlklose
https://codereview.chromium.org/57873002/diff/1230001/sdk/lib/_internal/compiler/implementation/elements/elements.dart File sdk/lib/_internal/compiler/implementation/elements/elements.dart (right): https://codereview.chromium.org/57873002/diff/1230001/sdk/lib/_internal/compiler/implementation/elements/elements.dart#newcode183 sdk/lib/_internal/compiler/implementation/elements/elements.dart:183: bool hasIrNode(Compiler compiler); How about moving these two methods ...
7 years, 1 month ago (2013-11-22 12:36:10 UTC) #18
lukas
Move hasIr from Element to IrBuilder, and also make it handle external functions. https://codereview.chromium.org/57873002/diff/1230001/sdk/lib/_internal/compiler/implementation/elements/elements.dart File ...
7 years ago (2013-11-22 16:33:03 UTC) #19
lukas
Committed patchset #13 manually as r30613 (presubmit successful).
7 years ago (2013-11-25 09:49:38 UTC) #20
kasperl
Nits: https://codereview.chromium.org/57873002/diff/1750001/sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart File sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart (right): https://codereview.chromium.org/57873002/diff/1750001/sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart#newcode5 sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart:5: library ir_builder; dart2js.ir_builder? https://codereview.chromium.org/57873002/diff/1750001/sdk/lib/_internal/compiler/implementation/ir/ir_nodes.dart File sdk/lib/_internal/compiler/implementation/ir/ir_nodes.dart (right): https://codereview.chromium.org/57873002/diff/1750001/sdk/lib/_internal/compiler/implementation/ir/ir_nodes.dart#newcode6 ...
7 years ago (2013-11-25 11:32:53 UTC) #21
lukas
7 years ago (2013-11-25 14:50:51 UTC) #22
Message was sent while issue was closed.
Feedback addressed in https://codereview.chromium.org/85813002/

https://codereview.chromium.org/57873002/diff/1750001/sdk/lib/_internal/compi...
File sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart (right):

https://codereview.chromium.org/57873002/diff/1750001/sdk/lib/_internal/compi...
sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart:5: library
ir_builder;
On 2013/11/25 11:32:54, kasperl wrote:
> dart2js.ir_builder?

Done.

https://codereview.chromium.org/57873002/diff/1750001/sdk/lib/_internal/compi...
File sdk/lib/_internal/compiler/implementation/ir/ir_nodes.dart (right):

https://codereview.chromium.org/57873002/diff/1750001/sdk/lib/_internal/compi...
sdk/lib/_internal/compiler/implementation/ir/ir_nodes.dart:6: // dependencies on
other parts of the system
On 2013/11/25 11:32:54, kasperl wrote:
> Terminate comment with .

Done.

https://codereview.chromium.org/57873002/diff/1750001/sdk/lib/_internal/compi...
sdk/lib/_internal/compiler/implementation/ir/ir_nodes.dart:9: import
'../dart2jslib.dart' show Constant;
On 2013/11/25 11:32:54, kasperl wrote:
> It's a little bit scary to drag in the entire Constant thing -- who knows what
> kind of dependencies it has on the rest of the system. Maybe you'll have to
> rework this once you start serializing/deserializing? 

Yes - I'll address this in the next CL which will introduce serialization.

https://codereview.chromium.org/57873002/diff/1750001/sdk/lib/_internal/compi...
sdk/lib/_internal/compiler/implementation/ir/ir_nodes.dart:27: (position is
PositionWithIdentifierName) ? position.offset : position;
On 2013/11/25 11:32:54, kasperl wrote:
> 'is int' is simpler?

Done.

Powered by Google App Engine
This is Rietveld 408576698