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

Side by Side Diff: src/objects.h

Issue 2567333002: [promises] port NewPromiseCapability to TF (Closed)
Patch Set: Make gcmole happy Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « src/js/promise.js ('k') | src/objects-body-descriptors-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 V(JS_ARRAY_TYPE) \ 415 V(JS_ARRAY_TYPE) \
416 V(JS_ARRAY_BUFFER_TYPE) \ 416 V(JS_ARRAY_BUFFER_TYPE) \
417 V(JS_TYPED_ARRAY_TYPE) \ 417 V(JS_TYPED_ARRAY_TYPE) \
418 V(JS_DATA_VIEW_TYPE) \ 418 V(JS_DATA_VIEW_TYPE) \
419 V(JS_SET_TYPE) \ 419 V(JS_SET_TYPE) \
420 V(JS_MAP_TYPE) \ 420 V(JS_MAP_TYPE) \
421 V(JS_SET_ITERATOR_TYPE) \ 421 V(JS_SET_ITERATOR_TYPE) \
422 V(JS_MAP_ITERATOR_TYPE) \ 422 V(JS_MAP_ITERATOR_TYPE) \
423 V(JS_WEAK_MAP_TYPE) \ 423 V(JS_WEAK_MAP_TYPE) \
424 V(JS_WEAK_SET_TYPE) \ 424 V(JS_WEAK_SET_TYPE) \
425 V(JS_PROMISE_CAPABILITY_TYPE) \
425 V(JS_PROMISE_TYPE) \ 426 V(JS_PROMISE_TYPE) \
426 V(JS_REGEXP_TYPE) \ 427 V(JS_REGEXP_TYPE) \
427 V(JS_ERROR_TYPE) \ 428 V(JS_ERROR_TYPE) \
428 V(JS_STRING_ITERATOR_TYPE) \ 429 V(JS_STRING_ITERATOR_TYPE) \
429 \ 430 \
430 V(JS_TYPED_ARRAY_KEY_ITERATOR_TYPE) \ 431 V(JS_TYPED_ARRAY_KEY_ITERATOR_TYPE) \
431 V(JS_FAST_ARRAY_KEY_ITERATOR_TYPE) \ 432 V(JS_FAST_ARRAY_KEY_ITERATOR_TYPE) \
432 V(JS_GENERIC_ARRAY_KEY_ITERATOR_TYPE) \ 433 V(JS_GENERIC_ARRAY_KEY_ITERATOR_TYPE) \
433 \ 434 \
434 V(JS_UINT8_ARRAY_KEY_VALUE_ITERATOR_TYPE) \ 435 V(JS_UINT8_ARRAY_KEY_VALUE_ITERATOR_TYPE) \
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 JS_ARRAY_TYPE, 761 JS_ARRAY_TYPE,
761 JS_ARRAY_BUFFER_TYPE, 762 JS_ARRAY_BUFFER_TYPE,
762 JS_TYPED_ARRAY_TYPE, 763 JS_TYPED_ARRAY_TYPE,
763 JS_DATA_VIEW_TYPE, 764 JS_DATA_VIEW_TYPE,
764 JS_SET_TYPE, 765 JS_SET_TYPE,
765 JS_MAP_TYPE, 766 JS_MAP_TYPE,
766 JS_SET_ITERATOR_TYPE, 767 JS_SET_ITERATOR_TYPE,
767 JS_MAP_ITERATOR_TYPE, 768 JS_MAP_ITERATOR_TYPE,
768 JS_WEAK_MAP_TYPE, 769 JS_WEAK_MAP_TYPE,
769 JS_WEAK_SET_TYPE, 770 JS_WEAK_SET_TYPE,
771 JS_PROMISE_CAPABILITY_TYPE,
770 JS_PROMISE_TYPE, 772 JS_PROMISE_TYPE,
771 JS_REGEXP_TYPE, 773 JS_REGEXP_TYPE,
772 JS_ERROR_TYPE, 774 JS_ERROR_TYPE,
773 JS_STRING_ITERATOR_TYPE, 775 JS_STRING_ITERATOR_TYPE,
774 776
775 JS_TYPED_ARRAY_KEY_ITERATOR_TYPE, 777 JS_TYPED_ARRAY_KEY_ITERATOR_TYPE,
776 JS_FAST_ARRAY_KEY_ITERATOR_TYPE, 778 JS_FAST_ARRAY_KEY_ITERATOR_TYPE,
777 JS_GENERIC_ARRAY_KEY_ITERATOR_TYPE, 779 JS_GENERIC_ARRAY_KEY_ITERATOR_TYPE,
778 780
779 JS_UINT8_ARRAY_KEY_VALUE_ITERATOR_TYPE, 781 JS_UINT8_ARRAY_KEY_VALUE_ITERATOR_TYPE,
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 V(Boolean) \ 1084 V(Boolean) \
1083 V(JSArray) \ 1085 V(JSArray) \
1084 V(JSArrayBuffer) \ 1086 V(JSArrayBuffer) \
1085 V(JSArrayBufferView) \ 1087 V(JSArrayBufferView) \
1086 V(JSCollection) \ 1088 V(JSCollection) \
1087 V(JSTypedArray) \ 1089 V(JSTypedArray) \
1088 V(JSArrayIterator) \ 1090 V(JSArrayIterator) \
1089 V(JSDataView) \ 1091 V(JSDataView) \
1090 V(JSProxy) \ 1092 V(JSProxy) \
1091 V(JSError) \ 1093 V(JSError) \
1094 V(JSPromiseCapability) \
1092 V(JSPromise) \ 1095 V(JSPromise) \
1093 V(JSStringIterator) \ 1096 V(JSStringIterator) \
1094 V(JSSet) \ 1097 V(JSSet) \
1095 V(JSMap) \ 1098 V(JSMap) \
1096 V(JSSetIterator) \ 1099 V(JSSetIterator) \
1097 V(JSMapIterator) \ 1100 V(JSMapIterator) \
1098 V(JSWeakCollection) \ 1101 V(JSWeakCollection) \
1099 V(JSWeakMap) \ 1102 V(JSWeakMap) \
1100 V(JSWeakSet) \ 1103 V(JSWeakSet) \
1101 V(JSRegExp) \ 1104 V(JSRegExp) \
(...skipping 7529 matching lines...) Expand 10 before | Expand all | Expand 10 after
8631 static const int kStartPositionOffset = kStackFramesOffset + kPointerSize; 8634 static const int kStartPositionOffset = kStackFramesOffset + kPointerSize;
8632 static const int kEndPositionOffset = kStartPositionOffset + kPointerSize; 8635 static const int kEndPositionOffset = kStartPositionOffset + kPointerSize;
8633 static const int kErrorLevelOffset = kEndPositionOffset + kPointerSize; 8636 static const int kErrorLevelOffset = kEndPositionOffset + kPointerSize;
8634 static const int kSize = kErrorLevelOffset + kPointerSize; 8637 static const int kSize = kErrorLevelOffset + kPointerSize;
8635 8638
8636 typedef FixedBodyDescriptor<HeapObject::kMapOffset, 8639 typedef FixedBodyDescriptor<HeapObject::kMapOffset,
8637 kStackFramesOffset + kPointerSize, 8640 kStackFramesOffset + kPointerSize,
8638 kSize> BodyDescriptor; 8641 kSize> BodyDescriptor;
8639 }; 8642 };
8640 8643
8644 class JSPromise;
8645
8646 // TODO(caitp): Make this a Struct once properties are no longer accessed from
8647 // JS
8648 class JSPromiseCapability : public JSObject {
8649 public:
8650 DECLARE_CAST(JSPromiseCapability)
8651
8652 DECLARE_VERIFIER(JSPromiseCapability)
8653
8654 DECL_ACCESSORS(promise, Object)
8655 DECL_ACCESSORS(resolve, Object)
8656 DECL_ACCESSORS(reject, Object)
8657
8658 static const int kPromiseOffset = JSObject::kHeaderSize;
8659 static const int kResolveOffset = kPromiseOffset + kPointerSize;
8660 static const int kRejectOffset = kResolveOffset + kPointerSize;
8661 static const int kSize = kRejectOffset + kPointerSize;
8662
8663 enum InObjectPropertyIndex {
8664 kPromiseIndex,
8665 kResolveIndex,
8666 kRejectIndex,
8667 kInObjectPropertyCount // Dummy.
8668 };
8669
8670 private:
8671 DISALLOW_IMPLICIT_CONSTRUCTORS(JSPromiseCapability);
8672 };
8673
8641 class JSPromise : public JSObject { 8674 class JSPromise : public JSObject {
8642 public: 8675 public:
8643 DECL_INT_ACCESSORS(status) 8676 DECL_INT_ACCESSORS(status)
8644 DECL_ACCESSORS(result, Object) 8677 DECL_ACCESSORS(result, Object)
8645 8678
8646 // There are 3 possible states for these fields -- 8679 // There are 3 possible states for these fields --
8647 // 1) Undefined -- This is the zero state when there is no callback 8680 // 1) Undefined -- This is the zero state when there is no callback
8648 // or deferred fields registered. 8681 // or deferred fields registered.
8649 // 8682 //
8650 // 2) Object -- There is a single Callable directly attached to the 8683 // 2) Object -- There is a single Callable directly attached to the
(...skipping 3069 matching lines...) Expand 10 before | Expand all | Expand 10 after
11720 } 11753 }
11721 }; 11754 };
11722 11755
11723 11756
11724 } // NOLINT, false-positive due to second-order macros. 11757 } // NOLINT, false-positive due to second-order macros.
11725 } // NOLINT, false-positive due to second-order macros. 11758 } // NOLINT, false-positive due to second-order macros.
11726 11759
11727 #include "src/objects/object-macros-undef.h" 11760 #include "src/objects/object-macros-undef.h"
11728 11761
11729 #endif // V8_OBJECTS_H_ 11762 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/js/promise.js ('k') | src/objects-body-descriptors-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698