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 2452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2463 Isolate* isolate = global->GetIsolate(); | 2463 Isolate* isolate = global->GetIsolate(); |
2464 Factory* factory = isolate->factory(); | 2464 Factory* factory = isolate->factory(); |
2465 | 2465 |
2466 Handle<JSFunction> object_function = isolate->object_function(); | 2466 Handle<JSFunction> object_function = isolate->object_function(); |
2467 SimpleInstallFunction(object_function, factory->entries_string(), | 2467 SimpleInstallFunction(object_function, factory->entries_string(), |
2468 Builtins::kObjectEntries, 1, false); | 2468 Builtins::kObjectEntries, 1, false); |
2469 SimpleInstallFunction(object_function, factory->values_string(), | 2469 SimpleInstallFunction(object_function, factory->values_string(), |
2470 Builtins::kObjectValues, 1, false); | 2470 Builtins::kObjectValues, 1, false); |
2471 } | 2471 } |
2472 | 2472 |
| 2473 void Genesis::InitializeGlobal_harmony_object_own_property_descriptors() { |
| 2474 if (!FLAG_harmony_object_own_property_descriptors) return; |
| 2475 |
| 2476 Handle<JSGlobalObject> global( |
| 2477 JSGlobalObject::cast(native_context()->global_object())); |
| 2478 Isolate* isolate = global->GetIsolate(); |
| 2479 Factory* factory = isolate->factory(); |
| 2480 |
| 2481 Handle<JSFunction> object_function = isolate->object_function(); |
| 2482 SimpleInstallFunction(object_function, |
| 2483 factory->getOwnPropertyDescriptors_string(), |
| 2484 Builtins::kObjectGetOwnPropertyDescriptors, 1, false); |
| 2485 } |
2473 | 2486 |
2474 void Genesis::InstallJSProxyMaps() { | 2487 void Genesis::InstallJSProxyMaps() { |
2475 // Allocate the different maps for all Proxy types. | 2488 // Allocate the different maps for all Proxy types. |
2476 // Next to the default proxy, we need maps indicating callable and | 2489 // Next to the default proxy, we need maps indicating callable and |
2477 // constructable proxies. | 2490 // constructable proxies. |
2478 | 2491 |
2479 Handle<Map> proxy_function_map = | 2492 Handle<Map> proxy_function_map = |
2480 Map::Copy(isolate()->sloppy_function_without_prototype_map(), "Proxy"); | 2493 Map::Copy(isolate()->sloppy_function_without_prototype_map(), "Proxy"); |
2481 proxy_function_map->set_is_constructor(true); | 2494 proxy_function_map->set_is_constructor(true); |
2482 native_context()->set_proxy_function_map(*proxy_function_map); | 2495 native_context()->set_proxy_function_map(*proxy_function_map); |
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2956 static const char* harmony_tolength_natives[] = {nullptr}; | 2969 static const char* harmony_tolength_natives[] = {nullptr}; |
2957 static const char* harmony_completion_natives[] = {nullptr}; | 2970 static const char* harmony_completion_natives[] = {nullptr}; |
2958 static const char* harmony_do_expressions_natives[] = {nullptr}; | 2971 static const char* harmony_do_expressions_natives[] = {nullptr}; |
2959 static const char* harmony_regexp_subclass_natives[] = {nullptr}; | 2972 static const char* harmony_regexp_subclass_natives[] = {nullptr}; |
2960 static const char* harmony_regexp_lookbehind_natives[] = {nullptr}; | 2973 static const char* harmony_regexp_lookbehind_natives[] = {nullptr}; |
2961 static const char* harmony_function_name_natives[] = {nullptr}; | 2974 static const char* harmony_function_name_natives[] = {nullptr}; |
2962 static const char* harmony_function_sent_natives[] = {nullptr}; | 2975 static const char* harmony_function_sent_natives[] = {nullptr}; |
2963 static const char* promise_extra_natives[] = {"native promise-extra.js", | 2976 static const char* promise_extra_natives[] = {"native promise-extra.js", |
2964 nullptr}; | 2977 nullptr}; |
2965 static const char* harmony_object_values_entries_natives[] = {nullptr}; | 2978 static const char* harmony_object_values_entries_natives[] = {nullptr}; |
| 2979 static const char* harmony_object_own_property_descriptors_natives[] = { |
| 2980 nullptr}; |
2966 | 2981 |
2967 for (int i = ExperimentalNatives::GetDebuggerCount(); | 2982 for (int i = ExperimentalNatives::GetDebuggerCount(); |
2968 i < ExperimentalNatives::GetBuiltinsCount(); i++) { | 2983 i < ExperimentalNatives::GetBuiltinsCount(); i++) { |
2969 #define INSTALL_EXPERIMENTAL_NATIVES(id, desc) \ | 2984 #define INSTALL_EXPERIMENTAL_NATIVES(id, desc) \ |
2970 if (FLAG_##id) { \ | 2985 if (FLAG_##id) { \ |
2971 for (size_t j = 0; id##_natives[j] != NULL; j++) { \ | 2986 for (size_t j = 0; id##_natives[j] != NULL; j++) { \ |
2972 Vector<const char> script_name = ExperimentalNatives::GetScriptName(i); \ | 2987 Vector<const char> script_name = ExperimentalNatives::GetScriptName(i); \ |
2973 if (strncmp(script_name.start(), id##_natives[j], \ | 2988 if (strncmp(script_name.start(), id##_natives[j], \ |
2974 script_name.length()) == 0) { \ | 2989 script_name.length()) == 0) { \ |
2975 if (!Bootstrapper::CompileExperimentalBuiltin(isolate(), i)) { \ | 2990 if (!Bootstrapper::CompileExperimentalBuiltin(isolate(), i)) { \ |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3631 } | 3646 } |
3632 | 3647 |
3633 | 3648 |
3634 // Called when the top-level V8 mutex is destroyed. | 3649 // Called when the top-level V8 mutex is destroyed. |
3635 void Bootstrapper::FreeThreadResources() { | 3650 void Bootstrapper::FreeThreadResources() { |
3636 DCHECK(!IsActive()); | 3651 DCHECK(!IsActive()); |
3637 } | 3652 } |
3638 | 3653 |
3639 } // namespace internal | 3654 } // namespace internal |
3640 } // namespace v8 | 3655 } // namespace v8 |
OLD | NEW |