OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 3373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3384 // are contiguous and aligned to their size. | 3384 // are contiguous and aligned to their size. |
3385 if (!MemoryAllocator::Setup(MaxReserved())) return false; | 3385 if (!MemoryAllocator::Setup(MaxReserved())) return false; |
3386 void* chunk = | 3386 void* chunk = |
3387 MemoryAllocator::ReserveInitialChunk(4 * reserved_semispace_size_); | 3387 MemoryAllocator::ReserveInitialChunk(4 * reserved_semispace_size_); |
3388 if (chunk == NULL) return false; | 3388 if (chunk == NULL) return false; |
3389 | 3389 |
3390 // Align the pair of semispaces to their size, which must be a power | 3390 // Align the pair of semispaces to their size, which must be a power |
3391 // of 2. | 3391 // of 2. |
3392 Address new_space_start = | 3392 Address new_space_start = |
3393 RoundUp(reinterpret_cast<byte*>(chunk), 2 * reserved_semispace_size_); | 3393 RoundUp(reinterpret_cast<byte*>(chunk), 2 * reserved_semispace_size_); |
3394 if (!new_space_.Setup(new_space_start, 2 * reserved_semispace_size_)) return f
alse; | 3394 if (!new_space_.Setup(new_space_start, 2 * reserved_semispace_size_)) { |
| 3395 return false; |
| 3396 } |
3395 | 3397 |
3396 // Initialize old pointer space. | 3398 // Initialize old pointer space. |
3397 old_pointer_space_ = | 3399 old_pointer_space_ = |
3398 new OldSpace(max_old_generation_size_, OLD_POINTER_SPACE, NOT_EXECUTABLE); | 3400 new OldSpace(max_old_generation_size_, OLD_POINTER_SPACE, NOT_EXECUTABLE); |
3399 if (old_pointer_space_ == NULL) return false; | 3401 if (old_pointer_space_ == NULL) return false; |
3400 if (!old_pointer_space_->Setup(NULL, 0)) return false; | 3402 if (!old_pointer_space_->Setup(NULL, 0)) return false; |
3401 | 3403 |
3402 // Initialize old data space. | 3404 // Initialize old data space. |
3403 old_data_space_ = | 3405 old_data_space_ = |
3404 new OldSpace(max_old_generation_size_, OLD_DATA_SPACE, NOT_EXECUTABLE); | 3406 new OldSpace(max_old_generation_size_, OLD_DATA_SPACE, NOT_EXECUTABLE); |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4033 for (int i = 0; i < kNumberOfCaches; i++) { | 4035 for (int i = 0; i < kNumberOfCaches; i++) { |
4034 if (caches_[i] != NULL) { | 4036 if (caches_[i] != NULL) { |
4035 delete caches_[i]; | 4037 delete caches_[i]; |
4036 caches_[i] = NULL; | 4038 caches_[i] = NULL; |
4037 } | 4039 } |
4038 } | 4040 } |
4039 } | 4041 } |
4040 | 4042 |
4041 | 4043 |
4042 } } // namespace v8::internal | 4044 } } // namespace v8::internal |
OLD | NEW |