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

Side by Side Diff: src/js/promise.js

Issue 2025073002: Promises: Make PromiseSet operation monomorphic (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 (function(global, utils, extrasUtils) { 5 (function(global, utils, extrasUtils) {
6 6
7 "use strict"; 7 "use strict";
8 8
9 %CheckIsBootstrapping(); 9 %CheckIsBootstrapping();
10 10
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 } 142 }
143 143
144 function FulfillPromise(promise, status, value, promiseQueue) { 144 function FulfillPromise(promise, status, value, promiseQueue) {
145 if (GET_PRIVATE(promise, promiseStateSymbol) === kPending) { 145 if (GET_PRIVATE(promise, promiseStateSymbol) === kPending) {
146 var tasks = GET_PRIVATE(promise, promiseQueue); 146 var tasks = GET_PRIVATE(promise, promiseQueue);
147 if (!IS_UNDEFINED(tasks)) { 147 if (!IS_UNDEFINED(tasks)) {
148 var tasks = GET_PRIVATE(promise, promiseQueue); 148 var tasks = GET_PRIVATE(promise, promiseQueue);
149 var deferreds = GET_PRIVATE(promise, promiseDeferredReactionsSymbol); 149 var deferreds = GET_PRIVATE(promise, promiseDeferredReactionsSymbol);
150 PromiseEnqueue(value, tasks, deferreds, status); 150 PromiseEnqueue(value, tasks, deferreds, status);
151 } 151 }
152 PromiseSet(promise, status, value); 152 SET_PRIVATE(promise, promiseStateSymbol, status);
153 SET_PRIVATE(promise, promiseResultSymbol, value);
153 } 154 }
154 } 155 }
155 156
156 function PromiseHandle(value, handler, deferred) { 157 function PromiseHandle(value, handler, deferred) {
157 var debug_is_active = DEBUG_IS_ACTIVE; 158 var debug_is_active = DEBUG_IS_ACTIVE;
158 try { 159 try {
159 if (debug_is_active) %DebugPushPromise(deferred.promise, PromiseHandle); 160 if (debug_is_active) %DebugPushPromise(deferred.promise, PromiseHandle);
160 var result = handler(value); 161 var result = handler(value);
161 deferred.resolve(result); 162 deferred.resolve(result);
162 } catch (exception) { 163 } catch (exception) {
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 to.PromiseChain = PromiseChain; 584 to.PromiseChain = PromiseChain;
584 to.PromiseDefer = PromiseDefer; 585 to.PromiseDefer = PromiseDefer;
585 to.PromiseAccept = PromiseAccept; 586 to.PromiseAccept = PromiseAccept;
586 587
587 to.PromiseCreateRejected = PromiseCreateRejected; 588 to.PromiseCreateRejected = PromiseCreateRejected;
588 to.PromiseCreateResolved = PromiseCreateResolved; 589 to.PromiseCreateResolved = PromiseCreateResolved;
589 to.PromiseThen = PromiseThen; 590 to.PromiseThen = PromiseThen;
590 }); 591 });
591 592
592 }) 593 })
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698