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 2812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2823 // is set to avoid expanding the dictionary during bootstrapping. | 2823 // is set to avoid expanding the dictionary during bootstrapping. |
2824 set_non_monomorphic_cache(*UnseededNumberDictionary::New(isolate(), 64)); | 2824 set_non_monomorphic_cache(*UnseededNumberDictionary::New(isolate(), 64)); |
2825 | 2825 |
2826 set_polymorphic_code_cache(PolymorphicCodeCache::cast( | 2826 set_polymorphic_code_cache(PolymorphicCodeCache::cast( |
2827 *factory->NewStruct(POLYMORPHIC_CODE_CACHE_TYPE))); | 2827 *factory->NewStruct(POLYMORPHIC_CODE_CACHE_TYPE))); |
2828 | 2828 |
2829 set_instanceof_cache_function(Smi::FromInt(0)); | 2829 set_instanceof_cache_function(Smi::FromInt(0)); |
2830 set_instanceof_cache_map(Smi::FromInt(0)); | 2830 set_instanceof_cache_map(Smi::FromInt(0)); |
2831 set_instanceof_cache_answer(Smi::FromInt(0)); | 2831 set_instanceof_cache_answer(Smi::FromInt(0)); |
2832 | 2832 |
| 2833 #define SYMBOL_INIT(name) \ |
| 2834 roots_[k##name##RootIndex] = *factory->NewPrivateOwnSymbol(); |
| 2835 PRIVATE_SYMBOL_LIST(SYMBOL_INIT) |
| 2836 #undef SYMBOL_INIT |
| 2837 |
2833 CreateFixedStubs(); | 2838 CreateFixedStubs(); |
2834 | 2839 |
2835 // Allocate the dictionary of intrinsic function names. | 2840 // Allocate the dictionary of intrinsic function names. |
2836 Handle<NameDictionary> intrinsic_names = | 2841 Handle<NameDictionary> intrinsic_names = |
2837 NameDictionary::New(isolate(), Runtime::kNumFunctions, TENURED); | 2842 NameDictionary::New(isolate(), Runtime::kNumFunctions, TENURED); |
2838 Runtime::InitializeIntrinsicFunctionNames(isolate(), intrinsic_names); | 2843 Runtime::InitializeIntrinsicFunctionNames(isolate(), intrinsic_names); |
2839 set_intrinsic_function_names(*intrinsic_names); | 2844 set_intrinsic_function_names(*intrinsic_names); |
2840 | 2845 |
2841 set_number_string_cache( | 2846 set_number_string_cache( |
2842 *factory->NewFixedArray(kInitialNumberStringCacheSize * 2, TENURED)); | 2847 *factory->NewFixedArray(kInitialNumberStringCacheSize * 2, TENURED)); |
(...skipping 18 matching lines...) Expand all Loading... |
2861 set_symbol_registry(undefined_value()); | 2866 set_symbol_registry(undefined_value()); |
2862 | 2867 |
2863 // Allocate object to hold object observation state. | 2868 // Allocate object to hold object observation state. |
2864 set_observation_state(*factory->NewJSObjectFromMap( | 2869 set_observation_state(*factory->NewJSObjectFromMap( |
2865 factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize))); | 2870 factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize))); |
2866 | 2871 |
2867 // Microtask queue uses the empty fixed array as a sentinel for "empty". | 2872 // Microtask queue uses the empty fixed array as a sentinel for "empty". |
2868 // Number of queued microtasks stored in Isolate::pending_microtask_count(). | 2873 // Number of queued microtasks stored in Isolate::pending_microtask_count(). |
2869 set_microtask_queue(empty_fixed_array()); | 2874 set_microtask_queue(empty_fixed_array()); |
2870 | 2875 |
2871 set_detailed_stack_trace_symbol(*factory->NewPrivateOwnSymbol()); | |
2872 set_elements_transition_symbol(*factory->NewPrivateOwnSymbol()); | |
2873 set_frozen_symbol(*factory->NewPrivateOwnSymbol()); | |
2874 set_megamorphic_symbol(*factory->NewPrivateOwnSymbol()); | |
2875 set_premonomorphic_symbol(*factory->NewPrivateOwnSymbol()); | |
2876 set_generic_symbol(*factory->NewPrivateOwnSymbol()); | |
2877 set_nonexistent_symbol(*factory->NewPrivateOwnSymbol()); | |
2878 set_normal_ic_symbol(*factory->NewPrivateOwnSymbol()); | |
2879 set_observed_symbol(*factory->NewPrivateOwnSymbol()); | |
2880 set_stack_trace_symbol(*factory->NewPrivateOwnSymbol()); | |
2881 set_uninitialized_symbol(*factory->NewPrivateOwnSymbol()); | |
2882 set_home_object_symbol(*factory->NewPrivateOwnSymbol()); | |
2883 set_promise_debug_marker_symbol(*factory->NewPrivateOwnSymbol()); | |
2884 set_promise_has_handler_symbol(*factory->NewPrivateOwnSymbol()); | |
2885 | |
2886 Handle<SeededNumberDictionary> slow_element_dictionary = | 2876 Handle<SeededNumberDictionary> slow_element_dictionary = |
2887 SeededNumberDictionary::New(isolate(), 0, TENURED); | 2877 SeededNumberDictionary::New(isolate(), 0, TENURED); |
2888 slow_element_dictionary->set_requires_slow_elements(); | 2878 slow_element_dictionary->set_requires_slow_elements(); |
2889 set_empty_slow_element_dictionary(*slow_element_dictionary); | 2879 set_empty_slow_element_dictionary(*slow_element_dictionary); |
2890 | 2880 |
2891 set_materialized_objects(*factory->NewFixedArray(0, TENURED)); | 2881 set_materialized_objects(*factory->NewFixedArray(0, TENURED)); |
2892 | 2882 |
2893 // Handling of script id generation is in Factory::NewScript. | 2883 // Handling of script id generation is in Factory::NewScript. |
2894 set_last_script_id(Smi::FromInt(v8::UnboundScript::kNoScriptId)); | 2884 set_last_script_id(Smi::FromInt(v8::UnboundScript::kNoScriptId)); |
2895 | 2885 |
(...skipping 3256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6152 static_cast<int>(object_sizes_last_time_[index])); | 6142 static_cast<int>(object_sizes_last_time_[index])); |
6153 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6143 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6154 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6144 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6155 | 6145 |
6156 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6146 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6157 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6147 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6158 ClearObjectStats(); | 6148 ClearObjectStats(); |
6159 } | 6149 } |
6160 } | 6150 } |
6161 } // namespace v8::internal | 6151 } // namespace v8::internal |
OLD | NEW |