OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 | 847 |
848 { | 848 { |
849 HistogramTimerScope histogram_timer_scope( | 849 HistogramTimerScope histogram_timer_scope( |
850 (collector == SCAVENGER) ? isolate_->counters()->gc_scavenger() | 850 (collector == SCAVENGER) ? isolate_->counters()->gc_scavenger() |
851 : isolate_->counters()->gc_compactor()); | 851 : isolate_->counters()->gc_compactor()); |
852 next_gc_likely_to_collect_more = | 852 next_gc_likely_to_collect_more = |
853 PerformGarbageCollection(collector, gc_callback_flags); | 853 PerformGarbageCollection(collector, gc_callback_flags); |
854 } | 854 } |
855 | 855 |
856 GarbageCollectionEpilogue(); | 856 GarbageCollectionEpilogue(); |
| 857 if (collector == MARK_COMPACTOR && FLAG_track_detached_contexts) { |
| 858 isolate()->CheckDetachedContextsAfterGC(); |
| 859 } |
857 tracer()->Stop(collector); | 860 tracer()->Stop(collector); |
858 } | 861 } |
859 | 862 |
860 // Start incremental marking for the next cycle. The heap snapshot | 863 // Start incremental marking for the next cycle. The heap snapshot |
861 // generator needs incremental marking to stay off after it aborted. | 864 // generator needs incremental marking to stay off after it aborted. |
862 if (!mark_compact_collector()->abort_incremental_marking() && | 865 if (!mark_compact_collector()->abort_incremental_marking() && |
863 WorthActivatingIncrementalMarking()) { | 866 WorthActivatingIncrementalMarking()) { |
864 incremental_marking()->Start(); | 867 incremental_marking()->Start(); |
865 } | 868 } |
866 | 869 |
(...skipping 2197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3064 Handle<TypeFeedbackVector> dummy_vector = | 3067 Handle<TypeFeedbackVector> dummy_vector = |
3065 factory->NewTypeFeedbackVector(spec); | 3068 factory->NewTypeFeedbackVector(spec); |
3066 dummy_vector->Set(FeedbackVectorICSlot(0), | 3069 dummy_vector->Set(FeedbackVectorICSlot(0), |
3067 *TypeFeedbackVector::MegamorphicSentinel(isolate()), | 3070 *TypeFeedbackVector::MegamorphicSentinel(isolate()), |
3068 SKIP_WRITE_BARRIER); | 3071 SKIP_WRITE_BARRIER); |
3069 set_keyed_load_dummy_vector(*dummy_vector); | 3072 set_keyed_load_dummy_vector(*dummy_vector); |
3070 } else { | 3073 } else { |
3071 set_keyed_load_dummy_vector(empty_fixed_array()); | 3074 set_keyed_load_dummy_vector(empty_fixed_array()); |
3072 } | 3075 } |
3073 | 3076 |
| 3077 set_detached_contexts(empty_fixed_array()); |
| 3078 |
3074 Handle<SeededNumberDictionary> slow_element_dictionary = | 3079 Handle<SeededNumberDictionary> slow_element_dictionary = |
3075 SeededNumberDictionary::New(isolate(), 0, TENURED); | 3080 SeededNumberDictionary::New(isolate(), 0, TENURED); |
3076 slow_element_dictionary->set_requires_slow_elements(); | 3081 slow_element_dictionary->set_requires_slow_elements(); |
3077 set_empty_slow_element_dictionary(*slow_element_dictionary); | 3082 set_empty_slow_element_dictionary(*slow_element_dictionary); |
3078 | 3083 |
3079 set_materialized_objects(*factory->NewFixedArray(0, TENURED)); | 3084 set_materialized_objects(*factory->NewFixedArray(0, TENURED)); |
3080 | 3085 |
3081 // Handling of script id generation is in Factory::NewScript. | 3086 // Handling of script id generation is in Factory::NewScript. |
3082 set_last_script_id(Smi::FromInt(v8::UnboundScript::kNoScriptId)); | 3087 set_last_script_id(Smi::FromInt(v8::UnboundScript::kNoScriptId)); |
3083 | 3088 |
(...skipping 3403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6487 static_cast<int>(object_sizes_last_time_[index])); | 6492 static_cast<int>(object_sizes_last_time_[index])); |
6488 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6493 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6489 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6494 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6490 | 6495 |
6491 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6496 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6492 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6497 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6493 ClearObjectStats(); | 6498 ClearObjectStats(); |
6494 } | 6499 } |
6495 } | 6500 } |
6496 } // namespace v8::internal | 6501 } // namespace v8::internal |
OLD | NEW |