| 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/ast/scopeinfo.h" | 9 #include "src/ast/scopeinfo.h" |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 2673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2684 for (unsigned i = 0; i < arraysize(constant_string_table); i++) { | 2684 for (unsigned i = 0; i < arraysize(constant_string_table); i++) { |
| 2685 Handle<String> str = | 2685 Handle<String> str = |
| 2686 factory->InternalizeUtf8String(constant_string_table[i].contents); | 2686 factory->InternalizeUtf8String(constant_string_table[i].contents); |
| 2687 roots_[constant_string_table[i].index] = *str; | 2687 roots_[constant_string_table[i].index] = *str; |
| 2688 } | 2688 } |
| 2689 | 2689 |
| 2690 // Create the code_stubs dictionary. The initial size is set to avoid | 2690 // Create the code_stubs dictionary. The initial size is set to avoid |
| 2691 // expanding the dictionary during bootstrapping. | 2691 // expanding the dictionary during bootstrapping. |
| 2692 set_code_stubs(*UnseededNumberDictionary::New(isolate(), 128)); | 2692 set_code_stubs(*UnseededNumberDictionary::New(isolate(), 128)); |
| 2693 | 2693 |
| 2694 // Create the non_monomorphic_cache used in stub-cache.cc. The initial size | |
| 2695 // is set to avoid expanding the dictionary during bootstrapping. | |
| 2696 set_non_monomorphic_cache(*UnseededNumberDictionary::New(isolate(), 64)); | |
| 2697 | |
| 2698 set_instanceof_cache_function(Smi::FromInt(0)); | 2694 set_instanceof_cache_function(Smi::FromInt(0)); |
| 2699 set_instanceof_cache_map(Smi::FromInt(0)); | 2695 set_instanceof_cache_map(Smi::FromInt(0)); |
| 2700 set_instanceof_cache_answer(Smi::FromInt(0)); | 2696 set_instanceof_cache_answer(Smi::FromInt(0)); |
| 2701 | 2697 |
| 2702 { | 2698 { |
| 2703 HandleScope scope(isolate()); | 2699 HandleScope scope(isolate()); |
| 2704 #define SYMBOL_INIT(name) \ | 2700 #define SYMBOL_INIT(name) \ |
| 2705 { \ | 2701 { \ |
| 2706 Handle<String> name##d = factory->NewStringFromStaticChars(#name); \ | 2702 Handle<String> name##d = factory->NewStringFromStaticChars(#name); \ |
| 2707 Handle<Symbol> symbol(isolate()->factory()->NewPrivateSymbol()); \ | 2703 Handle<Symbol> symbol(isolate()->factory()->NewPrivateSymbol()); \ |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2890 } | 2886 } |
| 2891 | 2887 |
| 2892 | 2888 |
| 2893 bool Heap::RootCanBeWrittenAfterInitialization(Heap::RootListIndex root_index) { | 2889 bool Heap::RootCanBeWrittenAfterInitialization(Heap::RootListIndex root_index) { |
| 2894 switch (root_index) { | 2890 switch (root_index) { |
| 2895 case kNumberStringCacheRootIndex: | 2891 case kNumberStringCacheRootIndex: |
| 2896 case kInstanceofCacheFunctionRootIndex: | 2892 case kInstanceofCacheFunctionRootIndex: |
| 2897 case kInstanceofCacheMapRootIndex: | 2893 case kInstanceofCacheMapRootIndex: |
| 2898 case kInstanceofCacheAnswerRootIndex: | 2894 case kInstanceofCacheAnswerRootIndex: |
| 2899 case kCodeStubsRootIndex: | 2895 case kCodeStubsRootIndex: |
| 2900 case kNonMonomorphicCacheRootIndex: | |
| 2901 case kEmptyScriptRootIndex: | 2896 case kEmptyScriptRootIndex: |
| 2902 case kSymbolRegistryRootIndex: | 2897 case kSymbolRegistryRootIndex: |
| 2903 case kScriptListRootIndex: | 2898 case kScriptListRootIndex: |
| 2904 case kMaterializedObjectsRootIndex: | 2899 case kMaterializedObjectsRootIndex: |
| 2905 case kMicrotaskQueueRootIndex: | 2900 case kMicrotaskQueueRootIndex: |
| 2906 case kDetachedContextsRootIndex: | 2901 case kDetachedContextsRootIndex: |
| 2907 case kWeakObjectToCodeTableRootIndex: | 2902 case kWeakObjectToCodeTableRootIndex: |
| 2908 case kRetainedMapsRootIndex: | 2903 case kRetainedMapsRootIndex: |
| 2909 case kNoScriptSharedFunctionInfosRootIndex: | 2904 case kNoScriptSharedFunctionInfosRootIndex: |
| 2910 case kWeakStackTraceListRootIndex: | 2905 case kWeakStackTraceListRootIndex: |
| (...skipping 3532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6443 } | 6438 } |
| 6444 | 6439 |
| 6445 | 6440 |
| 6446 // static | 6441 // static |
| 6447 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6442 int Heap::GetStaticVisitorIdForMap(Map* map) { |
| 6448 return StaticVisitorBase::GetVisitorId(map); | 6443 return StaticVisitorBase::GetVisitorId(map); |
| 6449 } | 6444 } |
| 6450 | 6445 |
| 6451 } // namespace internal | 6446 } // namespace internal |
| 6452 } // namespace v8 | 6447 } // namespace v8 |
| OLD | NEW |