| 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_GC_TRACER_H_ | 5 #ifndef V8_GC_TRACER_H_ |
| 6 #define V8_GC_TRACER_H_ | 6 #define V8_GC_TRACER_H_ |
| 7 | 7 |
| 8 namespace v8 { | 8 namespace v8 { |
| 9 namespace internal { | 9 namespace internal { |
| 10 | 10 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 MC_WEAKCOLLECTION_CLEAR, | 105 MC_WEAKCOLLECTION_CLEAR, |
| 106 MC_FLUSH_CODE, | 106 MC_FLUSH_CODE, |
| 107 NUMBER_OF_SCOPES | 107 NUMBER_OF_SCOPES |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 Scope(GCTracer* tracer, ScopeId scope) : tracer_(tracer), scope_(scope) { | 110 Scope(GCTracer* tracer, ScopeId scope) : tracer_(tracer), scope_(scope) { |
| 111 start_time_ = base::OS::TimeCurrentMillis(); | 111 start_time_ = base::OS::TimeCurrentMillis(); |
| 112 } | 112 } |
| 113 | 113 |
| 114 ~Scope() { | 114 ~Scope() { |
| 115 ASSERT(scope_ < NUMBER_OF_SCOPES); // scope_ is unsigned. | 115 DCHECK(scope_ < NUMBER_OF_SCOPES); // scope_ is unsigned. |
| 116 tracer_->current_.scopes[scope_] += | 116 tracer_->current_.scopes[scope_] += |
| 117 base::OS::TimeCurrentMillis() - start_time_; | 117 base::OS::TimeCurrentMillis() - start_time_; |
| 118 } | 118 } |
| 119 | 119 |
| 120 private: | 120 private: |
| 121 GCTracer* tracer_; | 121 GCTracer* tracer_; |
| 122 ScopeId scope_; | 122 ScopeId scope_; |
| 123 double start_time_; | 123 double start_time_; |
| 124 | 124 |
| 125 DISALLOW_COPY_AND_ASSIGN(Scope); | 125 DISALLOW_COPY_AND_ASSIGN(Scope); |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 // of the initial atomic sweeping pause. Make sure that it accumulates | 333 // of the initial atomic sweeping pause. Make sure that it accumulates |
| 334 // all sweeping operations performed on the main thread. | 334 // all sweeping operations performed on the main thread. |
| 335 double cumulative_sweeping_duration_; | 335 double cumulative_sweeping_duration_; |
| 336 | 336 |
| 337 DISALLOW_COPY_AND_ASSIGN(GCTracer); | 337 DISALLOW_COPY_AND_ASSIGN(GCTracer); |
| 338 }; | 338 }; |
| 339 } | 339 } |
| 340 } // namespace v8::internal | 340 } // namespace v8::internal |
| 341 | 341 |
| 342 #endif // V8_GC_TRACER_H_ | 342 #endif // V8_GC_TRACER_H_ |
| OLD | NEW |