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

Side by Side Diff: src/heap.cc

Issue 10974003: Make the speed of incrmental marking depend also on the rate (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 3 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 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 5109 matching lines...) Expand 10 before | Expand all | Expand 10 after
5120 bool Heap::IdleNotification(int hint) { 5120 bool Heap::IdleNotification(int hint) {
5121 // Hints greater than this value indicate that 5121 // Hints greater than this value indicate that
5122 // the embedder is requesting a lot of GC work. 5122 // the embedder is requesting a lot of GC work.
5123 const int kMaxHint = 1000; 5123 const int kMaxHint = 1000;
5124 // Minimal hint that allows to do full GC. 5124 // Minimal hint that allows to do full GC.
5125 const int kMinHintForFullGC = 100; 5125 const int kMinHintForFullGC = 100;
5126 intptr_t size_factor = Min(Max(hint, 20), kMaxHint) / 4; 5126 intptr_t size_factor = Min(Max(hint, 20), kMaxHint) / 4;
5127 // The size factor is in range [5..250]. The numbers here are chosen from 5127 // The size factor is in range [5..250]. The numbers here are chosen from
5128 // experiments. If you changes them, make sure to test with 5128 // experiments. If you changes them, make sure to test with
5129 // chrome/performance_ui_tests --gtest_filter="GeneralMixMemoryTest.* 5129 // chrome/performance_ui_tests --gtest_filter="GeneralMixMemoryTest.*
5130 intptr_t step_size = size_factor * IncrementalMarking::kAllocatedThreshold; 5130 intptr_t step_size =
5131 size_factor * IncrementalMarking::kIncrementalMarkingThreshold;
5131 5132
5132 if (contexts_disposed_ > 0) { 5133 if (contexts_disposed_ > 0) {
5133 if (hint >= kMaxHint) { 5134 if (hint >= kMaxHint) {
5134 // The embedder is requesting a lot of GC work after context disposal, 5135 // The embedder is requesting a lot of GC work after context disposal,
5135 // we age inline caches so that they don't keep objects from 5136 // we age inline caches so that they don't keep objects from
5136 // the old context alive. 5137 // the old context alive.
5137 AgeInlineCaches(); 5138 AgeInlineCaches();
5138 } 5139 }
5139 int mark_sweep_time = Min(TimeMarkSweepWouldTakeInMs(), 1000); 5140 int mark_sweep_time = Min(TimeMarkSweepWouldTakeInMs(), 1000);
5140 if (hint >= mark_sweep_time && !FLAG_expose_gc && 5141 if (hint >= mark_sweep_time && !FLAG_expose_gc &&
(...skipping 2179 matching lines...) Expand 10 before | Expand all | Expand 10 after
7320 static_cast<int>(object_sizes_last_time_[index])); 7321 static_cast<int>(object_sizes_last_time_[index]));
7321 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) 7322 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT)
7322 #undef ADJUST_LAST_TIME_OBJECT_COUNT 7323 #undef ADJUST_LAST_TIME_OBJECT_COUNT
7323 7324
7324 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 7325 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
7325 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 7326 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
7326 ClearObjectStats(); 7327 ClearObjectStats();
7327 } 7328 }
7328 7329
7329 } } // namespace v8::internal 7330 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698