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

Side by Side Diff: src/heap.h

Issue 4034002: Revert r5455 from bleeding_edge: attempt to collect more garbage... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 2 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/global-handles.cc ('k') | src/heap.cc » ('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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 // Converts the given boolean condition to JavaScript boolean value. 686 // Converts the given boolean condition to JavaScript boolean value.
687 static Object* ToBoolean(bool condition) { 687 static Object* ToBoolean(bool condition) {
688 return condition ? true_value() : false_value(); 688 return condition ? true_value() : false_value();
689 } 689 }
690 690
691 // Code that should be run before and after each GC. Includes some 691 // Code that should be run before and after each GC. Includes some
692 // reporting/verification activities when compiled with DEBUG set. 692 // reporting/verification activities when compiled with DEBUG set.
693 static void GarbageCollectionPrologue(); 693 static void GarbageCollectionPrologue();
694 static void GarbageCollectionEpilogue(); 694 static void GarbageCollectionEpilogue();
695 695
696 enum CollectionPolicy { NORMAL, AGGRESSIVE };
697
698 // Performs garbage collection operation. 696 // Performs garbage collection operation.
699 // Returns whether required_space bytes are available after the collection. 697 // Returns whether required_space bytes are available after the collection.
700 static void CollectGarbage(AllocationSpace space, 698 static void CollectGarbage(AllocationSpace space);
701 CollectionPolicy collectionPolicy = NORMAL);
702 699
703 // Performs a full garbage collection. Force compaction if the 700 // Performs a full garbage collection. Force compaction if the
704 // parameter is true. 701 // parameter is true.
705 static void CollectAllGarbage(bool force_compaction, 702 static void CollectAllGarbage(bool force_compaction);
706 CollectionPolicy collectionPolicy = NORMAL);
707
708 // Last hope GC, should try to squeeze as much as possible.
709 static void CollectAllAvailableGarbage();
710 703
711 // Notify the heap that a context has been disposed. 704 // Notify the heap that a context has been disposed.
712 static int NotifyContextDisposed() { return ++contexts_disposed_; } 705 static int NotifyContextDisposed() { return ++contexts_disposed_; }
713 706
714 // Utility to invoke the scavenger. This is needed in test code to 707 // Utility to invoke the scavenger. This is needed in test code to
715 // ensure correct callback for weak global handles. 708 // ensure correct callback for weak global handles.
716 static void PerformScavenge(); 709 static void PerformScavenge();
717 710
718 #ifdef DEBUG 711 #ifdef DEBUG
719 // Utility used with flag gc-greedy. 712 // Utility used with flag gc-greedy.
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
1235 gc_safe_size_of_old_object_ = encoded 1228 gc_safe_size_of_old_object_ = encoded
1236 ? &GcSafeSizeOfOldObjectWithEncodedMap 1229 ? &GcSafeSizeOfOldObjectWithEncodedMap
1237 : &GcSafeSizeOfOldObject; 1230 : &GcSafeSizeOfOldObject;
1238 } 1231 }
1239 1232
1240 // Checks whether a global GC is necessary 1233 // Checks whether a global GC is necessary
1241 static GarbageCollector SelectGarbageCollector(AllocationSpace space); 1234 static GarbageCollector SelectGarbageCollector(AllocationSpace space);
1242 1235
1243 // Performs garbage collection 1236 // Performs garbage collection
1244 static void PerformGarbageCollection(GarbageCollector collector, 1237 static void PerformGarbageCollection(GarbageCollector collector,
1245 GCTracer* tracer, 1238 GCTracer* tracer);
1246 CollectionPolicy collectionPolicy);
1247
1248 static const intptr_t kMinimumPromotionLimit = 2 * MB;
1249 static const intptr_t kMinimumAllocationLimit = 8 * MB;
1250
1251 inline static void UpdateOldSpaceLimits();
1252 1239
1253 // Allocate an uninitialized object in map space. The behavior is identical 1240 // Allocate an uninitialized object in map space. The behavior is identical
1254 // to Heap::AllocateRaw(size_in_bytes, MAP_SPACE), except that (a) it doesn't 1241 // to Heap::AllocateRaw(size_in_bytes, MAP_SPACE), except that (a) it doesn't
1255 // have to test the allocation space argument and (b) can reduce code size 1242 // have to test the allocation space argument and (b) can reduce code size
1256 // (since both AllocateRaw and AllocateRawMap are inlined). 1243 // (since both AllocateRaw and AllocateRawMap are inlined).
1257 MUST_USE_RESULT static inline Object* AllocateRawMap(); 1244 MUST_USE_RESULT static inline Object* AllocateRawMap();
1258 1245
1259 // Allocate an uninitialized object in the global property cell space. 1246 // Allocate an uninitialized object in the global property cell space.
1260 MUST_USE_RESULT static inline Object* AllocateRawCell(); 1247 MUST_USE_RESULT static inline Object* AllocateRawCell();
1261 1248
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after
2066 // Return whether this object should be retained. If NULL is returned the 2053 // Return whether this object should be retained. If NULL is returned the
2067 // object has no references. Otherwise the address of the retained object 2054 // object has no references. Otherwise the address of the retained object
2068 // should be returned as in some GC situations the object has been moved. 2055 // should be returned as in some GC situations the object has been moved.
2069 virtual Object* RetainAs(Object* object) = 0; 2056 virtual Object* RetainAs(Object* object) = 0;
2070 }; 2057 };
2071 2058
2072 2059
2073 } } // namespace v8::internal 2060 } } // namespace v8::internal
2074 2061
2075 #endif // V8_HEAP_H_ 2062 #endif // V8_HEAP_H_
OLDNEW
« no previous file with comments | « src/global-handles.cc ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698