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

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

Issue 2578173004: [promisehook] Fire init hook for promise subclass (Closed)
Patch Set: use jspromise 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 46f6043bd3c85350d81ea25da6940d0219a4b0ef..9811c19a3b47934c251ecd85ebc2e8021d54c239 100644
--- a/src/builtins/builtins-promise.cc
+++ b/src/builtins/builtins-promise.cc
@@ -612,7 +612,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);
Dan Ehrenberg 2016/12/28 18:14:42 What is this change for?
gsathya 2016/12/28 18:59:38 The debug_push block is always visited with this c
Branch(WordEqual(promise_fun, new_target), &if_targetisnotmodified,
&if_targetismodified);
@@ -625,9 +625,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);
}
@@ -644,11 +641,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