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

Side by Side Diff: bleeding_edge/src/heap.cc

Issue 450007: Clear the compilation cache just before starting to do mark-sweep... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years 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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 2883 matching lines...) Expand 10 before | Expand all | Expand 10 after
2894 number_idle_notifications = 0; 2894 number_idle_notifications = 0;
2895 last_gc_count = gc_count_; 2895 last_gc_count = gc_count_;
2896 } 2896 }
2897 2897
2898 if (number_idle_notifications == kIdlesBeforeScavenge) { 2898 if (number_idle_notifications == kIdlesBeforeScavenge) {
2899 CollectGarbage(0, NEW_SPACE); 2899 CollectGarbage(0, NEW_SPACE);
2900 new_space_.Shrink(); 2900 new_space_.Shrink();
2901 last_gc_count = gc_count_; 2901 last_gc_count = gc_count_;
2902 2902
2903 } else if (number_idle_notifications == kIdlesBeforeMarkSweep) { 2903 } else if (number_idle_notifications == kIdlesBeforeMarkSweep) {
2904 // Before doing the mark-sweep collections we clear the
2905 // compilation cache to avoid hanging on to source code and
2906 // generated code for cached functions.
2907 CompilationCache::Clear();
2908
2904 CollectAllGarbage(false); 2909 CollectAllGarbage(false);
2905 new_space_.Shrink(); 2910 new_space_.Shrink();
2906 last_gc_count = gc_count_; 2911 last_gc_count = gc_count_;
2907 2912
2908 } else if (number_idle_notifications == kIdlesBeforeMarkCompact) { 2913 } else if (number_idle_notifications == kIdlesBeforeMarkCompact) {
2909 CollectAllGarbage(true); 2914 CollectAllGarbage(true);
2910 new_space_.Shrink(); 2915 new_space_.Shrink();
2911 last_gc_count = gc_count_; 2916 last_gc_count = gc_count_;
2912 number_idle_notifications = 0; 2917 number_idle_notifications = 0;
2913 finished = true; 2918 finished = true;
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after
3951 for (int i = 0; i < kNumberOfCaches; i++) { 3956 for (int i = 0; i < kNumberOfCaches; i++) {
3952 if (caches_[i] != NULL) { 3957 if (caches_[i] != NULL) {
3953 delete caches_[i]; 3958 delete caches_[i];
3954 caches_[i] = NULL; 3959 caches_[i] = NULL;
3955 } 3960 }
3956 } 3961 }
3957 } 3962 }
3958 3963
3959 3964
3960 } } // namespace v8::internal 3965 } } // 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