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

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

Issue 1180043002: [heap] All immutable roots are either smis or immovable heap objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/v8.h" 5 #include "src/v8.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 3298 matching lines...) Expand 10 before | Expand all | Expand 10 after
3309 case kStringTableRootIndex: 3309 case kStringTableRootIndex:
3310 return true; 3310 return true;
3311 3311
3312 default: 3312 default:
3313 return false; 3313 return false;
3314 } 3314 }
3315 } 3315 }
3316 3316
3317 3317
3318 bool Heap::RootCanBeTreatedAsConstant(RootListIndex root_index) { 3318 bool Heap::RootCanBeTreatedAsConstant(RootListIndex root_index) {
3319 return !RootCanBeWrittenAfterInitialization(root_index) && 3319 if (!RootCanBeWrittenAfterInitialization(root_index)) {
3320 !InNewSpace(roots_array_start()[root_index]); 3320 DCHECK(!InNewSpace(roots_array_start()[root_index]));
3321 return true;
3322 }
3323 return false;
3321 } 3324 }
3322 3325
3323 3326
3324 Object* RegExpResultsCache::Lookup(Heap* heap, String* key_string, 3327 Object* RegExpResultsCache::Lookup(Heap* heap, String* key_string,
3325 Object* key_pattern, ResultsCacheType type) { 3328 Object* key_pattern, ResultsCacheType type) {
3326 FixedArray* cache; 3329 FixedArray* cache;
3327 if (!key_string->IsInternalizedString()) return Smi::FromInt(0); 3330 if (!key_string->IsInternalizedString()) return Smi::FromInt(0);
3328 if (type == STRING_SPLIT_SUBSTRINGS) { 3331 if (type == STRING_SPLIT_SUBSTRINGS) {
3329 DCHECK(key_pattern->IsString()); 3332 DCHECK(key_pattern->IsString());
3330 if (!key_pattern->IsInternalizedString()) return Smi::FromInt(0); 3333 if (!key_pattern->IsInternalizedString()) return Smi::FromInt(0);
(...skipping 3285 matching lines...) Expand 10 before | Expand all | Expand 10 after
6616 *object_type = "CODE_TYPE"; \ 6619 *object_type = "CODE_TYPE"; \
6617 *object_sub_type = "CODE_AGE/" #name; \ 6620 *object_sub_type = "CODE_AGE/" #name; \
6618 return true; 6621 return true;
6619 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) 6622 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME)
6620 #undef COMPARE_AND_RETURN_NAME 6623 #undef COMPARE_AND_RETURN_NAME
6621 } 6624 }
6622 return false; 6625 return false;
6623 } 6626 }
6624 } // namespace internal 6627 } // namespace internal
6625 } // namespace v8 6628 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698