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

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

Issue 490943002: Use size_t in GCIdleTimeHandler to fix undefined behaviour. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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/heap/gc-idle-time-handler.cc ('k') | src/heap/spaces.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/base/once.h" 9 #include "src/base/once.h"
10 #include "src/base/utils/random-number-generator.h" 10 #include "src/base/utils/random-number-generator.h"
(...skipping 4247 matching lines...) Expand 10 before | Expand all | Expand 10 after
4258 CollectAllGarbage(kMakeHeapIterableMask, "Heap::MakeHeapIterable"); 4258 CollectAllGarbage(kMakeHeapIterableMask, "Heap::MakeHeapIterable");
4259 } 4259 }
4260 if (mark_compact_collector()->sweeping_in_progress()) { 4260 if (mark_compact_collector()->sweeping_in_progress()) {
4261 mark_compact_collector()->EnsureSweepingCompleted(); 4261 mark_compact_collector()->EnsureSweepingCompleted();
4262 } 4262 }
4263 DCHECK(IsHeapIterable()); 4263 DCHECK(IsHeapIterable());
4264 } 4264 }
4265 4265
4266 4266
4267 void Heap::AdvanceIdleIncrementalMarking(int idle_time_in_ms) { 4267 void Heap::AdvanceIdleIncrementalMarking(int idle_time_in_ms) {
4268 intptr_t step_size = GCIdleTimeHandler::EstimateMarkingStepSize( 4268 intptr_t step_size =
4269 idle_time_in_ms, tracer_.IncrementalMarkingSpeedInBytesPerMillisecond()); 4269 static_cast<size_t>(GCIdleTimeHandler::EstimateMarkingStepSize(
4270 idle_time_in_ms,
4271 tracer_.IncrementalMarkingSpeedInBytesPerMillisecond()));
4270 4272
4271 incremental_marking()->Step(step_size, 4273 incremental_marking()->Step(step_size,
4272 IncrementalMarking::NO_GC_VIA_STACK_GUARD, true); 4274 IncrementalMarking::NO_GC_VIA_STACK_GUARD, true);
4273 4275
4274 if (incremental_marking()->IsComplete()) { 4276 if (incremental_marking()->IsComplete()) {
4275 bool uncommit = false; 4277 bool uncommit = false;
4276 if (gc_count_at_last_idle_gc_ == gc_count_) { 4278 if (gc_count_at_last_idle_gc_ == gc_count_) {
4277 // No GC since the last full GC, the mutator is probably not active. 4279 // No GC since the last full GC, the mutator is probably not active.
4278 isolate_->compilation_cache()->Clear(); 4280 isolate_->compilation_cache()->Clear();
4279 uncommit = true; 4281 uncommit = true;
(...skipping 1861 matching lines...) Expand 10 before | Expand all | Expand 10 after
6141 static_cast<int>(object_sizes_last_time_[index])); 6143 static_cast<int>(object_sizes_last_time_[index]));
6142 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 6144 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
6143 #undef ADJUST_LAST_TIME_OBJECT_COUNT 6145 #undef ADJUST_LAST_TIME_OBJECT_COUNT
6144 6146
6145 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 6147 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
6146 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 6148 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
6147 ClearObjectStats(); 6149 ClearObjectStats();
6148 } 6150 }
6149 } 6151 }
6150 } // namespace v8::internal 6152 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap/gc-idle-time-handler.cc ('k') | src/heap/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698