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

Issue 12218008: Inline getters of byte array view in the optimized flow graph. (Closed)

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

Description

Inline getters of byte array view in the optimized flow graph. This CL provides inline IL code for the getters _getInt8, _getInt16, etc. to speed up [] and byte array views. The code uses the existing LoadIndexed instructions by passing a index scale factor explicitly: For normal arrays loads, the scale factor is equal to the element size. For byte array access, the scale factor is always 1. I'm adding inlined setters in a separate CL. Committed: https://code.google.com/p/dart/source/detail?r=18173

Patch Set 1 #

Patch Set 2 : added separate test to exercise optimized code #

Patch Set 3 : updated vm.status with new test #

Total comments: 10
Unified diffs Side-by-side diffs Delta from patch set Stats (+2505 lines, -136 lines) Patch
A runtime/tests/vm/dart/byte_array_optimized_test.dart View 1 1 chunk +2214 lines, -0 lines 0 comments Download
M runtime/tests/vm/dart/byte_array_test.dart View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M runtime/tests/vm/vm.status View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/flow_graph_compiler.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M runtime/vm/flow_graph_compiler_arm.cc View 1 2 3 chunks +12 lines, -6 lines 0 comments Download
M runtime/vm/flow_graph_compiler_ia32.cc View 1 2 1 chunk +36 lines, -45 lines 3 comments Download
M runtime/vm/flow_graph_compiler_mips.cc View 1 2 3 chunks +12 lines, -6 lines 0 comments Download
M runtime/vm/flow_graph_compiler_x64.cc View 1 2 1 chunk +36 lines, -45 lines 0 comments Download
M runtime/vm/flow_graph_optimizer.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M runtime/vm/flow_graph_optimizer.cc View 1 2 4 chunks +115 lines, -2 lines 5 comments Download
M runtime/vm/intermediate_language.h View 1 2 4 chunks +12 lines, -1 line 0 comments Download
M runtime/vm/intermediate_language_ia32.cc View 1 2 5 chunks +24 lines, -12 lines 2 comments Download
M runtime/vm/intermediate_language_x64.cc View 1 2 5 chunks +32 lines, -18 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Florian Schneider
7 years, 10 months ago (2013-02-06 14:07:42 UTC) #1
Florian Schneider
On 2013/02/06 14:07:42, Florian Schneider wrote: The test I added is a modified version of ...
7 years, 10 months ago (2013-02-06 14:09:10 UTC) #2
Vyacheslav Egorov (Google)
lgtm
7 years, 10 months ago (2013-02-06 14:49:47 UTC) #3
Vyacheslav Egorov (Google)
still lgtm
7 years, 10 months ago (2013-02-06 15:16:52 UTC) #4
srdjan
DBC https://codereview.chromium.org/12218008/diff/4004/runtime/vm/flow_graph_compiler_ia32.cc File runtime/vm/flow_graph_compiler_ia32.cc (right): https://codereview.chromium.org/12218008/diff/4004/runtime/vm/flow_graph_compiler_ia32.cc#newcode1517 runtime/vm/flow_graph_compiler_ia32.cc:1517: static ScaleFactor ToScaleFactor(intptr_t index_scale) { I understand this ...
7 years, 10 months ago (2013-02-06 17:11:16 UTC) #5
Florian Schneider
Thanks. Addressed DBCs in a following CL. https://codereview.chromium.org/12218008/diff/4004/runtime/vm/flow_graph_compiler_ia32.cc File runtime/vm/flow_graph_compiler_ia32.cc (right): https://codereview.chromium.org/12218008/diff/4004/runtime/vm/flow_graph_compiler_ia32.cc#newcode1517 runtime/vm/flow_graph_compiler_ia32.cc:1517: static ScaleFactor ...
7 years, 10 months ago (2013-02-14 12:20:51 UTC) #6
srdjan
7 years, 10 months ago (2013-02-14 16:36:35 UTC) #7
Message was sent while issue was closed.
https://codereview.chromium.org/12218008/diff/4004/runtime/vm/flow_graph_comp...
File runtime/vm/flow_graph_compiler_ia32.cc (right):

https://codereview.chromium.org/12218008/diff/4004/runtime/vm/flow_graph_comp...
runtime/vm/flow_graph_compiler_ia32.cc:1517: static ScaleFactor
ToScaleFactor(intptr_t index_scale) {
On 2013/02/14 12:20:51, Florian Schneider wrote:
> On 2013/02/06 17:11:16, srdjan wrote:
> > I understand this function but find it confusing (integer index scale is
> > actually index_scale * 2, except when it is not (index_scale == 1)). 
> 
> It is indeed a little subtle. The code before had the same underlying issue
> though( that element size 1 is different)
> 
> Any suggestions to improve it?

No :-(.

https://codereview.chromium.org/12218008/diff/4004/runtime/vm/flow_graph_opti...
File runtime/vm/flow_graph_optimizer.cc (right):

https://codereview.chromium.org/12218008/diff/4004/runtime/vm/flow_graph_opti...
runtime/vm/flow_graph_optimizer.cc:1370: case kFloat64ArrayCid:
On 2013/02/14 12:20:51, Florian Schneider wrote:
> On 2013/02/06 17:11:16, srdjan wrote:
> > They may be ordered, i.e., you could check for ranges, maybe...
> 
> How can I make sure that they are ordered? It would be nice to have
> kFirstByteArrayCid and kLastByteArrayCid for a concise cid check.
> 
> Right now, I'm hoping that gcc figures out an efficient check if they're are
> indeed ordered.


They are ordered but not as we need it, see RawObject::IsByteArrayClassId.

Powered by Google App Engine
This is Rietveld 408576698