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

Issue 504143003: Support Int32 representation for selected binary operations. (Closed)

Created:
6 years, 3 months ago by Vyacheslav Egorov (Google)
Modified:
6 years, 3 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Support Int32 representation for selected binary operations. BUG= R=fschneider@google.com Committed: https://code.google.com/p/dart/source/detail?r=39595

Patch Set 1 #

Patch Set 2 : support ARM and ia32 #

Patch Set 3 : fix int32->double conversion, fix int32->int32, uint32->uint32 boxing #

Patch Set 4 : fix SHA256 regression related to over eager UnboxInteger()->UnboxUint32() fusion #

Patch Set 5 : #

Total comments: 34

Patch Set 6 : #

Total comments: 28
Unified diffs Side-by-side diffs Delta from patch set Stats (+2592 lines, -535 lines) Patch
M runtime/vm/compiler.cc View 1 2 3 4 5 1 chunk +12 lines, -0 lines 0 comments Download
M runtime/vm/deopt_instructions.h View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/deopt_instructions.cc View 1 5 chunks +21 lines, -6 lines 2 comments Download
M runtime/vm/flow_graph_allocator.cc View 5 chunks +8 lines, -8 lines 0 comments Download
M runtime/vm/flow_graph_compiler_arm.cc View 1 2 chunks +10 lines, -2 lines 0 comments Download
M runtime/vm/flow_graph_compiler_ia32.cc View 2 chunks +11 lines, -1 line 4 comments Download
M runtime/vm/flow_graph_optimizer.h View 3 chunks +7 lines, -4 lines 0 comments Download
M runtime/vm/flow_graph_optimizer.cc View 1 2 3 4 5 17 chunks +370 lines, -31 lines 16 comments Download
M runtime/vm/flow_graph_range_analysis.h View 1 2 3 4 5 12 chunks +106 lines, -43 lines 2 comments Download
M runtime/vm/flow_graph_range_analysis.cc View 1 2 3 4 5 26 chunks +245 lines, -71 lines 0 comments Download
M runtime/vm/flow_graph_range_analysis_test.cc View 1 2 3 4 5 2 chunks +33 lines, -16 lines 0 comments Download
M runtime/vm/flow_graph_type_propagator.cc View 1 2 3 chunks +26 lines, -0 lines 0 comments Download
M runtime/vm/il_printer.cc View 1 5 chunks +63 lines, -0 lines 0 comments Download
M runtime/vm/intermediate_language.h View 1 2 3 4 5 21 chunks +284 lines, -24 lines 4 comments Download
M runtime/vm/intermediate_language.cc View 1 2 3 9 chunks +235 lines, -8 lines 0 comments Download
M runtime/vm/intermediate_language_arm.cc View 1 2 3 4 5 15 chunks +497 lines, -28 lines 0 comments Download
M runtime/vm/intermediate_language_arm64.cc View 1 2 3 4 7 chunks +15 lines, -71 lines 0 comments Download
M runtime/vm/intermediate_language_ia32.cc View 1 2 3 4 5 11 chunks +515 lines, -50 lines 0 comments Download
M runtime/vm/intermediate_language_mips.cc View 1 2 3 4 6 chunks +15 lines, -83 lines 0 comments Download
M runtime/vm/intermediate_language_x64.cc View 1 2 3 4 8 chunks +18 lines, -78 lines 0 comments Download
M runtime/vm/locations.h View 3 chunks +9 lines, -5 lines 0 comments Download
M runtime/vm/locations.cc View 7 chunks +11 lines, -6 lines 0 comments Download
M tests/standalone/standalone.status View 1 1 chunk +1 line, -0 lines 0 comments Download
A tests/standalone/unboxed_int_converter_test.dart View 1 2 3 4 5 1 chunk +79 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Vyacheslav Egorov (Google)
vegorov@google.com changed reviewers: + fschneider@google.com, johnmccutchan@google.com, srdjan@google.com
6 years, 3 months ago (2014-08-26 22:48:37 UTC) #1
Vyacheslav Egorov (Google)
I think this is ready for the review. Only ARM and x86 support. You can ...
6 years, 3 months ago (2014-08-26 22:48:37 UTC) #2
Florian Schneider
LGTM. https://codereview.chromium.org/504143003/diff/80001/runtime/vm/compiler.cc File runtime/vm/compiler.cc (right): https://codereview.chromium.org/504143003/diff/80001/runtime/vm/compiler.cc#newcode415 runtime/vm/compiler.cc:415: // comming from the loop pre-header into smi-phis. ...
6 years, 3 months ago (2014-08-27 09:36:52 UTC) #3
Vyacheslav Egorov (Google)
Thanks for the review. Addressing comments and landing. https://codereview.chromium.org/504143003/diff/80001/runtime/vm/compiler.cc File runtime/vm/compiler.cc (right): https://codereview.chromium.org/504143003/diff/80001/runtime/vm/compiler.cc#newcode415 runtime/vm/compiler.cc:415: // ...
6 years, 3 months ago (2014-08-27 11:45:37 UTC) #4
Florian Schneider
lgtm
6 years, 3 months ago (2014-08-27 14:38:14 UTC) #5
Vyacheslav Egorov (Google)
Committed patchset #6 manually as 39595 (presubmit successful).
6 years, 3 months ago (2014-08-27 14:49:41 UTC) #6
srdjan
DBC and thanks for quick implementation. https://codereview.chromium.org/504143003/diff/100001/runtime/vm/deopt_instructions.cc File runtime/vm/deopt_instructions.cc (right): https://codereview.chromium.org/504143003/diff/100001/runtime/vm/deopt_instructions.cc#newcode1136 runtime/vm/deopt_instructions.cc:1136: ToCpuRegisterSource(source_loc)); 4 spaces ...
6 years, 3 months ago (2014-08-27 16:17:13 UTC) #7
Vyacheslav Egorov (Google)
6 years, 3 months ago (2014-08-28 20:48:37 UTC) #8
Message was sent while issue was closed.
DBC addressed

