| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 4867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4878 // Since we know the clone is allocated in new space, we can copy | 4878 // Since we know the clone is allocated in new space, we can copy |
| 4879 // the contents without worrying about updating the write barrier. | 4879 // the contents without worrying about updating the write barrier. |
| 4880 CopyBlock(HeapObject::cast(clone)->address(), | 4880 CopyBlock(HeapObject::cast(clone)->address(), |
| 4881 source->address(), | 4881 source->address(), |
| 4882 object_size); | 4882 object_size); |
| 4883 | 4883 |
| 4884 if (site != NULL) { | 4884 if (site != NULL) { |
| 4885 AllocationMemento* alloc_memento = reinterpret_cast<AllocationMemento*>( | 4885 AllocationMemento* alloc_memento = reinterpret_cast<AllocationMemento*>( |
| 4886 reinterpret_cast<Address>(clone) + object_size); | 4886 reinterpret_cast<Address>(clone) + object_size); |
| 4887 InitializeAllocationMemento(alloc_memento, site); | 4887 InitializeAllocationMemento(alloc_memento, site); |
| 4888 HeapProfiler* profiler = isolate()->heap_profiler(); | |
| 4889 if (profiler->is_tracking_allocations()) { | |
| 4890 profiler->UpdateObjectSizeEvent(HeapObject::cast(clone)->address(), | |
| 4891 object_size); | |
| 4892 profiler->NewObjectEvent(alloc_memento->address(), | |
| 4893 AllocationMemento::kSize); | |
| 4894 } | |
| 4895 } | 4888 } |
| 4896 } | 4889 } |
| 4897 | 4890 |
| 4898 SLOW_ASSERT( | 4891 SLOW_ASSERT( |
| 4899 JSObject::cast(clone)->GetElementsKind() == source->GetElementsKind()); | 4892 JSObject::cast(clone)->GetElementsKind() == source->GetElementsKind()); |
| 4900 FixedArrayBase* elements = FixedArrayBase::cast(source->elements()); | 4893 FixedArrayBase* elements = FixedArrayBase::cast(source->elements()); |
| 4901 FixedArray* properties = FixedArray::cast(source->properties()); | 4894 FixedArray* properties = FixedArray::cast(source->properties()); |
| 4902 // Update elements if necessary. | 4895 // Update elements if necessary. |
| 4903 if (elements->length() > 0) { | 4896 if (elements->length() > 0) { |
| 4904 Object* elem; | 4897 Object* elem; |
| (...skipping 3090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7995 static_cast<int>(object_sizes_last_time_[index])); | 7988 static_cast<int>(object_sizes_last_time_[index])); |
| 7996 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 7989 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
| 7997 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 7990 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
| 7998 | 7991 |
| 7999 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 7992 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
| 8000 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 7993 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
| 8001 ClearObjectStats(); | 7994 ClearObjectStats(); |
| 8002 } | 7995 } |
| 8003 | 7996 |
| 8004 } } // namespace v8::internal | 7997 } } // namespace v8::internal |
| OLD | NEW |