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

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: returns handles, added tests 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
« no previous file with comments | « src/heap.h ('k') | src/isolate.h » ('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 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 2184 matching lines...) Expand 10 before | Expand all | Expand 10 after
3211 if (!maybe_obj->ToObject(&obj)) return false; 3213 if (!maybe_obj->ToObject(&obj)) return false;
3212 } 3214 }
3213 SeededNumberDictionary::cast(obj)->set_requires_slow_elements(); 3215 SeededNumberDictionary::cast(obj)->set_requires_slow_elements();
3214 set_empty_slow_element_dictionary(SeededNumberDictionary::cast(obj)); 3216 set_empty_slow_element_dictionary(SeededNumberDictionary::cast(obj));
3215 3217
3216 { MaybeObject* maybe_obj = AllocateSymbol(); 3218 { MaybeObject* maybe_obj = AllocateSymbol();
3217 if (!maybe_obj->ToObject(&obj)) return false; 3219 if (!maybe_obj->ToObject(&obj)) return false;
3218 } 3220 }
3219 set_observed_symbol(Symbol::cast(obj)); 3221 set_observed_symbol(Symbol::cast(obj));
3220 3222
3221 set_i18n_template_one(the_hole_value());
3222 set_i18n_template_two(the_hole_value());
3223
3224 // Handling of script id generation is in Factory::NewScript. 3223 // Handling of script id generation is in Factory::NewScript.
3225 set_last_script_id(Smi::FromInt(v8::Script::kNoScriptId)); 3224 set_last_script_id(Smi::FromInt(v8::Script::kNoScriptId));
3226 3225
3227 // Initialize keyed lookup cache. 3226 // Initialize keyed lookup cache.
3228 isolate_->keyed_lookup_cache()->Clear(); 3227 isolate_->keyed_lookup_cache()->Clear();
3229 3228
3230 // Initialize context slot cache. 3229 // Initialize context slot cache.
3231 isolate_->context_slot_cache()->Clear(); 3230 isolate_->context_slot_cache()->Clear();
3232 3231
3233 // Initialize descriptor cache. 3232 // Initialize descriptor cache.
(...skipping 3367 matching lines...) Expand 10 before | Expand all | Expand 10 after
6601 case VISIT_ALL_IN_SCAVENGE: 6600 case VISIT_ALL_IN_SCAVENGE:
6602 isolate_->global_handles()->IterateNewSpaceStrongAndDependentRoots(v); 6601 isolate_->global_handles()->IterateNewSpaceStrongAndDependentRoots(v);
6603 break; 6602 break;
6604 case VISIT_ALL_IN_SWEEP_NEWSPACE: 6603 case VISIT_ALL_IN_SWEEP_NEWSPACE:
6605 case VISIT_ALL: 6604 case VISIT_ALL:
6606 isolate_->global_handles()->IterateAllRoots(v); 6605 isolate_->global_handles()->IterateAllRoots(v);
6607 break; 6606 break;
6608 } 6607 }
6609 v->Synchronize(VisitorSynchronization::kGlobalHandles); 6608 v->Synchronize(VisitorSynchronization::kGlobalHandles);
6610 6609
6610 // Iterate over eternal handles.
6611 if (mode == VISIT_ALL_IN_SCAVENGE) {
6612 isolate_->eternal_handles()->IterateNewSpaceRoots(v);
6613 } else {
6614 isolate_->eternal_handles()->IterateAllRoots(v);
6615 }
6616 v->Synchronize(VisitorSynchronization::kEternalHandles);
6617
6611 // Iterate over pointers being held by inactive threads. 6618 // Iterate over pointers being held by inactive threads.
6612 isolate_->thread_manager()->Iterate(v); 6619 isolate_->thread_manager()->Iterate(v);
6613 v->Synchronize(VisitorSynchronization::kThreadManager); 6620 v->Synchronize(VisitorSynchronization::kThreadManager);
6614 6621
6615 // Iterate over the pointers the Serialization/Deserialization code is 6622 // Iterate over the pointers the Serialization/Deserialization code is
6616 // holding. 6623 // holding.
6617 // During garbage collection this keeps the partial snapshot cache alive. 6624 // During garbage collection this keeps the partial snapshot cache alive.
6618 // During deserialization of the startup snapshot this creates the partial 6625 // During deserialization of the startup snapshot this creates the partial
6619 // snapshot cache and deserializes the objects it refers to. During 6626 // snapshot cache and deserializes the objects it refers to. During
6620 // serialization this does nothing, since the partial snapshot cache is 6627 // serialization this does nothing, since the partial snapshot cache is
(...skipping 1415 matching lines...) Expand 10 before | Expand all | Expand 10 after
8036 if (FLAG_parallel_recompilation) { 8043 if (FLAG_parallel_recompilation) {
8037 heap_->relocation_mutex_->Lock(); 8044 heap_->relocation_mutex_->Lock();
8038 #ifdef DEBUG 8045 #ifdef DEBUG
8039 heap_->relocation_mutex_locked_by_optimizer_thread_ = 8046 heap_->relocation_mutex_locked_by_optimizer_thread_ =
8040 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); 8047 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread();
8041 #endif // DEBUG 8048 #endif // DEBUG
8042 } 8049 }
8043 } 8050 }
8044 8051
8045 } } // namespace v8::internal 8052 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698