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

Issue 2647913002: Optimizations to IC stub for unoptimized code performance on x64. (Closed)

Created:
3 years, 11 months ago by erikcorry
Modified:
3 years, 11 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Optimizations to IC stub for unoptimized code performance on x64. Using two CMOVs for class ID load is not a win relative to a simple branch. Unroll the loop that checks entries in the IC data to find correct call. Don't check a counter for overflow on 64 bit, it's not going to happen and even if it did it makes little difference. Don't reload receiver and arg0 for every entry in the IC data in the multidispatch case. According to my measurements this IC stub is about 10% faster in the single dispatch case, and about 15% faster in the less important double dispatch case. Unoptimzed code spends about 30% of its time in these two stubs. R=regis@google.com BUG= Committed: https://github.com/dart-lang/sdk/commit/f03f62ad09be3132f5d086ae2852ef617b94dda9

Patch Set 1 #

Total comments: 3

Patch Set 2 : Unroll loops on IA32, ARM and ARM64 too #

Patch Set 3 : Add MIPS and remove more overflow checks #

Total comments: 6

Patch Set 4 : Feedback from Regis #

Unified diffs Side-by-side diffs Delta from patch set Stats (+324 lines, -290 lines) Patch
M runtime/vm/assembler_ia32.cc View 1 1 chunk +41 lines, -13 lines 0 comments Download
M runtime/vm/assembler_x64.cc View 1 1 chunk +44 lines, -17 lines 0 comments Download
M runtime/vm/object.cc View 1 2 3 1 chunk +7 lines, -1 line 0 comments Download
M runtime/vm/stub_code_arm.cc View 1 2 3 5 chunks +44 lines, -45 lines 0 comments Download
M runtime/vm/stub_code_arm64.cc View 1 2 6 chunks +36 lines, -44 lines 0 comments Download
M runtime/vm/stub_code_ia32.cc View 1 2 3 5 chunks +60 lines, -59 lines 0 comments Download
M runtime/vm/stub_code_mips.cc View 1 2 7 chunks +46 lines, -53 lines 0 comments Download
M runtime/vm/stub_code_x64.cc View 1 2 3 5 chunks +46 lines, -58 lines 0 comments Download

Messages

Total messages: 8 (2 generated)
erikcorry
3 years, 11 months ago (2017-01-20 14:47:13 UTC) #1
regis
Most of the changes look good to me. But we try to keep the different ...
3 years, 11 months ago (2017-01-20 17:11:02 UTC) #3
Florian Schneider
dbc: Nice speedup! This should help really large apps like dart2js. But I agree with ...
3 years, 11 months ago (2017-01-20 17:26:35 UTC) #4
erikcorry
I did the loop unroll on ARM, MIPS and IA32, too. I did more measurements ...
3 years, 11 months ago (2017-01-24 15:35:41 UTC) #5
regis
lgtm Thanks for improving all architectures! https://codereview.chromium.org/2647913002/diff/1/runtime/vm/stub_code_x64.cc File runtime/vm/stub_code_x64.cc (right): https://codereview.chromium.org/2647913002/diff/1/runtime/vm/stub_code_x64.cc#newcode1611 runtime/vm/stub_code_x64.cc:1611: __ addq(Address(R12, count_offset), ...
3 years, 11 months ago (2017-01-24 18:27:21 UTC) #6
erikcorry
3 years, 11 months ago (2017-01-25 09:15:11 UTC) #8
Message was sent while issue was closed.
Committed patchset #4 (id:60001) manually as
f03f62ad09be3132f5d086ae2852ef617b94dda9 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698