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_HEAP_H_ | 5 #ifndef V8_HEAP_HEAP_H_ |
6 #define V8_HEAP_HEAP_H_ | 6 #define V8_HEAP_HEAP_H_ |
7 | 7 |
8 #include <cmath> | 8 #include <cmath> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1291 } | 1291 } |
1292 | 1292 |
1293 void IncrementCodeGeneratedBytes(bool is_crankshafted, int size) { | 1293 void IncrementCodeGeneratedBytes(bool is_crankshafted, int size) { |
1294 if (is_crankshafted) { | 1294 if (is_crankshafted) { |
1295 crankshaft_codegen_bytes_generated_ += size; | 1295 crankshaft_codegen_bytes_generated_ += size; |
1296 } else { | 1296 } else { |
1297 full_codegen_bytes_generated_ += size; | 1297 full_codegen_bytes_generated_ += size; |
1298 } | 1298 } |
1299 } | 1299 } |
1300 | 1300 |
1301 void UpdateNewSpaceAllocationCounter() { | |
1302 new_space_allocation_counter_ = NewSpaceAllocationCounter(); | |
1303 } | |
1304 | |
1305 size_t NewSpaceAllocationCounter() { | |
1306 return new_space_allocation_counter_ + new_space()->AllocatedSinceLastGC(); | |
1307 } | |
1308 | |
1309 // This should be used only for testing. | |
1310 void set_new_space_allocation_counter(size_t new_value) { | |
1311 new_space_allocation_counter_ = new_value; | |
1312 } | |
1313 | |
1301 // Update GC statistics that are tracked on the Heap. | 1314 // Update GC statistics that are tracked on the Heap. |
1302 void UpdateCumulativeGCStatistics(double duration, double spent_in_mutator, | 1315 void UpdateCumulativeGCStatistics(double duration, double spent_in_mutator, |
1303 double marking_time); | 1316 double marking_time); |
1304 | 1317 |
1305 // Returns maximum GC pause. | 1318 // Returns maximum GC pause. |
1306 double get_max_gc_pause() { return max_gc_pause_; } | 1319 double get_max_gc_pause() { return max_gc_pause_; } |
1307 | 1320 |
1308 // Returns maximum size of objects alive after GC. | 1321 // Returns maximum size of objects alive after GC. |
1309 intptr_t get_max_alive_after_gc() { return max_alive_after_gc_; } | 1322 intptr_t get_max_alive_after_gc() { return max_alive_after_gc_; } |
1310 | 1323 |
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2146 Marking marking_; | 2159 Marking marking_; |
2147 | 2160 |
2148 IncrementalMarking incremental_marking_; | 2161 IncrementalMarking incremental_marking_; |
2149 | 2162 |
2150 GCIdleTimeHandler gc_idle_time_handler_; | 2163 GCIdleTimeHandler gc_idle_time_handler_; |
2151 | 2164 |
2152 unsigned int gc_count_at_last_idle_gc_; | 2165 unsigned int gc_count_at_last_idle_gc_; |
2153 | 2166 |
2154 // These two counters are monotomically increasing and never reset. | 2167 // These two counters are monotomically increasing and never reset. |
2155 size_t full_codegen_bytes_generated_; | 2168 size_t full_codegen_bytes_generated_; |
2156 size_t crankshaft_codegen_bytes_generated_; | 2169 size_t crankshaft_codegen_bytes_generated_; |
Hannes Payer (out of office)
2015/05/12 17:04:17
newline
ulan
2015/05/18 12:45:51
Done.
| |
2170 // This counter is increased before each GC and never reset. | |
2171 // To account for the bytes allocated since the last GC, use the | |
2172 // NewSpaceAllocationCounter() function. | |
2173 size_t new_space_allocation_counter_; | |
2157 | 2174 |
2158 // If the --deopt_every_n_garbage_collections flag is set to a positive value, | 2175 // If the --deopt_every_n_garbage_collections flag is set to a positive value, |
2159 // this variable holds the number of garbage collections since the last | 2176 // this variable holds the number of garbage collections since the last |
2160 // deoptimization triggered by garbage collection. | 2177 // deoptimization triggered by garbage collection. |
2161 int gcs_since_last_deopt_; | 2178 int gcs_since_last_deopt_; |
2162 | 2179 |
2163 static const int kAllocationSiteScratchpadSize = 256; | 2180 static const int kAllocationSiteScratchpadSize = 256; |
2164 int allocation_sites_scratchpad_length_; | 2181 int allocation_sites_scratchpad_length_; |
2165 | 2182 |
2166 static const int kMaxMarkCompactsInIdleRound = 7; | 2183 static const int kMaxMarkCompactsInIdleRound = 7; |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2647 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2664 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2648 | 2665 |
2649 private: | 2666 private: |
2650 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2667 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2651 }; | 2668 }; |
2652 #endif // DEBUG | 2669 #endif // DEBUG |
2653 } | 2670 } |
2654 } // namespace v8::internal | 2671 } // namespace v8::internal |
2655 | 2672 |
2656 #endif // V8_HEAP_HEAP_H_ | 2673 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |