| 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 1875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1886 DCHECK_EQ(1, args.length()); | 1886 DCHECK_EQ(1, args.length()); |
| 1887 HandleScope scope(isolate); | 1887 HandleScope scope(isolate); |
| 1888 CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0); | 1888 CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0); |
| 1889 isolate->PushPromise(promise); | 1889 isolate->PushPromise(promise); |
| 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::kDebugEnqueueRecurring, id, | 1896 isolate->debug()->OnAsyncTaskEvent(debug::kDebugEnqueueAsyncFunction, id); |
| 1897 kDebugAsyncFunction); | |
| 1898 return isolate->heap()->undefined_value(); | 1897 return isolate->heap()->undefined_value(); |
| 1899 } | 1898 } |
| 1900 | 1899 |
| 1901 RUNTIME_FUNCTION(Runtime_DebugAsyncEventEnqueueRecurring) { | 1900 RUNTIME_FUNCTION(Runtime_DebugAsyncEventEnqueueRecurring) { |
| 1902 HandleScope scope(isolate); | 1901 HandleScope scope(isolate); |
| 1903 DCHECK_EQ(2, args.length()); | 1902 DCHECK_EQ(2, args.length()); |
| 1904 CONVERT_ARG_HANDLE_CHECKED(JSPromise, promise, 0); | 1903 CONVERT_ARG_HANDLE_CHECKED(JSPromise, promise, 0); |
| 1905 CONVERT_SMI_ARG_CHECKED(status, 1); | 1904 CONVERT_SMI_ARG_CHECKED(status, 1); |
| 1906 if (isolate->debug()->is_active()) { | 1905 if (isolate->debug()->is_active()) { |
| 1907 isolate->debug()->OnAsyncTaskEvent( | 1906 isolate->debug()->OnAsyncTaskEvent( |
| 1908 debug::kDebugEnqueueRecurring, | 1907 status == v8::Promise::kFulfilled ? debug::kDebugEnqueuePromiseResolve |
| 1909 isolate->debug()->NextAsyncTaskId(promise), | 1908 : debug::kDebugEnqueuePromiseReject, |
| 1910 status == v8::Promise::kFulfilled ? kDebugPromiseResolve | 1909 isolate->debug()->NextAsyncTaskId(promise)); |
| 1911 : kDebugPromiseReject); | |
| 1912 } | 1910 } |
| 1913 return isolate->heap()->undefined_value(); | 1911 return isolate->heap()->undefined_value(); |
| 1914 } | 1912 } |
| 1915 | 1913 |
| 1916 RUNTIME_FUNCTION(Runtime_DebugIsActive) { | 1914 RUNTIME_FUNCTION(Runtime_DebugIsActive) { |
| 1917 SealHandleScope shs(isolate); | 1915 SealHandleScope shs(isolate); |
| 1918 return Smi::FromInt(isolate->debug()->is_active()); | 1916 return Smi::FromInt(isolate->debug()->is_active()); |
| 1919 } | 1917 } |
| 1920 | 1918 |
| 1921 | 1919 |
| 1922 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { | 1920 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { |
| 1923 UNIMPLEMENTED(); | 1921 UNIMPLEMENTED(); |
| 1924 return NULL; | 1922 return NULL; |
| 1925 } | 1923 } |
| 1926 | 1924 |
| 1927 } // namespace internal | 1925 } // namespace internal |
| 1928 } // namespace v8 | 1926 } // namespace v8 |
| OLD | NEW |