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

Issue 22839003: Polymorphic inlining for some recognized methods in the optimizing compiler. (Closed)

Created:
7 years, 4 months ago by Florian Schneider
Modified:
7 years, 4 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Polymorphic inlining for some recognized methods in the optimizing compiler. The optimizing compiler currently recognizes a certain frequent native methods like array length or string length and provides an inlined implementation. Inlining does currently not work for polymorphic call sites of these methods. This CL enables also polymorphic inlining in the case of .length getters for arrays and strings. 1. The method is recognized at flow graph build time. The builder creates the body of the method for both compilers (non-optimizing and optimizing). Native methods that are not recognized, are translated as before using a NativeCall IL instruction. 2. The flow graph inliner handles recognized methods in the same manner as normal methods. Until now intrinsic and recognized method could not be inlined. This CL enables it. 3. There is no need for an intrinsic assembly implementation because recognized methods have an IL implementation that does not call into the C++ runtime. I left the intrinsics in for now, but they can be removed if there is not noticable performance benefit anymore. 4. The inlining heuristics are tweaked in a way that enables more aggressive inlining of recognized methods: +1 level of inlining depths, call sites of recognized methods are not counted in the inlining heuristic. R=kmillikin@google.com, srdjan@google.com Committed: https://code.google.com/p/dart/source/detail?r=26429

Patch Set 1 #

Total comments: 21

Patch Set 2 : addressed comments #

Patch Set 3 : #

Patch Set 4 : synced #

Patch Set 5 : leave most intrinsics intact, cleanup modulo #

Patch Set 6 : fixed modulo performance regression #

Unified diffs Side-by-side diffs Delta from patch set Stats (+177 lines, -127 lines) Patch
M runtime/vm/ast.h View 1 2 3 4 3 chunks +4 lines, -0 lines 0 comments Download
M runtime/vm/code_generator_test.cc View 1 2 3 4 3 chunks +3 lines, -0 lines 0 comments Download
M runtime/vm/compiler.cc View 1 2 3 4 1 chunk +11 lines, -0 lines 0 comments Download
M runtime/vm/flow_graph_builder.cc View 1 2 3 4 3 chunks +76 lines, -9 lines 0 comments Download
M runtime/vm/flow_graph_compiler.cc View 1 2 3 4 1 chunk +0 lines, -1 line 0 comments Download
M runtime/vm/flow_graph_inliner.cc View 1 2 3 4 8 chunks +47 lines, -29 lines 0 comments Download
M runtime/vm/flow_graph_optimizer.h View 1 2 3 4 1 chunk +0 lines, -5 lines 0 comments Download
M runtime/vm/flow_graph_optimizer.cc View 1 2 3 4 5 chunks +1 line, -69 lines 0 comments Download
M runtime/vm/intermediate_language.h View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M runtime/vm/intermediate_language.cc View 1 2 3 4 1 chunk +8 lines, -0 lines 0 comments Download
M runtime/vm/intrinsifier.h View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M runtime/vm/intrinsifier_arm.cc View 1 2 3 4 5 1 chunk +6 lines, -2 lines 0 comments Download
M runtime/vm/intrinsifier_ia32.cc View 1 2 3 4 5 1 chunk +2 lines, -4 lines 0 comments Download
M runtime/vm/intrinsifier_mips.cc View 1 2 3 4 5 1 chunk +7 lines, -2 lines 0 comments Download
M runtime/vm/intrinsifier_x64.cc View 1 2 3 4 5 1 chunk +2 lines, -4 lines 0 comments Download
M runtime/vm/object.cc View 1 2 3 4 1 chunk +0 lines, -1 line 0 comments Download
M runtime/vm/parser.cc View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Florian Schneider
This CL handles only recognized .length getters to show the approach. It simplifies handling of ...
7 years, 4 months ago (2013-08-12 15:48:14 UTC) #1
srdjan
LGTM with comments. https://codereview.chromium.org/22839003/diff/1/runtime/vm/flow_graph_builder.cc File runtime/vm/flow_graph_builder.cc (right): https://codereview.chromium.org/22839003/diff/1/runtime/vm/flow_graph_builder.cc#newcode2811 runtime/vm/flow_graph_builder.cc:2811: static intptr_t OffsetForLengthGetter(MethodRecognizer::Kind kind) { Can ...
7 years, 4 months ago (2013-08-12 21:49:47 UTC) #2
Kevin Millikin (Google)
I like the approach. LGTM with comments addressed. https://codereview.chromium.org/22839003/diff/1/runtime/vm/compiler.cc File runtime/vm/compiler.cc (right): https://codereview.chromium.org/22839003/diff/1/runtime/vm/compiler.cc#newcode344 runtime/vm/compiler.cc:344: propagator.Propagate(); ...
7 years, 4 months ago (2013-08-13 11:47:40 UTC) #3
Florian Schneider
https://codereview.chromium.org/22839003/diff/1/runtime/vm/compiler.cc File runtime/vm/compiler.cc (right): https://codereview.chromium.org/22839003/diff/1/runtime/vm/compiler.cc#newcode344 runtime/vm/compiler.cc:344: propagator.Propagate(); On 2013/08/13 11:47:40, kmillikin wrote: > Why? > ...
7 years, 4 months ago (2013-08-14 12:30:24 UTC) #4
Florian Schneider
@Kevin: Could you have a quick look at the diff in the intrinsifier* files? I ...
7 years, 4 months ago (2013-08-21 11:18:15 UTC) #5
Kevin Millikin (Google)
On 2013/08/21 11:18:15, Florian Schneider wrote: > @Kevin: Could you have a quick look at ...
7 years, 4 months ago (2013-08-21 12:36:05 UTC) #6
Florian Schneider
7 years, 4 months ago (2013-08-21 12:58:30 UTC) #7
Message was sent while issue was closed.
Committed patchset #6 manually as r26429 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698