Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 531 if (FLAG_trace_incremental_marking) { | 531 if (FLAG_trace_incremental_marking) { |
| 532 PrintF("[IncrementalMarking] Complete (normal).\n"); | 532 PrintF("[IncrementalMarking] Complete (normal).\n"); |
| 533 } | 533 } |
| 534 heap_->isolate()->stack_guard()->RequestGC(); | 534 heap_->isolate()->stack_guard()->RequestGC(); |
| 535 } | 535 } |
| 536 | 536 |
| 537 | 537 |
| 538 void IncrementalMarking::Step(intptr_t allocated_bytes) { | 538 void IncrementalMarking::Step(intptr_t allocated_bytes) { |
| 539 if (heap_->gc_state() != Heap::NOT_IN_GC) return; | 539 if (heap_->gc_state() != Heap::NOT_IN_GC) return; |
| 540 if (!FLAG_incremental_marking) return; | 540 if (!FLAG_incremental_marking) return; |
| 541 if (!FLAG_incremental_marking_steps) return; | 541 if (!FLAG_incremental_marking_steps) return; |
|
Lasse Reichstein
2011/07/12 08:18:32
Are FLAG_incremental_marking and FLAG_incremental_
Vyacheslav Egorov (Chromium)
2011/07/12 09:27:54
They are independent.
| |
| 542 if (state_ != SWEEPING && state_ != MARKING) return; | |
|
Lasse Reichstein
2011/07/12 08:18:32
How about combining all these conditions with || a
Vyacheslav Egorov (Chromium)
2011/07/12 09:27:54
Done.
| |
| 542 | 543 |
| 543 allocated_ += allocated_bytes; | 544 allocated_ += allocated_bytes; |
| 544 | 545 |
| 545 if (allocated_ < kAllocatedThreshold) return; | 546 if (allocated_ < kAllocatedThreshold) return; |
| 546 | 547 |
| 547 intptr_t bytes_to_process = allocated_ * allocation_marking_factor_; | 548 intptr_t bytes_to_process = allocated_ * allocation_marking_factor_; |
| 548 | 549 |
| 549 double start = 0; | 550 double start = 0; |
| 550 | 551 |
| 551 if (FLAG_trace_incremental_marking || FLAG_trace_gc) { | 552 if (FLAG_trace_incremental_marking || FLAG_trace_gc) { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 602 if (FLAG_trace_incremental_marking || FLAG_trace_gc) { | 603 if (FLAG_trace_incremental_marking || FLAG_trace_gc) { |
| 603 double end = OS::TimeCurrentMillis(); | 604 double end = OS::TimeCurrentMillis(); |
| 604 double delta = (end - start); | 605 double delta = (end - start); |
| 605 steps_took_ += delta; | 606 steps_took_ += delta; |
| 606 steps_took_since_last_gc_ += delta; | 607 steps_took_since_last_gc_ += delta; |
| 607 } | 608 } |
| 608 } | 609 } |
| 609 | 610 |
| 610 | 611 |
| 611 } } // namespace v8::internal | 612 } } // namespace v8::internal |
| OLD | NEW |