| 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/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 3041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3052 | 3052 |
| 3053 set_polymorphic_code_cache(PolymorphicCodeCache::cast( | 3053 set_polymorphic_code_cache(PolymorphicCodeCache::cast( |
| 3054 *factory->NewStruct(POLYMORPHIC_CODE_CACHE_TYPE))); | 3054 *factory->NewStruct(POLYMORPHIC_CODE_CACHE_TYPE))); |
| 3055 | 3055 |
| 3056 set_instanceof_cache_function(Smi::FromInt(0)); | 3056 set_instanceof_cache_function(Smi::FromInt(0)); |
| 3057 set_instanceof_cache_map(Smi::FromInt(0)); | 3057 set_instanceof_cache_map(Smi::FromInt(0)); |
| 3058 set_instanceof_cache_answer(Smi::FromInt(0)); | 3058 set_instanceof_cache_answer(Smi::FromInt(0)); |
| 3059 | 3059 |
| 3060 { | 3060 { |
| 3061 HandleScope scope(isolate()); | 3061 HandleScope scope(isolate()); |
| 3062 #define SYMBOL_INIT(name) \ | 3062 #define SYMBOL_INIT(name) \ |
| 3063 Handle<Symbol> name = factory->NewPrivateOwnSymbol(); \ | 3063 { \ |
| 3064 roots_[k##name##RootIndex] = *name; | 3064 Handle<String> name##d = factory->NewStringFromStaticChars(#name); \ |
| 3065 Handle<Object> symbol(isolate()->factory()->NewPrivateOwnSymbol(name##d)); \ |
| 3066 roots_[k##name##RootIndex] = *symbol; \ |
| 3067 } |
| 3065 PRIVATE_SYMBOL_LIST(SYMBOL_INIT) | 3068 PRIVATE_SYMBOL_LIST(SYMBOL_INIT) |
| 3066 #undef SYMBOL_INIT | 3069 #undef SYMBOL_INIT |
| 3067 } | 3070 } |
| 3068 | 3071 |
| 3069 { | 3072 { |
| 3070 HandleScope scope(isolate()); | 3073 HandleScope scope(isolate()); |
| 3071 #define SYMBOL_INIT(name, varname, description) \ | 3074 #define SYMBOL_INIT(name, varname, description) \ |
| 3072 Handle<Symbol> name = factory->NewSymbol(); \ | 3075 Handle<Symbol> name = factory->NewSymbol(); \ |
| 3073 Handle<String> name##d = factory->NewStringFromStaticChars(#description); \ | 3076 Handle<String> name##d = factory->NewStringFromStaticChars(#description); \ |
| 3074 name->set_name(*name##d); \ | 3077 name->set_name(*name##d); \ |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3163 isolate_->context_slot_cache()->Clear(); | 3166 isolate_->context_slot_cache()->Clear(); |
| 3164 | 3167 |
| 3165 // Initialize descriptor cache. | 3168 // Initialize descriptor cache. |
| 3166 isolate_->descriptor_lookup_cache()->Clear(); | 3169 isolate_->descriptor_lookup_cache()->Clear(); |
| 3167 | 3170 |
| 3168 // Initialize compilation cache. | 3171 // Initialize compilation cache. |
| 3169 isolate_->compilation_cache()->Clear(); | 3172 isolate_->compilation_cache()->Clear(); |
| 3170 } | 3173 } |
| 3171 | 3174 |
| 3172 | 3175 |
| 3176 void Heap::AddPrivateGlobalSymbols(Handle<Object> private_intern_table) { |
| 3177 #define ADD_SYMBOL_TO_PRIVATE_INTERN_TABLE(name_arg) \ |
| 3178 { \ |
| 3179 Handle<Symbol> symbol(Symbol::cast(roots_[k##name_arg##RootIndex])); \ |
| 3180 Handle<String> name_arg##d(String::cast(symbol->name())); \ |
| 3181 JSObject::SetProperty(Handle<JSObject>::cast(private_intern_table), \ |
| 3182 name_arg##d, symbol, STRICT).Assert(); \ |
| 3183 } |
| 3184 PRIVATE_SYMBOL_LIST(ADD_SYMBOL_TO_PRIVATE_INTERN_TABLE) |
| 3185 #undef ADD_SYMBOL_TO_PRIVATE_INTERN_TABLE |
| 3186 } |
| 3187 |
| 3188 |
| 3173 bool Heap::RootCanBeWrittenAfterInitialization(Heap::RootListIndex root_index) { | 3189 bool Heap::RootCanBeWrittenAfterInitialization(Heap::RootListIndex root_index) { |
| 3174 switch (root_index) { | 3190 switch (root_index) { |
| 3175 case kStoreBufferTopRootIndex: | 3191 case kStoreBufferTopRootIndex: |
| 3176 case kNumberStringCacheRootIndex: | 3192 case kNumberStringCacheRootIndex: |
| 3177 case kInstanceofCacheFunctionRootIndex: | 3193 case kInstanceofCacheFunctionRootIndex: |
| 3178 case kInstanceofCacheMapRootIndex: | 3194 case kInstanceofCacheMapRootIndex: |
| 3179 case kInstanceofCacheAnswerRootIndex: | 3195 case kInstanceofCacheAnswerRootIndex: |
| 3180 case kCodeStubsRootIndex: | 3196 case kCodeStubsRootIndex: |
| 3181 case kNonMonomorphicCacheRootIndex: | 3197 case kNonMonomorphicCacheRootIndex: |
| 3182 case kPolymorphicCodeCacheRootIndex: | 3198 case kPolymorphicCodeCacheRootIndex: |
| (...skipping 3358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6541 *object_type = "CODE_TYPE"; \ | 6557 *object_type = "CODE_TYPE"; \ |
| 6542 *object_sub_type = "CODE_AGE/" #name; \ | 6558 *object_sub_type = "CODE_AGE/" #name; \ |
| 6543 return true; | 6559 return true; |
| 6544 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) | 6560 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) |
| 6545 #undef COMPARE_AND_RETURN_NAME | 6561 #undef COMPARE_AND_RETURN_NAME |
| 6546 } | 6562 } |
| 6547 return false; | 6563 return false; |
| 6548 } | 6564 } |
| 6549 } | 6565 } |
| 6550 } // namespace v8::internal | 6566 } // namespace v8::internal |
| OLD | NEW |