Please take a look at https://codereview.chromium.org/516013003/

https://codereview.chromium.org/504143003/diff/100001/runtime/vm/deopt_instru...
File runtime/vm/deopt_instructions.cc (right):

https://codereview.chromium.org/504143003/diff/100001/runtime/vm/deopt_instru...
runtime/vm/deopt_instructions.cc:1136: ToCpuRegisterSource(source_loc));
On 2014/08/27 16:17:12, srdjan wrote:
> 4 spaces

Done.

https://codereview.chromium.org/504143003/diff/100001/runtime/vm/flow_graph_c...
File runtime/vm/flow_graph_compiler_ia32.cc (right):

https://codereview.chromium.org/504143003/diff/100001/runtime/vm/flow_graph_c...
runtime/vm/flow_graph_compiler_ia32.cc:1580:
source.constant_instruction()->representation() == kUnboxedInt32) {
On 2014/08/27 16:17:12, srdjan wrote:
> add parentheses

Done.

https://codereview.chromium.org/504143003/diff/100001/runtime/vm/flow_graph_c...
runtime/vm/flow_graph_compiler_ia32.cc:1617:
source.constant_instruction()->representation() == kUnboxedInt32) {
On 2014/08/27 16:17:12, srdjan wrote:
> add parentheses

Done.

https://codereview.chromium.org/504143003/diff/100001/runtime/vm/flow_graph_o...
File runtime/vm/flow_graph_optimizer.cc (right):

https://codereview.chromium.org/504143003/diff/100001/runtime/vm/flow_graph_o...
runtime/vm/flow_graph_optimizer.cc:626: deopt_id);
On 2014/08/27 16:17:13, srdjan wrote:
> Why does the case (to == kUnboxedUin32 && from == kUnboxedInt32) not need
> deopt-id (e.g., if from is negative)?

