Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Side by Side Diff: src/heap.cc

Issue 6287004: Adding GC hooks to support LiveObjectList functionality. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/mark-compact.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
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
OLDNEW
« no previous file with comments | « no previous file | src/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698