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