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

Unified Diff: src/builtins/builtins-promise.cc

Issue 2633443002: [promisehook] Pass deferred promise to Before/After callback (Closed)
Patch Set: Remove adaptor 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/builtins/builtins.h ('k') | src/code-stub-assembler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins-promise.cc
diff --git a/src/builtins/builtins-promise.cc b/src/builtins/builtins-promise.cc
index 345625d6d098d09eeb7686658803da7bdbcfa046..72b9101cc1b91324e0109c2c575f5382ac955ee4 100644
--- a/src/builtins/builtins-promise.cc
+++ b/src/builtins/builtins-promise.cc
@@ -569,10 +569,10 @@ Node* PromiseBuiltinsAssembler::InternalPerformPromiseThen(
&reject);
Node* info = AllocatePromiseReactionJobInfo(
- promise, result, var_on_resolve.value(), deferred_promise,
- deferred_on_resolve, deferred_on_reject, context);
+ result, var_on_resolve.value(), deferred_promise, deferred_on_resolve,
+ deferred_on_reject, context);
// TODO(gsathya): Move this to TF
- CallRuntime(Runtime::kEnqueuePromiseReactionJob, context, info,
+ CallRuntime(Runtime::kEnqueuePromiseReactionJob, context, promise, info,
SmiConstant(v8::Promise::kFulfilled));
Goto(&out);
@@ -589,11 +589,11 @@ Node* PromiseBuiltinsAssembler::InternalPerformPromiseThen(
Bind(&enqueue);
{
Node* info = AllocatePromiseReactionJobInfo(
- promise, result, var_on_reject.value(), deferred_promise,
+ result, var_on_reject.value(), deferred_promise,
deferred_on_resolve, deferred_on_reject, context);
// TODO(gsathya): Move this to TF
- CallRuntime(Runtime::kEnqueuePromiseReactionJob, context, info,
- SmiConstant(v8::Promise::kRejected));
+ CallRuntime(Runtime::kEnqueuePromiseReactionJob, context, promise,
+ info, SmiConstant(v8::Promise::kRejected));
Goto(&out);
}
}
@@ -873,10 +873,11 @@ void PromiseBuiltinsAssembler::PromiseFulfill(
LoadObjectField(promise, JSPromise::kDeferredOnRejectOffset);
Node* const info = AllocatePromiseReactionJobInfo(
- promise, result, tasks, deferred_promise, deferred_on_resolve,
- deferred_on_reject, context);
+ result, tasks, deferred_promise, deferred_on_resolve, deferred_on_reject,
+ context);
- CallRuntime(Runtime::kEnqueuePromiseReactionJob, context, info, status_smi);
+ CallRuntime(Runtime::kEnqueuePromiseReactionJob, context, promise, info,
+ status_smi);
Goto(&debug_async_event_enqueue_recurring);
Bind(&debug_async_event_enqueue_recurring);
@@ -1169,13 +1170,12 @@ TF_BUILTIN(PromiseHandleReject, PromiseBuiltinsAssembler) {
}
TF_BUILTIN(PromiseHandle, PromiseBuiltinsAssembler) {
- Node* const promise = Parameter(1);
- Node* const value = Parameter(2);
- Node* const handler = Parameter(3);
- Node* const deferred_promise = Parameter(4);
- Node* const deferred_on_resolve = Parameter(5);
- Node* const deferred_on_reject = Parameter(6);
- Node* const context = Parameter(9);
+ Node* const value = Parameter(1);
+ Node* const handler = Parameter(2);
+ Node* const deferred_promise = Parameter(3);
+ Node* const deferred_on_resolve = Parameter(4);
+ Node* const deferred_on_reject = Parameter(5);
+ Node* const context = Parameter(8);
Isolate* isolate = this->isolate();
Variable var_reason(this, MachineRepresentation::kTagged);
@@ -1191,7 +1191,7 @@ TF_BUILTIN(PromiseHandle, PromiseBuiltinsAssembler) {
Bind(&promisehook_before);
{
GotoUnless(IsPromiseHookEnabled(), &run_handler);
- CallRuntime(Runtime::kPromiseHookBefore, context, promise);
+ CallRuntime(Runtime::kPromiseHookBefore, context, deferred_promise);
Goto(&run_handler);
}
@@ -1232,7 +1232,7 @@ TF_BUILTIN(PromiseHandle, PromiseBuiltinsAssembler) {
Bind(&promisehook_after);
{
GotoUnless(IsPromiseHookEnabled(), &debug_pop);
- CallRuntime(Runtime::kPromiseHookAfter, context, promise);
+ CallRuntime(Runtime::kPromiseHookAfter, context, deferred_promise);
Goto(&debug_pop);
}
« no previous file with comments | « src/builtins/builtins.h ('k') | src/code-stub-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698