Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: src/heap.h

Issue 423303006: Make sure that there is enough time left before finishing incremental marking in idle notification. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/heap.cc » ('j') | src/heap.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after
1083 int freed_global_handles); 1083 int freed_global_handles);
1084 1084
1085 // Indicates whether inline bump-pointer allocation has been disabled. 1085 // Indicates whether inline bump-pointer allocation has been disabled.
1086 bool inline_allocation_disabled() { return inline_allocation_disabled_; } 1086 bool inline_allocation_disabled() { return inline_allocation_disabled_; }
1087 1087
1088 // Switch whether inline bump-pointer allocation should be used. 1088 // Switch whether inline bump-pointer allocation should be used.
1089 void EnableInlineAllocation(); 1089 void EnableInlineAllocation();
1090 void DisableInlineAllocation(); 1090 void DisableInlineAllocation();
1091 1091
1092 // Implements the corresponding V8 API function. 1092 // Implements the corresponding V8 API function.
1093 bool IdleNotification(int hint); 1093 bool IdleNotification(int idle_time_in_ms);
1094 1094
1095 // Declare all the root indices. This defines the root list order. 1095 // Declare all the root indices. This defines the root list order.
1096 enum RootListIndex { 1096 enum RootListIndex {
1097 #define ROOT_INDEX_DECLARATION(type, name, camel_name) k##camel_name##RootIndex, 1097 #define ROOT_INDEX_DECLARATION(type, name, camel_name) k##camel_name##RootIndex,
1098 STRONG_ROOT_LIST(ROOT_INDEX_DECLARATION) 1098 STRONG_ROOT_LIST(ROOT_INDEX_DECLARATION)
1099 #undef ROOT_INDEX_DECLARATION 1099 #undef ROOT_INDEX_DECLARATION
1100 1100
1101 #define STRING_INDEX_DECLARATION(name, str) k##name##RootIndex, 1101 #define STRING_INDEX_DECLARATION(name, str) k##name##RootIndex,
1102 INTERNALIZED_STRING_LIST(STRING_INDEX_DECLARATION) 1102 INTERNALIZED_STRING_LIST(STRING_INDEX_DECLARATION)
1103 #undef STRING_DECLARATION 1103 #undef STRING_DECLARATION
(...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after
2056 // - a number less than 10 for small heaps, which are less than 8Mb. 2056 // - a number less than 10 for small heaps, which are less than 8Mb.
2057 // - a number greater than 10 for large heaps, which are greater than 32Mb. 2057 // - a number greater than 10 for large heaps, which are greater than 32Mb.
2058 int TimeMarkSweepWouldTakeInMs() { 2058 int TimeMarkSweepWouldTakeInMs() {
2059 // Rough estimate of how many megabytes of heap can be processed in 1 ms. 2059 // Rough estimate of how many megabytes of heap can be processed in 1 ms.
2060 static const int kMbPerMs = 2; 2060 static const int kMbPerMs = 2;
2061 2061
2062 int heap_size_mb = static_cast<int>(SizeOfObjects() / MB); 2062 int heap_size_mb = static_cast<int>(SizeOfObjects() / MB);
2063 return heap_size_mb / kMbPerMs; 2063 return heap_size_mb / kMbPerMs;
2064 } 2064 }
2065 2065
2066 void AdvanceIdleIncrementalMarking(intptr_t step_size); 2066 // Returns the time in ms spent in incremental marking.
2067 int AdvanceIdleIncrementalMarking(intptr_t step_size);
2068
2069 void FinalizeIdleIncrementalMarking();
2067 2070
2068 void ClearObjectStats(bool clear_last_time_stats = false); 2071 void ClearObjectStats(bool clear_last_time_stats = false);
2069 2072
2070 void set_weak_object_to_code_table(Object* value) { 2073 void set_weak_object_to_code_table(Object* value) {
2071 ASSERT(!InNewSpace(value)); 2074 ASSERT(!InNewSpace(value));
2072 weak_object_to_code_table_ = value; 2075 weak_object_to_code_table_ = value;
2073 } 2076 }
2074 2077
2075 Object** weak_object_to_code_table_address() { 2078 Object** weak_object_to_code_table_address() {
2076 return &weak_object_to_code_table_; 2079 return &weak_object_to_code_table_;
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
2639 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 2642 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
2640 2643
2641 private: 2644 private:
2642 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2645 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2643 }; 2646 };
2644 #endif // DEBUG 2647 #endif // DEBUG
2645 2648
2646 } } // namespace v8::internal 2649 } } // namespace v8::internal
2647 2650
2648 #endif // V8_HEAP_H_ 2651 #endif // V8_HEAP_H_
OLDNEW
« no previous file with comments | « no previous file | src/heap.cc » ('j') | src/heap.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698