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

Issue 1125623003: Move megamorphic lookup code to stub instead of inlining. Preformance loss < 5%, instruction size r… (Closed)

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

Description

Move megamorphic lookup code to stub instead of inlining. Preformance loss < 5%, instruction size reduced by 30% (when using always-megamorphic). R=fschneider@google.com Committed: https://code.google.com/p/dart/source/detail?r=45525

Patch Set 1 #

Total comments: 6

Patch Set 2 : #

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+343 lines, -191 lines) Patch
M runtime/vm/flow_graph_compiler.cc View 1 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/flow_graph_compiler_arm.cc View 1 2 chunks +13 lines, -38 lines 0 comments Download
M runtime/vm/flow_graph_compiler_arm64.cc View 1 2 chunks +13 lines, -38 lines 0 comments Download
M runtime/vm/flow_graph_compiler_ia32.cc View 1 2 chunks +15 lines, -38 lines 0 comments Download
M runtime/vm/flow_graph_compiler_mips.cc View 1 2 chunks +13 lines, -39 lines 0 comments Download
M runtime/vm/flow_graph_compiler_x64.cc View 1 2 2 chunks +14 lines, -38 lines 0 comments Download
M runtime/vm/stub_code.h View 1 2 chunks +4 lines, -0 lines 0 comments Download
M runtime/vm/stub_code_arm.cc View 1 1 chunk +54 lines, -0 lines 0 comments Download
M runtime/vm/stub_code_arm64.cc View 1 1 chunk +54 lines, -0 lines 0 comments Download
M runtime/vm/stub_code_ia32.cc View 1 1 chunk +54 lines, -0 lines 0 comments Download
M runtime/vm/stub_code_mips.cc View 1 1 chunk +55 lines, -0 lines 0 comments Download
M runtime/vm/stub_code_x64.cc View 1 2 1 chunk +53 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (1 generated)
srdjan
5 years, 7 months ago (2015-05-04 13:22:59 UTC) #2
Florian Schneider
LGTM with comments. https://codereview.chromium.org/1125623003/diff/1/runtime/vm/flow_graph_compiler_arm.cc File runtime/vm/flow_graph_compiler_arm.cc (right): https://codereview.chromium.org/1125623003/diff/1/runtime/vm/flow_graph_compiler_arm.cc#newcode1295 runtime/vm/flow_graph_compiler_arm.cc:1295: if (FLAG_use_megamorphic_stub) { To avoid performance ...
5 years, 7 months ago (2015-05-04 22:06:20 UTC) #3
srdjan
https://codereview.chromium.org/1125623003/diff/1/runtime/vm/flow_graph_compiler_arm.cc File runtime/vm/flow_graph_compiler_arm.cc (right): https://codereview.chromium.org/1125623003/diff/1/runtime/vm/flow_graph_compiler_arm.cc#newcode1295 runtime/vm/flow_graph_compiler_arm.cc:1295: if (FLAG_use_megamorphic_stub) { On 2015/05/04 22:06:20, Florian Schneider wrote: ...
5 years, 7 months ago (2015-05-05 07:15:29 UTC) #4
srdjan
https://codereview.chromium.org/1125623003/diff/1/runtime/vm/flow_graph_compiler_arm.cc File runtime/vm/flow_graph_compiler_arm.cc (right): https://codereview.chromium.org/1125623003/diff/1/runtime/vm/flow_graph_compiler_arm.cc#newcode1295 runtime/vm/flow_graph_compiler_arm.cc:1295: if (FLAG_use_megamorphic_stub) { On 2015/05/05 07:15:29, srdjan wrote: > ...
5 years, 7 months ago (2015-05-05 12:13:28 UTC) #5
srdjan
Committed patchset #3 (id:40001) manually as r45525 (presubmit successful).
5 years, 7 months ago (2015-05-05 14:08:16 UTC) #6
srdjan
On 2015/05/05 12:13:28, srdjan wrote: > https://codereview.chromium.org/1125623003/diff/1/runtime/vm/flow_graph_compiler_arm.cc > File runtime/vm/flow_graph_compiler_arm.cc (right): > > https://codereview.chromium.org/1125623003/diff/1/runtime/vm/flow_graph_compiler_arm.cc#newcode1295 > ...
5 years, 7 months ago (2015-05-05 14:10:12 UTC) #7
Florian Schneider
5 years, 7 months ago (2015-05-05 16:34:43 UTC) #8
Message was sent while issue was closed.
Sounds good.

https://codereview.chromium.org/1125623003/diff/1/runtime/vm/flow_graph_compi...
File runtime/vm/flow_graph_compiler_arm.cc (right):

https://codereview.chromium.org/1125623003/diff/1/runtime/vm/flow_graph_compi...
runtime/vm/flow_graph_compiler_arm.cc:1295: if (FLAG_use_megamorphic_stub) {
On 2015/05/05 12:13:28, srdjan wrote:
> On 2015/05/05 07:15:29, srdjan wrote:
> > On 2015/05/04 22:06:20, Florian Schneider wrote:
> > > To avoid performance regression in optimized code, maybe try always doing
> the
> > > inline lookup in optimized code?
> > > 
> > > if (FLAG_use_megamorphic_stub && !is_optimizing()) {
> > >   ...
> > > } else {
> > >   ...
> > > }
> > 
> > There are no measureable (< 0.5% diffs) in optimized code. Only when running
> > with --noopt can I measure  regression.  I think the code size saving is
more
> > significant than such a small performance loss What do you think?
> 
> Measured dart2js optimized: with out-of-line megamorphic lookup: ~4% reduction
> in code size, < 1% loss in performance. Will not to add '!is_optimizing', let
me
> know if you disagree.

If the difference is not noticable in optimized code, I'm totally fine with
always using the stub.

Powered by Google App Engine
This is Rietveld 408576698