Uint32 representation is kinda special right now in a sense that it is
*truncating* that is it just equivalent to doing implicit & 0xFFFFFFFF over its
input. That's why it *never* deopts.

https://codereview.chromium.org/504143003/diff/100001/runtime/vm/flow_graph_o...
runtime/vm/flow_graph_optimizer.cc:4628: class DefinitionWorklist {
On 2014/08/27 16:17:13, srdjan wrote:
> public ValueObject

Done.

https://codereview.chromium.org/504143003/diff/100001/runtime/vm/flow_graph_o...
runtime/vm/flow_graph_optimizer.cc:4658: BitVector* contains_;
On 2014/08/27 16:17:13, srdjan wrote:
> I think it is slightly confusing to have contains() and Contains(Definition*
> defn). Maybe rename contains_ to contains_vector_?

Done.

https://codereview.chromium.org/504143003/diff/100001/runtime/vm/flow_graph_o...
runtime/vm/flow_graph_optimizer.cc:4677: return true;
On 2014/08/27 16:17:13, srdjan wrote:
> Why not kSHL?

Shift Left by a *constant* does not need to untag or retag, so by itself it does
not benefit from Int32 representation right now.

https://codereview.chromium.org/504143003/diff/100001/runtime/vm/flow_graph_o...
runtime/vm/flow_graph_optimizer.cc:4697: if (smi_op != NULL &&
On 2014/08/27 16:17:13, srdjan wrote:
> add parentheses

Done.

https://codereview.chromium.org/504143003/diff/100001/runtime/vm/flow_graph_o...
runtime/vm/flow_graph_optimizer.cc:4705: if (candidates.length() == 0) {
On 2014/08/27 16:17:13, srdjan wrote:
> candidates.is_empty()

Done.

https://codereview.chromium.org/504143003/diff/100001/runtime/vm/flow_graph_o...
runtime/vm/flow_graph_optimizer.cc:4715: flow_graph()->loop_headers();
On 2014/08/27 16:17:13, srdjan wrote:
> 4 spaces indent

Done.

https://codereview.chromium.org/504143003/diff/100001/runtime/vm/flow_graph_o...
runtime/vm/flow_graph_optimizer.cc:4780: } else if (input->IsPhi() &&
input->Type()->ToCid() == kSmiCid) {
On 2014/08/27 16:17:13, srdjan wrote:
> Add parentheses

Done.

https://codereview.chromium.org/504143003/diff/100001/runtime/vm/flow_graph_r...
File runtime/vm/flow_graph_range_analysis.h (right):

https://codereview.chromium.org/504143003/diff/100001/runtime/vm/flow_graph_r...
runtime/vm/flow_graph_range_analysis.h:430: }
On 2014/08/27 16:17:13, srdjan wrote:
> I think it is confusing to have a non-static and static method with same name.

Agreed. Moved into a separate AllStatic helper class.

https://codereview.chromium.org/504143003/diff/100001/runtime/vm/intermediate...
File runtime/vm/intermediate_language.h (right):

https://codereview.chromium.org/504143003/diff/100001/runtime/vm/intermediate...
runtime/vm/intermediate_language.h:6939: #if defined(TARGET_ARCH_IA32) ||
defined(TARGET_ARCH_ARM)
On 2014/08/27 16:17:13, srdjan wrote:
> You could move this into intermediate_language_xxx.cc

Agreed. However I did not for two reasons:

1) This is a very temporary solution, and it is priority for me to actually
remove this #ifdef.

2) It would cause me to duplicated this switch twice (ARM, IA32) and duplicate
return false twice (MIPS, ARM64).

https://codereview.chromium.org/504143003/diff/100001/runtime/vm/intermediate...
runtime/vm/intermediate_language.h:6993: ASSERT(idx == 0 || idx == 1);
On 2014/08/27 16:17:13, srdjan wrote:
> parentheses

Done.

Powered by Google App Engine
This is Rietveld 408576698