OLD | NEW |
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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 crankshaft_codegen_bytes_generated_(0), | 147 crankshaft_codegen_bytes_generated_(0), |
148 gcs_since_last_deopt_(0), | 148 gcs_since_last_deopt_(0), |
149 #ifdef VERIFY_HEAP | 149 #ifdef VERIFY_HEAP |
150 no_weak_object_verification_scope_depth_(0), | 150 no_weak_object_verification_scope_depth_(0), |
151 #endif | 151 #endif |
152 allocation_sites_scratchpad_length_(0), | 152 allocation_sites_scratchpad_length_(0), |
153 promotion_queue_(this), | 153 promotion_queue_(this), |
154 configured_(false), | 154 configured_(false), |
155 external_string_table_(this), | 155 external_string_table_(this), |
156 chunks_queued_for_free_(NULL), | 156 chunks_queued_for_free_(NULL), |
157 relocation_mutex_(NULL), | |
158 gc_callbacks_depth_(0) { | 157 gc_callbacks_depth_(0) { |
159 // Allow build-time customization of the max semispace size. Building | 158 // Allow build-time customization of the max semispace size. Building |
160 // V8 with snapshots and a non-default max semispace size is much | 159 // V8 with snapshots and a non-default max semispace size is much |
161 // easier if you can define it as part of the build environment. | 160 // easier if you can define it as part of the build environment. |
162 #if defined(V8_MAX_SEMISPACE_SIZE) | 161 #if defined(V8_MAX_SEMISPACE_SIZE) |
163 max_semispace_size_ = reserved_semispace_size_ = V8_MAX_SEMISPACE_SIZE; | 162 max_semispace_size_ = reserved_semispace_size_ = V8_MAX_SEMISPACE_SIZE; |
164 #endif | 163 #endif |
165 | 164 |
166 // Ensure old_generation_size_ is a multiple of kPageSize. | 165 // Ensure old_generation_size_ is a multiple of kPageSize. |
167 ASSERT(MB >= Page::kPageSize); | 166 ASSERT(MB >= Page::kPageSize); |
(...skipping 6420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6588 } | 6587 } |
6589 } | 6588 } |
6590 | 6589 |
6591 LOG(isolate_, IntPtrTEvent("heap-capacity", Capacity())); | 6590 LOG(isolate_, IntPtrTEvent("heap-capacity", Capacity())); |
6592 LOG(isolate_, IntPtrTEvent("heap-available", Available())); | 6591 LOG(isolate_, IntPtrTEvent("heap-available", Available())); |
6593 | 6592 |
6594 store_buffer()->SetUp(); | 6593 store_buffer()->SetUp(); |
6595 | 6594 |
6596 mark_compact_collector()->SetUp(); | 6595 mark_compact_collector()->SetUp(); |
6597 | 6596 |
6598 if (FLAG_concurrent_recompilation) relocation_mutex_ = new Mutex; | |
6599 | |
6600 return true; | 6597 return true; |
6601 } | 6598 } |
6602 | 6599 |
6603 | 6600 |
6604 bool Heap::CreateHeapObjects() { | 6601 bool Heap::CreateHeapObjects() { |
6605 // Create initial maps. | 6602 // Create initial maps. |
6606 if (!CreateInitialMaps()) return false; | 6603 if (!CreateInitialMaps()) return false; |
6607 if (!CreateApiObjects()) return false; | 6604 if (!CreateApiObjects()) return false; |
6608 | 6605 |
6609 // Create initial objects | 6606 // Create initial objects |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6731 if (lo_space_ != NULL) { | 6728 if (lo_space_ != NULL) { |
6732 lo_space_->TearDown(); | 6729 lo_space_->TearDown(); |
6733 delete lo_space_; | 6730 delete lo_space_; |
6734 lo_space_ = NULL; | 6731 lo_space_ = NULL; |
6735 } | 6732 } |
6736 | 6733 |
6737 store_buffer()->TearDown(); | 6734 store_buffer()->TearDown(); |
6738 incremental_marking()->TearDown(); | 6735 incremental_marking()->TearDown(); |
6739 | 6736 |
6740 isolate_->memory_allocator()->TearDown(); | 6737 isolate_->memory_allocator()->TearDown(); |
6741 | |
6742 delete relocation_mutex_; | |
6743 relocation_mutex_ = NULL; | |
6744 } | 6738 } |
6745 | 6739 |
6746 | 6740 |
6747 void Heap::AddGCPrologueCallback(v8::Isolate::GCPrologueCallback callback, | 6741 void Heap::AddGCPrologueCallback(v8::Isolate::GCPrologueCallback callback, |
6748 GCType gc_type, | 6742 GCType gc_type, |
6749 bool pass_isolate) { | 6743 bool pass_isolate) { |
6750 ASSERT(callback != NULL); | 6744 ASSERT(callback != NULL); |
6751 GCPrologueCallbackPair pair(callback, gc_type, pass_isolate); | 6745 GCPrologueCallbackPair pair(callback, gc_type, pass_isolate); |
6752 ASSERT(!gc_prologue_callbacks_.Contains(pair)); | 6746 ASSERT(!gc_prologue_callbacks_.Contains(pair)); |
6753 return gc_prologue_callbacks_.Add(pair); | 6747 return gc_prologue_callbacks_.Add(pair); |
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7802 static_cast<int>(object_sizes_last_time_[index])); | 7796 static_cast<int>(object_sizes_last_time_[index])); |
7803 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 7797 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
7804 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 7798 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
7805 | 7799 |
7806 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 7800 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
7807 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 7801 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
7808 ClearObjectStats(); | 7802 ClearObjectStats(); |
7809 } | 7803 } |
7810 | 7804 |
7811 } } // namespace v8::internal | 7805 } } // namespace v8::internal |
OLD | NEW |