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 3582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3593 Handle<JSObject> atomics_object = factory->NewJSObject(cons, TENURED); | 3593 Handle<JSObject> atomics_object = factory->NewJSObject(cons, TENURED); |
3594 DCHECK(atomics_object->IsJSObject()); | 3594 DCHECK(atomics_object->IsJSObject()); |
3595 JSObject::AddProperty(global, name, atomics_object, DONT_ENUM); | 3595 JSObject::AddProperty(global, name, atomics_object, DONT_ENUM); |
3596 | 3596 |
3597 SimpleInstallFunction(atomics_object, factory->InternalizeUtf8String("load"), | 3597 SimpleInstallFunction(atomics_object, factory->InternalizeUtf8String("load"), |
3598 Builtins::kAtomicsLoad, 2, true); | 3598 Builtins::kAtomicsLoad, 2, true); |
3599 SimpleInstallFunction(atomics_object, factory->InternalizeUtf8String("store"), | 3599 SimpleInstallFunction(atomics_object, factory->InternalizeUtf8String("store"), |
3600 Builtins::kAtomicsStore, 3, true); | 3600 Builtins::kAtomicsStore, 3, true); |
3601 } | 3601 } |
3602 | 3602 |
3603 | |
3604 void Genesis::InitializeGlobal_harmony_simd() { | |
3605 if (!FLAG_harmony_simd) return; | |
3606 | |
3607 Handle<JSGlobalObject> global( | |
3608 JSGlobalObject::cast(native_context()->global_object())); | |
3609 Isolate* isolate = global->GetIsolate(); | |
3610 Factory* factory = isolate->factory(); | |
3611 | |
3612 Handle<String> name = factory->InternalizeUtf8String("SIMD"); | |
3613 Handle<JSFunction> cons = factory->NewFunction(name); | |
3614 JSFunction::SetInstancePrototype( | |
3615 cons, | |
3616 Handle<Object>(native_context()->initial_object_prototype(), isolate)); | |
3617 cons->shared()->set_instance_class_name(*name); | |
3618 Handle<JSObject> simd_object = factory->NewJSObject(cons, TENURED); | |
3619 DCHECK(simd_object->IsJSObject()); | |
3620 JSObject::AddProperty(global, name, simd_object, DONT_ENUM); | |
3621 | |
3622 // Install SIMD type functions. Set the instance class names since | |
3623 // InstallFunction only does this when we install on the JSGlobalObject. | |
3624 #define SIMD128_INSTALL_FUNCTION(TYPE, Type, type, lane_count, lane_type) \ | |
3625 Handle<JSFunction> type##_function = InstallFunction( \ | |
3626 simd_object, #Type, JS_VALUE_TYPE, JSValue::kSize, \ | |
3627 isolate->initial_object_prototype(), Builtins::kIllegal); \ | |
3628 native_context()->set_##type##_function(*type##_function); \ | |
3629 type##_function->shared()->set_instance_class_name(*factory->Type##_string()); | |
3630 SIMD128_TYPES(SIMD128_INSTALL_FUNCTION) | |
3631 #undef SIMD128_INSTALL_FUNCTION | |
3632 } | |
3633 | |
3634 | |
3635 void Genesis::InitializeGlobal_harmony_array_prototype_values() { | 3603 void Genesis::InitializeGlobal_harmony_array_prototype_values() { |
3636 if (!FLAG_harmony_array_prototype_values) return; | 3604 if (!FLAG_harmony_array_prototype_values) return; |
3637 Handle<JSFunction> array_constructor(native_context()->array_function()); | 3605 Handle<JSFunction> array_constructor(native_context()->array_function()); |
3638 Handle<JSObject> array_prototype( | 3606 Handle<JSObject> array_prototype( |
3639 JSObject::cast(array_constructor->instance_prototype())); | 3607 JSObject::cast(array_constructor->instance_prototype())); |
3640 Handle<Object> values_iterator = | 3608 Handle<Object> values_iterator = |
3641 JSObject::GetProperty(array_prototype, factory()->iterator_symbol()) | 3609 JSObject::GetProperty(array_prototype, factory()->iterator_symbol()) |
3642 .ToHandleChecked(); | 3610 .ToHandleChecked(); |
3643 DCHECK(values_iterator->IsJSFunction()); | 3611 DCHECK(values_iterator->IsJSFunction()); |
3644 JSObject::AddProperty(array_prototype, factory()->values_string(), | 3612 JSObject::AddProperty(array_prototype, factory()->values_string(), |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4101 } | 4069 } |
4102 | 4070 |
4103 return true; | 4071 return true; |
4104 } | 4072 } |
4105 | 4073 |
4106 | 4074 |
4107 bool Genesis::InstallExperimentalNatives() { | 4075 bool Genesis::InstallExperimentalNatives() { |
4108 static const char* harmony_tailcalls_natives[] = {nullptr}; | 4076 static const char* harmony_tailcalls_natives[] = {nullptr}; |
4109 static const char* harmony_sharedarraybuffer_natives[] = { | 4077 static const char* harmony_sharedarraybuffer_natives[] = { |
4110 "native harmony-atomics.js", NULL}; | 4078 "native harmony-atomics.js", NULL}; |
4111 static const char* harmony_simd_natives[] = {"native harmony-simd.js", | |
4112 nullptr}; | |
4113 static const char* harmony_do_expressions_natives[] = {nullptr}; | 4079 static const char* harmony_do_expressions_natives[] = {nullptr}; |
4114 static const char* harmony_regexp_lookbehind_natives[] = {nullptr}; | 4080 static const char* harmony_regexp_lookbehind_natives[] = {nullptr}; |
4115 static const char* harmony_regexp_named_captures_natives[] = {nullptr}; | 4081 static const char* harmony_regexp_named_captures_natives[] = {nullptr}; |
4116 static const char* harmony_regexp_property_natives[] = {nullptr}; | 4082 static const char* harmony_regexp_property_natives[] = {nullptr}; |
4117 static const char* harmony_function_sent_natives[] = {nullptr}; | 4083 static const char* harmony_function_sent_natives[] = {nullptr}; |
4118 static const char* harmony_array_prototype_values_natives[] = {nullptr}; | 4084 static const char* harmony_array_prototype_values_natives[] = {nullptr}; |
4119 #ifdef V8_I18N_SUPPORT | 4085 #ifdef V8_I18N_SUPPORT |
4120 static const char* icu_case_mapping_natives[] = {"native icu-case-mapping.js", | 4086 static const char* icu_case_mapping_natives[] = {"native icu-case-mapping.js", |
4121 nullptr}; | 4087 nullptr}; |
4122 static const char* datetime_format_to_parts_natives[] = { | 4088 static const char* datetime_format_to_parts_natives[] = { |
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4877 } | 4843 } |
4878 | 4844 |
4879 | 4845 |
4880 // Called when the top-level V8 mutex is destroyed. | 4846 // Called when the top-level V8 mutex is destroyed. |
4881 void Bootstrapper::FreeThreadResources() { | 4847 void Bootstrapper::FreeThreadResources() { |
4882 DCHECK(!IsActive()); | 4848 DCHECK(!IsActive()); |
4883 } | 4849 } |
4884 | 4850 |
4885 } // namespace internal | 4851 } // namespace internal |
4886 } // namespace v8 | 4852 } // namespace v8 |
OLD | NEW |