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 3555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3566 native_context()->set_shared_array_buffer_fun(*shared_array_buffer_fun); | 3566 native_context()->set_shared_array_buffer_fun(*shared_array_buffer_fun); |
3567 | 3567 |
3568 Handle<String> name = factory->InternalizeUtf8String("Atomics"); | 3568 Handle<String> name = factory->InternalizeUtf8String("Atomics"); |
3569 Handle<JSFunction> cons = factory->NewFunction(name); | 3569 Handle<JSFunction> cons = factory->NewFunction(name); |
3570 JSFunction::SetInstancePrototype( | 3570 JSFunction::SetInstancePrototype( |
3571 cons, | 3571 cons, |
3572 Handle<Object>(native_context()->initial_object_prototype(), isolate)); | 3572 Handle<Object>(native_context()->initial_object_prototype(), isolate)); |
3573 Handle<JSObject> atomics_object = factory->NewJSObject(cons, TENURED); | 3573 Handle<JSObject> atomics_object = factory->NewJSObject(cons, TENURED); |
3574 DCHECK(atomics_object->IsJSObject()); | 3574 DCHECK(atomics_object->IsJSObject()); |
3575 JSObject::AddProperty(global, name, atomics_object, DONT_ENUM); | 3575 JSObject::AddProperty(global, name, atomics_object, DONT_ENUM); |
| 3576 JSObject::AddProperty(atomics_object, factory->to_string_tag_symbol(), name, |
| 3577 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); |
3576 | 3578 |
3577 SimpleInstallFunction(atomics_object, factory->InternalizeUtf8String("load"), | 3579 SimpleInstallFunction(atomics_object, factory->InternalizeUtf8String("load"), |
3578 Builtins::kAtomicsLoad, 2, true); | 3580 Builtins::kAtomicsLoad, 2, true); |
3579 SimpleInstallFunction(atomics_object, factory->InternalizeUtf8String("store"), | 3581 SimpleInstallFunction(atomics_object, factory->InternalizeUtf8String("store"), |
3580 Builtins::kAtomicsStore, 3, true); | 3582 Builtins::kAtomicsStore, 3, true); |
| 3583 SimpleInstallFunction(atomics_object, factory->InternalizeUtf8String("add"), |
| 3584 Builtins::kAtomicsAdd, 3, true); |
| 3585 SimpleInstallFunction(atomics_object, factory->InternalizeUtf8String("sub"), |
| 3586 Builtins::kAtomicsSub, 3, true); |
| 3587 SimpleInstallFunction(atomics_object, factory->InternalizeUtf8String("and"), |
| 3588 Builtins::kAtomicsAnd, 3, true); |
| 3589 SimpleInstallFunction(atomics_object, factory->InternalizeUtf8String("or"), |
| 3590 Builtins::kAtomicsOr, 3, true); |
| 3591 SimpleInstallFunction(atomics_object, factory->InternalizeUtf8String("xor"), |
| 3592 Builtins::kAtomicsXor, 3, true); |
| 3593 SimpleInstallFunction(atomics_object, |
| 3594 factory->InternalizeUtf8String("exchange"), |
| 3595 Builtins::kAtomicsExchange, 3, true); |
| 3596 SimpleInstallFunction(atomics_object, |
| 3597 factory->InternalizeUtf8String("compareExchange"), |
| 3598 Builtins::kAtomicsCompareExchange, 4, true); |
| 3599 SimpleInstallFunction(atomics_object, |
| 3600 factory->InternalizeUtf8String("isLockFree"), |
| 3601 Builtins::kAtomicsIsLockFree, 1, true); |
| 3602 SimpleInstallFunction(atomics_object, factory->InternalizeUtf8String("wait"), |
| 3603 Builtins::kAtomicsWait, 4, true); |
| 3604 SimpleInstallFunction(atomics_object, factory->InternalizeUtf8String("wake"), |
| 3605 Builtins::kAtomicsWake, 3, true); |
3581 } | 3606 } |
3582 | 3607 |
3583 void Genesis::InitializeGlobal_harmony_array_prototype_values() { | 3608 void Genesis::InitializeGlobal_harmony_array_prototype_values() { |
3584 if (!FLAG_harmony_array_prototype_values) return; | 3609 if (!FLAG_harmony_array_prototype_values) return; |
3585 Handle<JSFunction> array_constructor(native_context()->array_function()); | 3610 Handle<JSFunction> array_constructor(native_context()->array_function()); |
3586 Handle<JSObject> array_prototype( | 3611 Handle<JSObject> array_prototype( |
3587 JSObject::cast(array_constructor->instance_prototype())); | 3612 JSObject::cast(array_constructor->instance_prototype())); |
3588 Handle<Object> values_iterator = | 3613 Handle<Object> values_iterator = |
3589 JSObject::GetProperty(array_prototype, factory()->iterator_symbol()) | 3614 JSObject::GetProperty(array_prototype, factory()->iterator_symbol()) |
3590 .ToHandleChecked(); | 3615 .ToHandleChecked(); |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4116 map->AppendDescriptor(&d); | 4141 map->AppendDescriptor(&d); |
4117 } | 4142 } |
4118 } | 4143 } |
4119 | 4144 |
4120 return true; | 4145 return true; |
4121 } | 4146 } |
4122 | 4147 |
4123 | 4148 |
4124 bool Genesis::InstallExperimentalNatives() { | 4149 bool Genesis::InstallExperimentalNatives() { |
4125 static const char* harmony_tailcalls_natives[] = {nullptr}; | 4150 static const char* harmony_tailcalls_natives[] = {nullptr}; |
4126 static const char* harmony_sharedarraybuffer_natives[] = { | 4151 static const char* harmony_sharedarraybuffer_natives[] = {nullptr}; |
4127 "native harmony-atomics.js", NULL}; | |
4128 static const char* harmony_do_expressions_natives[] = {nullptr}; | 4152 static const char* harmony_do_expressions_natives[] = {nullptr}; |
4129 static const char* harmony_regexp_lookbehind_natives[] = {nullptr}; | 4153 static const char* harmony_regexp_lookbehind_natives[] = {nullptr}; |
4130 static const char* harmony_regexp_named_captures_natives[] = {nullptr}; | 4154 static const char* harmony_regexp_named_captures_natives[] = {nullptr}; |
4131 static const char* harmony_regexp_property_natives[] = {nullptr}; | 4155 static const char* harmony_regexp_property_natives[] = {nullptr}; |
4132 static const char* harmony_function_sent_natives[] = {nullptr}; | 4156 static const char* harmony_function_sent_natives[] = {nullptr}; |
4133 static const char* harmony_array_prototype_values_natives[] = {nullptr}; | 4157 static const char* harmony_array_prototype_values_natives[] = {nullptr}; |
4134 #ifdef V8_I18N_SUPPORT | 4158 #ifdef V8_I18N_SUPPORT |
4135 static const char* icu_case_mapping_natives[] = {nullptr}; | 4159 static const char* icu_case_mapping_natives[] = {nullptr}; |
4136 static const char* datetime_format_to_parts_natives[] = {nullptr}; | 4160 static const char* datetime_format_to_parts_natives[] = {nullptr}; |
4137 #endif | 4161 #endif |
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4889 } | 4913 } |
4890 | 4914 |
4891 | 4915 |
4892 // Called when the top-level V8 mutex is destroyed. | 4916 // Called when the top-level V8 mutex is destroyed. |
4893 void Bootstrapper::FreeThreadResources() { | 4917 void Bootstrapper::FreeThreadResources() { |
4894 DCHECK(!IsActive()); | 4918 DCHECK(!IsActive()); |
4895 } | 4919 } |
4896 | 4920 |
4897 } // namespace internal | 4921 } // namespace internal |
4898 } // namespace v8 | 4922 } // namespace v8 |
OLD | NEW |