OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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/heap/spaces.h" | 5 #include "src/heap/spaces.h" |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/base/platform/platform.h" | 8 #include "src/base/platform/platform.h" |
9 #include "src/full-codegen/full-codegen.h" | 9 #include "src/full-codegen/full-codegen.h" |
10 #include "src/heap/slot-set.h" | 10 #include "src/heap/slot-set.h" |
(...skipping 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1328 | 1328 |
1329 to_space_.SetUp(chunk_base_, initial_semispace_capacity, | 1329 to_space_.SetUp(chunk_base_, initial_semispace_capacity, |
1330 maximum_semispace_capacity); | 1330 maximum_semispace_capacity); |
1331 from_space_.SetUp(chunk_base_ + reserved_semispace_capacity, | 1331 from_space_.SetUp(chunk_base_ + reserved_semispace_capacity, |
1332 initial_semispace_capacity, maximum_semispace_capacity); | 1332 initial_semispace_capacity, maximum_semispace_capacity); |
1333 if (!to_space_.Commit()) { | 1333 if (!to_space_.Commit()) { |
1334 return false; | 1334 return false; |
1335 } | 1335 } |
1336 DCHECK(!from_space_.is_committed()); // No need to use memory yet. | 1336 DCHECK(!from_space_.is_committed()); // No need to use memory yet. |
1337 | 1337 |
1338 start_ = chunk_base_; | |
1339 | |
1340 ResetAllocationInfo(); | 1338 ResetAllocationInfo(); |
1341 | 1339 |
1342 return true; | 1340 return true; |
1343 } | 1341 } |
1344 | 1342 |
1345 | 1343 |
1346 void NewSpace::TearDown() { | 1344 void NewSpace::TearDown() { |
1347 if (allocated_histogram_) { | 1345 if (allocated_histogram_) { |
1348 DeleteArray(allocated_histogram_); | 1346 DeleteArray(allocated_histogram_); |
1349 allocated_histogram_ = NULL; | 1347 allocated_histogram_ = NULL; |
1350 } | 1348 } |
1351 if (promoted_histogram_) { | 1349 if (promoted_histogram_) { |
1352 DeleteArray(promoted_histogram_); | 1350 DeleteArray(promoted_histogram_); |
1353 promoted_histogram_ = NULL; | 1351 promoted_histogram_ = NULL; |
1354 } | 1352 } |
1355 | 1353 |
1356 start_ = NULL; | |
1357 allocation_info_.Reset(nullptr, nullptr); | 1354 allocation_info_.Reset(nullptr, nullptr); |
1358 | 1355 |
1359 | |
1360 to_space_.TearDown(); | 1356 to_space_.TearDown(); |
1361 from_space_.TearDown(); | 1357 from_space_.TearDown(); |
1362 | 1358 |
1363 heap()->isolate()->memory_allocator()->FreeNewSpaceMemory( | 1359 heap()->isolate()->memory_allocator()->FreeNewSpaceMemory( |
1364 chunk_base_, &reservation_, NOT_EXECUTABLE); | 1360 chunk_base_, &reservation_, NOT_EXECUTABLE); |
1365 | 1361 |
1366 chunk_base_ = NULL; | 1362 chunk_base_ = NULL; |
1367 chunk_size_ = 0; | 1363 chunk_size_ = 0; |
1368 } | 1364 } |
1369 | 1365 |
(...skipping 1791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3161 object->ShortPrint(); | 3157 object->ShortPrint(); |
3162 PrintF("\n"); | 3158 PrintF("\n"); |
3163 } | 3159 } |
3164 printf(" --------------------------------------\n"); | 3160 printf(" --------------------------------------\n"); |
3165 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 3161 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
3166 } | 3162 } |
3167 | 3163 |
3168 #endif // DEBUG | 3164 #endif // DEBUG |
3169 } // namespace internal | 3165 } // namespace internal |
3170 } // namespace v8 | 3166 } // namespace v8 |
OLD | NEW |