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

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

Issue 1125803002: Revert parts of r45502 and always generate guard field instructions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 7 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 | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/intermediate_language_arm64.cc » ('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/globals.h" // Needed here to get TARGET_ARCH_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 1562 matching lines...) Expand 10 before | Expand all | Expand 10 after
1573 1573
1574 return summary; 1574 return summary;
1575 } 1575 }
1576 1576
1577 1577
1578 void GuardFieldClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1578 void GuardFieldClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1579 const intptr_t value_cid = value()->Type()->ToCid(); 1579 const intptr_t value_cid = value()->Type()->ToCid();
1580 const intptr_t field_cid = field().guarded_cid(); 1580 const intptr_t field_cid = field().guarded_cid();
1581 const intptr_t nullability = field().is_nullable() ? kNullCid : kIllegalCid; 1581 const intptr_t nullability = field().is_nullable() ? kNullCid : kIllegalCid;
1582 1582
1583 ASSERT(field_cid != kDynamicCid); 1583 if (field_cid == kDynamicCid) {
1584 ASSERT(!compiler->is_optimizing());
1585 return; // Nothing to emit.
1586 }
1584 1587
1585 const bool emit_full_guard = 1588 const bool emit_full_guard =
1586 !compiler->is_optimizing() || (field_cid == kIllegalCid); 1589 !compiler->is_optimizing() || (field_cid == kIllegalCid);
1587 1590
1588 const bool needs_value_cid_temp_reg = emit_full_guard || 1591 const bool needs_value_cid_temp_reg = emit_full_guard ||
1589 ((value_cid == kDynamicCid) && (field_cid != kSmiCid)); 1592 ((value_cid == kDynamicCid) && (field_cid != kSmiCid));
1590 1593
1591 const bool needs_field_temp_reg = emit_full_guard; 1594 const bool needs_field_temp_reg = emit_full_guard;
1592 1595
1593 const Register value_reg = locs()->in(0).reg(); 1596 const Register value_reg = locs()->in(0).reg();
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
1725 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); 1728 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
1726 summary->set_in(0, Location::RequiresRegister()); 1729 summary->set_in(0, Location::RequiresRegister());
1727 summary->set_temp(0, Location::RequiresRegister()); 1730 summary->set_temp(0, Location::RequiresRegister());
1728 return summary; 1731 return summary;
1729 } 1732 }
1730 UNREACHABLE(); 1733 UNREACHABLE();
1731 } 1734 }
1732 1735
1733 1736
1734 void GuardFieldLengthInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1737 void GuardFieldLengthInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1735 ASSERT(field().guarded_list_length() != Field::kNoFixedLength); 1738 if (field().guarded_list_length() == Field::kNoFixedLength) {
1739 ASSERT(!compiler->is_optimizing());
1740 return; // Nothing to emit.
1741 }
1736 1742
1737 Label* deopt = compiler->is_optimizing() ? 1743 Label* deopt = compiler->is_optimizing() ?
1738 compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL; 1744 compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL;
1739 1745
1740 const Register value_reg = locs()->in(0).reg(); 1746 const Register value_reg = locs()->in(0).reg();
1741 1747
1742 if (!compiler->is_optimizing() || 1748 if (!compiler->is_optimizing() ||
1743 (field().guarded_list_length() == Field::kUnknownFixedLength)) { 1749 (field().guarded_list_length() == Field::kUnknownFixedLength)) {
1744 const Register field_reg = locs()->temp(0).reg(); 1750 const Register field_reg = locs()->temp(0).reg();
1745 const Register offset_reg = locs()->temp(1).reg(); 1751 const Register offset_reg = locs()->temp(1).reg();
(...skipping 5131 matching lines...) Expand 10 before | Expand all | Expand 10 after
6877 1, 6883 1,
6878 locs()); 6884 locs());
6879 __ Drop(1); 6885 __ Drop(1);
6880 __ Pop(result); 6886 __ Pop(result);
6881 } 6887 }
6882 6888
6883 6889
6884 } // namespace dart 6890 } // namespace dart
6885 6891
6886 #endif // defined TARGET_ARCH_ARM 6892 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/intermediate_language_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698