| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 #include "src/runtime/runtime-utils.h" | 4 #include "src/runtime/runtime-utils.h" |
| 5 | 5 |
| 6 #include "src/debug/debug.h" | 6 #include "src/debug/debug.h" |
| 7 #include "src/elements.h" | 7 #include "src/elements.h" |
| 8 #include "src/promise-utils.h" | 8 #include "src/promise-utils.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 CONVERT_ARG_HANDLE_CHECKED(JSPromise, promise, 0); | 177 CONVERT_ARG_HANDLE_CHECKED(JSPromise, promise, 0); |
| 178 CONVERT_ARG_HANDLE_CHECKED(Object, reason, 1); | 178 CONVERT_ARG_HANDLE_CHECKED(Object, reason, 1); |
| 179 CONVERT_BOOLEAN_ARG_CHECKED(debug_event, 2); | 179 CONVERT_BOOLEAN_ARG_CHECKED(debug_event, 2); |
| 180 | 180 |
| 181 PromiseRejectEvent(isolate, promise, promise, reason, debug_event); | 181 PromiseRejectEvent(isolate, promise, promise, reason, debug_event); |
| 182 PromiseFulfill(isolate, promise, v8::Promise::kRejected, reason); | 182 PromiseFulfill(isolate, promise, v8::Promise::kRejected, reason); |
| 183 | 183 |
| 184 return isolate->heap()->undefined_value(); | 184 return isolate->heap()->undefined_value(); |
| 185 } | 185 } |
| 186 | 186 |
| 187 RUNTIME_FUNCTION(Runtime_PromiseFulfill) { | |
| 188 DCHECK(args.length() == 3); | |
| 189 HandleScope scope(isolate); | |
| 190 CONVERT_ARG_HANDLE_CHECKED(JSPromise, promise, 0); | |
| 191 CONVERT_SMI_ARG_CHECKED(status, 1); | |
| 192 CONVERT_ARG_HANDLE_CHECKED(Object, value, 2); | |
| 193 PromiseFulfill(isolate, promise, status, value); | |
| 194 return isolate->heap()->undefined_value(); | |
| 195 } | |
| 196 | |
| 197 RUNTIME_FUNCTION(Runtime_EnqueuePromiseReactionJob) { | 187 RUNTIME_FUNCTION(Runtime_EnqueuePromiseReactionJob) { |
| 198 HandleScope scope(isolate); | 188 HandleScope scope(isolate); |
| 199 DCHECK(args.length() == 2); | 189 DCHECK(args.length() == 2); |
| 200 CONVERT_ARG_HANDLE_CHECKED(PromiseReactionJobInfo, info, 0); | 190 CONVERT_ARG_HANDLE_CHECKED(PromiseReactionJobInfo, info, 0); |
| 201 CONVERT_SMI_ARG_CHECKED(status, 1); | 191 CONVERT_SMI_ARG_CHECKED(status, 1); |
| 202 EnqueuePromiseReactionJob(isolate, info, status); | 192 EnqueuePromiseReactionJob(isolate, info, status); |
| 203 return isolate->heap()->undefined_value(); | 193 return isolate->heap()->undefined_value(); |
| 204 } | 194 } |
| 205 | 195 |
| 206 RUNTIME_FUNCTION(Runtime_EnqueuePromiseResolveThenableJob) { | 196 RUNTIME_FUNCTION(Runtime_EnqueuePromiseResolveThenableJob) { |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 HandleScope scope(isolate); | 319 HandleScope scope(isolate); |
| 330 DCHECK_EQ(1, args.length()); | 320 DCHECK_EQ(1, args.length()); |
| 331 CONVERT_ARG_HANDLE_CHECKED(JSPromise, promise, 0); | 321 CONVERT_ARG_HANDLE_CHECKED(JSPromise, promise, 0); |
| 332 isolate->RunPromiseHook(PromiseHookType::kAfter, promise, | 322 isolate->RunPromiseHook(PromiseHookType::kAfter, promise, |
| 333 isolate->factory()->undefined_value()); | 323 isolate->factory()->undefined_value()); |
| 334 return isolate->heap()->undefined_value(); | 324 return isolate->heap()->undefined_value(); |
| 335 } | 325 } |
| 336 | 326 |
| 337 } // namespace internal | 327 } // namespace internal |
| 338 } // namespace v8 | 328 } // namespace v8 |
| OLD | NEW |