Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "v8.h" | 5 #include "v8.h" |
| 6 | 6 |
| 7 #include "accessors.h" | 7 #include "accessors.h" |
| 8 #include "api.h" | 8 #include "api.h" |
| 9 #include "bootstrapper.h" | 9 #include "bootstrapper.h" |
| 10 #include "codegen.h" | 10 #include "codegen.h" |
| (...skipping 4289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4300 AllocationSpace space = SelectSpace(size, OLD_POINTER_SPACE, TENURED); | 4300 AllocationSpace space = SelectSpace(size, OLD_POINTER_SPACE, TENURED); |
| 4301 Struct* result; | 4301 Struct* result; |
| 4302 { AllocationResult allocation = Allocate(map, space); | 4302 { AllocationResult allocation = Allocate(map, space); |
| 4303 if (!allocation.To(&result)) return allocation; | 4303 if (!allocation.To(&result)) return allocation; |
| 4304 } | 4304 } |
| 4305 result->InitializeBody(size); | 4305 result->InitializeBody(size); |
| 4306 return result; | 4306 return result; |
| 4307 } | 4307 } |
| 4308 | 4308 |
| 4309 | 4309 |
| 4310 bool Heap::IsHeapIterable() { | 4310 void Heap::MakeHeapIterable() { |
| 4311 return (!old_pointer_space()->was_swept_conservatively() && | 4311 ASSERT(AllowHeapAllocation::IsAllowed()); |
| 4312 !old_data_space()->was_swept_conservatively()); | 4312 CollectAllGarbage(kMakeHeapIterableMask, "Heap::MakeHeapIterable"); |
|
Hannes Payer (out of office)
2014/05/19 08:31:12
Now I am not sure if we should remove that method.
| |
| 4313 } | 4313 } |
| 4314 | 4314 |
| 4315 | 4315 |
| 4316 void Heap::EnsureHeapIsIterable() { | |
| 4317 ASSERT(AllowHeapAllocation::IsAllowed()); | |
| 4318 if (!IsHeapIterable()) { | |
| 4319 CollectAllGarbage(kMakeHeapIterableMask, "Heap::EnsureHeapIsIterable"); | |
| 4320 } | |
| 4321 ASSERT(IsHeapIterable()); | |
| 4322 } | |
| 4323 | |
| 4324 | |
| 4325 void Heap::AdvanceIdleIncrementalMarking(intptr_t step_size) { | 4316 void Heap::AdvanceIdleIncrementalMarking(intptr_t step_size) { |
| 4326 incremental_marking()->Step(step_size, | 4317 incremental_marking()->Step(step_size, |
| 4327 IncrementalMarking::NO_GC_VIA_STACK_GUARD); | 4318 IncrementalMarking::NO_GC_VIA_STACK_GUARD); |
| 4328 | 4319 |
| 4329 if (incremental_marking()->IsComplete()) { | 4320 if (incremental_marking()->IsComplete()) { |
| 4330 bool uncommit = false; | 4321 bool uncommit = false; |
| 4331 if (gc_count_at_last_idle_gc_ == gc_count_) { | 4322 if (gc_count_at_last_idle_gc_ == gc_count_) { |
| 4332 // No GC since the last full GC, the mutator is probably not active. | 4323 // No GC since the last full GC, the mutator is probably not active. |
| 4333 isolate_->compilation_cache()->Clear(); | 4324 isolate_->compilation_cache()->Clear(); |
| 4334 uncommit = true; | 4325 uncommit = true; |
| (...skipping 2130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6465 static_cast<int>(object_sizes_last_time_[index])); | 6456 static_cast<int>(object_sizes_last_time_[index])); |
| 6466 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6457 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
| 6467 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6458 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
| 6468 | 6459 |
| 6469 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6460 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
| 6470 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6461 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
| 6471 ClearObjectStats(); | 6462 ClearObjectStats(); |
| 6472 } | 6463 } |
| 6473 | 6464 |
| 6474 } } // namespace v8::internal | 6465 } } // namespace v8::internal |
| OLD | NEW |