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

Issue 381803005: Reland r38116: Improve receiver class check in polymorphic inlining. (Closed)

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

Description

Reland r38116: Improve receiver class check in polymorphic inlining. Avoid reloading the class-id at the entry to last inlined variant at inlined polymorphic call sites. For this I added a new check instruction CheckClassIdInstr to deoptimize on integer-comparison. In polymorphic CheckClass with small dense ranges of class-ids now generate max. 2 branch instructions by doing a range check and computing a test mask instead of a sequence of compare and branch instructions. I fixed the crash bug which was due to illegal hoisting of CheckClassId and two more assertion failures. R=vegorov@google.com Committed: https://code.google.com/p/dart/source/detail?r=38154

Patch Set 1 #

Total comments: 7

Patch Set 2 : addressed comments #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+460 lines, -92 lines) Patch
M runtime/vm/assembler_ia32.h View 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/vm/assembler_ia32.cc View 1 chunk +8 lines, -0 lines 0 comments Download
M runtime/vm/assembler_ia32_test.cc View 1 chunk +20 lines, -0 lines 0 comments Download
M runtime/vm/assembler_x64.h View 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/vm/assembler_x64.cc View 1 chunk +9 lines, -0 lines 0 comments Download
M runtime/vm/assembler_x64_test.cc View 1 chunk +19 lines, -0 lines 0 comments Download
M runtime/vm/disassembler_ia32.cc View 3 chunks +8 lines, -4 lines 0 comments Download
M runtime/vm/flow_graph_inliner.cc View 1 2 chunks +14 lines, -33 lines 0 comments Download
M runtime/vm/flow_graph_optimizer.cc View 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/vm/flow_graph_type_propagator.h View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/flow_graph_type_propagator.cc View 1 1 chunk +9 lines, -0 lines 0 comments Download
M runtime/vm/intermediate_language.h View 1 5 chunks +42 lines, -0 lines 0 comments Download
M runtime/vm/intermediate_language.cc View 1 7 chunks +63 lines, -3 lines 2 comments Download
M runtime/vm/intermediate_language_arm.cc View 1 3 chunks +51 lines, -9 lines 0 comments Download
M runtime/vm/intermediate_language_arm64.cc View 1 2 chunks +52 lines, -9 lines 0 comments Download
M runtime/vm/intermediate_language_ia32.cc View 1 3 chunks +53 lines, -12 lines 0 comments Download
M runtime/vm/intermediate_language_mips.cc View 1 3 chunks +52 lines, -10 lines 0 comments Download
M runtime/vm/intermediate_language_x64.cc View 1 3 chunks +53 lines, -12 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Florian Schneider
https://codereview.chromium.org/381803005/diff/1/runtime/vm/intermediate_language.cc File runtime/vm/intermediate_language.cc (right): https://codereview.chromium.org/381803005/diff/1/runtime/vm/intermediate_language.cc#newcode2538 runtime/vm/intermediate_language.cc:2538: if (a.IsInfinity() || b.IsInfinity()) return overflow; Handle infinity here ...
6 years, 5 months ago (2014-07-10 15:10:13 UTC) #1
Vyacheslav Egorov (Google)
I fear this introduces excessive deopts in some cases. See the question below https://codereview.chromium.org/381803005/diff/1/runtime/vm/flow_graph_inliner.cc File ...
6 years, 5 months ago (2014-07-10 15:27:53 UTC) #2
Cutch
https://codereview.chromium.org/381803005/diff/1/runtime/vm/intermediate_language.cc File runtime/vm/intermediate_language.cc (right): https://codereview.chromium.org/381803005/diff/1/runtime/vm/intermediate_language.cc#newcode2538 runtime/vm/intermediate_language.cc:2538: if (a.IsInfinity() || b.IsInfinity()) return overflow; On 2014/07/10 15:10:13, ...
6 years, 5 months ago (2014-07-10 16:04:20 UTC) #3
Vyacheslav Egorov (Google)
https://codereview.chromium.org/381803005/diff/1/runtime/vm/intermediate_language.cc File runtime/vm/intermediate_language.cc (right): https://codereview.chromium.org/381803005/diff/1/runtime/vm/intermediate_language.cc#newcode2538 runtime/vm/intermediate_language.cc:2538: if (a.IsInfinity() || b.IsInfinity()) return overflow; On 2014/07/10 16:04:20, ...
6 years, 5 months ago (2014-07-10 16:34:56 UTC) #4
Florian Schneider
Added canonicalization for CheckClassId and simplified the instruction since it always take a constant on ...
6 years, 5 months ago (2014-07-11 11:38:30 UTC) #5
Vyacheslav Egorov (Google)
lgtm https://codereview.chromium.org/381803005/diff/20001/runtime/vm/intermediate_language.cc File runtime/vm/intermediate_language.cc (right): https://codereview.chromium.org/381803005/diff/20001/runtime/vm/intermediate_language.cc#newcode2014 runtime/vm/intermediate_language.cc:2014: if (value()->BindsToConstant()) { does BindsToConstant() see through to ...
6 years, 5 months ago (2014-07-11 11:50:24 UTC) #6
Florian Schneider
Committed patchset #2 manually as r38154 (presubmit successful).
6 years, 5 months ago (2014-07-11 12:08:50 UTC) #7
Florian Schneider
6 years, 5 months ago (2014-07-14 12:13:46 UTC) #8
Message was sent while issue was closed.
https://codereview.chromium.org/381803005/diff/20001/runtime/vm/intermediate_...
File runtime/vm/intermediate_language.cc (right):

https://codereview.chromium.org/381803005/diff/20001/runtime/vm/intermediate_...
runtime/vm/intermediate_language.cc:2014: if (value()->BindsToConstant()) {
On 2014/07/11 11:50:24, Vyacheslav Egorov (Google wrote:
> does BindsToConstant() see through to OriginalDefinition?
>

No, we run Canonicalize after removing Redefinitions though.
 
> note: constant folding of LoadClassId instruction does not take
externalization
> into account. we need to fix this.

Yes.

Powered by Google App Engine
This is Rietveld 408576698