| 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_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 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 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1377 buffer_.EmitObject(object); | 1377 buffer_.EmitObject(object); |
| 1378 } else { | 1378 } else { |
| 1379 EmitUint8(0x81); | 1379 EmitUint8(0x81); |
| 1380 EmitOperand(7, Operand(reg)); | 1380 EmitOperand(7, Operand(reg)); |
| 1381 buffer_.EmitObject(object); | 1381 buffer_.EmitObject(object); |
| 1382 } | 1382 } |
| 1383 } | 1383 } |
| 1384 } | 1384 } |
| 1385 | 1385 |
| 1386 | 1386 |
| 1387 // Destroys the value register. |
| 1387 void Assembler::StoreIntoObjectFilter(Register object, | 1388 void Assembler::StoreIntoObjectFilter(Register object, |
| 1388 Register value, | 1389 Register value, |
| 1389 Label* no_update) { | 1390 Label* no_update) { |
| 1390 andl(value, Immediate(0x5)); | 1391 // For the value we are only interested in the new/old bit and the tag bit. |
| 1392 andl(value, Immediate(kNewObjectAlignmentOffset | kHeapObjectTag)); |
| 1393 // Shift the tag bit into the carry. |
| 1391 shrl(value, Immediate(1)); | 1394 shrl(value, Immediate(1)); |
| 1395 // Add the tag bits together, if the value is not a Smi the addition will |
| 1396 // overflow into the next bit, leaving us with a zero low bit. |
| 1392 adcl(value, object); | 1397 adcl(value, object); |
| 1393 andl(value, Immediate(0x7)); | 1398 // Mask out higher, uninteresting bits which were polluted by dest. |
| 1394 cmpl(value, Immediate(0x4)); | 1399 andl(value, Immediate(kObjectAlignment - 1)); |
| 1400 // Compare with the expected bit pattern. |
| 1401 cmpl(value, Immediate( |
| 1402 (kNewObjectAlignmentOffset >> 1) + kHeapObjectTag + |
| 1403 kOldObjectAlignmentOffset + kHeapObjectTag)); |
| 1395 j(NOT_ZERO, no_update, Assembler::kNearJump); | 1404 j(NOT_ZERO, no_update, Assembler::kNearJump); |
| 1396 } | 1405 } |
| 1397 | 1406 |
| 1398 | 1407 |
| 1399 void Assembler::StoreIntoObject(Register object, | 1408 void Assembler::StoreIntoObject(Register object, |
| 1400 const FieldAddress& dest, | 1409 const FieldAddress& dest, |
| 1401 Register value) { | 1410 Register value) { |
| 1402 movl(dest, value); | 1411 movl(dest, value); |
| 1403 Label done; | 1412 Label done; |
| 1404 pushl(value); | 1413 pushl(value); |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1731 comments.SetCommentAt(i, comments_[i]->comment()); | 1740 comments.SetCommentAt(i, comments_[i]->comment()); |
| 1732 } | 1741 } |
| 1733 | 1742 |
| 1734 return comments; | 1743 return comments; |
| 1735 } | 1744 } |
| 1736 | 1745 |
| 1737 | 1746 |
| 1738 } // namespace dart | 1747 } // namespace dart |
| 1739 | 1748 |
| 1740 #endif // defined TARGET_ARCH_IA32 | 1749 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |