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" | |
Søren Thygesen Gjesse
2011/01/19 08:41:33
This suggests that the actual lol implementation l
marklam
2011/01/19 10:47:37
Done. It's at http://codereview.chromium.org/6335
| |
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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
393 if (FLAG_verify_heap) { | 394 if (FLAG_verify_heap) { |
394 Verify(); | 395 Verify(); |
395 } | 396 } |
396 | 397 |
397 if (FLAG_gc_verbose) Print(); | 398 if (FLAG_gc_verbose) Print(); |
398 #endif | 399 #endif |
399 | 400 |
400 #if defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING) | 401 #if defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING) |
401 ReportStatisticsBeforeGC(); | 402 ReportStatisticsBeforeGC(); |
402 #endif | 403 #endif |
404 | |
405 LiveObjectList::GCPrologue(); | |
403 } | 406 } |
404 | 407 |
405 intptr_t Heap::SizeOfObjects() { | 408 intptr_t Heap::SizeOfObjects() { |
406 intptr_t total = 0; | 409 intptr_t total = 0; |
407 AllSpaces spaces; | 410 AllSpaces spaces; |
408 for (Space* space = spaces.next(); space != NULL; space = spaces.next()) { | 411 for (Space* space = spaces.next(); space != NULL; space = spaces.next()) { |
409 total += space->SizeOfObjects(); | 412 total += space->SizeOfObjects(); |
410 } | 413 } |
411 return total; | 414 return total; |
412 } | 415 } |
413 | 416 |
414 void Heap::GarbageCollectionEpilogue() { | 417 void Heap::GarbageCollectionEpilogue() { |
418 LiveObjectList::GCEpilogue(); | |
415 #ifdef DEBUG | 419 #ifdef DEBUG |
416 allow_allocation(true); | 420 allow_allocation(true); |
417 ZapFromSpace(); | 421 ZapFromSpace(); |
418 | 422 |
419 if (FLAG_verify_heap) { | 423 if (FLAG_verify_heap) { |
420 Verify(); | 424 Verify(); |
421 } | 425 } |
422 | 426 |
423 if (FLAG_print_global_handles) GlobalHandles::Print(); | 427 if (FLAG_print_global_handles) GlobalHandles::Print(); |
424 if (FLAG_print_handles) PrintHandles(); | 428 if (FLAG_print_handles) PrintHandles(); |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1059 int sampler_window_size = RuntimeProfiler::SamplerWindowSize(); | 1063 int sampler_window_size = RuntimeProfiler::SamplerWindowSize(); |
1060 scavenge_visitor.VisitPointers( | 1064 scavenge_visitor.VisitPointers( |
1061 sampler_window_address, | 1065 sampler_window_address, |
1062 sampler_window_address + sampler_window_size); | 1066 sampler_window_address + sampler_window_size); |
1063 | 1067 |
1064 new_space_front = DoScavenge(&scavenge_visitor, new_space_front); | 1068 new_space_front = DoScavenge(&scavenge_visitor, new_space_front); |
1065 | 1069 |
1066 UpdateNewSpaceReferencesInExternalStringTable( | 1070 UpdateNewSpaceReferencesInExternalStringTable( |
1067 &UpdateNewSpaceReferenceInExternalStringTableEntry); | 1071 &UpdateNewSpaceReferenceInExternalStringTableEntry); |
1068 | 1072 |
1073 LiveObjectList::UpdateReferencesForScavengeGC(); | |
1074 | |
1069 ASSERT(new_space_front == new_space_.top()); | 1075 ASSERT(new_space_front == new_space_.top()); |
1070 | 1076 |
1071 // Set age mark. | 1077 // Set age mark. |
1072 new_space_.set_age_mark(new_space_.top()); | 1078 new_space_.set_age_mark(new_space_.top()); |
1073 | 1079 |
1074 // Update how much has survived scavenge. | 1080 // Update how much has survived scavenge. |
1075 IncrementYoungSurvivorsCounter(static_cast<int>( | 1081 IncrementYoungSurvivorsCounter(static_cast<int>( |
1076 (PromotedSpaceSize() - survived_watermark) + new_space_.Size())); | 1082 (PromotedSpaceSize() - survived_watermark) + new_space_.Size())); |
1077 | 1083 |
1078 LOG(ResourceEvent("scavenge", "end")); | 1084 LOG(ResourceEvent("scavenge", "end")); |
(...skipping 4460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5539 void ExternalStringTable::TearDown() { | 5545 void ExternalStringTable::TearDown() { |
5540 new_space_strings_.Free(); | 5546 new_space_strings_.Free(); |
5541 old_space_strings_.Free(); | 5547 old_space_strings_.Free(); |
5542 } | 5548 } |
5543 | 5549 |
5544 | 5550 |
5545 List<Object*> ExternalStringTable::new_space_strings_; | 5551 List<Object*> ExternalStringTable::new_space_strings_; |
5546 List<Object*> ExternalStringTable::old_space_strings_; | 5552 List<Object*> ExternalStringTable::old_space_strings_; |
5547 | 5553 |
5548 } } // namespace v8::internal | 5554 } } // namespace v8::internal |
OLD | NEW |