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

Side by Side Diff: runtime/vm/intermediate_language_x64.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_mips.cc ('k') | no next file » | 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_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
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 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1437 1437
1438 return summary; 1438 return summary;
1439 } 1439 }
1440 1440
1441 1441
1442 void GuardFieldClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1442 void GuardFieldClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1443 const intptr_t value_cid = value()->Type()->ToCid(); 1443 const intptr_t value_cid = value()->Type()->ToCid();
1444 const intptr_t field_cid = field().guarded_cid(); 1444 const intptr_t field_cid = field().guarded_cid();
1445 const intptr_t nullability = field().is_nullable() ? kNullCid : kIllegalCid; 1445 const intptr_t nullability = field().is_nullable() ? kNullCid : kIllegalCid;
1446 1446
1447 ASSERT(field_cid != kDynamicCid); 1447 if (field_cid == kDynamicCid) {
1448 ASSERT(!compiler->is_optimizing());
1449 return; // Nothing to emit.
1450 }
1448 1451
1449 const bool emit_full_guard = 1452 const bool emit_full_guard =
1450 !compiler->is_optimizing() || (field_cid == kIllegalCid); 1453 !compiler->is_optimizing() || (field_cid == kIllegalCid);
1451 1454
1452 const bool needs_value_cid_temp_reg = 1455 const bool needs_value_cid_temp_reg =
1453 (value_cid == kDynamicCid) && (emit_full_guard || (field_cid != kSmiCid)); 1456 (value_cid == kDynamicCid) && (emit_full_guard || (field_cid != kSmiCid));
1454 1457
1455 const bool needs_field_temp_reg = emit_full_guard; 1458 const bool needs_field_temp_reg = emit_full_guard;
1456 1459
1457 const Register value_reg = locs()->in(0).reg(); 1460 const Register value_reg = locs()->in(0).reg();
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1575 LocationSummary* summary = new(zone) LocationSummary( 1578 LocationSummary* summary = new(zone) LocationSummary(
1576 zone, kNumInputs, 0, LocationSummary::kNoCall); 1579 zone, kNumInputs, 0, LocationSummary::kNoCall);
1577 summary->set_in(0, Location::RequiresRegister()); 1580 summary->set_in(0, Location::RequiresRegister());
1578 return summary; 1581 return summary;
1579 } 1582 }
1580 UNREACHABLE(); 1583 UNREACHABLE();
1581 } 1584 }
1582 1585
1583 1586
1584 void GuardFieldLengthInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1587 void GuardFieldLengthInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1585 ASSERT(field().guarded_list_length() != Field::kNoFixedLength); 1588 if (field().guarded_list_length() == Field::kNoFixedLength) {
1589 ASSERT(!compiler->is_optimizing());
1590 return; // Nothing to emit.
1591 }
1586 1592
1587 Label* deopt = compiler->is_optimizing() ? 1593 Label* deopt = compiler->is_optimizing() ?
1588 compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL; 1594 compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL;
1589 1595
1590 const Register value_reg = locs()->in(0).reg(); 1596 const Register value_reg = locs()->in(0).reg();
1591 1597
1592 if (!compiler->is_optimizing() || 1598 if (!compiler->is_optimizing() ||
1593 (field().guarded_list_length() == Field::kUnknownFixedLength)) { 1599 (field().guarded_list_length() == Field::kUnknownFixedLength)) {
1594 const Register field_reg = locs()->temp(0).reg(); 1600 const Register field_reg = locs()->temp(0).reg();
1595 const Register offset_reg = locs()->temp(1).reg(); 1601 const Register offset_reg = locs()->temp(1).reg();
(...skipping 4847 matching lines...) Expand 10 before | Expand all | Expand 10 after
6443 __ Drop(1); 6449 __ Drop(1);
6444 __ popq(result); 6450 __ popq(result);
6445 } 6451 }
6446 6452
6447 6453
6448 } // namespace dart 6454 } // namespace dart
6449 6455
6450 #undef __ 6456 #undef __
6451 6457
6452 #endif // defined TARGET_ARCH_X64 6458 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698