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

Side by Side Diff: src/heap.cc

Issue 7054072: Refactor storage of global handles. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 6 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
OLDNEW
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 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 reinterpret_cast<Address>(cell) + 1053 reinterpret_cast<Address>(cell) +
1054 (JSGlobalPropertyCell::kValueOffset - kHeapObjectTag); 1054 (JSGlobalPropertyCell::kValueOffset - kHeapObjectTag);
1055 scavenge_visitor.VisitPointer(reinterpret_cast<Object**>(value_address)); 1055 scavenge_visitor.VisitPointer(reinterpret_cast<Object**>(value_address));
1056 } 1056 }
1057 } 1057 }
1058 1058
1059 // Scavenge object reachable from the global contexts list directly. 1059 // Scavenge object reachable from the global contexts list directly.
1060 scavenge_visitor.VisitPointer(BitCast<Object**>(&global_contexts_list_)); 1060 scavenge_visitor.VisitPointer(BitCast<Object**>(&global_contexts_list_));
1061 1061
1062 new_space_front = DoScavenge(&scavenge_visitor, new_space_front); 1062 new_space_front = DoScavenge(&scavenge_visitor, new_space_front);
1063 isolate_->global_handles()->IdentifyWeakIndependentHandles( 1063 isolate_->global_handles()->IdentifyNewSpaceWeakIndependentHandles(
1064 &IsUnscavengedHeapObject); 1064 &IsUnscavengedHeapObject);
1065 isolate_->global_handles()->IterateWeakIndependentRoots(&scavenge_visitor); 1065 isolate_->global_handles()->IterateNewSpaceWeakIndependentRoots(
1066 &scavenge_visitor);
1066 new_space_front = DoScavenge(&scavenge_visitor, new_space_front); 1067 new_space_front = DoScavenge(&scavenge_visitor, new_space_front);
1067 1068
1068 1069
1069 UpdateNewSpaceReferencesInExternalStringTable( 1070 UpdateNewSpaceReferencesInExternalStringTable(
1070 &UpdateNewSpaceReferenceInExternalStringTableEntry); 1071 &UpdateNewSpaceReferenceInExternalStringTableEntry);
1071 1072
1072 LiveObjectList::UpdateReferencesForScavengeGC(); 1073 LiveObjectList::UpdateReferencesForScavengeGC();
1073 isolate()->runtime_profiler()->UpdateSamplesAfterScavenge(); 1074 isolate()->runtime_profiler()->UpdateSamplesAfterScavenge();
1074 1075
1075 ASSERT(new_space_front == new_space_.top()); 1076 ASSERT(new_space_front == new_space_.top());
(...skipping 3516 matching lines...) Expand 10 before | Expand all | Expand 10 after
4592 isolate_->builtins()->IterateBuiltins(v); 4593 isolate_->builtins()->IterateBuiltins(v);
4593 } 4594 }
4594 v->Synchronize("builtins"); 4595 v->Synchronize("builtins");
4595 4596
4596 // Iterate over global handles. 4597 // Iterate over global handles.
4597 switch (mode) { 4598 switch (mode) {
4598 case VISIT_ONLY_STRONG: 4599 case VISIT_ONLY_STRONG:
4599 isolate_->global_handles()->IterateStrongRoots(v); 4600 isolate_->global_handles()->IterateStrongRoots(v);
4600 break; 4601 break;
4601 case VISIT_ALL_IN_SCAVENGE: 4602 case VISIT_ALL_IN_SCAVENGE:
4602 isolate_->global_handles()->IterateStrongAndDependentRoots(v); 4603 isolate_->global_handles()->IterateNewSpaceStrongAndDependentRoots(v);
4603 break; 4604 break;
4604 case VISIT_ALL_IN_SWEEP_NEWSPACE: 4605 case VISIT_ALL_IN_SWEEP_NEWSPACE:
4605 case VISIT_ALL: 4606 case VISIT_ALL:
4606 isolate_->global_handles()->IterateAllRoots(v); 4607 isolate_->global_handles()->IterateAllRoots(v);
4607 break; 4608 break;
4608 } 4609 }
4609 v->Synchronize("globalhandles"); 4610 v->Synchronize("globalhandles");
4610 4611
4611 // Iterate over pointers being held by inactive threads. 4612 // Iterate over pointers being held by inactive threads.
4612 isolate_->thread_manager()->Iterate(v); 4613 isolate_->thread_manager()->Iterate(v);
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after
5950 } 5951 }
5951 5952
5952 5953
5953 void ExternalStringTable::TearDown() { 5954 void ExternalStringTable::TearDown() {
5954 new_space_strings_.Free(); 5955 new_space_strings_.Free();
5955 old_space_strings_.Free(); 5956 old_space_strings_.Free();
5956 } 5957 }
5957 5958
5958 5959
5959 } } // namespace v8::internal 5960 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698