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

Unified Diff: src/isolate.cc

Issue 2415023002: [promises] Move async debug event creation to c++ (Closed)
Patch Set: rebase Created 4 years, 2 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/heap-symbols.h ('k') | src/js/async-await.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index cbde8ac562bd515f706e639f4f2710a068f94463..646842653baf39fb2a78d5d86b8b142ba429eb0b 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -3076,26 +3076,31 @@ void Isolate::ReportPromiseReject(Handle<JSObject> promise,
namespace {
class PromiseDebugEventScope {
public:
- PromiseDebugEventScope(Isolate* isolate, Object* before, Object* after)
+ PromiseDebugEventScope(Isolate* isolate, Object* id, Object* name)
: isolate_(isolate),
- after_(after, isolate_),
- is_debug_active_(isolate_->debug()->is_active() &&
- before->IsJSObject() && after->IsJSObject()) {
+ id_(id, isolate_),
+ name_(name, isolate_),
+ is_debug_active_(isolate_->debug()->is_active() && id_->IsNumber() &&
+ name_->IsString()) {
if (is_debug_active_) {
isolate_->debug()->OnAsyncTaskEvent(
- handle(JSObject::cast(before), isolate_));
+ isolate_->factory()->will_handle_string(), id_,
+ Handle<String>::cast(name_));
}
}
~PromiseDebugEventScope() {
if (is_debug_active_) {
- isolate_->debug()->OnAsyncTaskEvent(Handle<JSObject>::cast(after_));
+ isolate_->debug()->OnAsyncTaskEvent(
+ isolate_->factory()->did_handle_string(), id_,
+ Handle<String>::cast(name_));
}
}
private:
Isolate* isolate_;
- Handle<Object> after_;
+ Handle<Object> id_;
+ Handle<Object> name_;
bool is_debug_active_;
};
} // namespace
@@ -3103,8 +3108,7 @@ class PromiseDebugEventScope {
void Isolate::PromiseReactionJob(Handle<PromiseReactionJobInfo> info,
MaybeHandle<Object>* result,
MaybeHandle<Object>* maybe_exception) {
- PromiseDebugEventScope helper(this, info->before_debug_event(),
- info->after_debug_event());
+ PromiseDebugEventScope helper(this, info->debug_id(), info->debug_name());
Handle<Object> value(info->value(), this);
Handle<Object> tasks(info->tasks(), this);
@@ -3145,8 +3149,7 @@ void Isolate::PromiseReactionJob(Handle<PromiseReactionJobInfo> info,
void Isolate::PromiseResolveThenableJob(
Handle<PromiseResolveThenableJobInfo> info, MaybeHandle<Object>* result,
MaybeHandle<Object>* maybe_exception) {
- PromiseDebugEventScope helper(this, info->before_debug_event(),
- info->after_debug_event());
+ PromiseDebugEventScope helper(this, info->debug_id(), info->debug_name());
Handle<JSReceiver> thenable(info->thenable(), this);
Handle<JSFunction> resolve(info->resolve(), this);
« no previous file with comments | « src/heap-symbols.h ('k') | src/js/async-await.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698