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/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/extensions/externalize-string-extension.h" | 10 #include "src/extensions/externalize-string-extension.h" |
(...skipping 2233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2244 HandleScope scope(isolate); | 2244 HandleScope scope(isolate); |
2245 | 2245 |
2246 #define INITIALIZE_FLAG(FLAG) \ | 2246 #define INITIALIZE_FLAG(FLAG) \ |
2247 { \ | 2247 { \ |
2248 Handle<String> name = \ | 2248 Handle<String> name = \ |
2249 isolate->factory()->NewStringFromAsciiChecked(#FLAG); \ | 2249 isolate->factory()->NewStringFromAsciiChecked(#FLAG); \ |
2250 JSObject::AddProperty(container, name, \ | 2250 JSObject::AddProperty(container, name, \ |
2251 isolate->factory()->ToBoolean(FLAG), NONE); \ | 2251 isolate->factory()->ToBoolean(FLAG), NONE); \ |
2252 } | 2252 } |
2253 | 2253 |
2254 INITIALIZE_FLAG(FLAG_harmony_tostring) | |
2255 INITIALIZE_FLAG(FLAG_harmony_species) | 2254 INITIALIZE_FLAG(FLAG_harmony_species) |
2256 | 2255 |
2257 #undef INITIALIZE_FLAG | 2256 #undef INITIALIZE_FLAG |
2258 } | 2257 } |
2259 | 2258 |
2260 | 2259 |
2261 #define EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(id) \ | 2260 #define EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(id) \ |
2262 void Genesis::InitializeGlobal_##id() {} | 2261 void Genesis::InitializeGlobal_##id() {} |
2263 | 2262 |
2264 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_modules) | 2263 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_modules) |
(...skipping 21 matching lines...) Expand all Loading... |
2286 Handle<String> symbol_string = factory->InternalizeUtf8String("Symbol"); | 2285 Handle<String> symbol_string = factory->InternalizeUtf8String("Symbol"); |
2287 Handle<JSObject> symbol = Handle<JSObject>::cast( | 2286 Handle<JSObject> symbol = Handle<JSObject>::cast( |
2288 JSObject::GetProperty(global, symbol_string).ToHandleChecked()); | 2287 JSObject::GetProperty(global, symbol_string).ToHandleChecked()); |
2289 Handle<String> name_string = factory->InternalizeUtf8String(name); | 2288 Handle<String> name_string = factory->InternalizeUtf8String(name); |
2290 PropertyAttributes attributes = | 2289 PropertyAttributes attributes = |
2291 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); | 2290 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); |
2292 JSObject::AddProperty(symbol, name_string, value, attributes); | 2291 JSObject::AddProperty(symbol, name_string, value, attributes); |
2293 } | 2292 } |
2294 | 2293 |
2295 | 2294 |
2296 void Genesis::InitializeGlobal_harmony_tostring() { | |
2297 if (!FLAG_harmony_tostring) return; | |
2298 InstallPublicSymbol(factory(), native_context(), "toStringTag", | |
2299 factory()->to_string_tag_symbol()); | |
2300 } | |
2301 | |
2302 | |
2303 void Genesis::InitializeGlobal_harmony_regexp_subclass() { | 2295 void Genesis::InitializeGlobal_harmony_regexp_subclass() { |
2304 if (!FLAG_harmony_regexp_subclass) return; | 2296 if (!FLAG_harmony_regexp_subclass) return; |
2305 InstallPublicSymbol(factory(), native_context(), "match", | 2297 InstallPublicSymbol(factory(), native_context(), "match", |
2306 factory()->match_symbol()); | 2298 factory()->match_symbol()); |
2307 InstallPublicSymbol(factory(), native_context(), "replace", | 2299 InstallPublicSymbol(factory(), native_context(), "replace", |
2308 factory()->replace_symbol()); | 2300 factory()->replace_symbol()); |
2309 InstallPublicSymbol(factory(), native_context(), "search", | 2301 InstallPublicSymbol(factory(), native_context(), "search", |
2310 factory()->search_symbol()); | 2302 factory()->search_symbol()); |
2311 InstallPublicSymbol(factory(), native_context(), "split", | 2303 InstallPublicSymbol(factory(), native_context(), "split", |
2312 factory()->split_symbol()); | 2304 factory()->split_symbol()); |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2950 | 2942 |
2951 return true; | 2943 return true; |
2952 } | 2944 } |
2953 | 2945 |
2954 | 2946 |
2955 bool Genesis::InstallExperimentalNatives() { | 2947 bool Genesis::InstallExperimentalNatives() { |
2956 static const char* harmony_proxies_natives[] = {"native proxy.js", nullptr}; | 2948 static const char* harmony_proxies_natives[] = {"native proxy.js", nullptr}; |
2957 static const char* harmony_modules_natives[] = {nullptr}; | 2949 static const char* harmony_modules_natives[] = {nullptr}; |
2958 static const char* harmony_regexps_natives[] = {"native harmony-regexp.js", | 2950 static const char* harmony_regexps_natives[] = {"native harmony-regexp.js", |
2959 nullptr}; | 2951 nullptr}; |
2960 static const char* harmony_tostring_natives[] = {nullptr}; | |
2961 static const char* harmony_iterator_close_natives[] = {nullptr}; | 2952 static const char* harmony_iterator_close_natives[] = {nullptr}; |
2962 static const char* harmony_sloppy_natives[] = {nullptr}; | 2953 static const char* harmony_sloppy_natives[] = {nullptr}; |
2963 static const char* harmony_sloppy_function_natives[] = {nullptr}; | 2954 static const char* harmony_sloppy_function_natives[] = {nullptr}; |
2964 static const char* harmony_sloppy_let_natives[] = {nullptr}; | 2955 static const char* harmony_sloppy_let_natives[] = {nullptr}; |
2965 static const char* harmony_species_natives[] = {"native harmony-species.js", | 2956 static const char* harmony_species_natives[] = {"native harmony-species.js", |
2966 nullptr}; | 2957 nullptr}; |
2967 static const char* harmony_tailcalls_natives[] = {nullptr}; | 2958 static const char* harmony_tailcalls_natives[] = {nullptr}; |
2968 static const char* harmony_unicode_regexps_natives[] = { | 2959 static const char* harmony_unicode_regexps_natives[] = { |
2969 "native harmony-unicode-regexps.js", nullptr}; | 2960 "native harmony-unicode-regexps.js", nullptr}; |
2970 static const char* harmony_reflect_natives[] = {"native harmony-reflect.js", | 2961 static const char* harmony_reflect_natives[] = {"native harmony-reflect.js", |
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3655 } | 3646 } |
3656 | 3647 |
3657 | 3648 |
3658 // Called when the top-level V8 mutex is destroyed. | 3649 // Called when the top-level V8 mutex is destroyed. |
3659 void Bootstrapper::FreeThreadResources() { | 3650 void Bootstrapper::FreeThreadResources() { |
3660 DCHECK(!IsActive()); | 3651 DCHECK(!IsActive()); |
3661 } | 3652 } |
3662 | 3653 |
3663 } // namespace internal | 3654 } // namespace internal |
3664 } // namespace v8 | 3655 } // namespace v8 |
OLD | NEW |