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

Unified Diff: src/promise-utils.h

Issue 2487053002: [promises] Remove one runtime call to create_resolving_functions (Closed)
Patch Set: add dcheck Created 4 years, 1 month 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/objects-printer.cc ('k') | src/promise-utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/promise-utils.h
diff --git a/src/promise-utils.h b/src/promise-utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..6ed6fcde5f2188c4668fc7330cb70613d5719c3b
--- /dev/null
+++ b/src/promise-utils.h
@@ -0,0 +1,32 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_PROMISE_UTILS_H_
+#define V8_PROMISE_UTILS_H_
+
+#include "src/objects.h"
+
+namespace v8 {
+namespace internal {
+
+// Helper methods for Promise builtins.
+class PromiseUtils : public AllStatic {
+ public:
+ // These get and set the slots on the PromiseResolvingContext, which
+ // is used by the resolve/reject promise callbacks.
+ static JSObject* GetPromise(Handle<Context> context);
+ static Object* GetDebugEvent(Handle<Context> context);
+ static bool HasAlreadyVisited(Handle<Context> context);
+ static void SetAlreadyVisited(Handle<Context> context);
+
+ static void CreateResolvingFunctions(Isolate* isolate,
+ Handle<JSObject> promise,
+ Handle<Object> debug_event,
+ Handle<JSFunction>* resolve,
+ Handle<JSFunction>* reject);
+};
+} // namespace internal
+} // namespace v8
+
+#endif // V8_PROMISE_UTILS_H_
« no previous file with comments | « src/objects-printer.cc ('k') | src/promise-utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698