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

Side by Side Diff: src/spaces.cc

Issue 7621014: Fix the thresholds so that the heap does not grow uncontrollably. This fixes (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: '' Created 9 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
« src/heap.cc ('K') | « src/spaces.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1912 matching lines...) Expand 10 before | Expand all | Expand 10 after
1923 void PagedSpace::PrepareForMarkCompact() { 1923 void PagedSpace::PrepareForMarkCompact() {
1924 // We don't have a linear allocation area while sweeping. It will be restored 1924 // We don't have a linear allocation area while sweeping. It will be restored
1925 // on the first allocation after the sweep. 1925 // on the first allocation after the sweep.
1926 // Mark the old linear allocation area with a free space map so it can be 1926 // Mark the old linear allocation area with a free space map so it can be
1927 // skipped when scanning the heap. 1927 // skipped when scanning the heap.
1928 int old_linear_size = static_cast<int>(limit() - top()); 1928 int old_linear_size = static_cast<int>(limit() - top());
1929 Free(top(), old_linear_size); 1929 Free(top(), old_linear_size);
1930 SetTop(NULL, NULL); 1930 SetTop(NULL, NULL);
1931 1931
1932 // Stop lazy sweeping for the space. 1932 // Stop lazy sweeping for the space.
1933 if (FLAG_trace_gc && first_unswept_page_ != NULL) {
Vyacheslav Egorov (Chromium) 2011/08/12 09:11:51 _verbose
Erik Corry 2011/08/12 09:21:48 Actually this happens rarely and if it happens it
1934 int pages = 0;
1935 Page* p = last_unswept_page_;
1936 do {
1937 pages++;
1938 p = p->next_page();
1939 } while (p != last_unswept_page_);
1940 PrintF("Abandoned %d unswept pages\n", pages);
1941 }
1933 first_unswept_page_ = last_unswept_page_ = Page::FromAddress(NULL); 1942 first_unswept_page_ = last_unswept_page_ = Page::FromAddress(NULL);
1934 1943
1935 // Clear the free list before a full GC---it will be rebuilt afterward. 1944 // Clear the free list before a full GC---it will be rebuilt afterward.
1936 free_list_.Reset(); 1945 free_list_.Reset();
1937 1946
1938 // Clear EVACUATED flag from all pages. 1947 // Clear EVACUATED flag from all pages.
1939 PageIterator it(this); 1948 PageIterator it(this);
1940 while (it.has_next()) { 1949 while (it.has_next()) {
1941 Page* page = it.next(); 1950 Page* page = it.next();
1942 page->ClearSwept(); 1951 page->ClearSwept();
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
2508 for (HeapObject* obj = obj_it.Next(); obj != NULL; obj = obj_it.Next()) { 2517 for (HeapObject* obj = obj_it.Next(); obj != NULL; obj = obj_it.Next()) {
2509 if (obj->IsCode()) { 2518 if (obj->IsCode()) {
2510 Code* code = Code::cast(obj); 2519 Code* code = Code::cast(obj);
2511 isolate->code_kind_statistics()[code->kind()] += code->Size(); 2520 isolate->code_kind_statistics()[code->kind()] += code->Size();
2512 } 2521 }
2513 } 2522 }
2514 } 2523 }
2515 #endif // DEBUG 2524 #endif // DEBUG
2516 2525
2517 } } // namespace v8::internal 2526 } } // namespace v8::internal
OLDNEW
« src/heap.cc ('K') | « src/spaces.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698