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

Side by Side Diff: runtime/vm/intermediate_language_mips.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/intermediate_language_ia32.cc ('k') | runtime/vm/intermediate_language_x64.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_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 1599 matching lines...) Expand 10 before | Expand all | Expand 10 after
1610 } 1610 }
1611 1611
1612 1612
1613 void GuardFieldClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1613 void GuardFieldClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1614 __ Comment("GuardFieldClassInstr"); 1614 __ Comment("GuardFieldClassInstr");
1615 1615
1616 const intptr_t value_cid = value()->Type()->ToCid(); 1616 const intptr_t value_cid = value()->Type()->ToCid();
1617 const intptr_t field_cid = field().guarded_cid(); 1617 const intptr_t field_cid = field().guarded_cid();
1618 const intptr_t nullability = field().is_nullable() ? kNullCid : kIllegalCid; 1618 const intptr_t nullability = field().is_nullable() ? kNullCid : kIllegalCid;
1619 1619
1620 ASSERT(field_cid != kDynamicCid); 1620 if (field_cid == kDynamicCid) {
1621 ASSERT(!compiler->is_optimizing());
1622 return; // Nothing to emit.
1623 }
1621 1624
1622 const bool emit_full_guard = 1625 const bool emit_full_guard =
1623 !compiler->is_optimizing() || (field_cid == kIllegalCid); 1626 !compiler->is_optimizing() || (field_cid == kIllegalCid);
1624 1627
1625 const bool needs_value_cid_temp_reg = 1628 const bool needs_value_cid_temp_reg =
1626 (value_cid == kDynamicCid) && (emit_full_guard || (field_cid != kSmiCid)); 1629 (value_cid == kDynamicCid) && (emit_full_guard || (field_cid != kSmiCid));
1627 1630
1628 const bool needs_field_temp_reg = emit_full_guard; 1631 const bool needs_field_temp_reg = emit_full_guard;
1629 1632
1630 const Register value_reg = locs()->in(0).reg(); 1633 const Register value_reg = locs()->in(0).reg();
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
1761 LocationSummary* summary = new(zone) LocationSummary( 1764 LocationSummary* summary = new(zone) LocationSummary(
1762 zone, kNumInputs, 0, LocationSummary::kNoCall); 1765 zone, kNumInputs, 0, LocationSummary::kNoCall);
1763 summary->set_in(0, Location::RequiresRegister()); 1766 summary->set_in(0, Location::RequiresRegister());
1764 return summary; 1767 return summary;
1765 } 1768 }
1766 UNREACHABLE(); 1769 UNREACHABLE();
1767 } 1770 }
1768 1771
1769 1772
1770 void GuardFieldLengthInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1773 void GuardFieldLengthInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1771 ASSERT(field().guarded_list_length() != Field::kNoFixedLength); 1774 if (field().guarded_list_length() == Field::kNoFixedLength) {
1775 ASSERT(!compiler->is_optimizing());
1776 return; // Nothing to emit.
1777 }
1772 1778
1773 Label* deopt = compiler->is_optimizing() ? 1779 Label* deopt = compiler->is_optimizing() ?
1774 compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL; 1780 compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL;
1775 1781
1776 const Register value_reg = locs()->in(0).reg(); 1782 const Register value_reg = locs()->in(0).reg();
1777 1783
1778 if (!compiler->is_optimizing() || 1784 if (!compiler->is_optimizing() ||
1779 (field().guarded_list_length() == Field::kUnknownFixedLength)) { 1785 (field().guarded_list_length() == Field::kUnknownFixedLength)) {
1780 const Register field_reg = locs()->temp(0).reg(); 1786 const Register field_reg = locs()->temp(0).reg();
1781 1787
(...skipping 3838 matching lines...) Expand 10 before | Expand all | Expand 10 after
5620 1, 5626 1,
5621 locs()); 5627 locs());
5622 __ lw(result, Address(SP, 1 * kWordSize)); 5628 __ lw(result, Address(SP, 1 * kWordSize));
5623 __ addiu(SP, SP, Immediate(2 * kWordSize)); 5629 __ addiu(SP, SP, Immediate(2 * kWordSize));
5624 } 5630 }
5625 5631
5626 5632
5627 } // namespace dart 5633 } // namespace dart
5628 5634
5629 #endif // defined TARGET_ARCH_MIPS 5635 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698