Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/full-codegen.h" | 7 #include "src/full-codegen.h" |
| 8 #include "src/macro-assembler.h" | 8 #include "src/macro-assembler.h" |
| 9 #include "src/mark-compact.h" | 9 #include "src/mark-compact.h" |
| 10 #include "src/msan.h" | 10 #include "src/msan.h" |
| (...skipping 2879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2890 | 2890 |
| 2891 if (Heap::ShouldZapGarbage()) { | 2891 if (Heap::ShouldZapGarbage()) { |
| 2892 // Make the object consistent so the heap can be verified in OldSpaceStep. | 2892 // Make the object consistent so the heap can be verified in OldSpaceStep. |
| 2893 // We only need to do this in debug builds or if verify_heap is on. | 2893 // We only need to do this in debug builds or if verify_heap is on. |
| 2894 reinterpret_cast<Object**>(object->address())[0] = | 2894 reinterpret_cast<Object**>(object->address())[0] = |
| 2895 heap()->fixed_array_map(); | 2895 heap()->fixed_array_map(); |
| 2896 reinterpret_cast<Object**>(object->address())[1] = Smi::FromInt(0); | 2896 reinterpret_cast<Object**>(object->address())[1] = Smi::FromInt(0); |
| 2897 } | 2897 } |
| 2898 | 2898 |
| 2899 heap()->incremental_marking()->OldSpaceStep(object_size); | 2899 heap()->incremental_marking()->OldSpaceStep(object_size); |
| 2900 if (FLAG_allocations_digest) { | |
| 2901 heap()->OnAllocationEvent(object, object_size); | |
|
Hannes Payer (out of office)
2014/06/09 15:23:51
The event call should be in Heap::AllocateRaw. The
Igor Sheludko
2014/06/10 08:22:54
I trigger "allocation event" each time any allocat
Hannes Payer (out of office)
2014/06/10 16:58:59
1) Please move your monitoring code into Heap:Allo
| |
| 2902 } | |
| 2900 return object; | 2903 return object; |
| 2901 } | 2904 } |
| 2902 | 2905 |
| 2903 | 2906 |
| 2904 size_t LargeObjectSpace::CommittedPhysicalMemory() { | 2907 size_t LargeObjectSpace::CommittedPhysicalMemory() { |
| 2905 if (!VirtualMemory::HasLazyCommits()) return CommittedMemory(); | 2908 if (!VirtualMemory::HasLazyCommits()) return CommittedMemory(); |
| 2906 size_t size = 0; | 2909 size_t size = 0; |
| 2907 LargePage* current = first_page_; | 2910 LargePage* current = first_page_; |
| 2908 while (current != NULL) { | 2911 while (current != NULL) { |
| 2909 size += current->CommittedPhysicalMemory(); | 2912 size += current->CommittedPhysicalMemory(); |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3113 object->ShortPrint(); | 3116 object->ShortPrint(); |
| 3114 PrintF("\n"); | 3117 PrintF("\n"); |
| 3115 } | 3118 } |
| 3116 printf(" --------------------------------------\n"); | 3119 printf(" --------------------------------------\n"); |
| 3117 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 3120 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
| 3118 } | 3121 } |
| 3119 | 3122 |
| 3120 #endif // DEBUG | 3123 #endif // DEBUG |
| 3121 | 3124 |
| 3122 } } // namespace v8::internal | 3125 } } // namespace v8::internal |
| OLD | NEW |