Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: src/heap/heap.cc

Issue 1312763006: [heap] User safer root set accessor when possible. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-heap-root-set-1
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/heap/heap.h ('k') | src/ia32/macro-assembler-ia32.cc » ('j') | src/snapshot/serialize.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698