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 3371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3382 isolate_->context_slot_cache()->Clear(); | 3382 isolate_->context_slot_cache()->Clear(); |
3383 | 3383 |
3384 // Initialize descriptor cache. | 3384 // Initialize descriptor cache. |
3385 isolate_->descriptor_lookup_cache()->Clear(); | 3385 isolate_->descriptor_lookup_cache()->Clear(); |
3386 | 3386 |
3387 // Initialize compilation cache. | 3387 // Initialize compilation cache. |
3388 isolate_->compilation_cache()->Clear(); | 3388 isolate_->compilation_cache()->Clear(); |
3389 } | 3389 } |
3390 | 3390 |
3391 | 3391 |
3392 void Heap::AddPrivateGlobalSymbols(Handle<Object> private_intern_table) { | |
3393 #define ADD_SYMBOL_TO_PRIVATE_INTERN_TABLE(name_arg) \ | |
3394 { \ | |
3395 Handle<Symbol> symbol(Symbol::cast(roots_[k##name_arg##RootIndex])); \ | |
3396 Handle<String> name_arg##d(String::cast(symbol->name())); \ | |
3397 JSObject::AddProperty(Handle<JSObject>::cast(private_intern_table), \ | |
3398 name_arg##d, symbol, NONE); \ | |
3399 } | |
3400 PRIVATE_SYMBOL_LIST(ADD_SYMBOL_TO_PRIVATE_INTERN_TABLE) | |
3401 #undef ADD_SYMBOL_TO_PRIVATE_INTERN_TABLE | |
3402 } | |
3403 | |
3404 | |
3405 bool Heap::RootCanBeWrittenAfterInitialization(Heap::RootListIndex root_index) { | 3392 bool Heap::RootCanBeWrittenAfterInitialization(Heap::RootListIndex root_index) { |
3406 switch (root_index) { | 3393 switch (root_index) { |
3407 case kStoreBufferTopRootIndex: | 3394 case kStoreBufferTopRootIndex: |
3408 case kNumberStringCacheRootIndex: | 3395 case kNumberStringCacheRootIndex: |
3409 case kInstanceofCacheFunctionRootIndex: | 3396 case kInstanceofCacheFunctionRootIndex: |
3410 case kInstanceofCacheMapRootIndex: | 3397 case kInstanceofCacheMapRootIndex: |
3411 case kInstanceofCacheAnswerRootIndex: | 3398 case kInstanceofCacheAnswerRootIndex: |
3412 case kCodeStubsRootIndex: | 3399 case kCodeStubsRootIndex: |
3413 case kNonMonomorphicCacheRootIndex: | 3400 case kNonMonomorphicCacheRootIndex: |
3414 case kPolymorphicCodeCacheRootIndex: | 3401 case kPolymorphicCodeCacheRootIndex: |
(...skipping 3488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6903 *object_type = "CODE_TYPE"; \ | 6890 *object_type = "CODE_TYPE"; \ |
6904 *object_sub_type = "CODE_AGE/" #name; \ | 6891 *object_sub_type = "CODE_AGE/" #name; \ |
6905 return true; | 6892 return true; |
6906 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) | 6893 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) |
6907 #undef COMPARE_AND_RETURN_NAME | 6894 #undef COMPARE_AND_RETURN_NAME |
6908 } | 6895 } |
6909 return false; | 6896 return false; |
6910 } | 6897 } |
6911 } // namespace internal | 6898 } // namespace internal |
6912 } // namespace v8 | 6899 } // namespace v8 |
OLD | NEW |