OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef V8_HEAP_GC_TRACER_H_ | 5 #ifndef V8_HEAP_GC_TRACER_H_ |
6 #define V8_HEAP_GC_TRACER_H_ | 6 #define V8_HEAP_GC_TRACER_H_ |
7 | 7 |
8 #include "src/base/compiler-specific.h" | 8 #include "src/base/compiler-specific.h" |
9 #include "src/base/platform/platform.h" | 9 #include "src/base/platform/platform.h" |
10 #include "src/base/ring-buffer.h" | 10 #include "src/base/ring-buffer.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 F(MC_INCREMENTAL_WRAPPER_PROLOGUE) \ | 30 F(MC_INCREMENTAL_WRAPPER_PROLOGUE) \ |
31 F(MC_INCREMENTAL_WRAPPER_TRACING) \ | 31 F(MC_INCREMENTAL_WRAPPER_TRACING) \ |
32 F(MC_INCREMENTAL_FINALIZE) \ | 32 F(MC_INCREMENTAL_FINALIZE) \ |
33 F(MC_INCREMENTAL_FINALIZE_BODY) \ | 33 F(MC_INCREMENTAL_FINALIZE_BODY) \ |
34 F(MC_INCREMENTAL_FINALIZE_OBJECT_GROUPING) \ | 34 F(MC_INCREMENTAL_FINALIZE_OBJECT_GROUPING) \ |
35 F(MC_INCREMENTAL_EXTERNAL_EPILOGUE) \ | 35 F(MC_INCREMENTAL_EXTERNAL_EPILOGUE) \ |
36 F(MC_INCREMENTAL_EXTERNAL_PROLOGUE) | 36 F(MC_INCREMENTAL_EXTERNAL_PROLOGUE) |
37 | 37 |
38 #define TRACER_SCOPES(F) \ | 38 #define TRACER_SCOPES(F) \ |
39 INCREMENTAL_SCOPES(F) \ | 39 INCREMENTAL_SCOPES(F) \ |
| 40 F(EXTERNAL_EPILOGUE) \ |
| 41 F(EXTERNAL_PROLOGUE) \ |
40 F(EXTERNAL_WEAK_GLOBAL_HANDLES) \ | 42 F(EXTERNAL_WEAK_GLOBAL_HANDLES) \ |
41 F(MC_CLEAR) \ | 43 F(MC_CLEAR) \ |
42 F(MC_CLEAR_CODE_FLUSH) \ | 44 F(MC_CLEAR_CODE_FLUSH) \ |
43 F(MC_CLEAR_DEPENDENT_CODE) \ | 45 F(MC_CLEAR_DEPENDENT_CODE) \ |
44 F(MC_CLEAR_GLOBAL_HANDLES) \ | 46 F(MC_CLEAR_GLOBAL_HANDLES) \ |
45 F(MC_CLEAR_MAPS) \ | 47 F(MC_CLEAR_MAPS) \ |
46 F(MC_CLEAR_SLOTS_BUFFER) \ | 48 F(MC_CLEAR_SLOTS_BUFFER) \ |
47 F(MC_CLEAR_STORE_BUFFER) \ | 49 F(MC_CLEAR_STORE_BUFFER) \ |
48 F(MC_CLEAR_STRING_TABLE) \ | 50 F(MC_CLEAR_STRING_TABLE) \ |
49 F(MC_CLEAR_WEAK_CELLS) \ | 51 F(MC_CLEAR_WEAK_CELLS) \ |
50 F(MC_CLEAR_WEAK_COLLECTIONS) \ | 52 F(MC_CLEAR_WEAK_COLLECTIONS) \ |
51 F(MC_CLEAR_WEAK_LISTS) \ | 53 F(MC_CLEAR_WEAK_LISTS) \ |
52 F(MC_EPILOGUE) \ | 54 F(MC_EPILOGUE) \ |
53 F(MC_EVACUATE) \ | 55 F(MC_EVACUATE) \ |
54 F(MC_EVACUATE_CANDIDATES) \ | 56 F(MC_EVACUATE_CANDIDATES) \ |
55 F(MC_EVACUATE_CLEAN_UP) \ | 57 F(MC_EVACUATE_CLEAN_UP) \ |
56 F(MC_EVACUATE_COPY) \ | 58 F(MC_EVACUATE_COPY) \ |
57 F(MC_EVACUATE_UPDATE_POINTERS) \ | 59 F(MC_EVACUATE_UPDATE_POINTERS) \ |
58 F(MC_EVACUATE_UPDATE_POINTERS_TO_EVACUATED) \ | 60 F(MC_EVACUATE_UPDATE_POINTERS_TO_EVACUATED) \ |
59 F(MC_EVACUATE_UPDATE_POINTERS_TO_NEW) \ | 61 F(MC_EVACUATE_UPDATE_POINTERS_TO_NEW) \ |
60 F(MC_EVACUATE_UPDATE_POINTERS_WEAK) \ | 62 F(MC_EVACUATE_UPDATE_POINTERS_WEAK) \ |
61 F(MC_EXTERNAL_EPILOGUE) \ | |
62 F(MC_EXTERNAL_PROLOGUE) \ | |
63 F(MC_FINISH) \ | 63 F(MC_FINISH) \ |
64 F(MC_MARK) \ | 64 F(MC_MARK) \ |
65 F(MC_MARK_FINISH_INCREMENTAL) \ | 65 F(MC_MARK_FINISH_INCREMENTAL) \ |
66 F(MC_MARK_PREPARE_CODE_FLUSH) \ | 66 F(MC_MARK_PREPARE_CODE_FLUSH) \ |
67 F(MC_MARK_ROOTS) \ | 67 F(MC_MARK_ROOTS) \ |
68 F(MC_MARK_WEAK_CLOSURE) \ | 68 F(MC_MARK_WEAK_CLOSURE) \ |
69 F(MC_MARK_WEAK_CLOSURE_EPHEMERAL) \ | 69 F(MC_MARK_WEAK_CLOSURE_EPHEMERAL) \ |
70 F(MC_MARK_WEAK_CLOSURE_WEAK_HANDLES) \ | 70 F(MC_MARK_WEAK_CLOSURE_WEAK_HANDLES) \ |
71 F(MC_MARK_WEAK_CLOSURE_WEAK_ROOTS) \ | 71 F(MC_MARK_WEAK_CLOSURE_WEAK_ROOTS) \ |
72 F(MC_MARK_WEAK_CLOSURE_HARMONY) \ | 72 F(MC_MARK_WEAK_CLOSURE_HARMONY) \ |
73 F(MC_MARK_WRAPPER_EPILOGUE) \ | 73 F(MC_MARK_WRAPPER_EPILOGUE) \ |
74 F(MC_MARK_WRAPPER_PROLOGUE) \ | 74 F(MC_MARK_WRAPPER_PROLOGUE) \ |
75 F(MC_MARK_WRAPPER_TRACING) \ | 75 F(MC_MARK_WRAPPER_TRACING) \ |
76 F(MC_MARK_OBJECT_GROUPING) \ | 76 F(MC_MARK_OBJECT_GROUPING) \ |
77 F(MC_PROLOGUE) \ | 77 F(MC_PROLOGUE) \ |
78 F(MC_SWEEP) \ | 78 F(MC_SWEEP) \ |
79 F(MC_SWEEP_CODE) \ | 79 F(MC_SWEEP_CODE) \ |
80 F(MC_SWEEP_MAP) \ | 80 F(MC_SWEEP_MAP) \ |
81 F(MC_SWEEP_OLD) \ | 81 F(MC_SWEEP_OLD) \ |
82 F(SCAVENGER_CODE_FLUSH_CANDIDATES) \ | 82 F(SCAVENGER_CODE_FLUSH_CANDIDATES) \ |
83 F(SCAVENGER_EXTERNAL_EPILOGUE) \ | |
84 F(SCAVENGER_EXTERNAL_PROLOGUE) \ | |
85 F(SCAVENGER_OBJECT_GROUPS) \ | 83 F(SCAVENGER_OBJECT_GROUPS) \ |
86 F(SCAVENGER_OLD_TO_NEW_POINTERS) \ | 84 F(SCAVENGER_OLD_TO_NEW_POINTERS) \ |
87 F(SCAVENGER_ROOTS) \ | 85 F(SCAVENGER_ROOTS) \ |
88 F(SCAVENGER_SCAVENGE) \ | 86 F(SCAVENGER_SCAVENGE) \ |
89 F(SCAVENGER_SEMISPACE) \ | 87 F(SCAVENGER_SEMISPACE) \ |
90 F(SCAVENGER_WEAK) | 88 F(SCAVENGER_WEAK) |
91 | 89 |
92 #define TRACE_GC(tracer, scope_id) \ | 90 #define TRACE_GC(tracer, scope_id) \ |
93 GCTracer::Scope::ScopeId gc_tracer_scope_id(scope_id); \ | 91 GCTracer::Scope::ScopeId gc_tracer_scope_id(scope_id); \ |
94 GCTracer::Scope gc_tracer_scope(tracer, gc_tracer_scope_id); \ | 92 GCTracer::Scope gc_tracer_scope(tracer, gc_tracer_scope_id); \ |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 // Print one trace line. | 355 // Print one trace line. |
358 // TODO(ernstm): Move to Heap. | 356 // TODO(ernstm): Move to Heap. |
359 void Print() const; | 357 void Print() const; |
360 | 358 |
361 // Prints a line and also adds it to the heap's ring buffer so that | 359 // Prints a line and also adds it to the heap's ring buffer so that |
362 // it can be included in later crash dumps. | 360 // it can be included in later crash dumps. |
363 void PRINTF_FORMAT(2, 3) Output(const char* format, ...) const; | 361 void PRINTF_FORMAT(2, 3) Output(const char* format, ...) const; |
364 | 362 |
365 double TotalExternalTime() const { | 363 double TotalExternalTime() const { |
366 return current_.scopes[Scope::EXTERNAL_WEAK_GLOBAL_HANDLES] + | 364 return current_.scopes[Scope::EXTERNAL_WEAK_GLOBAL_HANDLES] + |
367 current_.scopes[Scope::MC_EXTERNAL_EPILOGUE] + | 365 current_.scopes[Scope::EXTERNAL_EPILOGUE] + |
368 current_.scopes[Scope::MC_EXTERNAL_PROLOGUE] + | 366 current_.scopes[Scope::EXTERNAL_PROLOGUE] + |
369 current_.scopes[Scope::MC_INCREMENTAL_EXTERNAL_EPILOGUE] + | 367 current_.scopes[Scope::MC_INCREMENTAL_EXTERNAL_EPILOGUE] + |
370 current_.scopes[Scope::MC_INCREMENTAL_EXTERNAL_PROLOGUE] + | 368 current_.scopes[Scope::MC_INCREMENTAL_EXTERNAL_PROLOGUE]; |
371 current_.scopes[Scope::SCAVENGER_EXTERNAL_EPILOGUE] + | |
372 current_.scopes[Scope::SCAVENGER_EXTERNAL_PROLOGUE]; | |
373 } | 369 } |
374 | 370 |
375 // Pointer to the heap that owns this tracer. | 371 // Pointer to the heap that owns this tracer. |
376 Heap* heap_; | 372 Heap* heap_; |
377 | 373 |
378 // Current tracer event. Populated during Start/Stop cycle. Valid after Stop() | 374 // Current tracer event. Populated during Start/Stop cycle. Valid after Stop() |
379 // has returned. | 375 // has returned. |
380 Event current_; | 376 Event current_; |
381 | 377 |
382 // Previous tracer event. | 378 // Previous tracer event. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 base::RingBuffer<BytesAndDuration> recorded_old_generation_allocations_; | 423 base::RingBuffer<BytesAndDuration> recorded_old_generation_allocations_; |
428 base::RingBuffer<double> recorded_context_disposal_times_; | 424 base::RingBuffer<double> recorded_context_disposal_times_; |
429 base::RingBuffer<double> recorded_survival_ratios_; | 425 base::RingBuffer<double> recorded_survival_ratios_; |
430 | 426 |
431 DISALLOW_COPY_AND_ASSIGN(GCTracer); | 427 DISALLOW_COPY_AND_ASSIGN(GCTracer); |
432 }; | 428 }; |
433 } // namespace internal | 429 } // namespace internal |
434 } // namespace v8 | 430 } // namespace v8 |
435 | 431 |
436 #endif // V8_HEAP_GC_TRACER_H_ | 432 #endif // V8_HEAP_GC_TRACER_H_ |
OLD | NEW |