Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1122)

Side by Side Diff: src/runtime/runtime-promise.cc

Issue 2614603003: [promises] Move PromiseFulfill to TF (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« src/builtins/builtins-promise.cc ('K') | « src/runtime/runtime.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« src/builtins/builtins-promise.cc ('K') | « src/runtime/runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698