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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 HandleScope scope(isolate); | 357 HandleScope scope(isolate); |
368 DCHECK_EQ(1, args.length()); | 358 DCHECK_EQ(1, args.length()); |
369 CONVERT_ARG_HANDLE_CHECKED(JSPromise, promise, 0); | 359 CONVERT_ARG_HANDLE_CHECKED(JSPromise, promise, 0); |
370 isolate->RunPromiseHook(PromiseHookType::kAfter, promise, | 360 isolate->RunPromiseHook(PromiseHookType::kAfter, promise, |
371 isolate->factory()->undefined_value()); | 361 isolate->factory()->undefined_value()); |
372 return isolate->heap()->undefined_value(); | 362 return isolate->heap()->undefined_value(); |
373 } | 363 } |
374 | 364 |
375 } // namespace internal | 365 } // namespace internal |
376 } // namespace v8 | 366 } // namespace v8 |
OLD | NEW |