| 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_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/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 1435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1446 | 1446 |
| 1447 void GuardFieldClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1447 void GuardFieldClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1448 ASSERT(sizeof(classid_t) == kInt32Size); | 1448 ASSERT(sizeof(classid_t) == kInt32Size); |
| 1449 const intptr_t value_cid = value()->Type()->ToCid(); | 1449 const intptr_t value_cid = value()->Type()->ToCid(); |
| 1450 const intptr_t field_cid = field().guarded_cid(); | 1450 const intptr_t field_cid = field().guarded_cid(); |
| 1451 const intptr_t nullability = field().is_nullable() ? kNullCid : kIllegalCid; | 1451 const intptr_t nullability = field().is_nullable() ? kNullCid : kIllegalCid; |
| 1452 | 1452 |
| 1453 if (field_cid == kDynamicCid) { | 1453 if (field_cid == kDynamicCid) { |
| 1454 if (Compiler::IsBackgroundCompilation()) { | 1454 if (Compiler::IsBackgroundCompilation()) { |
| 1455 // Field state changed while compiling. | 1455 // Field state changed while compiling. |
| 1456 Compiler::AbortBackgroundCompilation(deopt_id()); | 1456 Compiler::AbortBackgroundCompilation(deopt_id(), |
| 1457 "GuardFieldClassInstr: field state changed while compiling"); |
| 1457 } | 1458 } |
| 1458 ASSERT(!compiler->is_optimizing()); | 1459 ASSERT(!compiler->is_optimizing()); |
| 1459 return; // Nothing to emit. | 1460 return; // Nothing to emit. |
| 1460 } | 1461 } |
| 1461 | 1462 |
| 1462 const bool emit_full_guard = | 1463 const bool emit_full_guard = |
| 1463 !compiler->is_optimizing() || (field_cid == kIllegalCid); | 1464 !compiler->is_optimizing() || (field_cid == kIllegalCid); |
| 1464 | 1465 |
| 1465 const bool needs_value_cid_temp_reg = | 1466 const bool needs_value_cid_temp_reg = |
| 1466 (value_cid == kDynamicCid) && (emit_full_guard || (field_cid != kSmiCid)); | 1467 (value_cid == kDynamicCid) && (emit_full_guard || (field_cid != kSmiCid)); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1591 return summary; | 1592 return summary; |
| 1592 } | 1593 } |
| 1593 UNREACHABLE(); | 1594 UNREACHABLE(); |
| 1594 } | 1595 } |
| 1595 | 1596 |
| 1596 | 1597 |
| 1597 void GuardFieldLengthInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1598 void GuardFieldLengthInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1598 if (field().guarded_list_length() == Field::kNoFixedLength) { | 1599 if (field().guarded_list_length() == Field::kNoFixedLength) { |
| 1599 if (Compiler::IsBackgroundCompilation()) { | 1600 if (Compiler::IsBackgroundCompilation()) { |
| 1600 // Field state changed while compiling. | 1601 // Field state changed while compiling. |
| 1601 Compiler::AbortBackgroundCompilation(deopt_id()); | 1602 Compiler::AbortBackgroundCompilation(deopt_id(), |
| 1603 "GuardFieldLengthInstr: field state changed while compiling"); |
| 1602 } | 1604 } |
| 1603 ASSERT(!compiler->is_optimizing()); | 1605 ASSERT(!compiler->is_optimizing()); |
| 1604 return; // Nothing to emit. | 1606 return; // Nothing to emit. |
| 1605 } | 1607 } |
| 1606 | 1608 |
| 1607 Label* deopt = compiler->is_optimizing() ? | 1609 Label* deopt = compiler->is_optimizing() ? |
| 1608 compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL; | 1610 compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL; |
| 1609 | 1611 |
| 1610 const Register value_reg = locs()->in(0).reg(); | 1612 const Register value_reg = locs()->in(0).reg(); |
| 1611 | 1613 |
| (...skipping 4913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6525 __ Drop(1); | 6527 __ Drop(1); |
| 6526 __ popq(result); | 6528 __ popq(result); |
| 6527 } | 6529 } |
| 6528 | 6530 |
| 6529 | 6531 |
| 6530 } // namespace dart | 6532 } // namespace dart |
| 6531 | 6533 |
| 6532 #undef __ | 6534 #undef __ |
| 6533 | 6535 |
| 6534 #endif // defined TARGET_ARCH_X64 | 6536 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |