Chromium Code Reviews| 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 183 native_contexts_list_ = NULL; | 183 native_contexts_list_ = NULL; |
| 184 array_buffers_list_ = Smi::FromInt(0); | 184 array_buffers_list_ = Smi::FromInt(0); |
| 185 allocation_sites_list_ = Smi::FromInt(0); | 185 allocation_sites_list_ = Smi::FromInt(0); |
| 186 mark_compact_collector_.heap_ = this; | 186 mark_compact_collector_.heap_ = this; |
| 187 external_string_table_.heap_ = this; | 187 external_string_table_.heap_ = this; |
| 188 // Put a dummy entry in the remembered pages so we can find the list the | 188 // Put a dummy entry in the remembered pages so we can find the list the |
| 189 // minidump even if there are no real unmapped pages. | 189 // minidump even if there are no real unmapped pages. |
| 190 RememberUnmappedPage(NULL, false); | 190 RememberUnmappedPage(NULL, false); |
| 191 | 191 |
| 192 ClearObjectStats(true); | 192 ClearObjectStats(true); |
| 193 | |
| 194 // We rely on being able to allocate new arrays in paged spaces. | |
| 195 ASSERT(MaxRegularSpaceAllocationSize() >= | |
|
Michael Starzinger
2013/09/02 13:12:43
The initial_semispace_size might change at runtime
Jakob Kummerow
2013/09/02 13:35:11
Good point. Done.
| |
| 196 (JSArray::kSize + | |
| 197 FixedArray::kHeaderSize + | |
| 198 JSObject::kInitialMaxFastElementArray * kPointerSize + | |
|
Michael Starzinger
2013/09/02 13:12:43
nit: Lets use FixedArray::SizeFor for (part of) th
Jakob Kummerow
2013/09/02 13:35:11
Done.
| |
| 199 AllocationMemento::kSize)); | |
| 193 } | 200 } |
| 194 | 201 |
| 195 | 202 |
| 196 intptr_t Heap::Capacity() { | 203 intptr_t Heap::Capacity() { |
| 197 if (!HasBeenSetUp()) return 0; | 204 if (!HasBeenSetUp()) return 0; |
| 198 | 205 |
| 199 return new_space_.Capacity() + | 206 return new_space_.Capacity() + |
| 200 old_pointer_space_->Capacity() + | 207 old_pointer_space_->Capacity() + |
| 201 old_data_space_->Capacity() + | 208 old_data_space_->Capacity() + |
| 202 code_space_->Capacity() + | 209 code_space_->Capacity() + |
| (...skipping 7880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8083 if (FLAG_concurrent_recompilation) { | 8090 if (FLAG_concurrent_recompilation) { |
| 8084 heap_->relocation_mutex_->Lock(); | 8091 heap_->relocation_mutex_->Lock(); |
| 8085 #ifdef DEBUG | 8092 #ifdef DEBUG |
| 8086 heap_->relocation_mutex_locked_by_optimizer_thread_ = | 8093 heap_->relocation_mutex_locked_by_optimizer_thread_ = |
| 8087 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); | 8094 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); |
| 8088 #endif // DEBUG | 8095 #endif // DEBUG |
| 8089 } | 8096 } |
| 8090 } | 8097 } |
| 8091 | 8098 |
| 8092 } } // namespace v8::internal | 8099 } } // namespace v8::internal |
| OLD | NEW |