Revision: 3428 Author: [email protected] Date: Mon Dec 7 02:32:14 2009 Log: Push bleeding_edge revisions 3417 and 3426 to 1.3 branch. This change unfolds the heap statistics in OOM situations into separate named variables in the stack in an attempt to allow us to inspect them in windbg.
Review URL: http://codereview.chromium.org/462035 http://code.google.com/p/v8/source/detail?r=3428 Modified: /branches/1.3/src/api.cc /branches/1.3/src/global-handles.cc /branches/1.3/src/heap.cc /branches/1.3/src/heap.h /branches/1.3/src/version.cc ======================================= --- /branches/1.3/src/api.cc Thu Dec 3 06:18:11 2009 +++ /branches/1.3/src/api.cc Mon Dec 7 02:32:14 2009 @@ -124,8 +124,49 @@ // When V8 cannot allocated memory FatalProcessOutOfMemory is called. // The default fatal error handler is called and execution is stopped. -static void ExecuteFatalProcessOutOfMemory(const char* location, - i::HeapStats* heap_stats) { +void i::V8::FatalProcessOutOfMemory(const char* location) { + i::HeapStats heap_stats; + int start_marker; + heap_stats.start_marker = &start_marker; + int new_space_size; + heap_stats.new_space_size = &new_space_size; + int new_space_capacity; + heap_stats.new_space_capacity = &new_space_capacity; + int old_pointer_space_size; + heap_stats.old_pointer_space_size = &old_pointer_space_size; + int old_pointer_space_capacity; + heap_stats.old_pointer_space_capacity = &old_pointer_space_capacity; + int old_data_space_size; + heap_stats.old_data_space_size = &old_data_space_size; + int old_data_space_capacity; + heap_stats.old_data_space_capacity = &old_data_space_capacity; + int code_space_size; + heap_stats.code_space_size = &code_space_size; + int code_space_capacity; + heap_stats.code_space_capacity = &code_space_capacity; + int map_space_size; + heap_stats.map_space_size = &map_space_size; + int map_space_capacity; + heap_stats.map_space_capacity = &map_space_capacity; + int cell_space_size; + heap_stats.cell_space_size = &cell_space_size; + int cell_space_capacity; + heap_stats.cell_space_capacity = &cell_space_capacity; + int lo_space_size; + heap_stats.lo_space_size = &lo_space_size; + int global_handle_count; + heap_stats.global_handle_count = &global_handle_count; + int weak_global_handle_count; + heap_stats.weak_global_handle_count = &weak_global_handle_count; + int pending_global_handle_count; + heap_stats.pending_global_handle_count = &pending_global_handle_count; + int near_death_global_handle_count; + heap_stats.near_death_global_handle_count = &near_death_global_handle_count; + int destroyed_global_handle_count; + heap_stats.destroyed_global_handle_count = &destroyed_global_handle_count; + int end_marker; + heap_stats.end_marker = &end_marker; + i::Heap::RecordStats(&heap_stats); i::V8::SetFatalError(); FatalErrorCallback callback = GetFatalErrorHandler(); { @@ -135,13 +176,6 @@ // If the callback returns, we stop execution. UNREACHABLE(); } - - -void i::V8::FatalProcessOutOfMemory(const char* location) { - i::HeapStats heap_stats; - i::Heap::RecordStats(&heap_stats); - ExecuteFatalProcessOutOfMemory(location, &heap_stats); -} void V8::SetFatalErrorHandler(FatalErrorCallback that) { ======================================= --- /branches/1.3/src/global-handles.cc Thu Dec 3 06:18:11 2009 +++ /branches/1.3/src/global-handles.cc Mon Dec 7 02:32:14 2009 @@ -420,21 +420,21 @@ GlobalHandles::Node* GlobalHandles::first_deallocated_ = NULL; void GlobalHandles::RecordStats(HeapStats* stats) { - stats->global_handle_count = 0; - stats->weak_global_handle_count = 0; - stats->pending_global_handle_count = 0; - stats->near_death_global_handle_count = 0; - stats->destroyed_global_handle_count = 0; + *stats->global_handle_count = 0; + *stats->weak_global_handle_count = 0; + *stats->pending_global_handle_count = 0; + *stats->near_death_global_handle_count = 0; + *stats->destroyed_global_handle_count = 0; for (Node* current = head_; current != NULL; current = current->next()) { - stats->global_handle_count++; + *stats->global_handle_count += 1; if (current->state_ == Node::WEAK) { - stats->weak_global_handle_count++; + *stats->weak_global_handle_count += 1; } else if (current->state_ == Node::PENDING) { - stats->pending_global_handle_count++; + *stats->pending_global_handle_count += 1; } else if (current->state_ == Node::NEAR_DEATH) { - stats->near_death_global_handle_count++; + *stats->near_death_global_handle_count += 1; } else if (current->state_ == Node::DESTROYED) { - stats->destroyed_global_handle_count++; + *stats->destroyed_global_handle_count += 1; } } } ======================================= --- /branches/1.3/src/heap.cc Thu Dec 3 06:18:11 2009 +++ /branches/1.3/src/heap.cc Mon Dec 7 02:32:14 2009 @@ -3348,19 +3348,21 @@ void Heap::RecordStats(HeapStats* stats) { - stats->new_space_size = new_space_.Size(); - stats->new_space_capacity = new_space_.Capacity(); - stats->old_pointer_space_size = old_pointer_space_->Size(); - stats->old_pointer_space_capacity = old_pointer_space_->Capacity(); - stats->old_data_space_size = old_data_space_->Size(); - stats->old_data_space_capacity = old_data_space_->Capacity(); - stats->code_space_size = code_space_->Size(); - stats->code_space_capacity = code_space_->Capacity(); - stats->map_space_size = map_space_->Size(); - stats->map_space_capacity = map_space_->Capacity(); - stats->cell_space_size = cell_space_->Size(); - stats->cell_space_capacity = cell_space_->Capacity(); - stats->lo_space_size = lo_space_->Size(); + *stats->start_marker = 0xDECADE00; + *stats->end_marker = 0xDECADE01; + *stats->new_space_size = new_space_.Size(); + *stats->new_space_capacity = new_space_.Capacity(); + *stats->old_pointer_space_size = old_pointer_space_->Size(); + *stats->old_pointer_space_capacity = old_pointer_space_->Capacity(); + *stats->old_data_space_size = old_data_space_->Size(); + *stats->old_data_space_capacity = old_data_space_->Capacity(); + *stats->code_space_size = code_space_->Size(); + *stats->code_space_capacity = code_space_->Capacity(); + *stats->map_space_size = map_space_->Size(); + *stats->map_space_capacity = map_space_->Capacity(); + *stats->cell_space_size = cell_space_->Size(); + *stats->cell_space_capacity = cell_space_->Capacity(); + *stats->lo_space_size = lo_space_->Size(); GlobalHandles::RecordStats(stats); } ======================================= --- /branches/1.3/src/heap.h Thu Dec 3 06:18:11 2009 +++ /branches/1.3/src/heap.h Mon Dec 7 02:32:14 2009 @@ -1152,24 +1152,26 @@ class HeapStats { public: - int new_space_size; - int new_space_capacity; - int old_pointer_space_size; - int old_pointer_space_capacity; - int old_data_space_size; - int old_data_space_capacity; - int code_space_size; - int code_space_capacity; - int map_space_size; - int map_space_capacity; - int cell_space_size; - int cell_space_capacity; - int lo_space_size; - int global_handle_count; - int weak_global_handle_count; - int pending_global_handle_count; - int near_death_global_handle_count; - int destroyed_global_handle_count; + int *start_marker; + int *new_space_size; + int *new_space_capacity; + int *old_pointer_space_size; + int *old_pointer_space_capacity; + int *old_data_space_size; + int *old_data_space_capacity; + int *code_space_size; + int *code_space_capacity; + int *map_space_size; + int *map_space_capacity; + int *cell_space_size; + int *cell_space_capacity; + int *lo_space_size; + int *global_handle_count; + int *weak_global_handle_count; + int *pending_global_handle_count; + int *near_death_global_handle_count; + int *destroyed_global_handle_count; + int *end_marker; }; ======================================= --- /branches/1.3/src/version.cc Thu Dec 3 06:18:11 2009 +++ /branches/1.3/src/version.cc Mon Dec 7 02:32:14 2009 @@ -35,7 +35,7 @@ #define MAJOR_VERSION 1 #define MINOR_VERSION 3 #define BUILD_NUMBER 18 -#define PATCH_LEVEL 15 +#define PATCH_LEVEL 16 #define CANDIDATE_VERSION false // Define SONAME to have the SCons build the put a specific SONAME into the -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
