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

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

Issue 2578173004: [promisehook] Fire init hook for promise subclass (Closed)
Patch Set: add regression test Created 4 years 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 | « no previous file | test/cctest/test-api.cc » ('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 25c9cf225e0363189c1b5e74e2298828a7847914..e335e64a6911932f2624b175e05686b721dfdd45 100644
--- a/src/builtins/builtins-promise.cc
+++ b/src/builtins/builtins-promise.cc
@@ -672,7 +672,7 @@ TF_BUILTIN(PromiseConstructor, PromiseBuiltinsAssembler) {
Node* const is_debug_active = IsDebugActive();
Label if_targetisnotmodified(this),
if_targetismodified(this, Label::kDeferred), run_executor(this),
- debug_push(this, Label::kDeferred), init(this);
+ debug_push(this), init(this);
Branch(WordEqual(promise_fun, new_target), &if_targetisnotmodified,
&if_targetismodified);
@@ -685,9 +685,6 @@ TF_BUILTIN(PromiseConstructor, PromiseBuiltinsAssembler) {
{
Node* const instance = AllocateJSPromise(context);
var_result.Bind(instance);
- GotoUnless(IsPromiseHookEnabled(), &init);
- CallRuntime(Runtime::kPromiseHookInit, context, instance,
- UndefinedConstant());
Goto(&init);
}
@@ -704,11 +701,15 @@ TF_BUILTIN(PromiseConstructor, PromiseBuiltinsAssembler) {
Bind(&init);
{
PromiseInit(var_result.value());
- Branch(is_debug_active, &debug_push, &run_executor);
+ GotoUnless(IsPromiseHookEnabled(), &debug_push);
+ CallRuntime(Runtime::kPromiseHookInit, context, var_result.value(),
+ UndefinedConstant());
+ Goto(&debug_push);
}
Bind(&debug_push);
{
+ GotoUnless(is_debug_active, &run_executor);
CallRuntime(Runtime::kDebugPushPromise, context, var_result.value());
Goto(&run_executor);
}
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698