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