OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/heap.h" | 5 #include "src/heap/heap.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
(...skipping 3355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3366 return true; | 3366 return true; |
3367 | 3367 |
3368 default: | 3368 default: |
3369 return false; | 3369 return false; |
3370 } | 3370 } |
3371 } | 3371 } |
3372 | 3372 |
3373 | 3373 |
3374 bool Heap::RootCanBeTreatedAsConstant(RootListIndex root_index) { | 3374 bool Heap::RootCanBeTreatedAsConstant(RootListIndex root_index) { |
3375 return !RootCanBeWrittenAfterInitialization(root_index) && | 3375 return !RootCanBeWrittenAfterInitialization(root_index) && |
3376 !InNewSpace(roots_array_start()[root_index]); | 3376 !InNewSpace(root(root_index)); |
3377 } | 3377 } |
3378 | 3378 |
3379 | 3379 |
3380 int Heap::FullSizeNumberStringCacheLength() { | 3380 int Heap::FullSizeNumberStringCacheLength() { |
3381 // Compute the size of the number string cache based on the max newspace size. | 3381 // Compute the size of the number string cache based on the max newspace size. |
3382 // The number string cache has a minimum size based on twice the initial cache | 3382 // The number string cache has a minimum size based on twice the initial cache |
3383 // size to ensure that it is bigger after being made 'full size'. | 3383 // size to ensure that it is bigger after being made 'full size'. |
3384 int number_string_cache_size = max_semi_space_size_ / 512; | 3384 int number_string_cache_size = max_semi_space_size_ / 512; |
3385 number_string_cache_size = Max(kInitialNumberStringCacheSize * 2, | 3385 number_string_cache_size = Max(kInitialNumberStringCacheSize * 2, |
3386 Min(0x4000, number_string_cache_size)); | 3386 Min(0x4000, number_string_cache_size)); |
(...skipping 3389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6776 *object_type = "CODE_TYPE"; \ | 6776 *object_type = "CODE_TYPE"; \ |
6777 *object_sub_type = "CODE_AGE/" #name; \ | 6777 *object_sub_type = "CODE_AGE/" #name; \ |
6778 return true; | 6778 return true; |
6779 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) | 6779 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) |
6780 #undef COMPARE_AND_RETURN_NAME | 6780 #undef COMPARE_AND_RETURN_NAME |
6781 } | 6781 } |
6782 return false; | 6782 return false; |
6783 } | 6783 } |
6784 } // namespace internal | 6784 } // namespace internal |
6785 } // namespace v8 | 6785 } // namespace v8 |
OLD | NEW |