| 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 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 | 491 |
| 492 | 492 |
| 493 bool IncrementalMarking::WorthActivating() { | 493 bool IncrementalMarking::WorthActivating() { |
| 494 #ifndef DEBUG | 494 #ifndef DEBUG |
| 495 static const intptr_t kActivationThreshold = 8 * MB; | 495 static const intptr_t kActivationThreshold = 8 * MB; |
| 496 #else | 496 #else |
| 497 // TODO(gc) consider setting this to some low level so that some | 497 // TODO(gc) consider setting this to some low level so that some |
| 498 // debug tests run with incremental marking and some without. | 498 // debug tests run with incremental marking and some without. |
| 499 static const intptr_t kActivationThreshold = 0; | 499 static const intptr_t kActivationThreshold = 0; |
| 500 #endif | 500 #endif |
| 501 // Only start incremental marking in a safe state: 1) when expose GC is | 501 // Only start incremental marking in a safe state: 1) when incremental |
| 502 // deactivated, 2) when incremental marking is turned on, 3) when we are | 502 // marking is turned on, 2) when we are currently not in a GC, and |
| 503 // currently not in a GC, and 4) when we are currently not serializing | 503 // 3) when we are currently not serializing or deserializing the heap. |
| 504 // or deserializing the heap. | 504 return FLAG_incremental_marking && |
| 505 return !FLAG_expose_gc && | |
| 506 FLAG_incremental_marking && | |
| 507 FLAG_incremental_marking_steps && | 505 FLAG_incremental_marking_steps && |
| 508 heap_->gc_state() == Heap::NOT_IN_GC && | 506 heap_->gc_state() == Heap::NOT_IN_GC && |
| 509 !Serializer::enabled() && | 507 !Serializer::enabled() && |
| 510 heap_->isolate()->IsInitialized() && | 508 heap_->isolate()->IsInitialized() && |
| 511 heap_->PromotedSpaceSizeOfObjects() > kActivationThreshold; | 509 heap_->PromotedSpaceSizeOfObjects() > kActivationThreshold; |
| 512 } | 510 } |
| 513 | 511 |
| 514 | 512 |
| 515 void IncrementalMarking::ActivateGeneratedStub(Code* stub) { | 513 void IncrementalMarking::ActivateGeneratedStub(Code* stub) { |
| 516 ASSERT(RecordWriteStub::GetMode(stub) == | 514 ASSERT(RecordWriteStub::GetMode(stub) == |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1035 bytes_scanned_ = 0; | 1033 bytes_scanned_ = 0; |
| 1036 write_barriers_invoked_since_last_step_ = 0; | 1034 write_barriers_invoked_since_last_step_ = 0; |
| 1037 } | 1035 } |
| 1038 | 1036 |
| 1039 | 1037 |
| 1040 int64_t IncrementalMarking::SpaceLeftInOldSpace() { | 1038 int64_t IncrementalMarking::SpaceLeftInOldSpace() { |
| 1041 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSizeOfObjects(); | 1039 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSizeOfObjects(); |
| 1042 } | 1040 } |
| 1043 | 1041 |
| 1044 } } // namespace v8::internal | 1042 } } // namespace v8::internal |
| OLD | NEW |