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 "src/heap/heap.h" | 5 #include "src/heap/heap.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/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
(...skipping 1367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1378 } | 1378 } |
1379 } | 1379 } |
1380 } | 1380 } |
1381 } | 1381 } |
1382 | 1382 |
1383 | 1383 |
1384 void Heap::MarkCompact() { | 1384 void Heap::MarkCompact() { |
1385 gc_state_ = MARK_COMPACT; | 1385 gc_state_ = MARK_COMPACT; |
1386 LOG(isolate_, ResourceEvent("markcompact", "begin")); | 1386 LOG(isolate_, ResourceEvent("markcompact", "begin")); |
1387 | 1387 |
1388 new_space()->PauseInlineAllocationObservers(); | |
Hannes Payer (out of office)
2015/11/26 09:55:10
A scope would be cleaner for pausing and resuming.
ofrobots
2015/12/02 06:05:31
Done.
| |
1389 | |
1388 uint64_t size_of_objects_before_gc = SizeOfObjects(); | 1390 uint64_t size_of_objects_before_gc = SizeOfObjects(); |
1389 | 1391 |
1390 mark_compact_collector()->Prepare(); | 1392 mark_compact_collector()->Prepare(); |
1391 | 1393 |
1392 ms_count_++; | 1394 ms_count_++; |
1393 | 1395 |
1394 MarkCompactPrologue(); | 1396 MarkCompactPrologue(); |
1395 | 1397 |
1396 mark_compact_collector()->CollectGarbage(); | 1398 mark_compact_collector()->CollectGarbage(); |
1397 | 1399 |
1398 LOG(isolate_, ResourceEvent("markcompact", "end")); | 1400 LOG(isolate_, ResourceEvent("markcompact", "end")); |
1399 | 1401 |
1400 MarkCompactEpilogue(); | 1402 MarkCompactEpilogue(); |
1401 | 1403 |
1402 if (FLAG_allocation_site_pretenuring) { | 1404 if (FLAG_allocation_site_pretenuring) { |
1403 EvaluateOldSpaceLocalPretenuring(size_of_objects_before_gc); | 1405 EvaluateOldSpaceLocalPretenuring(size_of_objects_before_gc); |
1404 } | 1406 } |
1407 | |
1408 new_space()->ResumeInlineAllocationObservers(); | |
1405 } | 1409 } |
1406 | 1410 |
1407 | 1411 |
1408 void Heap::MarkCompactEpilogue() { | 1412 void Heap::MarkCompactEpilogue() { |
1409 gc_state_ = NOT_IN_GC; | 1413 gc_state_ = NOT_IN_GC; |
1410 | 1414 |
1411 isolate_->counters()->objs_since_last_full()->Set(0); | 1415 isolate_->counters()->objs_since_last_full()->Set(0); |
1412 | 1416 |
1413 incremental_marking()->Epilogue(); | 1417 incremental_marking()->Epilogue(); |
1414 | 1418 |
(...skipping 4755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6170 } | 6174 } |
6171 | 6175 |
6172 | 6176 |
6173 // static | 6177 // static |
6174 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6178 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6175 return StaticVisitorBase::GetVisitorId(map); | 6179 return StaticVisitorBase::GetVisitorId(map); |
6176 } | 6180 } |
6177 | 6181 |
6178 } // namespace internal | 6182 } // namespace internal |
6179 } // namespace v8 | 6183 } // namespace v8 |
OLD | NEW |