| 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 | 9 |
| 10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| (...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 747 int flags, const char* gc_reason = NULL, | 747 int flags, const char* gc_reason = NULL, |
| 748 const GCCallbackFlags gc_callback_flags = kNoGCCallbackFlags); | 748 const GCCallbackFlags gc_callback_flags = kNoGCCallbackFlags); |
| 749 | 749 |
| 750 // Last hope GC, should try to squeeze as much as possible. | 750 // Last hope GC, should try to squeeze as much as possible. |
| 751 void CollectAllAvailableGarbage(const char* gc_reason = NULL); | 751 void CollectAllAvailableGarbage(const char* gc_reason = NULL); |
| 752 | 752 |
| 753 // Check whether the heap is currently iterable. | 753 // Check whether the heap is currently iterable. |
| 754 bool IsHeapIterable(); | 754 bool IsHeapIterable(); |
| 755 | 755 |
| 756 // Notify the heap that a context has been disposed. | 756 // Notify the heap that a context has been disposed. |
| 757 int NotifyContextDisposed(); | 757 void NotifyContextDisposed(); |
| 758 | 758 |
| 759 inline void increment_scan_on_scavenge_pages() { | 759 inline void increment_scan_on_scavenge_pages() { |
| 760 scan_on_scavenge_pages_++; | 760 scan_on_scavenge_pages_++; |
| 761 if (FLAG_gc_verbose) { | 761 if (FLAG_gc_verbose) { |
| 762 PrintF("Scan-on-scavenge pages: %d\n", scan_on_scavenge_pages_); | 762 PrintF("Scan-on-scavenge pages: %d\n", scan_on_scavenge_pages_); |
| 763 } | 763 } |
| 764 } | 764 } |
| 765 | 765 |
| 766 inline void decrement_scan_on_scavenge_pages() { | 766 inline void decrement_scan_on_scavenge_pages() { |
| 767 scan_on_scavenge_pages_--; | 767 scan_on_scavenge_pages_--; |
| (...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1455 | 1455 |
| 1456 // For keeping track of how much data has survived | 1456 // For keeping track of how much data has survived |
| 1457 // scavenge since last new space expansion. | 1457 // scavenge since last new space expansion. |
| 1458 int survived_since_last_expansion_; | 1458 int survived_since_last_expansion_; |
| 1459 | 1459 |
| 1460 // For keeping track on when to flush RegExp code. | 1460 // For keeping track on when to flush RegExp code. |
| 1461 int sweep_generation_; | 1461 int sweep_generation_; |
| 1462 | 1462 |
| 1463 int always_allocate_scope_depth_; | 1463 int always_allocate_scope_depth_; |
| 1464 | 1464 |
| 1465 // For keeping track of context disposals. | |
| 1466 int contexts_disposed_; | |
| 1467 | |
| 1468 int global_ic_age_; | 1465 int global_ic_age_; |
| 1469 | 1466 |
| 1470 bool flush_monomorphic_ics_; | 1467 bool flush_monomorphic_ics_; |
| 1471 | 1468 |
| 1469 // If context disposals happen at a high rate, we do a full gc in between |
| 1470 // context disposal. |
| 1471 // TODO(hpayer): We should get rid of that mode. |
| 1472 static const int kNotifyContextDisposedFullGCLimitInMS = 1000; |
| 1473 double last_notify_context_disposed_; |
| 1474 |
| 1472 int scan_on_scavenge_pages_; | 1475 int scan_on_scavenge_pages_; |
| 1473 | 1476 |
| 1474 NewSpace new_space_; | 1477 NewSpace new_space_; |
| 1475 OldSpace* old_pointer_space_; | 1478 OldSpace* old_pointer_space_; |
| 1476 OldSpace* old_data_space_; | 1479 OldSpace* old_data_space_; |
| 1477 OldSpace* code_space_; | 1480 OldSpace* code_space_; |
| 1478 MapSpace* map_space_; | 1481 MapSpace* map_space_; |
| 1479 CellSpace* cell_space_; | 1482 CellSpace* cell_space_; |
| 1480 PropertyCellSpace* property_cell_space_; | 1483 PropertyCellSpace* property_cell_space_; |
| 1481 LargeObjectSpace* lo_space_; | 1484 LargeObjectSpace* lo_space_; |
| (...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2538 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2541 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
| 2539 | 2542 |
| 2540 private: | 2543 private: |
| 2541 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2544 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
| 2542 }; | 2545 }; |
| 2543 #endif // DEBUG | 2546 #endif // DEBUG |
| 2544 } | 2547 } |
| 2545 } // namespace v8::internal | 2548 } // namespace v8::internal |
| 2546 | 2549 |
| 2547 #endif // V8_HEAP_HEAP_H_ | 2550 #endif // V8_HEAP_HEAP_H_ |
| OLD | NEW |