| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/heap.h" | 9 #include "vm/heap.h" |
| 10 #include "vm/memory_region.h" | 10 #include "vm/memory_region.h" |
| (...skipping 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1404 if (object.IsSmi()) { | 1404 if (object.IsSmi()) { |
| 1405 cmpq(reg, Immediate(reinterpret_cast<int64_t>(object.raw()))); | 1405 cmpq(reg, Immediate(reinterpret_cast<int64_t>(object.raw()))); |
| 1406 } else { | 1406 } else { |
| 1407 ASSERT(reg != TMP); | 1407 ASSERT(reg != TMP); |
| 1408 LoadObject(TMP, object); | 1408 LoadObject(TMP, object); |
| 1409 cmpq(reg, TMP); | 1409 cmpq(reg, TMP); |
| 1410 } | 1410 } |
| 1411 } | 1411 } |
| 1412 | 1412 |
| 1413 | 1413 |
| 1414 // Destroys the incoming value. | 1414 // Destroys the value register. |
| 1415 void Assembler::StoreIntoObjectFilter(Register object, | 1415 void Assembler::StoreIntoObjectFilter(Register object, |
| 1416 Register value, | 1416 Register value, |
| 1417 Label* no_update) { | 1417 Label* no_update) { |
| 1418 andl(value, Immediate(0x9)); | 1418 // For the value we are only interested in the new/old bit and the tag bit. |
| 1419 andl(value, Immediate(kNewObjectAlignmentOffset | kHeapObjectTag)); |
| 1420 // Shift the tag bit into the carry. |
| 1419 shrl(value, Immediate(1)); | 1421 shrl(value, Immediate(1)); |
| 1422 // Add the tag bits together, if the value is not a Smi the addition will |
| 1423 // overflow into the next bit, leaving us with a zero low bit. |
| 1420 adcl(value, object); | 1424 adcl(value, object); |
| 1421 andl(value, Immediate(0xf)); | 1425 // Mask out higher, uninteresting bits which were polluted by dest. |
| 1422 cmpl(value, Immediate(0x6)); | 1426 andl(value, Immediate(kObjectAlignment - 1)); |
| 1427 // Compare with the expected bit pattern. |
| 1428 cmpl(value, Immediate( |
| 1429 (kNewObjectAlignmentOffset >> 1) + kHeapObjectTag + |
| 1430 kOldObjectAlignmentOffset + kHeapObjectTag)); |
| 1423 j(NOT_ZERO, no_update, Assembler::kNearJump); | 1431 j(NOT_ZERO, no_update, Assembler::kNearJump); |
| 1424 } | 1432 } |
| 1425 | 1433 |
| 1426 | 1434 |
| 1427 void Assembler::StoreIntoObject(Register object, | 1435 void Assembler::StoreIntoObject(Register object, |
| 1428 const FieldAddress& dest, | 1436 const FieldAddress& dest, |
| 1429 Register value) { | 1437 Register value) { |
| 1430 movq(dest, value); | 1438 movq(dest, value); |
| 1431 | 1439 |
| 1432 Label done; | 1440 Label done; |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1732 comments.SetCommentAt(i, comments_[i]->comment()); | 1740 comments.SetCommentAt(i, comments_[i]->comment()); |
| 1733 } | 1741 } |
| 1734 | 1742 |
| 1735 return comments; | 1743 return comments; |
| 1736 } | 1744 } |
| 1737 | 1745 |
| 1738 | 1746 |
| 1739 } // namespace dart | 1747 } // namespace dart |
| 1740 | 1748 |
| 1741 #endif // defined TARGET_ARCH_X64 | 1749 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |