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 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 (mode == UPDATE_WRITE_BARRIER) { \ |
802 Heap::RecordWrite(object->address(), offset); \ | 802 Heap::RecordWrite(object->address(), offset); \ |
803 } else { \ | 803 } else { \ |
804 ASSERT(mode == SKIP_WRITE_BARRIER); \ | 804 ASSERT(mode == SKIP_WRITE_BARRIER); \ |
805 ASSERT(Heap::InNewSpace(object) || \ | |
Vyacheslav Egorov (Chromium)
2011/02/02 13:15:47
I there a way to rewrite this assertion to check t
Erik Corry
2011/02/03 13:21:17
I brought back the assert but hid it behind a --en
| |
806 !Heap::InNewSpace(READ_FIELD(object, offset)) || \ | |
807 Page::FromAddress(object->address())-> \ | |
808 IsRegionDirty(object->address() + offset)); \ | |
809 } | 805 } |
810 | 806 |
811 #define READ_DOUBLE_FIELD(p, offset) \ | 807 #define READ_DOUBLE_FIELD(p, offset) \ |
812 (*reinterpret_cast<double*>(FIELD_ADDR(p, offset))) | 808 (*reinterpret_cast<double*>(FIELD_ADDR(p, offset))) |
813 | 809 |
814 #define WRITE_DOUBLE_FIELD(p, offset, value) \ | 810 #define WRITE_DOUBLE_FIELD(p, offset, value) \ |
815 (*reinterpret_cast<double*>(FIELD_ADDR(p, offset)) = value) | 811 (*reinterpret_cast<double*>(FIELD_ADDR(p, offset)) = value) |
816 | 812 |
817 #define READ_INT_FIELD(p, offset) \ | 813 #define READ_INT_FIELD(p, offset) \ |
818 (*reinterpret_cast<int*>(FIELD_ADDR(p, offset))) | 814 (*reinterpret_cast<int*>(FIELD_ADDR(p, offset))) |
(...skipping 2900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3719 #undef WRITE_INT_FIELD | 3715 #undef WRITE_INT_FIELD |
3720 #undef READ_SHORT_FIELD | 3716 #undef READ_SHORT_FIELD |
3721 #undef WRITE_SHORT_FIELD | 3717 #undef WRITE_SHORT_FIELD |
3722 #undef READ_BYTE_FIELD | 3718 #undef READ_BYTE_FIELD |
3723 #undef WRITE_BYTE_FIELD | 3719 #undef WRITE_BYTE_FIELD |
3724 | 3720 |
3725 | 3721 |
3726 } } // namespace v8::internal | 3722 } } // namespace v8::internal |
3727 | 3723 |
3728 #endif // V8_OBJECTS_INL_H_ | 3724 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |