| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 17 matching lines...) Expand all Loading... |
| 28 #include "v8.h" | 28 #include "v8.h" |
| 29 | 29 |
| 30 #include "accessors.h" | 30 #include "accessors.h" |
| 31 #include "api.h" | 31 #include "api.h" |
| 32 #include "bootstrapper.h" | 32 #include "bootstrapper.h" |
| 33 #include "codegen-inl.h" | 33 #include "codegen-inl.h" |
| 34 #include "compilation-cache.h" | 34 #include "compilation-cache.h" |
| 35 #include "debug.h" | 35 #include "debug.h" |
| 36 #include "heap-profiler.h" | 36 #include "heap-profiler.h" |
| 37 #include "global-handles.h" | 37 #include "global-handles.h" |
| 38 #include "liveobjectlist-inl.h" |
| 38 #include "mark-compact.h" | 39 #include "mark-compact.h" |
| 39 #include "natives.h" | 40 #include "natives.h" |
| 40 #include "objects-visiting.h" | 41 #include "objects-visiting.h" |
| 41 #include "runtime-profiler.h" | 42 #include "runtime-profiler.h" |
| 42 #include "scanner-base.h" | 43 #include "scanner-base.h" |
| 43 #include "scopeinfo.h" | 44 #include "scopeinfo.h" |
| 44 #include "snapshot.h" | 45 #include "snapshot.h" |
| 45 #include "v8threads.h" | 46 #include "v8threads.h" |
| 46 #include "vm-state-inl.h" | 47 #include "vm-state-inl.h" |
| 47 #if V8_TARGET_ARCH_ARM && !V8_INTERPRETED_REGEXP | 48 #if V8_TARGET_ARCH_ARM && !V8_INTERPRETED_REGEXP |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 if (FLAG_verify_heap) { | 387 if (FLAG_verify_heap) { |
| 387 Verify(); | 388 Verify(); |
| 388 } | 389 } |
| 389 | 390 |
| 390 if (FLAG_gc_verbose) Print(); | 391 if (FLAG_gc_verbose) Print(); |
| 391 #endif | 392 #endif |
| 392 | 393 |
| 393 #if defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING) | 394 #if defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING) |
| 394 ReportStatisticsBeforeGC(); | 395 ReportStatisticsBeforeGC(); |
| 395 #endif | 396 #endif |
| 397 |
| 398 LiveObjectList::GCPrologue(); |
| 396 } | 399 } |
| 397 | 400 |
| 398 intptr_t Heap::SizeOfObjects() { | 401 intptr_t Heap::SizeOfObjects() { |
| 399 intptr_t total = 0; | 402 intptr_t total = 0; |
| 400 AllSpaces spaces; | 403 AllSpaces spaces; |
| 401 for (Space* space = spaces.next(); space != NULL; space = spaces.next()) { | 404 for (Space* space = spaces.next(); space != NULL; space = spaces.next()) { |
| 402 total += space->SizeOfObjects(); | 405 total += space->SizeOfObjects(); |
| 403 } | 406 } |
| 404 return total; | 407 return total; |
| 405 } | 408 } |
| 406 | 409 |
| 407 void Heap::GarbageCollectionEpilogue() { | 410 void Heap::GarbageCollectionEpilogue() { |
| 411 LiveObjectList::GCEpilogue(); |
| 408 #ifdef DEBUG | 412 #ifdef DEBUG |
| 409 allow_allocation(true); | 413 allow_allocation(true); |
| 410 ZapFromSpace(); | 414 ZapFromSpace(); |
| 411 | 415 |
| 412 if (FLAG_verify_heap) { | 416 if (FLAG_verify_heap) { |
| 413 Verify(); | 417 Verify(); |
| 414 } | 418 } |
| 415 | 419 |
| 416 if (FLAG_print_global_handles) isolate_->global_handles()->Print(); | 420 if (FLAG_print_global_handles) isolate_->global_handles()->Print(); |
| 417 if (FLAG_print_handles) PrintHandles(); | 421 if (FLAG_print_handles) PrintHandles(); |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1027 int sampler_window_size = runtime_profiler->SamplerWindowSize(); | 1031 int sampler_window_size = runtime_profiler->SamplerWindowSize(); |
| 1028 scavenge_visitor.VisitPointers( | 1032 scavenge_visitor.VisitPointers( |
| 1029 sampler_window_address, | 1033 sampler_window_address, |
| 1030 sampler_window_address + sampler_window_size); | 1034 sampler_window_address + sampler_window_size); |
| 1031 | 1035 |
| 1032 new_space_front = DoScavenge(&scavenge_visitor, new_space_front); | 1036 new_space_front = DoScavenge(&scavenge_visitor, new_space_front); |
| 1033 | 1037 |
| 1034 UpdateNewSpaceReferencesInExternalStringTable( | 1038 UpdateNewSpaceReferencesInExternalStringTable( |
| 1035 &UpdateNewSpaceReferenceInExternalStringTableEntry); | 1039 &UpdateNewSpaceReferenceInExternalStringTableEntry); |
| 1036 | 1040 |
| 1041 LiveObjectList::UpdateReferencesForScavengeGC(); |
| 1042 |
| 1037 ASSERT(new_space_front == new_space_.top()); | 1043 ASSERT(new_space_front == new_space_.top()); |
| 1038 | 1044 |
| 1039 is_safe_to_read_maps_ = true; | 1045 is_safe_to_read_maps_ = true; |
| 1040 | 1046 |
| 1041 // Set age mark. | 1047 // Set age mark. |
| 1042 new_space_.set_age_mark(new_space_.top()); | 1048 new_space_.set_age_mark(new_space_.top()); |
| 1043 | 1049 |
| 1044 // Update how much has survived scavenge. | 1050 // Update how much has survived scavenge. |
| 1045 IncrementYoungSurvivorsCounter(static_cast<int>( | 1051 IncrementYoungSurvivorsCounter(static_cast<int>( |
| 1046 (PromotedSpaceSize() - survived_watermark) + new_space_.Size())); | 1052 (PromotedSpaceSize() - survived_watermark) + new_space_.Size())); |
| (...skipping 4555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5602 } | 5608 } |
| 5603 | 5609 |
| 5604 | 5610 |
| 5605 void ExternalStringTable::TearDown() { | 5611 void ExternalStringTable::TearDown() { |
| 5606 new_space_strings_.Free(); | 5612 new_space_strings_.Free(); |
| 5607 old_space_strings_.Free(); | 5613 old_space_strings_.Free(); |
| 5608 } | 5614 } |
| 5609 | 5615 |
| 5610 | 5616 |
| 5611 } } // namespace v8::internal | 5617 } } // namespace v8::internal |
| OLD | NEW |