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

Issue 11967012: Optimized loads/stores for scalar list: Uint8Clamped, Int8, Int16, Uint16. (Closed)

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

Description

Optimized loads/stores for scalar list: Uint8Clamped, Int8, Int16, Uint16. This CL adds optimized stores for Uint8ClampedList, and loads+stores for Int8List, Int16List and Uint16List. TEST=tests/standalone/byte_array_test.dart, tests/standalone/int_array_test.dart Committed: https://code.google.com/p/dart/source/detail?r=17190

Patch Set 1 #

Patch Set 2 : #

Total comments: 8

Patch Set 3 : addressed comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+327 lines, -43 lines) Patch
M runtime/vm/deopt_instructions.cc View 1 chunk +0 lines, -1 line 0 comments Download
M runtime/vm/flow_graph_compiler.cc View 1 4 chunks +40 lines, -0 lines 0 comments Download
M runtime/vm/flow_graph_compiler_ia32.h View 1 chunk +6 lines, -0 lines 0 comments Download
M runtime/vm/flow_graph_compiler_x64.h View 1 chunk +6 lines, -0 lines 0 comments Download
M runtime/vm/flow_graph_optimizer.cc View 3 chunks +13 lines, -1 line 0 comments Download
M runtime/vm/intermediate_language.cc View 5 chunks +25 lines, -0 lines 0 comments Download
M runtime/vm/intermediate_language_ia32.cc View 1 2 10 chunks +97 lines, -21 lines 0 comments Download
M runtime/vm/intermediate_language_x64.cc View 1 2 7 chunks +94 lines, -18 lines 0 comments Download
M tests/standalone/int_array_test.dart View 1 2 3 chunks +46 lines, -2 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Florian Schneider
7 years, 11 months ago (2013-01-16 15:08:35 UTC) #1
Florian Schneider
[+vm-dev]
7 years, 11 months ago (2013-01-16 15:11:13 UTC) #2
srdjan
LGTM https://codereview.chromium.org/11967012/diff/2001/runtime/vm/flow_graph_compiler.cc File runtime/vm/flow_graph_compiler.cc (right): https://codereview.chromium.org/11967012/diff/2001/runtime/vm/flow_graph_compiler.cc#newcode1059 runtime/vm/flow_graph_compiler.cc:1059: return ExternalUint8Array::kBytesPerElement; Can you add kExternalUint8ClampedArrayCid as well. ...
7 years, 11 months ago (2013-01-16 17:47:33 UTC) #3
Florian Schneider
7 years, 11 months ago (2013-01-17 10:27:14 UTC) #4
https://codereview.chromium.org/11967012/diff/2001/runtime/vm/flow_graph_comp...
File runtime/vm/flow_graph_compiler.cc (right):

https://codereview.chromium.org/11967012/diff/2001/runtime/vm/flow_graph_comp...
runtime/vm/flow_graph_compiler.cc:1059: return
ExternalUint8Array::kBytesPerElement;
On 2013/01/16 17:47:33, srdjan wrote:
> Can you add kExternalUint8ClampedArrayCid as well. It turns out that is the
one
> that we will be getting from Canvas.

Yes, of course. I will add the external array operations in a separate CL.

https://codereview.chromium.org/11967012/diff/2001/runtime/vm/intermediate_la...
File runtime/vm/intermediate_language_ia32.cc (right):

https://codereview.chromium.org/11967012/diff/2001/runtime/vm/intermediate_la...
runtime/vm/intermediate_language_ia32.cc:1244: : Location::RequiresRegister());
On 2013/01/16 17:47:33, srdjan wrote:
> SInce index gets untagged, do you need writable register?

The smi index either gets retagged at the end (element size == 1) or it is left
smi tagged (for all element sizes > 1). I'll add a comment.

I'm thinking about changing this though: If we add a constraint
WritableRegisterOrConstant, we can avoid the tagging the index again completely.

https://codereview.chromium.org/11967012/diff/2001/runtime/vm/intermediate_la...
runtime/vm/intermediate_language_ia32.cc:1259: case kUint16ArrayCid:
On 2013/01/16 17:47:33, srdjan wrote:
> Add a comment why a writable register.

Done.

https://codereview.chromium.org/11967012/diff/2001/tests/standalone/int_array...
File tests/standalone/int_array_test.dart (right):

https://codereview.chromium.org/11967012/diff/2001/tests/standalone/int_array...
tests/standalone/int_array_test.dart:131: for (int i = 0; i < 10000; i++) {
On 2013/01/16 17:47:33, srdjan wrote:
> Why 10000? 2000 should be plenty to trigger compilation.

Done.

Powered by Google App Engine
This is Rietveld 408576698