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

Side by Side Diff: src/heap.h

Issue 8234002: New flag --stress-compaction (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 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
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 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after
1024 1024
1025 // The hidden_symbol is special because it is the empty string, but does 1025 // The hidden_symbol is special because it is the empty string, but does
1026 // not match the empty string. 1026 // not match the empty string.
1027 String* hidden_symbol() { return hidden_symbol_; } 1027 String* hidden_symbol() { return hidden_symbol_; }
1028 1028
1029 void set_global_contexts_list(Object* object) { 1029 void set_global_contexts_list(Object* object) {
1030 global_contexts_list_ = object; 1030 global_contexts_list_ = object;
1031 } 1031 }
1032 Object* global_contexts_list() { return global_contexts_list_; } 1032 Object* global_contexts_list() { return global_contexts_list_; }
1033 1033
1034 // Number of mark-sweeps.
1035 int ms_count() { return ms_count_; }
1036
1034 // Iterates over all roots in the heap. 1037 // Iterates over all roots in the heap.
1035 void IterateRoots(ObjectVisitor* v, VisitMode mode); 1038 void IterateRoots(ObjectVisitor* v, VisitMode mode);
1036 // Iterates over all strong roots in the heap. 1039 // Iterates over all strong roots in the heap.
1037 void IterateStrongRoots(ObjectVisitor* v, VisitMode mode); 1040 void IterateStrongRoots(ObjectVisitor* v, VisitMode mode);
1038 // Iterates over all the other roots in the heap. 1041 // Iterates over all the other roots in the heap.
1039 void IterateWeakRoots(ObjectVisitor* v, VisitMode mode); 1042 void IterateWeakRoots(ObjectVisitor* v, VisitMode mode);
1040 1043
1041 // Iterate pointers to from semispace of new space found in memory interval 1044 // Iterate pointers to from semispace of new space found in memory interval
1042 // from start to end. 1045 // from start to end.
1043 void IterateAndMarkPointersToFromSpace(Address start, 1046 void IterateAndMarkPointersToFromSpace(Address start,
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
1236 // timing of the next GC also need to be adjusted downwards. 1239 // timing of the next GC also need to be adjusted downwards.
1237 void LowerOldGenLimits(intptr_t adjustment) { 1240 void LowerOldGenLimits(intptr_t adjustment) {
1238 size_of_old_gen_at_last_old_space_gc_ -= adjustment; 1241 size_of_old_gen_at_last_old_space_gc_ -= adjustment;
1239 old_gen_promotion_limit_ = 1242 old_gen_promotion_limit_ =
1240 OldGenPromotionLimit(size_of_old_gen_at_last_old_space_gc_); 1243 OldGenPromotionLimit(size_of_old_gen_at_last_old_space_gc_);
1241 old_gen_allocation_limit_ = 1244 old_gen_allocation_limit_ =
1242 OldGenAllocationLimit(size_of_old_gen_at_last_old_space_gc_); 1245 OldGenAllocationLimit(size_of_old_gen_at_last_old_space_gc_);
1243 } 1246 }
1244 1247
1245 intptr_t OldGenPromotionLimit(intptr_t old_gen_size) { 1248 intptr_t OldGenPromotionLimit(intptr_t old_gen_size) {
1249 static int divisor = 3;
Vyacheslav Egorov (Chromium) 2011/10/11 13:55:29 it does not have to be static. just have int divis
Sven Panne 2011/10/11 14:02:15 *const* int divisor = ... ;-)
1250 if (FLAG_stress_compaction) divisor = 10;
1246 intptr_t limit = 1251 intptr_t limit =
1247 Max(old_gen_size + old_gen_size / 3, kMinimumPromotionLimit); 1252 Max(old_gen_size + old_gen_size / divisor, kMinimumPromotionLimit);
1248 limit += new_space_.Capacity(); 1253 limit += new_space_.Capacity();
1249 limit *= old_gen_limit_factor_; 1254 limit *= old_gen_limit_factor_;
1250 return limit; 1255 return limit;
1251 } 1256 }
1252 1257
1253 intptr_t OldGenAllocationLimit(intptr_t old_gen_size) { 1258 intptr_t OldGenAllocationLimit(intptr_t old_gen_size) {
1259 static int divisor = 2;
Vyacheslav Egorov (Chromium) 2011/10/11 13:55:29 ditto
Sven Panne 2011/10/11 14:02:15 ditto
1260 if (FLAG_stress_compaction) divisor = 8;
1254 intptr_t limit = 1261 intptr_t limit =
1255 Max(old_gen_size + old_gen_size / 2, kMinimumAllocationLimit); 1262 Max(old_gen_size + old_gen_size / divisor, kMinimumAllocationLimit);
1256 limit += new_space_.Capacity(); 1263 limit += new_space_.Capacity();
1257 limit *= old_gen_limit_factor_; 1264 limit *= old_gen_limit_factor_;
1258 return limit; 1265 return limit;
1259 } 1266 }
1260 1267
1261 // Can be called when the embedding application is idle. 1268 // Can be called when the embedding application is idle.
1262 bool IdleNotification(); 1269 bool IdleNotification();
1263 1270
1264 // Declare all the root indices. 1271 // Declare all the root indices.
1265 enum RootListIndex { 1272 enum RootListIndex {
(...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after
2463 2470
2464 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2471 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2465 }; 2472 };
2466 #endif // DEBUG || LIVE_OBJECT_LIST 2473 #endif // DEBUG || LIVE_OBJECT_LIST
2467 2474
2468 } } // namespace v8::internal 2475 } } // namespace v8::internal
2469 2476
2470 #undef HEAP 2477 #undef HEAP
2471 2478
2472 #endif // V8_HEAP_H_ 2479 #endif // V8_HEAP_H_
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | src/mark-compact.cc » ('j') | src/mark-compact.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698