OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/bootstrapper.h" | 5 #include "src/bootstrapper.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
9 #include "src/base/ieee754.h" | 9 #include "src/base/ieee754.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 void InitializeExperimentalGlobal(); | 202 void InitializeExperimentalGlobal(); |
203 // Depending on the situation, expose and/or get rid of the utils object. | 203 // Depending on the situation, expose and/or get rid of the utils object. |
204 void ConfigureUtilsObject(GlobalContextType context_type); | 204 void ConfigureUtilsObject(GlobalContextType context_type); |
205 | 205 |
206 #define DECLARE_FEATURE_INITIALIZATION(id, descr) \ | 206 #define DECLARE_FEATURE_INITIALIZATION(id, descr) \ |
207 void InitializeGlobal_##id(); | 207 void InitializeGlobal_##id(); |
208 | 208 |
209 HARMONY_INPROGRESS(DECLARE_FEATURE_INITIALIZATION) | 209 HARMONY_INPROGRESS(DECLARE_FEATURE_INITIALIZATION) |
210 HARMONY_STAGED(DECLARE_FEATURE_INITIALIZATION) | 210 HARMONY_STAGED(DECLARE_FEATURE_INITIALIZATION) |
211 HARMONY_SHIPPING(DECLARE_FEATURE_INITIALIZATION) | 211 HARMONY_SHIPPING(DECLARE_FEATURE_INITIALIZATION) |
212 DECLARE_FEATURE_INITIALIZATION(promise_extra, "") | |
213 DECLARE_FEATURE_INITIALIZATION(intl_extra, "") | 212 DECLARE_FEATURE_INITIALIZATION(intl_extra, "") |
214 #undef DECLARE_FEATURE_INITIALIZATION | 213 #undef DECLARE_FEATURE_INITIALIZATION |
215 | 214 |
216 Handle<JSFunction> InstallArrayBuffer(Handle<JSObject> target, | 215 Handle<JSFunction> InstallArrayBuffer(Handle<JSObject> target, |
217 const char* name, Builtins::Name call, | 216 const char* name, Builtins::Name call, |
218 BuiltinFunctionId id); | 217 BuiltinFunctionId id); |
219 Handle<JSFunction> InstallInternalArray(Handle<JSObject> target, | 218 Handle<JSFunction> InstallInternalArray(Handle<JSObject> target, |
220 const char* name, | 219 const char* name, |
221 ElementsKind elements_kind); | 220 ElementsKind elements_kind); |
222 bool InstallNatives(GlobalContextType context_type); | 221 bool InstallNatives(GlobalContextType context_type); |
(...skipping 1947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2170 *fun = result; | 2169 *fun = result; |
2171 } | 2170 } |
2172 | 2171 |
2173 | 2172 |
2174 void Genesis::InitializeExperimentalGlobal() { | 2173 void Genesis::InitializeExperimentalGlobal() { |
2175 #define FEATURE_INITIALIZE_GLOBAL(id, descr) InitializeGlobal_##id(); | 2174 #define FEATURE_INITIALIZE_GLOBAL(id, descr) InitializeGlobal_##id(); |
2176 | 2175 |
2177 HARMONY_INPROGRESS(FEATURE_INITIALIZE_GLOBAL) | 2176 HARMONY_INPROGRESS(FEATURE_INITIALIZE_GLOBAL) |
2178 HARMONY_STAGED(FEATURE_INITIALIZE_GLOBAL) | 2177 HARMONY_STAGED(FEATURE_INITIALIZE_GLOBAL) |
2179 HARMONY_SHIPPING(FEATURE_INITIALIZE_GLOBAL) | 2178 HARMONY_SHIPPING(FEATURE_INITIALIZE_GLOBAL) |
2180 FEATURE_INITIALIZE_GLOBAL(promise_extra, "") | |
2181 FEATURE_INITIALIZE_GLOBAL(intl_extra, "") | 2179 FEATURE_INITIALIZE_GLOBAL(intl_extra, "") |
2182 #undef FEATURE_INITIALIZE_GLOBAL | 2180 #undef FEATURE_INITIALIZE_GLOBAL |
2183 } | 2181 } |
2184 | 2182 |
2185 | 2183 |
2186 bool Bootstrapper::CompileBuiltin(Isolate* isolate, int index) { | 2184 bool Bootstrapper::CompileBuiltin(Isolate* isolate, int index) { |
2187 Vector<const char> name = Natives::GetScriptName(index); | 2185 Vector<const char> name = Natives::GetScriptName(index); |
2188 Handle<String> source_code = | 2186 Handle<String> source_code = |
2189 isolate->bootstrapper()->SourceLookup<Natives>(index); | 2187 isolate->bootstrapper()->SourceLookup<Natives>(index); |
2190 | 2188 |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2756 | 2754 |
2757 #define EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(id) \ | 2755 #define EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(id) \ |
2758 void Genesis::InitializeGlobal_##id() {} | 2756 void Genesis::InitializeGlobal_##id() {} |
2759 | 2757 |
2760 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_do_expressions) | 2758 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_do_expressions) |
2761 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_for_in) | 2759 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_for_in) |
2762 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexp_lookbehind) | 2760 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexp_lookbehind) |
2763 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexp_named_captures) | 2761 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexp_named_captures) |
2764 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexp_property) | 2762 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexp_property) |
2765 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_function_sent) | 2763 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_function_sent) |
2766 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(promise_extra) | |
2767 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(intl_extra) | 2764 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(intl_extra) |
2768 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_explicit_tailcalls) | 2765 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_explicit_tailcalls) |
2769 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_tailcalls) | 2766 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_tailcalls) |
2770 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_restrictive_declarations) | 2767 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_restrictive_declarations) |
2771 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_string_padding) | 2768 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_string_padding) |
2772 #ifdef V8_I18N_SUPPORT | 2769 #ifdef V8_I18N_SUPPORT |
2773 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(icu_case_mapping) | 2770 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(icu_case_mapping) |
2774 #endif | 2771 #endif |
2775 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_async_await) | 2772 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_async_await) |
2776 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_restrictive_generators) | 2773 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_restrictive_generators) |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3344 "native harmony-atomics.js", NULL}; | 3341 "native harmony-atomics.js", NULL}; |
3345 static const char* harmony_simd_natives[] = {"native harmony-simd.js", | 3342 static const char* harmony_simd_natives[] = {"native harmony-simd.js", |
3346 nullptr}; | 3343 nullptr}; |
3347 static const char* harmony_do_expressions_natives[] = {nullptr}; | 3344 static const char* harmony_do_expressions_natives[] = {nullptr}; |
3348 static const char* harmony_for_in_natives[] = {nullptr}; | 3345 static const char* harmony_for_in_natives[] = {nullptr}; |
3349 static const char* harmony_regexp_lookbehind_natives[] = {nullptr}; | 3346 static const char* harmony_regexp_lookbehind_natives[] = {nullptr}; |
3350 static const char* harmony_restrictive_declarations_natives[] = {nullptr}; | 3347 static const char* harmony_restrictive_declarations_natives[] = {nullptr}; |
3351 static const char* harmony_regexp_named_captures_natives[] = {nullptr}; | 3348 static const char* harmony_regexp_named_captures_natives[] = {nullptr}; |
3352 static const char* harmony_regexp_property_natives[] = {nullptr}; | 3349 static const char* harmony_regexp_property_natives[] = {nullptr}; |
3353 static const char* harmony_function_sent_natives[] = {nullptr}; | 3350 static const char* harmony_function_sent_natives[] = {nullptr}; |
3354 static const char* promise_extra_natives[] = {"native promise-extra.js", | |
3355 nullptr}; | |
3356 static const char* intl_extra_natives[] = {"native intl-extra.js", nullptr}; | 3351 static const char* intl_extra_natives[] = {"native intl-extra.js", nullptr}; |
3357 static const char* harmony_object_values_entries_natives[] = {nullptr}; | 3352 static const char* harmony_object_values_entries_natives[] = {nullptr}; |
3358 static const char* harmony_object_own_property_descriptors_natives[] = { | 3353 static const char* harmony_object_own_property_descriptors_natives[] = { |
3359 nullptr}; | 3354 nullptr}; |
3360 static const char* harmony_array_prototype_values_natives[] = {nullptr}; | 3355 static const char* harmony_array_prototype_values_natives[] = {nullptr}; |
3361 static const char* harmony_string_padding_natives[] = { | 3356 static const char* harmony_string_padding_natives[] = { |
3362 "native harmony-string-padding.js", nullptr}; | 3357 "native harmony-string-padding.js", nullptr}; |
3363 #ifdef V8_I18N_SUPPORT | 3358 #ifdef V8_I18N_SUPPORT |
3364 static const char* icu_case_mapping_natives[] = {"native icu-case-mapping.js", | 3359 static const char* icu_case_mapping_natives[] = {"native icu-case-mapping.js", |
3365 nullptr}; | 3360 nullptr}; |
(...skipping 14 matching lines...) Expand all Loading... |
3380 if (!Bootstrapper::CompileExperimentalBuiltin(isolate(), i)) { \ | 3375 if (!Bootstrapper::CompileExperimentalBuiltin(isolate(), i)) { \ |
3381 return false; \ | 3376 return false; \ |
3382 } \ | 3377 } \ |
3383 } \ | 3378 } \ |
3384 } \ | 3379 } \ |
3385 } | 3380 } |
3386 HARMONY_INPROGRESS(INSTALL_EXPERIMENTAL_NATIVES); | 3381 HARMONY_INPROGRESS(INSTALL_EXPERIMENTAL_NATIVES); |
3387 HARMONY_STAGED(INSTALL_EXPERIMENTAL_NATIVES); | 3382 HARMONY_STAGED(INSTALL_EXPERIMENTAL_NATIVES); |
3388 HARMONY_SHIPPING(INSTALL_EXPERIMENTAL_NATIVES); | 3383 HARMONY_SHIPPING(INSTALL_EXPERIMENTAL_NATIVES); |
3389 INSTALL_EXPERIMENTAL_NATIVES(intl_extra, ""); | 3384 INSTALL_EXPERIMENTAL_NATIVES(intl_extra, ""); |
3390 INSTALL_EXPERIMENTAL_NATIVES(promise_extra, ""); | |
3391 #undef INSTALL_EXPERIMENTAL_NATIVES | 3385 #undef INSTALL_EXPERIMENTAL_NATIVES |
3392 } | 3386 } |
3393 | 3387 |
3394 if (!CallUtilsFunction(isolate(), "PostExperimentals")) return false; | 3388 if (!CallUtilsFunction(isolate(), "PostExperimentals")) return false; |
3395 | 3389 |
3396 InstallExperimentalBuiltinFunctionIds(); | 3390 InstallExperimentalBuiltinFunctionIds(); |
3397 return true; | 3391 return true; |
3398 } | 3392 } |
3399 | 3393 |
3400 | 3394 |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4100 } | 4094 } |
4101 | 4095 |
4102 | 4096 |
4103 // Called when the top-level V8 mutex is destroyed. | 4097 // Called when the top-level V8 mutex is destroyed. |
4104 void Bootstrapper::FreeThreadResources() { | 4098 void Bootstrapper::FreeThreadResources() { |
4105 DCHECK(!IsActive()); | 4099 DCHECK(!IsActive()); |
4106 } | 4100 } |
4107 | 4101 |
4108 } // namespace internal | 4102 } // namespace internal |
4109 } // namespace v8 | 4103 } // namespace v8 |
OLD | NEW |