Commit 87ec1673 authored by gsathya's avatar gsathya Committed by Commit bot

[promises] Remove FulfillPromise

This patch replaces it with calls to the runtime function and PromiseSet.

This allows us to move PromiseReject to C++ without regressions.

BUG=v8:5343

Review-Url: https://codereview.chromium.org/2451133002
Cr-Commit-Position: refs/heads/master@{#40589}
parent 35e4a03f
......@@ -142,11 +142,6 @@ function PromiseInit(promise) {
return PromiseSet(promise, kPending, UNDEFINED);
}
function FulfillPromise(promise, status, value, promiseQueue) {
%PromiseFulfill(promise, status, value, promiseQueue);
PromiseSet(promise, status, value);
}
function PromiseHandle(value, handler, deferred) {
var debug_is_active = DEBUG_IS_ACTIVE;
try {
......@@ -269,8 +264,9 @@ function ResolvePromise(promise, resolution) {
// This goes inside the if-else to save one symbol lookup in
// the slow path.
var thenableValue = GET_PRIVATE(resolution, promiseResultSymbol);
FulfillPromise(promise, kFulfilled, thenableValue,
%PromiseFulfill(promise, kFulfilled, thenableValue,
promiseFulfillReactionsSymbol);
PromiseSet(promise, kFulfilled, thenableValue);
SET_PRIVATE(promise, promiseHasHandlerSymbol, true);
return;
} else if (thenableState === kRejected) {
......@@ -298,8 +294,9 @@ function ResolvePromise(promise, resolution) {
return;
}
}
FulfillPromise(promise, kFulfilled, resolution,
promiseFulfillReactionsSymbol);
%PromiseFulfill(promise, kFulfilled, resolution,
promiseFulfillReactionsSymbol);
PromiseSet(promise, kFulfilled, resolution);
}
// ES#sec-rejectpromise
......@@ -318,7 +315,8 @@ function RejectPromise(promise, reason, debugEvent) {
%PromiseRejectEvent(promise, reason, debugEvent);
}
}
FulfillPromise(promise, kRejected, reason, promiseRejectReactionsSymbol)
%PromiseFulfill(promise, kRejected, reason, promiseRejectReactionsSymbol)
PromiseSet(promise, kRejected, reason);
}
// Export to bindings
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment