OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 int Heap::contexts_disposed_ = 0; | 127 int Heap::contexts_disposed_ = 0; |
128 | 128 |
129 int Heap::young_survivors_after_last_gc_ = 0; | 129 int Heap::young_survivors_after_last_gc_ = 0; |
130 int Heap::high_survival_rate_period_length_ = 0; | 130 int Heap::high_survival_rate_period_length_ = 0; |
131 double Heap::survival_rate_ = 0; | 131 double Heap::survival_rate_ = 0; |
132 Heap::SurvivalRateTrend Heap::previous_survival_rate_trend_ = Heap::STABLE; | 132 Heap::SurvivalRateTrend Heap::previous_survival_rate_trend_ = Heap::STABLE; |
133 Heap::SurvivalRateTrend Heap::survival_rate_trend_ = Heap::STABLE; | 133 Heap::SurvivalRateTrend Heap::survival_rate_trend_ = Heap::STABLE; |
134 | 134 |
135 #ifdef DEBUG | 135 #ifdef DEBUG |
136 bool Heap::allocation_allowed_ = true; | 136 bool Heap::allocation_allowed_ = true; |
| 137 bool Heap::gc_allowed_ = true; |
137 | 138 |
138 int Heap::allocation_timeout_ = 0; | 139 int Heap::allocation_timeout_ = 0; |
139 bool Heap::disallow_allocation_failure_ = false; | 140 bool Heap::disallow_allocation_failure_ = false; |
140 #endif // DEBUG | 141 #endif // DEBUG |
141 | 142 |
142 int GCTracer::alive_after_last_gc_ = 0; | 143 int GCTracer::alive_after_last_gc_ = 0; |
143 double GCTracer::last_gc_end_timestamp_ = 0.0; | 144 double GCTracer::last_gc_end_timestamp_ = 0.0; |
144 int GCTracer::max_gc_pause_ = 0; | 145 int GCTracer::max_gc_pause_ = 0; |
145 int GCTracer::max_alive_after_gc_ = 0; | 146 int GCTracer::max_alive_after_gc_ = 0; |
146 int GCTracer::min_in_mutator_ = kMaxInt; | 147 int GCTracer::min_in_mutator_ = kMaxInt; |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 #elif defined(DEBUG) | 313 #elif defined(DEBUG) |
313 if (FLAG_heap_stats) ReportHeapStatistics("After GC"); | 314 if (FLAG_heap_stats) ReportHeapStatistics("After GC"); |
314 #elif defined(ENABLE_LOGGING_AND_PROFILING) | 315 #elif defined(ENABLE_LOGGING_AND_PROFILING) |
315 if (FLAG_log_gc) new_space_.ReportStatistics(); | 316 if (FLAG_log_gc) new_space_.ReportStatistics(); |
316 #endif | 317 #endif |
317 } | 318 } |
318 #endif // defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING) | 319 #endif // defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING) |
319 | 320 |
320 | 321 |
321 void Heap::GarbageCollectionPrologue() { | 322 void Heap::GarbageCollectionPrologue() { |
| 323 #ifdef DEBUG |
| 324 ASSERT(gc_allowed_); |
| 325 #endif |
322 TranscendentalCache::Clear(); | 326 TranscendentalCache::Clear(); |
323 ClearJSFunctionResultCaches(); | 327 ClearJSFunctionResultCaches(); |
324 gc_count_++; | 328 gc_count_++; |
325 unflattened_strings_length_ = 0; | 329 unflattened_strings_length_ = 0; |
326 #ifdef DEBUG | 330 #ifdef DEBUG |
327 ASSERT(allocation_allowed_ && gc_state_ == NOT_IN_GC); | 331 ASSERT(allocation_allowed_ && gc_state_ == NOT_IN_GC); |
328 allow_allocation(false); | 332 allow_allocation(false); |
329 | 333 |
330 if (FLAG_verify_heap) { | 334 if (FLAG_verify_heap) { |
331 Verify(); | 335 Verify(); |
(...skipping 4653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4985 void ExternalStringTable::TearDown() { | 4989 void ExternalStringTable::TearDown() { |
4986 new_space_strings_.Free(); | 4990 new_space_strings_.Free(); |
4987 old_space_strings_.Free(); | 4991 old_space_strings_.Free(); |
4988 } | 4992 } |
4989 | 4993 |
4990 | 4994 |
4991 List<Object*> ExternalStringTable::new_space_strings_; | 4995 List<Object*> ExternalStringTable::new_space_strings_; |
4992 List<Object*> ExternalStringTable::old_space_strings_; | 4996 List<Object*> ExternalStringTable::old_space_strings_; |
4993 | 4997 |
4994 } } // namespace v8::internal | 4998 } } // namespace v8::internal |
OLD | NEW |