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