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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
9 #include "src/debug/debug-evaluate.h" | 9 #include "src/debug/debug-evaluate.h" |
10 #include "src/debug/debug-frames.h" | 10 #include "src/debug/debug-frames.h" |
(...skipping 1878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1889 int id = isolate->debug()->NextAsyncTaskId(promise); | 1889 int id = isolate->debug()->NextAsyncTaskId(promise); |
1890 Handle<Symbol> async_stack_id_symbol = | 1890 Handle<Symbol> async_stack_id_symbol = |
1891 isolate->factory()->promise_async_stack_id_symbol(); | 1891 isolate->factory()->promise_async_stack_id_symbol(); |
1892 JSObject::SetProperty(promise, async_stack_id_symbol, | 1892 JSObject::SetProperty(promise, async_stack_id_symbol, |
1893 handle(Smi::FromInt(id), isolate), STRICT) | 1893 handle(Smi::FromInt(id), isolate), STRICT) |
1894 .Assert(); | 1894 .Assert(); |
1895 isolate->debug()->OnAsyncTaskEvent(debug::kDebugEnqueueAsyncFunction, id); | 1895 isolate->debug()->OnAsyncTaskEvent(debug::kDebugEnqueueAsyncFunction, id); |
1896 return isolate->heap()->undefined_value(); | 1896 return isolate->heap()->undefined_value(); |
1897 } | 1897 } |
1898 | 1898 |
| 1899 RUNTIME_FUNCTION(Runtime_DebugPromiseReject) { |
| 1900 HandleScope scope(isolate); |
| 1901 DCHECK_EQ(2, args.length()); |
| 1902 CONVERT_ARG_HANDLE_CHECKED(JSPromise, rejected_promise, 0); |
| 1903 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); |
| 1904 |
| 1905 isolate->debug()->OnPromiseReject(rejected_promise, value); |
| 1906 return isolate->heap()->undefined_value(); |
| 1907 } |
| 1908 |
1899 RUNTIME_FUNCTION(Runtime_DebugAsyncEventEnqueueRecurring) { | 1909 RUNTIME_FUNCTION(Runtime_DebugAsyncEventEnqueueRecurring) { |
1900 HandleScope scope(isolate); | 1910 HandleScope scope(isolate); |
1901 DCHECK_EQ(2, args.length()); | 1911 DCHECK_EQ(2, args.length()); |
1902 CONVERT_ARG_HANDLE_CHECKED(JSPromise, promise, 0); | 1912 CONVERT_ARG_HANDLE_CHECKED(JSPromise, promise, 0); |
1903 CONVERT_SMI_ARG_CHECKED(status, 1); | 1913 CONVERT_SMI_ARG_CHECKED(status, 1); |
1904 if (isolate->debug()->is_active()) { | 1914 if (isolate->debug()->is_active()) { |
1905 isolate->debug()->OnAsyncTaskEvent( | 1915 isolate->debug()->OnAsyncTaskEvent( |
1906 status == v8::Promise::kFulfilled ? debug::kDebugEnqueuePromiseResolve | 1916 status == v8::Promise::kFulfilled ? debug::kDebugEnqueuePromiseResolve |
1907 : debug::kDebugEnqueuePromiseReject, | 1917 : debug::kDebugEnqueuePromiseReject, |
1908 isolate->debug()->NextAsyncTaskId(promise)); | 1918 isolate->debug()->NextAsyncTaskId(promise)); |
1909 } | 1919 } |
1910 return isolate->heap()->undefined_value(); | 1920 return isolate->heap()->undefined_value(); |
1911 } | 1921 } |
1912 | 1922 |
1913 RUNTIME_FUNCTION(Runtime_DebugIsActive) { | 1923 RUNTIME_FUNCTION(Runtime_DebugIsActive) { |
1914 SealHandleScope shs(isolate); | 1924 SealHandleScope shs(isolate); |
1915 return Smi::FromInt(isolate->debug()->is_active()); | 1925 return Smi::FromInt(isolate->debug()->is_active()); |
1916 } | 1926 } |
1917 | 1927 |
1918 | 1928 |
1919 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { | 1929 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { |
1920 UNIMPLEMENTED(); | 1930 UNIMPLEMENTED(); |
1921 return NULL; | 1931 return NULL; |
1922 } | 1932 } |
1923 | 1933 |
1924 } // namespace internal | 1934 } // namespace internal |
1925 } // namespace v8 | 1935 } // namespace v8 |
OLD | NEW |