| 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 8892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8903 // or deferred registered. | 8903 // or deferred registered. |
| 8904 // 2) Object -- There is a single Callable directly attached to the | 8904 // 2) Object -- There is a single Callable directly attached to the |
| 8905 // fulfill_reactions, reject_reactions and the deferred JSObject is | 8905 // fulfill_reactions, reject_reactions and the deferred JSObject is |
| 8906 // directly attached to the deferred field. | 8906 // directly attached to the deferred field. |
| 8907 // 3) FixedArray -- There is more than one callback and deferred | 8907 // 3) FixedArray -- There is more than one callback and deferred |
| 8908 // attached to a FixedArray. | 8908 // attached to a FixedArray. |
| 8909 DECL_ACCESSORS(deferred, Object) | 8909 DECL_ACCESSORS(deferred, Object) |
| 8910 DECL_ACCESSORS(fulfill_reactions, Object) | 8910 DECL_ACCESSORS(fulfill_reactions, Object) |
| 8911 DECL_ACCESSORS(reject_reactions, Object) | 8911 DECL_ACCESSORS(reject_reactions, Object) |
| 8912 | 8912 |
| 8913 DECL_INT_ACCESSORS(flags) |
| 8914 |
| 8915 // [has_handler]: Whether this promise has a reject handler or not. |
| 8916 DECL_BOOLEAN_ACCESSORS(has_handler) |
| 8917 |
| 8913 static const char* Status(int status); | 8918 static const char* Status(int status); |
| 8914 | 8919 |
| 8915 DECLARE_CAST(JSPromise) | 8920 DECLARE_CAST(JSPromise) |
| 8916 | 8921 |
| 8917 // Dispatched behavior. | 8922 // Dispatched behavior. |
| 8918 DECLARE_PRINTER(JSPromise) | 8923 DECLARE_PRINTER(JSPromise) |
| 8919 DECLARE_VERIFIER(JSPromise) | 8924 DECLARE_VERIFIER(JSPromise) |
| 8920 | 8925 |
| 8921 // Layout description. | 8926 // Layout description. |
| 8922 static const int kStatusOffset = JSObject::kHeaderSize; | 8927 static const int kStatusOffset = JSObject::kHeaderSize; |
| 8923 static const int kResultOffset = kStatusOffset + kPointerSize; | 8928 static const int kResultOffset = kStatusOffset + kPointerSize; |
| 8924 static const int kDeferredOffset = kResultOffset + kPointerSize; | 8929 static const int kDeferredOffset = kResultOffset + kPointerSize; |
| 8925 static const int kFulfillReactionsOffset = kDeferredOffset + kPointerSize; | 8930 static const int kFulfillReactionsOffset = kDeferredOffset + kPointerSize; |
| 8926 static const int kRejectReactionsOffset = | 8931 static const int kRejectReactionsOffset = |
| 8927 kFulfillReactionsOffset + kPointerSize; | 8932 kFulfillReactionsOffset + kPointerSize; |
| 8928 static const int kSize = kRejectReactionsOffset + kPointerSize; | 8933 static const int kFlagsOffset = kRejectReactionsOffset + kPointerSize; |
| 8934 static const int kSize = kFlagsOffset + kPointerSize; |
| 8935 |
| 8936 // Flags layout. |
| 8937 static const int kHasHandlerBit = 0; |
| 8929 }; | 8938 }; |
| 8930 | 8939 |
| 8931 // Regular expressions | 8940 // Regular expressions |
| 8932 // The regular expression holds a single reference to a FixedArray in | 8941 // The regular expression holds a single reference to a FixedArray in |
| 8933 // the kDataOffset field. | 8942 // the kDataOffset field. |
| 8934 // The FixedArray contains the following data: | 8943 // The FixedArray contains the following data: |
| 8935 // - tag : type of regexp implementation (not compiled yet, atom or irregexp) | 8944 // - tag : type of regexp implementation (not compiled yet, atom or irregexp) |
| 8936 // - reference to the original source string | 8945 // - reference to the original source string |
| 8937 // - reference to the original flag string | 8946 // - reference to the original flag string |
| 8938 // If it is an atom regexp | 8947 // If it is an atom regexp |
| (...skipping 3047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11986 } | 11995 } |
| 11987 return value; | 11996 return value; |
| 11988 } | 11997 } |
| 11989 }; | 11998 }; |
| 11990 | 11999 |
| 11991 | 12000 |
| 11992 } // NOLINT, false-positive due to second-order macros. | 12001 } // NOLINT, false-positive due to second-order macros. |
| 11993 } // NOLINT, false-positive due to second-order macros. | 12002 } // NOLINT, false-positive due to second-order macros. |
| 11994 | 12003 |
| 11995 #endif // V8_OBJECTS_H_ | 12004 #endif // V8_OBJECTS_H_ |
| OLD | NEW |