summaryrefslogtreecommitdiff
path: root/chromium/v8/src/builtins/builtins-promise-gen.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-11-20 10:33:36 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-11-22 11:45:12 +0000
commitbe59a35641616a4cf23c4a13fa0632624b021c1b (patch)
tree9da183258bdf9cc413f7562079d25ace6955467f /chromium/v8/src/builtins/builtins-promise-gen.h
parentd702e4b6a64574e97fc7df8fe3238cde70242080 (diff)
downloadqtwebengine-chromium-be59a35641616a4cf23c4a13fa0632624b021c1b.tar.gz
BASELINE: Update Chromium to 62.0.3202.101
Change-Id: I2d5eca8117600df6d331f6166ab24d943d9814ac Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/v8/src/builtins/builtins-promise-gen.h')
-rw-r--r--chromium/v8/src/builtins/builtins-promise-gen.h33
1 files changed, 21 insertions, 12 deletions
diff --git a/chromium/v8/src/builtins/builtins-promise-gen.h b/chromium/v8/src/builtins/builtins-promise-gen.h
index 997933e10ba..5240da182d6 100644
--- a/chromium/v8/src/builtins/builtins-promise-gen.h
+++ b/chromium/v8/src/builtins/builtins-promise-gen.h
@@ -55,16 +55,23 @@ class PromiseBuiltinsAssembler : public CodeStubAssembler {
kCapabilitiesContextLength,
};
- // This is used by the PromiseThenFinally and PromiseCatchFinally
- // builtins to store the onFinally in the onFinallySlot.
- //
- // This is also used by the PromiseValueThunkFinally to store the
- // value in the onFinallySlot and PromiseThrowerFinally to store the
- // reason in the onFinallySlot.
+ // This is used by the Promise.prototype.finally builtin to store
+ // onFinally callback and the Promise constructor.
+ // TODO(gsathya): Add extra slot for Promise constructor.
+ // TODO(gsathya): For native promises we can create a variant of
+ // this without extra space for the constructor to save memory.
enum PromiseFinallyContextSlot {
kOnFinallySlot = Context::MIN_CONTEXT_SLOTS,
- kOnFinallyContextLength,
+ kPromiseFinallyContextLength,
+ };
+
+ // This is used by the ThenFinally and CatchFinally builtins to
+ // store the value to return or reason to throw.
+ enum PromiseValueThunkOrReasonContextSlot {
+ kValueSlot = Context::MIN_CONTEXT_SLOTS,
+
+ kPromiseValueThunkOrReasonContextLength,
};
explicit PromiseBuiltinsAssembler(compiler::CodeAssemblerState* state)
@@ -81,7 +88,8 @@ class PromiseBuiltinsAssembler : public CodeStubAssembler {
// This allocates and initializes a promise with the given state and
// fields.
- Node* AllocateAndSetJSPromise(Node* context, Node* status, Node* result);
+ Node* AllocateAndSetJSPromise(Node* context, v8::Promise::PromiseState status,
+ Node* result);
Node* AllocatePromiseResolveThenableJobInfo(Node* result, Node* then,
Node* resolve, Node* reject,
@@ -149,12 +157,8 @@ class PromiseBuiltinsAssembler : public CodeStubAssembler {
Node* debug_event);
std::pair<Node*, Node*> CreatePromiseFinallyFunctions(Node* on_finally,
Node* native_context);
- Node* CreatePromiseFinallyContext(Node* on_finally, Node* native_context);
-
Node* CreateValueThunkFunction(Node* value, Node* native_context);
- Node* CreateValueThunkFunctionContext(Node* value, Node* native_context);
- Node* CreateThrowerFunctionContext(Node* reason, Node* native_context);
Node* CreateThrowerFunction(Node* reason, Node* native_context);
Node* PerformPromiseAll(Node* context, Node* constructor, Node* capability,
@@ -174,7 +178,12 @@ class PromiseBuiltinsAssembler : public CodeStubAssembler {
void SetPromiseHandledByIfTrue(Node* context, Node* condition, Node* promise,
const NodeGenerator& handled_by);
+ Node* PromiseStatus(Node* promise);
+
private:
+ Node* IsPromiseStatus(Node* actual, v8::Promise::PromiseState expected);
+ void PromiseSetStatus(Node* promise, v8::Promise::PromiseState status);
+
Node* AllocateJSPromise(Node* context);
};