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

Side by Side Diff: src/heap.cc

Issue 227513003: Do not greedy GC if no allocation is expected/allowed. (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 | « no previous file | 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 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 7510 matching lines...) Expand 10 before | Expand all | Expand 10 after
7521 void DescriptorLookupCache::Clear() { 7521 void DescriptorLookupCache::Clear() {
7522 for (int index = 0; index < kLength; index++) keys_[index].source = NULL; 7522 for (int index = 0; index < kLength; index++) keys_[index].source = NULL;
7523 } 7523 }
7524 7524
7525 7525
7526 #ifdef DEBUG 7526 #ifdef DEBUG
7527 void Heap::GarbageCollectionGreedyCheck() { 7527 void Heap::GarbageCollectionGreedyCheck() {
7528 ASSERT(FLAG_gc_greedy); 7528 ASSERT(FLAG_gc_greedy);
7529 if (isolate_->bootstrapper()->IsActive()) return; 7529 if (isolate_->bootstrapper()->IsActive()) return;
7530 if (!AllowAllocationFailure::IsAllowed(isolate_)) return; 7530 if (!AllowAllocationFailure::IsAllowed(isolate_)) return;
7531 if (!AllowHeapAllocation::IsAllowed(isolate_)) return;
7531 CollectGarbage(NEW_SPACE); 7532 CollectGarbage(NEW_SPACE);
7532 } 7533 }
7533 #endif 7534 #endif
7534 7535
7535 7536
7536 void ExternalStringTable::CleanUp() { 7537 void ExternalStringTable::CleanUp() {
7537 int last = 0; 7538 int last = 0;
7538 for (int i = 0; i < new_space_strings_.length(); ++i) { 7539 for (int i = 0; i < new_space_strings_.length(); ++i) {
7539 if (new_space_strings_[i] == heap_->the_hole_value()) { 7540 if (new_space_strings_[i] == heap_->the_hole_value()) {
7540 continue; 7541 continue;
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
7714 static_cast<int>(object_sizes_last_time_[index])); 7715 static_cast<int>(object_sizes_last_time_[index]));
7715 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 7716 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
7716 #undef ADJUST_LAST_TIME_OBJECT_COUNT 7717 #undef ADJUST_LAST_TIME_OBJECT_COUNT
7717 7718
7718 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 7719 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
7719 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 7720 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
7720 ClearObjectStats(); 7721 ClearObjectStats();
7721 } 7722 }
7722 7723
7723 } } // namespace v8::internal 7724 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698