OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1081 V(Boolean) \ | 1083 V(Boolean) \ |
1082 V(JSArray) \ | 1084 V(JSArray) \ |
1083 V(JSArrayBuffer) \ | 1085 V(JSArrayBuffer) \ |
1084 V(JSArrayBufferView) \ | 1086 V(JSArrayBufferView) \ |
1085 V(JSCollection) \ | 1087 V(JSCollection) \ |
1086 V(JSTypedArray) \ | 1088 V(JSTypedArray) \ |
1087 V(JSArrayIterator) \ | 1089 V(JSArrayIterator) \ |
1088 V(JSDataView) \ | 1090 V(JSDataView) \ |
1089 V(JSProxy) \ | 1091 V(JSProxy) \ |
1090 V(JSError) \ | 1092 V(JSError) \ |
1093 V(JSPromiseCapability) \ | |
1091 V(JSPromise) \ | 1094 V(JSPromise) \ |
1092 V(JSStringIterator) \ | 1095 V(JSStringIterator) \ |
1093 V(JSSet) \ | 1096 V(JSSet) \ |
1094 V(JSMap) \ | 1097 V(JSMap) \ |
1095 V(JSSetIterator) \ | 1098 V(JSSetIterator) \ |
1096 V(JSMapIterator) \ | 1099 V(JSMapIterator) \ |
1097 V(JSWeakCollection) \ | 1100 V(JSWeakCollection) \ |
1098 V(JSWeakMap) \ | 1101 V(JSWeakMap) \ |
1099 V(JSWeakSet) \ | 1102 V(JSWeakSet) \ |
1100 V(JSRegExp) \ | 1103 V(JSRegExp) \ |
(...skipping 7512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8613 static const int kStartPositionOffset = kStackFramesOffset + kPointerSize; | 8616 static const int kStartPositionOffset = kStackFramesOffset + kPointerSize; |
8614 static const int kEndPositionOffset = kStartPositionOffset + kPointerSize; | 8617 static const int kEndPositionOffset = kStartPositionOffset + kPointerSize; |
8615 static const int kErrorLevelOffset = kEndPositionOffset + kPointerSize; | 8618 static const int kErrorLevelOffset = kEndPositionOffset + kPointerSize; |
8616 static const int kSize = kErrorLevelOffset + kPointerSize; | 8619 static const int kSize = kErrorLevelOffset + kPointerSize; |
8617 | 8620 |
8618 typedef FixedBodyDescriptor<HeapObject::kMapOffset, | 8621 typedef FixedBodyDescriptor<HeapObject::kMapOffset, |
8619 kStackFramesOffset + kPointerSize, | 8622 kStackFramesOffset + kPointerSize, |
8620 kSize> BodyDescriptor; | 8623 kSize> BodyDescriptor; |
8621 }; | 8624 }; |
8622 | 8625 |
8626 class JSPromise; | |
8627 class JSPromiseCapability : public JSObject { | |
gsathya
2016/12/29 21:48:47
can you please add a TODO to make this into a stru
caitp
2017/01/02 15:51:12
Done.
| |
8628 public: | |
8629 DECLARE_CAST(JSPromiseCapability) | |
8630 | |
8631 DECLARE_VERIFIER(JSPromiseCapability) | |
8632 | |
8633 DECL_ACCESSORS(promise, Object) | |
8634 DECL_ACCESSORS(resolve, Object) | |
8635 DECL_ACCESSORS(reject, Object) | |
8636 | |
8637 static const int kPromiseOffset = JSObject::kHeaderSize; | |
8638 static const int kResolveOffset = kPromiseOffset + kPointerSize; | |
8639 static const int kRejectOffset = kResolveOffset + kPointerSize; | |
8640 static const int kSize = kRejectOffset + kPointerSize; | |
8641 | |
8642 enum InObjectPropertyIndex { | |
8643 kPromiseIndex, | |
8644 kResolveIndex, | |
8645 kRejectIndex, | |
8646 kInObjectPropertyCount // Dummy. | |
8647 }; | |
8648 | |
8649 private: | |
8650 DISALLOW_IMPLICIT_CONSTRUCTORS(JSPromiseCapability); | |
8651 }; | |
8652 | |
8623 class JSPromise : public JSObject { | 8653 class JSPromise : public JSObject { |
8624 public: | 8654 public: |
8625 DECL_INT_ACCESSORS(status) | 8655 DECL_INT_ACCESSORS(status) |
8626 DECL_ACCESSORS(result, Object) | 8656 DECL_ACCESSORS(result, Object) |
8627 | 8657 |
8628 // There are 3 possible states for these fields -- | 8658 // There are 3 possible states for these fields -- |
8629 // 1) Undefined -- This is the zero state when there is no callback | 8659 // 1) Undefined -- This is the zero state when there is no callback |
8630 // or deferred registered. | 8660 // or deferred registered. |
8631 // 2) Object -- There is a single Callable directly attached to the | 8661 // 2) Object -- There is a single Callable directly attached to the |
8632 // fulfill_reactions, reject_reactions and the deferred JSObject is | 8662 // fulfill_reactions, reject_reactions and the deferred JSObject is |
(...skipping 3062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
11695 } | 11725 } |
11696 }; | 11726 }; |
11697 | 11727 |
11698 | 11728 |
11699 } // NOLINT, false-positive due to second-order macros. | 11729 } // NOLINT, false-positive due to second-order macros. |
11700 } // NOLINT, false-positive due to second-order macros. | 11730 } // NOLINT, false-positive due to second-order macros. |
11701 | 11731 |
11702 #include "src/objects/object-macros-undef.h" | 11732 #include "src/objects/object-macros-undef.h" |
11703 | 11733 |
11704 #endif // V8_OBJECTS_H_ | 11734 #endif // V8_OBJECTS_H_ |
OLD | NEW |