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

Side by Side Diff: src/heap.cc

Issue 227553005: Remove gc greedy mode. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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 | « src/heap.h ('k') | src/heap-inl.h » ('j') | no next file with comments »
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 // 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 7656 matching lines...) Expand 10 before | Expand all | Expand 10 after
7667 void KeyedLookupCache::Clear() { 7667 void KeyedLookupCache::Clear() {
7668 for (int index = 0; index < kLength; index++) keys_[index].map = NULL; 7668 for (int index = 0; index < kLength; index++) keys_[index].map = NULL;
7669 } 7669 }
7670 7670
7671 7671
7672 void DescriptorLookupCache::Clear() { 7672 void DescriptorLookupCache::Clear() {
7673 for (int index = 0; index < kLength; index++) keys_[index].source = NULL; 7673 for (int index = 0; index < kLength; index++) keys_[index].source = NULL;
7674 } 7674 }
7675 7675
7676 7676
7677 #ifdef DEBUG
7678 void Heap::GarbageCollectionGreedyCheck() {
7679 ASSERT(FLAG_gc_greedy);
7680 if (isolate_->bootstrapper()->IsActive()) return;
7681 if (!AllowAllocationFailure::IsAllowed(isolate_)) return;
7682 CollectGarbage(NEW_SPACE);
7683 }
7684 #endif
7685
7686
7687 void ExternalStringTable::CleanUp() { 7677 void ExternalStringTable::CleanUp() {
7688 int last = 0; 7678 int last = 0;
7689 for (int i = 0; i < new_space_strings_.length(); ++i) { 7679 for (int i = 0; i < new_space_strings_.length(); ++i) {
7690 if (new_space_strings_[i] == heap_->the_hole_value()) { 7680 if (new_space_strings_[i] == heap_->the_hole_value()) {
7691 continue; 7681 continue;
7692 } 7682 }
7693 ASSERT(new_space_strings_[i]->IsExternalString()); 7683 ASSERT(new_space_strings_[i]->IsExternalString());
7694 if (heap_->InNewSpace(new_space_strings_[i])) { 7684 if (heap_->InNewSpace(new_space_strings_[i])) {
7695 new_space_strings_[last++] = new_space_strings_[i]; 7685 new_space_strings_[last++] = new_space_strings_[i];
7696 } else { 7686 } else {
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
7865 static_cast<int>(object_sizes_last_time_[index])); 7855 static_cast<int>(object_sizes_last_time_[index]));
7866 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 7856 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
7867 #undef ADJUST_LAST_TIME_OBJECT_COUNT 7857 #undef ADJUST_LAST_TIME_OBJECT_COUNT
7868 7858
7869 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 7859 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
7870 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 7860 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
7871 ClearObjectStats(); 7861 ClearObjectStats();
7872 } 7862 }
7873 7863
7874 } } // namespace v8::internal 7864 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/heap-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698