| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 | 755 |
| 756 void HeapObject::IteratePointer(ObjectVisitor* v, int offset) { | 756 void HeapObject::IteratePointer(ObjectVisitor* v, int offset) { |
| 757 v->VisitPointer(reinterpret_cast<Object**>(FIELD_ADDR(this, offset))); | 757 v->VisitPointer(reinterpret_cast<Object**>(FIELD_ADDR(this, offset))); |
| 758 } | 758 } |
| 759 | 759 |
| 760 | 760 |
| 761 void HeapObject::CopyBody(JSObject* from) { | 761 void HeapObject::CopyBody(JSObject* from) { |
| 762 ASSERT(map() == from->map()); | 762 ASSERT(map() == from->map()); |
| 763 ASSERT(Size() == from->Size()); | 763 ASSERT(Size() == from->Size()); |
| 764 int object_size = Size(); | 764 int object_size = Size(); |
| 765 for (int offset = kHeaderSize; offset < object_size; offset += kPointerSize)
{ | 765 for (int offset = kHeaderSize; |
| 766 offset < object_size; |
| 767 offset += kPointerSize) { |
| 766 Object* value = READ_FIELD(from, offset); | 768 Object* value = READ_FIELD(from, offset); |
| 767 // Note: WRITE_FIELD does not update the write barrier. | 769 // Note: WRITE_FIELD does not update the write barrier. |
| 768 WRITE_FIELD(this, offset, value); | 770 WRITE_FIELD(this, offset, value); |
| 769 WRITE_BARRIER(this, offset); | 771 WRITE_BARRIER(this, offset); |
| 770 } | 772 } |
| 771 } | 773 } |
| 772 | 774 |
| 773 | 775 |
| 774 bool HeapObject::IsMarked() { | 776 bool HeapObject::IsMarked() { |
| 775 return map_word().IsMarked(); | 777 return map_word().IsMarked(); |
| (...skipping 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2160 #undef WRITE_INT_FIELD | 2162 #undef WRITE_INT_FIELD |
| 2161 #undef READ_SHORT_FIELD | 2163 #undef READ_SHORT_FIELD |
| 2162 #undef WRITE_SHORT_FIELD | 2164 #undef WRITE_SHORT_FIELD |
| 2163 #undef READ_BYTE_FIELD | 2165 #undef READ_BYTE_FIELD |
| 2164 #undef WRITE_BYTE_FIELD | 2166 #undef WRITE_BYTE_FIELD |
| 2165 | 2167 |
| 2166 | 2168 |
| 2167 } } // namespace v8::internal | 2169 } } // namespace v8::internal |
| 2168 | 2170 |
| 2169 #endif // V8_OBJECTS_INL_H_ | 2171 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |