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

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

Issue 1121303002: VM: Improve unoptimized code size by avoid emitting field guards. (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_compiler.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 if (field_cid == kDynamicCid) { 1583 ASSERT(field_cid != kDynamicCid);
1584 ASSERT(!compiler->is_optimizing());
1585 return; // Nothing to emit.
1586 }
1587 1584
1588 const bool emit_full_guard = 1585 const bool emit_full_guard =
1589 !compiler->is_optimizing() || (field_cid == kIllegalCid); 1586 !compiler->is_optimizing() || (field_cid == kIllegalCid);
1590 1587
1591 const bool needs_value_cid_temp_reg = emit_full_guard || 1588 const bool needs_value_cid_temp_reg = emit_full_guard ||
1592 ((value_cid == kDynamicCid) && (field_cid != kSmiCid)); 1589 ((value_cid == kDynamicCid) && (field_cid != kSmiCid));
1593 1590
1594 const bool needs_field_temp_reg = emit_full_guard; 1591 const bool needs_field_temp_reg = emit_full_guard;
1595 1592
1596 const Register value_reg = locs()->in(0).reg(); 1593 const Register value_reg = locs()->in(0).reg();
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
1728 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); 1725 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
1729 summary->set_in(0, Location::RequiresRegister()); 1726 summary->set_in(0, Location::RequiresRegister());
1730 summary->set_temp(0, Location::RequiresRegister()); 1727 summary->set_temp(0, Location::RequiresRegister());
1731 return summary; 1728 return summary;
1732 } 1729 }
1733 UNREACHABLE(); 1730 UNREACHABLE();
1734 } 1731 }
1735 1732
1736 1733
1737 void GuardFieldLengthInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1734 void GuardFieldLengthInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1738 if (field().guarded_list_length() == Field::kNoFixedLength) { 1735 ASSERT(field().guarded_list_length() != Field::kNoFixedLength);
1739 ASSERT(!compiler->is_optimizing());
1740 return; // Nothing to emit.
1741 }
1742 1736
1743 Label* deopt = compiler->is_optimizing() ? 1737 Label* deopt = compiler->is_optimizing() ?
1744 compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL; 1738 compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL;
1745 1739
1746 const Register value_reg = locs()->in(0).reg(); 1740 const Register value_reg = locs()->in(0).reg();
1747 1741
1748 if (!compiler->is_optimizing() || 1742 if (!compiler->is_optimizing() ||
1749 (field().guarded_list_length() == Field::kUnknownFixedLength)) { 1743 (field().guarded_list_length() == Field::kUnknownFixedLength)) {
1750 const Register field_reg = locs()->temp(0).reg(); 1744 const Register field_reg = locs()->temp(0).reg();
1751 const Register offset_reg = locs()->temp(1).reg(); 1745 const Register offset_reg = locs()->temp(1).reg();
(...skipping 5131 matching lines...) Expand 10 before | Expand all | Expand 10 after
6883 1, 6877 1,
6884 locs()); 6878 locs());
6885 __ Drop(1); 6879 __ Drop(1);
6886 __ Pop(result); 6880 __ Pop(result);
6887 } 6881 }
6888 6882
6889 6883
6890 } // namespace dart 6884 } // namespace dart
6891 6885
6892 #endif // defined TARGET_ARCH_ARM 6886 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler.cc ('k') | runtime/vm/intermediate_language_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698