OLD | NEW |
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 19 matching lines...) Expand all Loading... |
30 #include "code-stubs.h" | 30 #include "code-stubs.h" |
31 #include "compilation-cache.h" | 31 #include "compilation-cache.h" |
32 #include "deoptimizer.h" | 32 #include "deoptimizer.h" |
33 #include "execution.h" | 33 #include "execution.h" |
34 #include "gdb-jit.h" | 34 #include "gdb-jit.h" |
35 #include "global-handles.h" | 35 #include "global-handles.h" |
36 #include "heap-profiler.h" | 36 #include "heap-profiler.h" |
37 #include "ic-inl.h" | 37 #include "ic-inl.h" |
38 #include "incremental-marking.h" | 38 #include "incremental-marking.h" |
39 #include "mark-compact.h" | 39 #include "mark-compact.h" |
| 40 #include "marking-thread.h" |
40 #include "objects-visiting.h" | 41 #include "objects-visiting.h" |
41 #include "objects-visiting-inl.h" | 42 #include "objects-visiting-inl.h" |
42 #include "stub-cache.h" | 43 #include "stub-cache.h" |
43 #include "sweeper-thread.h" | 44 #include "sweeper-thread.h" |
44 | 45 |
45 namespace v8 { | 46 namespace v8 { |
46 namespace internal { | 47 namespace internal { |
47 | 48 |
48 | 49 |
49 const char* Marking::kWhiteBitPattern = "00"; | 50 const char* Marking::kWhiteBitPattern = "00"; |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 } | 534 } |
534 return freed_bytes; | 535 return freed_bytes; |
535 } | 536 } |
536 | 537 |
537 | 538 |
538 bool MarkCompactCollector::AreSweeperThreadsActivated() { | 539 bool MarkCompactCollector::AreSweeperThreadsActivated() { |
539 return heap()->isolate()->sweeper_threads() != NULL; | 540 return heap()->isolate()->sweeper_threads() != NULL; |
540 } | 541 } |
541 | 542 |
542 | 543 |
| 544 void MarkCompactCollector::MarkInParallel() { |
| 545 for (int i = 0; i < FLAG_marking_threads; i++) { |
| 546 heap()->isolate()->marking_threads()[i]->StartMarking(); |
| 547 } |
| 548 } |
| 549 |
| 550 |
| 551 void MarkCompactCollector::WaitUntilMarkingCompleted() { |
| 552 for (int i = 0; i < FLAG_marking_threads; i++) { |
| 553 heap()->isolate()->marking_threads()[i]->WaitForMarkingThread(); |
| 554 } |
| 555 } |
| 556 |
| 557 |
543 bool Marking::TransferMark(Address old_start, Address new_start) { | 558 bool Marking::TransferMark(Address old_start, Address new_start) { |
544 // This is only used when resizing an object. | 559 // This is only used when resizing an object. |
545 ASSERT(MemoryChunk::FromAddress(old_start) == | 560 ASSERT(MemoryChunk::FromAddress(old_start) == |
546 MemoryChunk::FromAddress(new_start)); | 561 MemoryChunk::FromAddress(new_start)); |
547 | 562 |
548 // If the mark doesn't move, we don't check the color of the object. | 563 // If the mark doesn't move, we don't check the color of the object. |
549 // It doesn't matter whether the object is black, since it hasn't changed | 564 // It doesn't matter whether the object is black, since it hasn't changed |
550 // size, so the adjustment to the live data count will be zero anyway. | 565 // size, so the adjustment to the live data count will be zero anyway. |
551 if (old_start == new_start) return false; | 566 if (old_start == new_start) return false; |
552 | 567 |
(...skipping 3478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4031 while (buffer != NULL) { | 4046 while (buffer != NULL) { |
4032 SlotsBuffer* next_buffer = buffer->next(); | 4047 SlotsBuffer* next_buffer = buffer->next(); |
4033 DeallocateBuffer(buffer); | 4048 DeallocateBuffer(buffer); |
4034 buffer = next_buffer; | 4049 buffer = next_buffer; |
4035 } | 4050 } |
4036 *buffer_address = NULL; | 4051 *buffer_address = NULL; |
4037 } | 4052 } |
4038 | 4053 |
4039 | 4054 |
4040 } } // namespace v8::internal | 4055 } } // namespace v8::internal |
OLD | NEW |