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

Side by Side Diff: runtime/vm/flow_graph_optimizer.cc

Issue 414163003: Fix issue 20190: Mark Uint32/Int32 typed data load to produce a Mint always (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/flow_graph_optimizer.h" 5 #include "vm/flow_graph_optimizer.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/cha.h" 8 #include "vm/cha.h"
9 #include "vm/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 1641 matching lines...) Expand 10 before | Expand all | Expand 10 after
1652 1652
1653 array_cid = PrepareInlineIndexedOp(call, 1653 array_cid = PrepareInlineIndexedOp(call,
1654 array_cid, 1654 array_cid,
1655 &array, 1655 &array,
1656 index, 1656 index,
1657 &cursor); 1657 &cursor);
1658 1658
1659 intptr_t deopt_id = Isolate::kNoDeoptId; 1659 intptr_t deopt_id = Isolate::kNoDeoptId;
1660 if ((array_cid == kTypedDataInt32ArrayCid) || 1660 if ((array_cid == kTypedDataInt32ArrayCid) ||
1661 (array_cid == kTypedDataUint32ArrayCid)) { 1661 (array_cid == kTypedDataUint32ArrayCid)) {
1662 // Prevent excessive deoptimization, assume full 32 bits used, and therefore 1662 // Deoptimization may be needed if result does not always fit in a Smi.
1663 // generate Mint on 32-bit architectures. 1663 deopt_id = (kSmiBits >= 32) ? Isolate::kNoDeoptId : call->deopt_id();
1664 deopt_id = (kSmiBits < 32) ? Isolate::kNoDeoptId : call->deopt_id();
1665 } 1664 }
1666 1665
1667 // Array load and return. 1666 // Array load and return.
1668 intptr_t index_scale = Instance::ElementSizeFor(array_cid); 1667 intptr_t index_scale = Instance::ElementSizeFor(array_cid);
1669 *last = new(I) LoadIndexedInstr(new(I) Value(array), 1668 *last = new(I) LoadIndexedInstr(new(I) Value(array),
1670 new(I) Value(index), 1669 new(I) Value(index),
1671 index_scale, 1670 index_scale,
1672 array_cid, 1671 array_cid,
1673 deopt_id, 1672 deopt_id,
1674 call->token_pos()); 1673 call->token_pos());
(...skipping 1873 matching lines...) Expand 10 before | Expand all | Expand 10 after
3548 array_cid = PrepareInlineByteArrayViewOp(call, 3547 array_cid = PrepareInlineByteArrayViewOp(call,
3549 array_cid, 3548 array_cid,
3550 view_cid, 3549 view_cid,
3551 &array, 3550 &array,
3552 index, 3551 index,
3553 &cursor); 3552 &cursor);
3554 3553
3555 intptr_t deopt_id = Isolate::kNoDeoptId; 3554 intptr_t deopt_id = Isolate::kNoDeoptId;
3556 if ((array_cid == kTypedDataInt32ArrayCid) || 3555 if ((array_cid == kTypedDataInt32ArrayCid) ||
3557 (array_cid == kTypedDataUint32ArrayCid)) { 3556 (array_cid == kTypedDataUint32ArrayCid)) {
3558 // Prevent excessive deoptimization, assume full 32 bits used, and therefore 3557 // Deoptimization may be needed if result does not always fit in a Smi.
3559 // generate Mint on 32-bit architectures. 3558 deopt_id = (kSmiBits >= 32) ? Isolate::kNoDeoptId : call->deopt_id();
3560 deopt_id = (kSmiBits < 32) ? Isolate::kNoDeoptId : call->deopt_id();
3561 } 3559 }
3562 3560
3563 *last = new(I) LoadIndexedInstr(new(I) Value(array), 3561 *last = new(I) LoadIndexedInstr(new(I) Value(array),
3564 new(I) Value(index), 3562 new(I) Value(index),
3565 1, 3563 1,
3566 view_cid, 3564 view_cid,
3567 deopt_id, 3565 deopt_id,
3568 call->token_pos()); 3566 call->token_pos());
3569 cursor = flow_graph()->AppendTo( 3567 cursor = flow_graph()->AppendTo(
3570 cursor, 3568 cursor,
(...skipping 6846 matching lines...) Expand 10 before | Expand all | Expand 10 after
10417 10415
10418 // Insert materializations at environment uses. 10416 // Insert materializations at environment uses.
10419 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { 10417 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) {
10420 CreateMaterializationAt( 10418 CreateMaterializationAt(
10421 exits_collector_.exits()[i], alloc, alloc->cls(), *slots); 10419 exits_collector_.exits()[i], alloc, alloc->cls(), *slots);
10422 } 10420 }
10423 } 10421 }
10424 10422
10425 10423
10426 } // namespace dart 10424 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698