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

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

Issue 2630593004: [promises] Remove runtime call from fastpath in PromiseReject (Closed)
Patch Set: more cleanup 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
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 utils.OverrideFunction = OverrideFunction; 259 utils.OverrideFunction = OverrideFunction;
260 utils.SetUpLockedPrototype = SetUpLockedPrototype; 260 utils.SetUpLockedPrototype = SetUpLockedPrototype;
261 utils.PostNatives = PostNatives; 261 utils.PostNatives = PostNatives;
262 utils.PostExperimentals = PostExperimentals; 262 utils.PostExperimentals = PostExperimentals;
263 utils.PostDebug = PostDebug; 263 utils.PostDebug = PostDebug;
264 264
265 %ToFastProperties(utils); 265 %ToFastProperties(utils);
266 266
267 // ----------------------------------------------------------------------- 267 // -----------------------------------------------------------------------
268 268
269 %OptimizeObjectForAddingMultipleProperties(extrasUtils, 5); 269 function DoRejectPromise(promise, reason) {
270 %promise_internal_reject(promise, reason, true);
271 }
272
273 %InstallToContext([
274 "promise_reject", DoRejectPromise
adamk 2017/01/13 20:31:33 It looks to me like this is only used by api.cc, s
gsathya 2017/01/13 21:12:40 Done.
275 ]);
276
277 %OptimizeObjectForAddingMultipleProperties(extrasUtils, 7);
270 278
271 extrasUtils.logStackTrace = function logStackTrace() { 279 extrasUtils.logStackTrace = function logStackTrace() {
272 %DebugTrace(); 280 %DebugTrace();
273 }; 281 };
274 282
275 extrasUtils.log = function log() { 283 extrasUtils.log = function log() {
276 let message = ''; 284 let message = '';
277 for (const arg of arguments) { 285 for (const arg of arguments) {
278 message += arg; 286 message += arg;
279 } 287 }
(...skipping 20 matching lines...) Expand all
300 return %reflect_apply(func, thisArg, args); 308 return %reflect_apply(func, thisArg, args);
301 }; 309 };
302 }; 310 };
303 311
304 extrasUtils.uncurryThis = function uncurryThis(func) { 312 extrasUtils.uncurryThis = function uncurryThis(func) {
305 return function(thisArg, ...args) { 313 return function(thisArg, ...args) {
306 return %reflect_apply(func, thisArg, args); 314 return %reflect_apply(func, thisArg, args);
307 }; 315 };
308 }; 316 };
309 317
318 extrasUtils.rejectPromise = DoRejectPromise;
319
320 extrasUtils.markPromiseAsHandled = function(promise) {
adamk 2017/01/13 20:31:33 Make this function markPromiseAsHandled(...) to
gsathya 2017/01/13 21:12:40 Done.
321 %PromiseMarkAsHandled(promise);
322 };
323
310 %ToFastProperties(extrasUtils); 324 %ToFastProperties(extrasUtils);
311 325
312 }) 326 })
OLDNEW
« src/builtins/builtins-promise.cc ('K') | « src/js/async-await.js ('k') | src/js/promise.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698