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

Unified Diff: src/objects.h

Issue 2314903004: [promises] Move PromiseResolveThenableJob to c++ (Closed)
Patch Set: rebase Created 4 years, 3 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/js/promise.js ('k') | src/objects-debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 168dc0744e00ec8d2601cfa3ecfe657163f66773..3c8ff803304bb15be46d254ca62fdb7317d3cf71 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -396,6 +396,7 @@ const int kStubMinorKeyBits = kSmiValueSize - kStubMajorKeyBits - 1;
V(TYPE_FEEDBACK_INFO_TYPE) \
V(ALIASED_ARGUMENTS_ENTRY_TYPE) \
V(BOX_TYPE) \
+ V(PROMISE_CONTAINER_TYPE) \
V(PROTOTYPE_INFO_TYPE) \
V(CONTEXT_EXTENSION_TYPE) \
V(MODULE_TYPE) \
@@ -500,6 +501,7 @@ const int kStubMinorKeyBits = kSmiValueSize - kStubMajorKeyBits - 1;
// manually.
#define STRUCT_LIST(V) \
V(BOX, Box, box) \
+ V(PROMISE_CONTAINER, PromiseContainer, promise_container) \
V(ACCESSOR_INFO, AccessorInfo, accessor_info) \
V(ACCESSOR_PAIR, AccessorPair, accessor_pair) \
V(ACCESS_CHECK_INFO, AccessCheckInfo, access_check_info) \
@@ -681,6 +683,7 @@ enum InstanceType {
TYPE_FEEDBACK_INFO_TYPE,
ALIASED_ARGUMENTS_ENTRY_TYPE,
BOX_TYPE,
+ PROMISE_CONTAINER_TYPE,
DEBUG_INFO_TYPE,
BREAK_POINT_INFO_TYPE,
FIXED_ARRAY_TYPE,
@@ -6640,6 +6643,34 @@ class Struct: public HeapObject {
DECLARE_CAST(Struct)
};
+// A container struct to hold state required for
+// PromiseResolveThenableJob. {before, after}_debug_event could
+// potentially be undefined if the debugger is turned off.
+class PromiseContainer : public Struct {
+ public:
+ DECL_ACCESSORS(thenable, JSReceiver)
+ DECL_ACCESSORS(then, JSFunction)
+ DECL_ACCESSORS(resolve, JSFunction)
+ DECL_ACCESSORS(reject, JSFunction)
+ DECL_ACCESSORS(before_debug_event, Object)
+ DECL_ACCESSORS(after_debug_event, Object)
+
+ static const int kThenableOffset = Struct::kHeaderSize;
+ static const int kThenOffset = kThenableOffset + kPointerSize;
+ static const int kResolveOffset = kThenOffset + kPointerSize;
+ static const int kRejectOffset = kResolveOffset + kPointerSize;
+ static const int kBeforeDebugEventOffset = kRejectOffset + kPointerSize;
+ static const int kAfterDebugEventOffset =
+ kBeforeDebugEventOffset + kPointerSize;
+ static const int kSize = kAfterDebugEventOffset + kPointerSize;
+
+ DECLARE_CAST(PromiseContainer)
+ DECLARE_PRINTER(PromiseContainer)
+ DECLARE_VERIFIER(PromiseContainer)
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(PromiseContainer);
+};
// A simple one-element struct, useful where smis need to be boxed.
class Box : public Struct {
« no previous file with comments | « src/js/promise.js ('k') | src/objects-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698