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 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1126 Handle<JSFunction> object_function = isolate->object_function(); | 1126 Handle<JSFunction> object_function = isolate->object_function(); |
1127 JSObject::AddProperty(global_object, object_name, object_function, | 1127 JSObject::AddProperty(global_object, object_name, object_function, |
1128 DONT_ENUM); | 1128 DONT_ENUM); |
1129 | 1129 |
1130 SimpleInstallFunction(object_function, factory->assign_string(), | 1130 SimpleInstallFunction(object_function, factory->assign_string(), |
1131 Builtins::kObjectAssign, 2, false); | 1131 Builtins::kObjectAssign, 2, false); |
1132 SimpleInstallFunction(object_function, factory->create_string(), | 1132 SimpleInstallFunction(object_function, factory->create_string(), |
1133 Builtins::kObjectCreate, 2, true); | 1133 Builtins::kObjectCreate, 2, true); |
1134 SimpleInstallFunction(object_function, "getOwnPropertyDescriptor", | 1134 SimpleInstallFunction(object_function, "getOwnPropertyDescriptor", |
1135 Builtins::kObjectGetOwnPropertyDescriptor, 2, false); | 1135 Builtins::kObjectGetOwnPropertyDescriptor, 2, false); |
| 1136 SimpleInstallFunction(object_function, |
| 1137 factory->getOwnPropertyDescriptors_string(), |
| 1138 Builtins::kObjectGetOwnPropertyDescriptors, 1, false); |
1136 SimpleInstallFunction(object_function, "getOwnPropertyNames", | 1139 SimpleInstallFunction(object_function, "getOwnPropertyNames", |
1137 Builtins::kObjectGetOwnPropertyNames, 1, false); | 1140 Builtins::kObjectGetOwnPropertyNames, 1, false); |
1138 SimpleInstallFunction(object_function, "getOwnPropertySymbols", | 1141 SimpleInstallFunction(object_function, "getOwnPropertySymbols", |
1139 Builtins::kObjectGetOwnPropertySymbols, 1, false); | 1142 Builtins::kObjectGetOwnPropertySymbols, 1, false); |
1140 SimpleInstallFunction(object_function, "is", | 1143 SimpleInstallFunction(object_function, "is", |
1141 Builtins::kObjectIs, 2, true); | 1144 Builtins::kObjectIs, 2, true); |
1142 SimpleInstallFunction(object_function, "preventExtensions", | 1145 SimpleInstallFunction(object_function, "preventExtensions", |
1143 Builtins::kObjectPreventExtensions, 1, false); | 1146 Builtins::kObjectPreventExtensions, 1, false); |
1144 SimpleInstallFunction(object_function, "seal", | 1147 SimpleInstallFunction(object_function, "seal", |
1145 Builtins::kObjectSeal, 1, false); | 1148 Builtins::kObjectSeal, 1, false); |
(...skipping 28 matching lines...) Expand all Loading... |
1174 object_function, "isFrozen", Builtins::kObjectIsFrozen, 1, false); | 1177 object_function, "isFrozen", Builtins::kObjectIsFrozen, 1, false); |
1175 native_context()->set_object_is_frozen(*object_is_frozen); | 1178 native_context()->set_object_is_frozen(*object_is_frozen); |
1176 | 1179 |
1177 Handle<JSFunction> object_is_sealed = SimpleInstallFunction( | 1180 Handle<JSFunction> object_is_sealed = SimpleInstallFunction( |
1178 object_function, "isSealed", Builtins::kObjectIsSealed, 1, false); | 1181 object_function, "isSealed", Builtins::kObjectIsSealed, 1, false); |
1179 native_context()->set_object_is_sealed(*object_is_sealed); | 1182 native_context()->set_object_is_sealed(*object_is_sealed); |
1180 | 1183 |
1181 Handle<JSFunction> object_keys = SimpleInstallFunction( | 1184 Handle<JSFunction> object_keys = SimpleInstallFunction( |
1182 object_function, "keys", Builtins::kObjectKeys, 1, false); | 1185 object_function, "keys", Builtins::kObjectKeys, 1, false); |
1183 native_context()->set_object_keys(*object_keys); | 1186 native_context()->set_object_keys(*object_keys); |
| 1187 SimpleInstallFunction(object_function, factory->entries_string(), |
| 1188 Builtins::kObjectEntries, 1, false); |
| 1189 SimpleInstallFunction(object_function, factory->values_string(), |
| 1190 Builtins::kObjectValues, 1, false); |
1184 | 1191 |
1185 SimpleInstallFunction(isolate->initial_object_prototype(), | 1192 SimpleInstallFunction(isolate->initial_object_prototype(), |
1186 "__defineGetter__", Builtins::kObjectDefineGetter, 2, | 1193 "__defineGetter__", Builtins::kObjectDefineGetter, 2, |
1187 true); | 1194 true); |
1188 SimpleInstallFunction(isolate->initial_object_prototype(), | 1195 SimpleInstallFunction(isolate->initial_object_prototype(), |
1189 "__defineSetter__", Builtins::kObjectDefineSetter, 2, | 1196 "__defineSetter__", Builtins::kObjectDefineSetter, 2, |
1190 true); | 1197 true); |
1191 SimpleInstallFunction(isolate->initial_object_prototype(), "hasOwnProperty", | 1198 SimpleInstallFunction(isolate->initial_object_prototype(), "hasOwnProperty", |
1192 Builtins::kObjectHasOwnProperty, 1, true); | 1199 Builtins::kObjectHasOwnProperty, 1, true); |
1193 SimpleInstallFunction(isolate->initial_object_prototype(), | 1200 SimpleInstallFunction(isolate->initial_object_prototype(), |
(...skipping 2114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3308 Handle<JSFunction> type##_function = InstallFunction( \ | 3315 Handle<JSFunction> type##_function = InstallFunction( \ |
3309 simd_object, #Type, JS_VALUE_TYPE, JSValue::kSize, \ | 3316 simd_object, #Type, JS_VALUE_TYPE, JSValue::kSize, \ |
3310 isolate->initial_object_prototype(), Builtins::kIllegal); \ | 3317 isolate->initial_object_prototype(), Builtins::kIllegal); \ |
3311 native_context()->set_##type##_function(*type##_function); \ | 3318 native_context()->set_##type##_function(*type##_function); \ |
3312 type##_function->shared()->set_instance_class_name(*factory->Type##_string()); | 3319 type##_function->shared()->set_instance_class_name(*factory->Type##_string()); |
3313 SIMD128_TYPES(SIMD128_INSTALL_FUNCTION) | 3320 SIMD128_TYPES(SIMD128_INSTALL_FUNCTION) |
3314 #undef SIMD128_INSTALL_FUNCTION | 3321 #undef SIMD128_INSTALL_FUNCTION |
3315 } | 3322 } |
3316 | 3323 |
3317 | 3324 |
3318 void Genesis::InitializeGlobal_harmony_object_values_entries() { | |
3319 if (!FLAG_harmony_object_values_entries) return; | |
3320 | |
3321 Handle<JSGlobalObject> global( | |
3322 JSGlobalObject::cast(native_context()->global_object())); | |
3323 Isolate* isolate = global->GetIsolate(); | |
3324 Factory* factory = isolate->factory(); | |
3325 | |
3326 Handle<JSFunction> object_function = isolate->object_function(); | |
3327 SimpleInstallFunction(object_function, factory->entries_string(), | |
3328 Builtins::kObjectEntries, 1, false); | |
3329 SimpleInstallFunction(object_function, factory->values_string(), | |
3330 Builtins::kObjectValues, 1, false); | |
3331 } | |
3332 | |
3333 void Genesis::InitializeGlobal_harmony_object_own_property_descriptors() { | |
3334 if (!FLAG_harmony_object_own_property_descriptors) return; | |
3335 | |
3336 Handle<JSGlobalObject> global( | |
3337 JSGlobalObject::cast(native_context()->global_object())); | |
3338 Isolate* isolate = global->GetIsolate(); | |
3339 Factory* factory = isolate->factory(); | |
3340 | |
3341 Handle<JSFunction> object_function = isolate->object_function(); | |
3342 SimpleInstallFunction(object_function, | |
3343 factory->getOwnPropertyDescriptors_string(), | |
3344 Builtins::kObjectGetOwnPropertyDescriptors, 1, false); | |
3345 } | |
3346 | |
3347 void Genesis::InitializeGlobal_harmony_array_prototype_values() { | 3325 void Genesis::InitializeGlobal_harmony_array_prototype_values() { |
3348 if (!FLAG_harmony_array_prototype_values) return; | 3326 if (!FLAG_harmony_array_prototype_values) return; |
3349 Handle<JSFunction> array_constructor(native_context()->array_function()); | 3327 Handle<JSFunction> array_constructor(native_context()->array_function()); |
3350 Handle<JSObject> array_prototype( | 3328 Handle<JSObject> array_prototype( |
3351 JSObject::cast(array_constructor->instance_prototype())); | 3329 JSObject::cast(array_constructor->instance_prototype())); |
3352 Handle<Object> values_iterator = | 3330 Handle<Object> values_iterator = |
3353 JSObject::GetProperty(array_prototype, factory()->iterator_symbol()) | 3331 JSObject::GetProperty(array_prototype, factory()->iterator_symbol()) |
3354 .ToHandleChecked(); | 3332 .ToHandleChecked(); |
3355 DCHECK(values_iterator->IsJSFunction()); | 3333 DCHECK(values_iterator->IsJSFunction()); |
3356 JSObject::AddProperty(array_prototype, factory()->values_string(), | 3334 JSObject::AddProperty(array_prototype, factory()->values_string(), |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3816 static const char* harmony_sharedarraybuffer_natives[] = { | 3794 static const char* harmony_sharedarraybuffer_natives[] = { |
3817 "native harmony-atomics.js", NULL}; | 3795 "native harmony-atomics.js", NULL}; |
3818 static const char* harmony_simd_natives[] = {"native harmony-simd.js", | 3796 static const char* harmony_simd_natives[] = {"native harmony-simd.js", |
3819 nullptr}; | 3797 nullptr}; |
3820 static const char* harmony_do_expressions_natives[] = {nullptr}; | 3798 static const char* harmony_do_expressions_natives[] = {nullptr}; |
3821 static const char* harmony_regexp_lookbehind_natives[] = {nullptr}; | 3799 static const char* harmony_regexp_lookbehind_natives[] = {nullptr}; |
3822 static const char* harmony_restrictive_declarations_natives[] = {nullptr}; | 3800 static const char* harmony_restrictive_declarations_natives[] = {nullptr}; |
3823 static const char* harmony_regexp_named_captures_natives[] = {nullptr}; | 3801 static const char* harmony_regexp_named_captures_natives[] = {nullptr}; |
3824 static const char* harmony_regexp_property_natives[] = {nullptr}; | 3802 static const char* harmony_regexp_property_natives[] = {nullptr}; |
3825 static const char* harmony_function_sent_natives[] = {nullptr}; | 3803 static const char* harmony_function_sent_natives[] = {nullptr}; |
3826 static const char* harmony_object_values_entries_natives[] = {nullptr}; | |
3827 static const char* harmony_object_own_property_descriptors_natives[] = { | |
3828 nullptr}; | |
3829 static const char* harmony_array_prototype_values_natives[] = {nullptr}; | 3804 static const char* harmony_array_prototype_values_natives[] = {nullptr}; |
3830 static const char* harmony_string_padding_natives[] = { | 3805 static const char* harmony_string_padding_natives[] = { |
3831 "native harmony-string-padding.js", nullptr}; | 3806 "native harmony-string-padding.js", nullptr}; |
3832 #ifdef V8_I18N_SUPPORT | 3807 #ifdef V8_I18N_SUPPORT |
3833 static const char* icu_case_mapping_natives[] = {"native icu-case-mapping.js", | 3808 static const char* icu_case_mapping_natives[] = {"native icu-case-mapping.js", |
3834 nullptr}; | 3809 nullptr}; |
3835 static const char* datetime_format_to_parts_natives[] = { | 3810 static const char* datetime_format_to_parts_natives[] = { |
3836 "native datetime-format-to-parts.js", nullptr}; | 3811 "native datetime-format-to-parts.js", nullptr}; |
3837 #endif | 3812 #endif |
3838 static const char* harmony_async_await_natives[] = {nullptr}; | 3813 static const char* harmony_async_await_natives[] = {nullptr}; |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4568 } | 4543 } |
4569 | 4544 |
4570 | 4545 |
4571 // Called when the top-level V8 mutex is destroyed. | 4546 // Called when the top-level V8 mutex is destroyed. |
4572 void Bootstrapper::FreeThreadResources() { | 4547 void Bootstrapper::FreeThreadResources() { |
4573 DCHECK(!IsActive()); | 4548 DCHECK(!IsActive()); |
4574 } | 4549 } |
4575 | 4550 |
4576 } // namespace internal | 4551 } // namespace internal |
4577 } // namespace v8 | 4552 } // namespace v8 |
OLD | NEW |