| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_H_ | 5 #ifndef V8_HEAP_H_ |
| 6 #define V8_HEAP_H_ | 6 #define V8_HEAP_H_ |
| 7 | 7 |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| (...skipping 2128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2139 // Flag is set when the heap has been configured. The heap can be repeatedly | 2139 // Flag is set when the heap has been configured. The heap can be repeatedly |
| 2140 // configured through the API until it is set up. | 2140 // configured through the API until it is set up. |
| 2141 bool configured_; | 2141 bool configured_; |
| 2142 | 2142 |
| 2143 ExternalStringTable external_string_table_; | 2143 ExternalStringTable external_string_table_; |
| 2144 | 2144 |
| 2145 VisitorDispatchTable<ScavengingCallback> scavenging_visitors_table_; | 2145 VisitorDispatchTable<ScavengingCallback> scavenging_visitors_table_; |
| 2146 | 2146 |
| 2147 MemoryChunk* chunks_queued_for_free_; | 2147 MemoryChunk* chunks_queued_for_free_; |
| 2148 | 2148 |
| 2149 Mutex relocation_mutex_; | 2149 base::Mutex relocation_mutex_; |
| 2150 | 2150 |
| 2151 int gc_callbacks_depth_; | 2151 int gc_callbacks_depth_; |
| 2152 | 2152 |
| 2153 friend class AlwaysAllocateScope; | 2153 friend class AlwaysAllocateScope; |
| 2154 friend class Factory; | 2154 friend class Factory; |
| 2155 friend class GCCallbacksScope; | 2155 friend class GCCallbacksScope; |
| 2156 friend class GCTracer; | 2156 friend class GCTracer; |
| 2157 friend class HeapIterator; | 2157 friend class HeapIterator; |
| 2158 friend class Isolate; | 2158 friend class Isolate; |
| 2159 friend class MarkCompactCollector; | 2159 friend class MarkCompactCollector; |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2519 MC_UPDATE_MISC_POINTERS, | 2519 MC_UPDATE_MISC_POINTERS, |
| 2520 MC_WEAKCOLLECTION_PROCESS, | 2520 MC_WEAKCOLLECTION_PROCESS, |
| 2521 MC_WEAKCOLLECTION_CLEAR, | 2521 MC_WEAKCOLLECTION_CLEAR, |
| 2522 MC_FLUSH_CODE, | 2522 MC_FLUSH_CODE, |
| 2523 kNumberOfScopes | 2523 kNumberOfScopes |
| 2524 }; | 2524 }; |
| 2525 | 2525 |
| 2526 Scope(GCTracer* tracer, ScopeId scope) | 2526 Scope(GCTracer* tracer, ScopeId scope) |
| 2527 : tracer_(tracer), | 2527 : tracer_(tracer), |
| 2528 scope_(scope) { | 2528 scope_(scope) { |
| 2529 start_time_ = OS::TimeCurrentMillis(); | 2529 start_time_ = base::OS::TimeCurrentMillis(); |
| 2530 } | 2530 } |
| 2531 | 2531 |
| 2532 ~Scope() { | 2532 ~Scope() { |
| 2533 ASSERT(scope_ < kNumberOfScopes); // scope_ is unsigned. | 2533 ASSERT(scope_ < kNumberOfScopes); // scope_ is unsigned. |
| 2534 tracer_->scopes_[scope_] += OS::TimeCurrentMillis() - start_time_; | 2534 tracer_->scopes_[scope_] += base::OS::TimeCurrentMillis() - start_time_; |
| 2535 } | 2535 } |
| 2536 | 2536 |
| 2537 private: | 2537 private: |
| 2538 GCTracer* tracer_; | 2538 GCTracer* tracer_; |
| 2539 ScopeId scope_; | 2539 ScopeId scope_; |
| 2540 double start_time_; | 2540 double start_time_; |
| 2541 }; | 2541 }; |
| 2542 | 2542 |
| 2543 explicit GCTracer(Heap* heap, | 2543 explicit GCTracer(Heap* heap, |
| 2544 const char* gc_reason, | 2544 const char* gc_reason, |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2765 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2765 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
| 2766 | 2766 |
| 2767 private: | 2767 private: |
| 2768 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2768 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
| 2769 }; | 2769 }; |
| 2770 #endif // DEBUG | 2770 #endif // DEBUG |
| 2771 | 2771 |
| 2772 } } // namespace v8::internal | 2772 } } // namespace v8::internal |
| 2773 | 2773 |
| 2774 #endif // V8_HEAP_H_ | 2774 #endif // V8_HEAP_H_ |
| OLD | NEW |