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

Unified Diff: src/runtime/runtime-internal.cc

Issue 2450763002: [promises] remove PromiseEnqueue (Closed)
Patch Set: 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/runtime/runtime.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-internal.cc
diff --git a/src/runtime/runtime-internal.cc b/src/runtime/runtime-internal.cc
index 67b106182bc000f6ececee9798c8680ab2a35923..b9504527b6f6ff6bb25adef7847c76cd12921edf 100644
--- a/src/runtime/runtime-internal.cc
+++ b/src/runtime/runtime-internal.cc
@@ -11,6 +11,7 @@
#include "src/bootstrapper.h"
#include "src/conversions.h"
#include "src/debug/debug.h"
+#include "src/elements.h"
#include "src/frames-inl.h"
#include "src/isolate-inl.h"
#include "src/messages.h"
@@ -573,12 +574,30 @@ RUNTIME_FUNCTION(Runtime_GetAndResetRuntimeCallStats) {
RUNTIME_FUNCTION(Runtime_EnqueuePromiseReactionJob) {
HandleScope scope(isolate);
- DCHECK(args.length() == 5);
+ DCHECK(args.length() == 4);
CONVERT_ARG_HANDLE_CHECKED(Object, value, 0);
CONVERT_ARG_HANDLE_CHECKED(Object, tasks, 1);
CONVERT_ARG_HANDLE_CHECKED(Object, deferred, 2);
- CONVERT_ARG_HANDLE_CHECKED(Object, debug_id, 3);
- CONVERT_ARG_HANDLE_CHECKED(Object, debug_name, 4);
+ CONVERT_ARG_HANDLE_CHECKED(Object, status, 3);
+ Handle<Object> debug_id = isolate->factory()->undefined_value();
+ Handle<Object> debug_name = isolate->factory()->undefined_value();
+ if (isolate->debug()->is_active()) {
+ MaybeHandle<Object> maybe_result, maybe_exception;
adamk 2016/10/25 11:05:30 Looks like you don't use maybe_exception, so I'd j
gsathya 2016/10/25 11:12:30 Done.
+ Handle<Object> argv[] = {deferred, status};
+ maybe_result =
+ Execution::TryCall(isolate, isolate->promise_debug_get_info(),
+ isolate->factory()->undefined_value(),
+ arraysize(argv), argv, &maybe_exception);
+ Handle<Object> result;
+ if ((maybe_result).ToHandle(&result) && result->IsJSArray()) {
adamk 2016/10/25 11:05:30 No need for the parens around maybe_result. Can w
gsathya 2016/10/25 11:12:31 Done.
+ Handle<JSArray> array = Handle<JSArray>::cast(result);
+ ElementsAccessor* accessor = array->GetElementsAccessor();
+ DCHECK(accessor->HasElement(array, 0));
+ DCHECK(accessor->HasElement(array, 1));
+ debug_id = accessor->Get(array, 0);
+ debug_name = accessor->Get(array, 1);
+ }
+ }
Handle<PromiseReactionJobInfo> info =
isolate->factory()->NewPromiseReactionJobInfo(value, tasks, deferred,
debug_id, debug_name,
« no previous file with comments | « src/runtime/runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698