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 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 DisallowHeapAllocation no_recursive_gc; | 790 DisallowHeapAllocation no_recursive_gc; |
791 isolate()->optimizing_compile_dispatcher()->Flush(); | 791 isolate()->optimizing_compile_dispatcher()->Flush(); |
792 } | 792 } |
793 isolate()->ClearSerializerData(); | 793 isolate()->ClearSerializerData(); |
794 mark_compact_collector()->SetFlags(kMakeHeapIterableMask | | 794 mark_compact_collector()->SetFlags(kMakeHeapIterableMask | |
795 kReduceMemoryFootprintMask); | 795 kReduceMemoryFootprintMask); |
796 isolate_->compilation_cache()->Clear(); | 796 isolate_->compilation_cache()->Clear(); |
797 const int kMaxNumberOfAttempts = 7; | 797 const int kMaxNumberOfAttempts = 7; |
798 const int kMinNumberOfAttempts = 2; | 798 const int kMinNumberOfAttempts = 2; |
799 for (int attempt = 0; attempt < kMaxNumberOfAttempts; attempt++) { | 799 for (int attempt = 0; attempt < kMaxNumberOfAttempts; attempt++) { |
800 if (!CollectGarbage(MARK_COMPACTOR, gc_reason, NULL) && | 800 if (!CollectGarbage(MARK_COMPACTOR, gc_reason, NULL, |
| 801 v8::kGCCallbackFlagForced) && |
801 attempt + 1 >= kMinNumberOfAttempts) { | 802 attempt + 1 >= kMinNumberOfAttempts) { |
802 break; | 803 break; |
803 } | 804 } |
804 } | 805 } |
805 mark_compact_collector()->SetFlags(kNoGCFlags); | 806 mark_compact_collector()->SetFlags(kNoGCFlags); |
806 new_space_.Shrink(); | 807 new_space_.Shrink(); |
807 UncommitFromSpace(); | 808 UncommitFromSpace(); |
808 } | 809 } |
809 | 810 |
810 | 811 |
(...skipping 5593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6404 static_cast<int>(object_sizes_last_time_[index])); | 6405 static_cast<int>(object_sizes_last_time_[index])); |
6405 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6406 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6406 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6407 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6407 | 6408 |
6408 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6409 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6409 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6410 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6410 ClearObjectStats(); | 6411 ClearObjectStats(); |
6411 } | 6412 } |
6412 } | 6413 } |
6413 } // namespace v8::internal | 6414 } // namespace v8::internal |
OLD | NEW |