| 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/compiler.h" |
| 10 #include "vm/dart_entry.h" | 11 #include "vm/dart_entry.h" |
| 11 #include "vm/flow_graph.h" | 12 #include "vm/flow_graph.h" |
| 12 #include "vm/flow_graph_compiler.h" | 13 #include "vm/flow_graph_compiler.h" |
| 13 #include "vm/flow_graph_range_analysis.h" | 14 #include "vm/flow_graph_range_analysis.h" |
| 14 #include "vm/locations.h" | 15 #include "vm/locations.h" |
| 15 #include "vm/object_store.h" | 16 #include "vm/object_store.h" |
| 16 #include "vm/parser.h" | 17 #include "vm/parser.h" |
| 17 #include "vm/stack_frame.h" | 18 #include "vm/stack_frame.h" |
| 18 #include "vm/stub_code.h" | 19 #include "vm/stub_code.h" |
| 19 #include "vm/symbols.h" | 20 #include "vm/symbols.h" |
| (...skipping 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1427 } | 1428 } |
| 1428 | 1429 |
| 1429 | 1430 |
| 1430 void GuardFieldClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1431 void GuardFieldClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1431 ASSERT(sizeof(classid_t) == kInt16Size); | 1432 ASSERT(sizeof(classid_t) == kInt16Size); |
| 1432 const intptr_t value_cid = value()->Type()->ToCid(); | 1433 const intptr_t value_cid = value()->Type()->ToCid(); |
| 1433 const intptr_t field_cid = field().guarded_cid(); | 1434 const intptr_t field_cid = field().guarded_cid(); |
| 1434 const intptr_t nullability = field().is_nullable() ? kNullCid : kIllegalCid; | 1435 const intptr_t nullability = field().is_nullable() ? kNullCid : kIllegalCid; |
| 1435 | 1436 |
| 1436 if (field_cid == kDynamicCid) { | 1437 if (field_cid == kDynamicCid) { |
| 1438 if (Compiler::IsBackgroundCompilation()) { |
| 1439 // Field state changed while compiling. |
| 1440 Compiler::AbortBackgroundCompilation(deopt_id()); |
| 1441 } |
| 1437 ASSERT(!compiler->is_optimizing()); | 1442 ASSERT(!compiler->is_optimizing()); |
| 1438 return; // Nothing to emit. | 1443 return; // Nothing to emit. |
| 1439 } | 1444 } |
| 1440 | 1445 |
| 1441 const bool emit_full_guard = | 1446 const bool emit_full_guard = |
| 1442 !compiler->is_optimizing() || (field_cid == kIllegalCid); | 1447 !compiler->is_optimizing() || (field_cid == kIllegalCid); |
| 1443 | 1448 |
| 1444 const bool needs_value_cid_temp_reg = | 1449 const bool needs_value_cid_temp_reg = |
| 1445 (value_cid == kDynamicCid) && (emit_full_guard || (field_cid != kSmiCid)); | 1450 (value_cid == kDynamicCid) && (emit_full_guard || (field_cid != kSmiCid)); |
| 1446 | 1451 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1582 zone, kNumInputs, 0, LocationSummary::kNoCall); | 1587 zone, kNumInputs, 0, LocationSummary::kNoCall); |
| 1583 summary->set_in(0, Location::RequiresRegister()); | 1588 summary->set_in(0, Location::RequiresRegister()); |
| 1584 return summary; | 1589 return summary; |
| 1585 } | 1590 } |
| 1586 UNREACHABLE(); | 1591 UNREACHABLE(); |
| 1587 } | 1592 } |
| 1588 | 1593 |
| 1589 | 1594 |
| 1590 void GuardFieldLengthInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1595 void GuardFieldLengthInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1591 if (field().guarded_list_length() == Field::kNoFixedLength) { | 1596 if (field().guarded_list_length() == Field::kNoFixedLength) { |
| 1597 if (Compiler::IsBackgroundCompilation()) { |
| 1598 // Field state changed while compiling. |
| 1599 Compiler::AbortBackgroundCompilation(deopt_id()); |
| 1600 } |
| 1592 ASSERT(!compiler->is_optimizing()); | 1601 ASSERT(!compiler->is_optimizing()); |
| 1593 return; // Nothing to emit. | 1602 return; // Nothing to emit. |
| 1594 } | 1603 } |
| 1595 | 1604 |
| 1596 Label* deopt = compiler->is_optimizing() ? | 1605 Label* deopt = compiler->is_optimizing() ? |
| 1597 compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL; | 1606 compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL; |
| 1598 | 1607 |
| 1599 const Register value_reg = locs()->in(0).reg(); | 1608 const Register value_reg = locs()->in(0).reg(); |
| 1600 | 1609 |
| 1601 if (!compiler->is_optimizing() || | 1610 if (!compiler->is_optimizing() || |
| (...skipping 5266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6868 __ Drop(1); | 6877 __ Drop(1); |
| 6869 __ popl(result); | 6878 __ popl(result); |
| 6870 } | 6879 } |
| 6871 | 6880 |
| 6872 | 6881 |
| 6873 } // namespace dart | 6882 } // namespace dart |
| 6874 | 6883 |
| 6875 #undef __ | 6884 #undef __ |
| 6876 | 6885 |
| 6877 #endif // defined TARGET_ARCH_IA32 | 6886 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |