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 1884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1895 { // Internal: IsPromise | 1895 { // Internal: IsPromise |
1896 Handle<JSFunction> function = SimpleCreateFunction( | 1896 Handle<JSFunction> function = SimpleCreateFunction( |
1897 isolate, factory->empty_string(), Builtins::kIsPromise, 1, false); | 1897 isolate, factory->empty_string(), Builtins::kIsPromise, 1, false); |
1898 InstallWithIntrinsicDefaultProto(isolate, function, | 1898 InstallWithIntrinsicDefaultProto(isolate, function, |
1899 Context::IS_PROMISE_INDEX); | 1899 Context::IS_PROMISE_INDEX); |
1900 } | 1900 } |
1901 | 1901 |
1902 { // Internal: PerformPromiseThen | 1902 { // Internal: PerformPromiseThen |
1903 Handle<JSFunction> function = | 1903 Handle<JSFunction> function = |
1904 SimpleCreateFunction(isolate, factory->empty_string(), | 1904 SimpleCreateFunction(isolate, factory->empty_string(), |
1905 Builtins::kPerformPromiseThen, 4, false); | 1905 Builtins::kPerformPromiseThen, 4, true); |
1906 InstallWithIntrinsicDefaultProto(isolate, function, | 1906 InstallWithIntrinsicDefaultProto(isolate, function, |
1907 Context::PERFORM_PROMISE_THEN_INDEX); | 1907 Context::PERFORM_PROMISE_THEN_INDEX); |
1908 } | 1908 } |
1909 | 1909 |
1910 { // Internal: ResolvePromise | 1910 { // Internal: ResolvePromise |
1911 Handle<JSFunction> function = | 1911 Handle<JSFunction> function = SimpleCreateFunction( |
1912 SimpleCreateFunction(isolate, factory->empty_string(), | 1912 isolate, factory->empty_string(), Builtins::kResolvePromise, 2, true); |
1913 Builtins::kResolvePromise, 2, false); | |
1914 InstallWithIntrinsicDefaultProto(isolate, function, | 1913 InstallWithIntrinsicDefaultProto(isolate, function, |
1915 Context::PROMISE_RESOLVE_INDEX); | 1914 Context::PROMISE_RESOLVE_INDEX); |
1916 } | 1915 } |
1917 | 1916 |
| 1917 { // Internal: Promisehandle |
| 1918 Handle<JSFunction> function = SimpleCreateFunction( |
| 1919 isolate, factory->empty_string(), Builtins::kPromiseHandle, 3, true); |
| 1920 InstallWithIntrinsicDefaultProto(isolate, function, |
| 1921 Context::PROMISE_HANDLE_INDEX); |
| 1922 // Set up catch prediction |
| 1923 Handle<Code> promise_handle = isolate->builtins()->PromiseHandle(); |
| 1924 promise_handle->set_is_promise_rejection(true); |
| 1925 } |
| 1926 |
| 1927 { // Internal: Promisehandle |
| 1928 Handle<JSFunction> function = |
| 1929 SimpleCreateFunction(isolate, factory->empty_string(), |
| 1930 Builtins::kPromiseHandleReject, 3, true); |
| 1931 InstallWithIntrinsicDefaultProto(isolate, function, |
| 1932 Context::PROMISE_HANDLE_REJECT_INDEX); |
| 1933 // Set up catch prediction |
| 1934 Handle<Code> promise_handle = isolate->builtins()->PromiseHandleReject(); |
| 1935 promise_handle->set_is_exception_caught(true); |
| 1936 } |
| 1937 |
1918 { | 1938 { |
1919 Handle<Code> code = | 1939 Handle<Code> code = |
1920 handle(isolate->builtins()->builtin(Builtins::kPromiseResolveClosure), | 1940 handle(isolate->builtins()->builtin(Builtins::kPromiseResolveClosure), |
1921 isolate); | 1941 isolate); |
1922 Handle<SharedFunctionInfo> info = | 1942 Handle<SharedFunctionInfo> info = |
1923 factory->NewSharedFunctionInfo(factory->empty_string(), code, false); | 1943 factory->NewSharedFunctionInfo(factory->empty_string(), code, false); |
1924 info->set_internal_formal_parameter_count(1); | 1944 info->set_internal_formal_parameter_count(1); |
1925 info->set_length(1); | 1945 info->set_length(1); |
1926 native_context()->set_promise_resolve_shared_fun(*info); | 1946 native_context()->set_promise_resolve_shared_fun(*info); |
1927 | 1947 |
(...skipping 2726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4654 } | 4674 } |
4655 | 4675 |
4656 | 4676 |
4657 // Called when the top-level V8 mutex is destroyed. | 4677 // Called when the top-level V8 mutex is destroyed. |
4658 void Bootstrapper::FreeThreadResources() { | 4678 void Bootstrapper::FreeThreadResources() { |
4659 DCHECK(!IsActive()); | 4679 DCHECK(!IsActive()); |
4660 } | 4680 } |
4661 | 4681 |
4662 } // namespace internal | 4682 } // namespace internal |
4663 } // namespace v8 | 4683 } // namespace v8 |
OLD | NEW |