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

Side by Side Diff: src/heap.cc

Issue 21133006: introduce eternal handles (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: added new space iterability Created 7 years, 4 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 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 996 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 1007
1008 gc_post_processing_depth_++; 1008 gc_post_processing_depth_++;
1009 { AllowHeapAllocation allow_allocation; 1009 { AllowHeapAllocation allow_allocation;
1010 GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL); 1010 GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL);
1011 next_gc_likely_to_collect_more = 1011 next_gc_likely_to_collect_more =
1012 isolate_->global_handles()->PostGarbageCollectionProcessing( 1012 isolate_->global_handles()->PostGarbageCollectionProcessing(
1013 collector, tracer); 1013 collector, tracer);
1014 } 1014 }
1015 gc_post_processing_depth_--; 1015 gc_post_processing_depth_--;
1016 1016
1017 isolate_->eternal_handles()->PostGarbageCollectionProcessing(this);
1018
1017 // Update relocatables. 1019 // Update relocatables.
1018 Relocatable::PostGarbageCollectionProcessing(); 1020 Relocatable::PostGarbageCollectionProcessing();
1019 1021
1020 if (collector == MARK_COMPACTOR) { 1022 if (collector == MARK_COMPACTOR) {
1021 // Register the amount of external allocated memory. 1023 // Register the amount of external allocated memory.
1022 amount_of_external_allocated_memory_at_last_global_gc_ = 1024 amount_of_external_allocated_memory_at_last_global_gc_ =
1023 amount_of_external_allocated_memory_; 1025 amount_of_external_allocated_memory_;
1024 } 1026 }
1025 1027
1026 { 1028 {
(...skipping 2179 matching lines...) Expand 10 before | Expand all | Expand 10 after
3206 if (!maybe_obj->ToObject(&obj)) return false; 3208 if (!maybe_obj->ToObject(&obj)) return false;
3207 } 3209 }
3208 SeededNumberDictionary::cast(obj)->set_requires_slow_elements(); 3210 SeededNumberDictionary::cast(obj)->set_requires_slow_elements();
3209 set_empty_slow_element_dictionary(SeededNumberDictionary::cast(obj)); 3211 set_empty_slow_element_dictionary(SeededNumberDictionary::cast(obj));
3210 3212
3211 { MaybeObject* maybe_obj = AllocateSymbol(); 3213 { MaybeObject* maybe_obj = AllocateSymbol();
3212 if (!maybe_obj->ToObject(&obj)) return false; 3214 if (!maybe_obj->ToObject(&obj)) return false;
3213 } 3215 }
3214 set_observed_symbol(Symbol::cast(obj)); 3216 set_observed_symbol(Symbol::cast(obj));
3215 3217
3216 set_i18n_template_one(the_hole_value());
3217 set_i18n_template_two(the_hole_value());
3218
3219 // Handling of script id generation is in Factory::NewScript. 3218 // Handling of script id generation is in Factory::NewScript.
3220 set_last_script_id(Smi::FromInt(v8::Script::kNoScriptId)); 3219 set_last_script_id(Smi::FromInt(v8::Script::kNoScriptId));
3221 3220
3222 // Initialize keyed lookup cache. 3221 // Initialize keyed lookup cache.
3223 isolate_->keyed_lookup_cache()->Clear(); 3222 isolate_->keyed_lookup_cache()->Clear();
3224 3223
3225 // Initialize context slot cache. 3224 // Initialize context slot cache.
3226 isolate_->context_slot_cache()->Clear(); 3225 isolate_->context_slot_cache()->Clear();
3227 3226
3228 // Initialize descriptor cache. 3227 // Initialize descriptor cache.
(...skipping 3367 matching lines...) Expand 10 before | Expand all | Expand 10 after
6596 case VISIT_ALL_IN_SCAVENGE: 6595 case VISIT_ALL_IN_SCAVENGE:
6597 isolate_->global_handles()->IterateNewSpaceStrongAndDependentRoots(v); 6596 isolate_->global_handles()->IterateNewSpaceStrongAndDependentRoots(v);
6598 break; 6597 break;
6599 case VISIT_ALL_IN_SWEEP_NEWSPACE: 6598 case VISIT_ALL_IN_SWEEP_NEWSPACE:
6600 case VISIT_ALL: 6599 case VISIT_ALL:
6601 isolate_->global_handles()->IterateAllRoots(v); 6600 isolate_->global_handles()->IterateAllRoots(v);
6602 break; 6601 break;
6603 } 6602 }
6604 v->Synchronize(VisitorSynchronization::kGlobalHandles); 6603 v->Synchronize(VisitorSynchronization::kGlobalHandles);
6605 6604
6605 // Iterate over eternal handles.
6606 if (mode == VISIT_ALL_IN_SCAVENGE) {
6607 isolate_->eternal_handles()->IterateNewSpaceRoots(v);
6608 } else {
6609 isolate_->eternal_handles()->IterateAllRoots(v);
6610 }
6611 v->Synchronize(VisitorSynchronization::kEternalHandles);
6612
6606 // Iterate over pointers being held by inactive threads. 6613 // Iterate over pointers being held by inactive threads.
6607 isolate_->thread_manager()->Iterate(v); 6614 isolate_->thread_manager()->Iterate(v);
6608 v->Synchronize(VisitorSynchronization::kThreadManager); 6615 v->Synchronize(VisitorSynchronization::kThreadManager);
6609 6616
6610 // Iterate over the pointers the Serialization/Deserialization code is 6617 // Iterate over the pointers the Serialization/Deserialization code is
6611 // holding. 6618 // holding.
6612 // During garbage collection this keeps the partial snapshot cache alive. 6619 // During garbage collection this keeps the partial snapshot cache alive.
6613 // During deserialization of the startup snapshot this creates the partial 6620 // During deserialization of the startup snapshot this creates the partial
6614 // snapshot cache and deserializes the objects it refers to. During 6621 // snapshot cache and deserializes the objects it refers to. During
6615 // serialization this does nothing, since the partial snapshot cache is 6622 // serialization this does nothing, since the partial snapshot cache is
(...skipping 1415 matching lines...) Expand 10 before | Expand all | Expand 10 after
8031 if (FLAG_parallel_recompilation) { 8038 if (FLAG_parallel_recompilation) {
8032 heap_->relocation_mutex_->Lock(); 8039 heap_->relocation_mutex_->Lock();
8033 #ifdef DEBUG 8040 #ifdef DEBUG
8034 heap_->relocation_mutex_locked_by_optimizer_thread_ = 8041 heap_->relocation_mutex_locked_by_optimizer_thread_ =
8035 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); 8042 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread();
8036 #endif // DEBUG 8043 #endif // DEBUG
8037 } 8044 }
8038 } 8045 }
8039 8046
8040 } } // namespace v8::internal 8047 } } // namespace v8::internal
OLDNEW
« src/global-handles.cc ('K') | « src/heap.h ('k') | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698