Chromium Code Reviews| 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 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 788 #define READ_FIELD(p, offset) \ | 788 #define READ_FIELD(p, offset) \ |
| 789 (*reinterpret_cast<Object**>(FIELD_ADDR(p, offset))) | 789 (*reinterpret_cast<Object**>(FIELD_ADDR(p, offset))) |
| 790 | 790 |
| 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 #ifdef ENABLE_CARDMARKING_WRITE_BARRIER | |
| 799 // CONDITIONAL_WRITE_BARRIER must be issued after the actual | 798 // CONDITIONAL_WRITE_BARRIER must be issued after the actual |
| 800 // write due to the assert validating the written value. | 799 // write due to the assert validating the written value. |
| 801 #define CONDITIONAL_WRITE_BARRIER(object, offset, mode) \ | 800 #define CONDITIONAL_WRITE_BARRIER(object, offset, mode) \ |
| 802 if (mode == UPDATE_WRITE_BARRIER) { \ | 801 if (mode == UPDATE_WRITE_BARRIER) { \ |
| 803 Heap::RecordWrite(object->address(), offset); \ | 802 Heap::RecordWrite(object->address(), offset); \ |
| 804 } else { \ | 803 } else { \ |
| 805 ASSERT(mode == SKIP_WRITE_BARRIER); \ | 804 ASSERT(mode == SKIP_WRITE_BARRIER); \ |
| 806 ASSERT(Heap::InNewSpace(object) || \ | 805 ASSERT(Heap::InNewSpace(object) || \ |
| 807 !Heap::InNewSpace(READ_FIELD(object, offset)) || \ | 806 !Heap::InNewSpace(READ_FIELD(object, offset))); \ |
|
Vyacheslav Egorov (Chromium)
2011/01/21 18:18:18
This check was here for some reason.
Somewhere in
Erik Corry
2011/01/24 13:56:00
Done.
| |
| 808 Page::FromAddress(object->address())-> \ | |
| 809 IsRegionDirty(object->address() + offset)); \ | |
| 810 } | 807 } |
| 811 #else | |
| 812 #define CONDITIONAL_WRITE_BARRIER(object, offset, mode) | |
| 813 #endif | |
| 814 | 808 |
| 815 #define READ_DOUBLE_FIELD(p, offset) \ | 809 #define READ_DOUBLE_FIELD(p, offset) \ |
| 816 (*reinterpret_cast<double*>(FIELD_ADDR(p, offset))) | 810 (*reinterpret_cast<double*>(FIELD_ADDR(p, offset))) |
| 817 | 811 |
| 818 #define WRITE_DOUBLE_FIELD(p, offset, value) \ | 812 #define WRITE_DOUBLE_FIELD(p, offset, value) \ |
| 819 (*reinterpret_cast<double*>(FIELD_ADDR(p, offset)) = value) | 813 (*reinterpret_cast<double*>(FIELD_ADDR(p, offset)) = value) |
| 820 | 814 |
| 821 #define READ_INT_FIELD(p, offset) \ | 815 #define READ_INT_FIELD(p, offset) \ |
| 822 (*reinterpret_cast<int*>(FIELD_ADDR(p, offset))) | 816 (*reinterpret_cast<int*>(FIELD_ADDR(p, offset))) |
| 823 | 817 |
| (...skipping 2970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3794 #undef WRITE_INT_FIELD | 3788 #undef WRITE_INT_FIELD |
| 3795 #undef READ_SHORT_FIELD | 3789 #undef READ_SHORT_FIELD |
| 3796 #undef WRITE_SHORT_FIELD | 3790 #undef WRITE_SHORT_FIELD |
| 3797 #undef READ_BYTE_FIELD | 3791 #undef READ_BYTE_FIELD |
| 3798 #undef WRITE_BYTE_FIELD | 3792 #undef WRITE_BYTE_FIELD |
| 3799 | 3793 |
| 3800 | 3794 |
| 3801 } } // namespace v8::internal | 3795 } } // namespace v8::internal |
| 3802 | 3796 |
| 3803 #endif // V8_OBJECTS_INL_H_ | 3797 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |