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 |
3603 void Genesis::InitializeGlobal_harmony_array_prototype_values() { | 3635 void Genesis::InitializeGlobal_harmony_array_prototype_values() { |
3604 if (!FLAG_harmony_array_prototype_values) return; | 3636 if (!FLAG_harmony_array_prototype_values) return; |
3605 Handle<JSFunction> array_constructor(native_context()->array_function()); | 3637 Handle<JSFunction> array_constructor(native_context()->array_function()); |
3606 Handle<JSObject> array_prototype( | 3638 Handle<JSObject> array_prototype( |
3607 JSObject::cast(array_constructor->instance_prototype())); | 3639 JSObject::cast(array_constructor->instance_prototype())); |
3608 Handle<Object> values_iterator = | 3640 Handle<Object> values_iterator = |
3609 JSObject::GetProperty(array_prototype, factory()->iterator_symbol()) | 3641 JSObject::GetProperty(array_prototype, factory()->iterator_symbol()) |
3610 .ToHandleChecked(); | 3642 .ToHandleChecked(); |
3611 DCHECK(values_iterator->IsJSFunction()); | 3643 DCHECK(values_iterator->IsJSFunction()); |
3612 JSObject::AddProperty(array_prototype, factory()->values_string(), | 3644 JSObject::AddProperty(array_prototype, factory()->values_string(), |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4069 } | 4101 } |
4070 | 4102 |
4071 return true; | 4103 return true; |
4072 } | 4104 } |
4073 | 4105 |
4074 | 4106 |
4075 bool Genesis::InstallExperimentalNatives() { | 4107 bool Genesis::InstallExperimentalNatives() { |
4076 static const char* harmony_tailcalls_natives[] = {nullptr}; | 4108 static const char* harmony_tailcalls_natives[] = {nullptr}; |
4077 static const char* harmony_sharedarraybuffer_natives[] = { | 4109 static const char* harmony_sharedarraybuffer_natives[] = { |
4078 "native harmony-atomics.js", NULL}; | 4110 "native harmony-atomics.js", NULL}; |
| 4111 static const char* harmony_simd_natives[] = {"native harmony-simd.js", |
| 4112 nullptr}; |
4079 static const char* harmony_do_expressions_natives[] = {nullptr}; | 4113 static const char* harmony_do_expressions_natives[] = {nullptr}; |
4080 static const char* harmony_regexp_lookbehind_natives[] = {nullptr}; | 4114 static const char* harmony_regexp_lookbehind_natives[] = {nullptr}; |
4081 static const char* harmony_regexp_named_captures_natives[] = {nullptr}; | 4115 static const char* harmony_regexp_named_captures_natives[] = {nullptr}; |
4082 static const char* harmony_regexp_property_natives[] = {nullptr}; | 4116 static const char* harmony_regexp_property_natives[] = {nullptr}; |
4083 static const char* harmony_function_sent_natives[] = {nullptr}; | 4117 static const char* harmony_function_sent_natives[] = {nullptr}; |
4084 static const char* harmony_array_prototype_values_natives[] = {nullptr}; | 4118 static const char* harmony_array_prototype_values_natives[] = {nullptr}; |
4085 #ifdef V8_I18N_SUPPORT | 4119 #ifdef V8_I18N_SUPPORT |
4086 static const char* icu_case_mapping_natives[] = {"native icu-case-mapping.js", | 4120 static const char* icu_case_mapping_natives[] = {"native icu-case-mapping.js", |
4087 nullptr}; | 4121 nullptr}; |
4088 static const char* datetime_format_to_parts_natives[] = { | 4122 static const char* datetime_format_to_parts_natives[] = { |
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4843 } | 4877 } |
4844 | 4878 |
4845 | 4879 |
4846 // Called when the top-level V8 mutex is destroyed. | 4880 // Called when the top-level V8 mutex is destroyed. |
4847 void Bootstrapper::FreeThreadResources() { | 4881 void Bootstrapper::FreeThreadResources() { |
4848 DCHECK(!IsActive()); | 4882 DCHECK(!IsActive()); |
4849 } | 4883 } |
4850 | 4884 |
4851 } // namespace internal | 4885 } // namespace internal |
4852 } // namespace v8 | 4886 } // namespace v8 |
OLD | NEW |