| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 791 #define WRITE_FIELD(p, offset, value) \ | 791 #define WRITE_FIELD(p, offset, value) \ |
| 792 (*reinterpret_cast<Object**>(FIELD_ADDR(p, offset)) = value) | 792 (*reinterpret_cast<Object**>(FIELD_ADDR(p, offset)) = value) |
| 793 | 793 |
| 794 | 794 |
| 795 #define WRITE_BARRIER(object, offset) \ | 795 #define WRITE_BARRIER(object, offset) \ |
| 796 Heap::RecordWrite(object->address(), offset); | 796 Heap::RecordWrite(object->address(), offset); |
| 797 | 797 |
| 798 // CONDITIONAL_WRITE_BARRIER must be issued after the actual | 798 // CONDITIONAL_WRITE_BARRIER must be issued after the actual |
| 799 // write due to the assert validating the written value. | 799 // write due to the assert validating the written value. |
| 800 #define CONDITIONAL_WRITE_BARRIER(object, offset, mode) \ | 800 #define CONDITIONAL_WRITE_BARRIER(object, offset, mode) \ |
| 801 if (mode == UPDATE_WRITE_BARRIER) { \ | 801 if (!FLAG_new_gc) { \ |
| 802 Heap::RecordWrite(object->address(), offset); \ | 802 if (mode == UPDATE_WRITE_BARRIER) { \ |
| 803 } else { \ | 803 Heap::RecordWrite(object->address(), offset); \ |
| 804 ASSERT(mode == SKIP_WRITE_BARRIER); \ | 804 } else { \ |
| 805 ASSERT(Heap::InNewSpace(object) || \ | 805 ASSERT(mode == SKIP_WRITE_BARRIER); \ |
| 806 !Heap::InNewSpace(READ_FIELD(object, offset)) || \ | 806 ASSERT(Heap::InNewSpace(object) || \ |
| 807 Page::FromAddress(object->address())-> \ | 807 !Heap::InNewSpace(READ_FIELD(object, offset)) || \ |
| 808 IsRegionDirty(object->address() + offset)); \ | 808 Page::FromAddress(object->address())-> \ |
| 809 IsRegionDirty(object->address() + offset)); \ |
| 810 } \ |
| 809 } | 811 } |
| 810 | 812 |
| 811 #define READ_DOUBLE_FIELD(p, offset) \ | 813 #define READ_DOUBLE_FIELD(p, offset) \ |
| 812 (*reinterpret_cast<double*>(FIELD_ADDR(p, offset))) | 814 (*reinterpret_cast<double*>(FIELD_ADDR(p, offset))) |
| 813 | 815 |
| 814 #define WRITE_DOUBLE_FIELD(p, offset, value) \ | 816 #define WRITE_DOUBLE_FIELD(p, offset, value) \ |
| 815 (*reinterpret_cast<double*>(FIELD_ADDR(p, offset)) = value) | 817 (*reinterpret_cast<double*>(FIELD_ADDR(p, offset)) = value) |
| 816 | 818 |
| 817 #define READ_INT_FIELD(p, offset) \ | 819 #define READ_INT_FIELD(p, offset) \ |
| 818 (*reinterpret_cast<int*>(FIELD_ADDR(p, offset))) | 820 (*reinterpret_cast<int*>(FIELD_ADDR(p, offset))) |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1011 value_ |= kOverflowMask; | 1013 value_ |= kOverflowMask; |
| 1012 } | 1014 } |
| 1013 | 1015 |
| 1014 | 1016 |
| 1015 void MapWord::ClearOverflow() { | 1017 void MapWord::ClearOverflow() { |
| 1016 value_ &= ~kOverflowMask; | 1018 value_ &= ~kOverflowMask; |
| 1017 } | 1019 } |
| 1018 | 1020 |
| 1019 | 1021 |
| 1020 MapWord MapWord::EncodeAddress(Address map_address, int offset) { | 1022 MapWord MapWord::EncodeAddress(Address map_address, int offset) { |
| 1023 ASSERT(!FLAG_new_gc); |
| 1021 // Offset is the distance in live bytes from the first live object in the | 1024 // Offset is the distance in live bytes from the first live object in the |
| 1022 // same page. The offset between two objects in the same page should not | 1025 // same page. The offset between two objects in the same page should not |
| 1023 // exceed the object area size of a page. | 1026 // exceed the object area size of a page. |
| 1024 ASSERT(0 <= offset && offset < Page::kObjectAreaSize); | 1027 ASSERT(0 <= offset && offset < Page::kObjectAreaSize); |
| 1025 | 1028 |
| 1026 uintptr_t compact_offset = offset >> kObjectAlignmentBits; | 1029 uintptr_t compact_offset = offset >> kObjectAlignmentBits; |
| 1027 ASSERT(compact_offset < (1 << kForwardingOffsetBits)); | 1030 ASSERT(compact_offset < (1 << kForwardingOffsetBits)); |
| 1028 | 1031 |
| 1029 Page* map_page = Page::FromAddress(map_address); | 1032 Page* map_page = Page::FromAddress(map_address); |
| 1030 ASSERT_MAP_PAGE_INDEX(map_page->mc_page_index); | 1033 ASSERT_MAP_PAGE_INDEX(map_page->mc_page_index); |
| (...skipping 2821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3852 #undef WRITE_INT_FIELD | 3855 #undef WRITE_INT_FIELD |
| 3853 #undef READ_SHORT_FIELD | 3856 #undef READ_SHORT_FIELD |
| 3854 #undef WRITE_SHORT_FIELD | 3857 #undef WRITE_SHORT_FIELD |
| 3855 #undef READ_BYTE_FIELD | 3858 #undef READ_BYTE_FIELD |
| 3856 #undef WRITE_BYTE_FIELD | 3859 #undef WRITE_BYTE_FIELD |
| 3857 | 3860 |
| 3858 | 3861 |
| 3859 } } // namespace v8::internal | 3862 } } // namespace v8::internal |
| 3860 | 3863 |
| 3861 #endif // V8_OBJECTS_INL_H_ | 3864 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |