| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 code_range_size_(0), | 90 code_range_size_(0), |
| 91 #endif | 91 #endif |
| 92 // Variables set based on semispace_size_ and old_generation_size_ in | 92 // Variables set based on semispace_size_ and old_generation_size_ in |
| 93 // ConfigureHeap (survived_since_last_expansion_, external_allocation_limit_) | 93 // ConfigureHeap (survived_since_last_expansion_, external_allocation_limit_) |
| 94 // Will be 4 * reserved_semispace_size_ to ensure that young | 94 // Will be 4 * reserved_semispace_size_ to ensure that young |
| 95 // generation can be aligned to its size. | 95 // generation can be aligned to its size. |
| 96 survived_since_last_expansion_(0), | 96 survived_since_last_expansion_(0), |
| 97 always_allocate_scope_depth_(0), | 97 always_allocate_scope_depth_(0), |
| 98 linear_allocation_scope_depth_(0), | 98 linear_allocation_scope_depth_(0), |
| 99 contexts_disposed_(0), | 99 contexts_disposed_(0), |
| 100 scan_on_scavenge_pages_(0), |
| 100 new_space_(this), | 101 new_space_(this), |
| 101 old_pointer_space_(NULL), | 102 old_pointer_space_(NULL), |
| 102 old_data_space_(NULL), | 103 old_data_space_(NULL), |
| 103 code_space_(NULL), | 104 code_space_(NULL), |
| 104 map_space_(NULL), | 105 map_space_(NULL), |
| 105 cell_space_(NULL), | 106 cell_space_(NULL), |
| 106 lo_space_(NULL), | 107 lo_space_(NULL), |
| 107 gc_state_(NOT_IN_GC), | 108 gc_state_(NOT_IN_GC), |
| 108 mc_count_(0), | 109 mc_count_(0), |
| 109 ms_count_(0), | 110 ms_count_(0), |
| (...skipping 4894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5004 if (cell_space_ == NULL) return false; | 5005 if (cell_space_ == NULL) return false; |
| 5005 if (!cell_space_->Setup()) return false; | 5006 if (!cell_space_->Setup()) return false; |
| 5006 | 5007 |
| 5007 // The large object code space may contain code or data. We set the memory | 5008 // The large object code space may contain code or data. We set the memory |
| 5008 // to be non-executable here for safety, but this means we need to enable it | 5009 // to be non-executable here for safety, but this means we need to enable it |
| 5009 // explicitly when allocating large code objects. | 5010 // explicitly when allocating large code objects. |
| 5010 lo_space_ = new LargeObjectSpace(this, LO_SPACE); | 5011 lo_space_ = new LargeObjectSpace(this, LO_SPACE); |
| 5011 if (lo_space_ == NULL) return false; | 5012 if (lo_space_ == NULL) return false; |
| 5012 if (!lo_space_->Setup()) return false; | 5013 if (!lo_space_->Setup()) return false; |
| 5013 | 5014 |
| 5015 if (!marking()->Setup()) return false; |
| 5016 |
| 5014 if (create_heap_objects) { | 5017 if (create_heap_objects) { |
| 5015 // Create initial maps. | 5018 // Create initial maps. |
| 5016 if (!CreateInitialMaps()) return false; | 5019 if (!CreateInitialMaps()) return false; |
| 5017 if (!CreateApiObjects()) return false; | 5020 if (!CreateApiObjects()) return false; |
| 5018 | 5021 |
| 5019 // Create initial objects | 5022 // Create initial objects |
| 5020 if (!CreateInitialObjects()) return false; | 5023 if (!CreateInitialObjects()) return false; |
| 5021 | 5024 |
| 5022 global_contexts_list_ = undefined_value(); | 5025 global_contexts_list_ = undefined_value(); |
| 5023 } | 5026 } |
| 5024 | 5027 |
| 5025 LOG(isolate_, IntPtrTEvent("heap-capacity", Capacity())); | 5028 LOG(isolate_, IntPtrTEvent("heap-capacity", Capacity())); |
| 5026 LOG(isolate_, IntPtrTEvent("heap-available", Available())); | 5029 LOG(isolate_, IntPtrTEvent("heap-available", Available())); |
| 5027 | 5030 |
| 5028 #ifdef ENABLE_LOGGING_AND_PROFILING | 5031 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 5029 // This should be called only after initial objects have been created. | 5032 // This should be called only after initial objects have been created. |
| 5030 isolate_->producer_heap_profile()->Setup(); | 5033 isolate_->producer_heap_profile()->Setup(); |
| 5031 #endif | 5034 #endif |
| 5032 | 5035 |
| 5033 if (!marking()->Setup()) return false; | |
| 5034 | |
| 5035 store_buffer()->Setup(); | 5036 store_buffer()->Setup(); |
| 5036 | 5037 |
| 5037 return true; | 5038 return true; |
| 5038 } | 5039 } |
| 5039 | 5040 |
| 5040 | 5041 |
| 5041 void Heap::SetStackLimits() { | 5042 void Heap::SetStackLimits() { |
| 5042 ASSERT(isolate_ != NULL); | 5043 ASSERT(isolate_ != NULL); |
| 5043 ASSERT(isolate_ == isolate()); | 5044 ASSERT(isolate_ == isolate()); |
| 5044 // On 64 bit machines, pointers are generally out of range of Smis. We write | 5045 // On 64 bit machines, pointers are generally out of range of Smis. We write |
| (...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5890 } | 5891 } |
| 5891 | 5892 |
| 5892 | 5893 |
| 5893 void ExternalStringTable::TearDown() { | 5894 void ExternalStringTable::TearDown() { |
| 5894 new_space_strings_.Free(); | 5895 new_space_strings_.Free(); |
| 5895 old_space_strings_.Free(); | 5896 old_space_strings_.Free(); |
| 5896 } | 5897 } |
| 5897 | 5898 |
| 5898 | 5899 |
| 5899 } } // namespace v8::internal | 5900 } } // namespace v8::internal |
| OLD | NEW |