OLD | NEW |
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_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
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 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1418 | 1418 |
1419 return summary; | 1419 return summary; |
1420 } | 1420 } |
1421 | 1421 |
1422 | 1422 |
1423 void GuardFieldClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1423 void GuardFieldClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
1424 const intptr_t value_cid = value()->Type()->ToCid(); | 1424 const intptr_t value_cid = value()->Type()->ToCid(); |
1425 const intptr_t field_cid = field().guarded_cid(); | 1425 const intptr_t field_cid = field().guarded_cid(); |
1426 const intptr_t nullability = field().is_nullable() ? kNullCid : kIllegalCid; | 1426 const intptr_t nullability = field().is_nullable() ? kNullCid : kIllegalCid; |
1427 | 1427 |
1428 ASSERT(field_cid != kDynamicCid); | 1428 if (field_cid == kDynamicCid) { |
| 1429 ASSERT(!compiler->is_optimizing()); |
| 1430 return; // Nothing to emit. |
| 1431 } |
1429 | 1432 |
1430 const bool emit_full_guard = | 1433 const bool emit_full_guard = |
1431 !compiler->is_optimizing() || (field_cid == kIllegalCid); | 1434 !compiler->is_optimizing() || (field_cid == kIllegalCid); |
1432 | 1435 |
1433 const bool needs_value_cid_temp_reg = | 1436 const bool needs_value_cid_temp_reg = |
1434 (value_cid == kDynamicCid) && (emit_full_guard || (field_cid != kSmiCid)); | 1437 (value_cid == kDynamicCid) && (emit_full_guard || (field_cid != kSmiCid)); |
1435 | 1438 |
1436 const bool needs_field_temp_reg = emit_full_guard; | 1439 const bool needs_field_temp_reg = emit_full_guard; |
1437 | 1440 |
1438 const Register value_reg = locs()->in(0).reg(); | 1441 const Register value_reg = locs()->in(0).reg(); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1570 LocationSummary* summary = new(zone) LocationSummary( | 1573 LocationSummary* summary = new(zone) LocationSummary( |
1571 zone, kNumInputs, 0, LocationSummary::kNoCall); | 1574 zone, kNumInputs, 0, LocationSummary::kNoCall); |
1572 summary->set_in(0, Location::RequiresRegister()); | 1575 summary->set_in(0, Location::RequiresRegister()); |
1573 return summary; | 1576 return summary; |
1574 } | 1577 } |
1575 UNREACHABLE(); | 1578 UNREACHABLE(); |
1576 } | 1579 } |
1577 | 1580 |
1578 | 1581 |
1579 void GuardFieldLengthInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1582 void GuardFieldLengthInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
1580 ASSERT(field().guarded_list_length() != Field::kNoFixedLength); | 1583 if (field().guarded_list_length() == Field::kNoFixedLength) { |
| 1584 ASSERT(!compiler->is_optimizing()); |
| 1585 return; // Nothing to emit. |
| 1586 } |
1581 | 1587 |
1582 Label* deopt = compiler->is_optimizing() ? | 1588 Label* deopt = compiler->is_optimizing() ? |
1583 compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL; | 1589 compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL; |
1584 | 1590 |
1585 const Register value_reg = locs()->in(0).reg(); | 1591 const Register value_reg = locs()->in(0).reg(); |
1586 | 1592 |
1587 if (!compiler->is_optimizing() || | 1593 if (!compiler->is_optimizing() || |
1588 (field().guarded_list_length() == Field::kUnknownFixedLength)) { | 1594 (field().guarded_list_length() == Field::kUnknownFixedLength)) { |
1589 const Register field_reg = locs()->temp(0).reg(); | 1595 const Register field_reg = locs()->temp(0).reg(); |
1590 const Register offset_reg = locs()->temp(1).reg(); | 1596 const Register offset_reg = locs()->temp(1).reg(); |
(...skipping 5286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6877 __ Drop(1); | 6883 __ Drop(1); |
6878 __ popl(result); | 6884 __ popl(result); |
6879 } | 6885 } |
6880 | 6886 |
6881 | 6887 |
6882 } // namespace dart | 6888 } // namespace dart |
6883 | 6889 |
6884 #undef __ | 6890 #undef __ |
6885 | 6891 |
6886 #endif // defined TARGET_ARCH_IA32 | 6892 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |