OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_UTILS_H_ | 5 #ifndef V8_UTILS_H_ |
6 #define V8_UTILS_H_ | 6 #define V8_UTILS_H_ |
7 | 7 |
8 #include <limits.h> | 8 #include <limits.h> |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 #include <string.h> | 10 #include <string.h> |
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
934 id_ == ConstructStubInvoke().ToInt(); | 934 id_ == ConstructStubInvoke().ToInt(); |
935 } | 935 } |
936 | 936 |
937 bool IsNone() const { return id_ == kNoneId; } | 937 bool IsNone() const { return id_ == kNoneId; } |
938 bool operator==(const BailoutId& other) const { return id_ == other.id_; } | 938 bool operator==(const BailoutId& other) const { return id_ == other.id_; } |
939 bool operator!=(const BailoutId& other) const { return id_ != other.id_; } | 939 bool operator!=(const BailoutId& other) const { return id_ != other.id_; } |
940 friend size_t hash_value(BailoutId); | 940 friend size_t hash_value(BailoutId); |
941 V8_EXPORT_PRIVATE friend std::ostream& operator<<(std::ostream&, BailoutId); | 941 V8_EXPORT_PRIVATE friend std::ostream& operator<<(std::ostream&, BailoutId); |
942 | 942 |
943 private: | 943 private: |
| 944 friend class Builtins; |
| 945 |
944 static const int kNoneId = -1; | 946 static const int kNoneId = -1; |
945 | 947 |
946 // Using 0 could disguise errors. | 948 // Using 0 could disguise errors. |
947 static const int kScriptContextId = 1; | 949 static const int kScriptContextId = 1; |
948 static const int kFunctionContextId = 2; | 950 static const int kFunctionContextId = 2; |
949 static const int kFunctionEntryId = 3; | 951 static const int kFunctionEntryId = 3; |
950 | 952 |
951 // This AST id identifies the point after the declarations have been visited. | 953 // This AST id identifies the point after the declarations have been visited. |
952 // We need it to capture the environment effects of declarations that emit | 954 // We need it to capture the environment effects of declarations that emit |
953 // code (function declarations). | 955 // code (function declarations). |
954 static const int kDeclarationsId = 4; | 956 static const int kDeclarationsId = 4; |
955 | 957 |
956 // Every FunctionState starts with this id. | 958 // Every FunctionState starts with this id. |
957 static const int kFirstUsableId = 5; | 959 static const int kFirstUsableId = 5; |
958 | 960 |
959 // Every compiled stub starts with this id. | 961 // Every compiled stub starts with this id. |
960 static const int kStubEntryId = 6; | 962 static const int kStubEntryId = 6; |
961 | 963 |
| 964 // Builtin continuations bailout ids start here. If you need to add a |
| 965 // non-builtin BailoutId, add it before this id so that this Id has the |
| 966 // highest number. |
| 967 static const int kFirstBuiltinContinuationId = 7; |
| 968 |
962 int id_; | 969 int id_; |
963 }; | 970 }; |
964 | 971 |
965 | 972 |
966 // ---------------------------------------------------------------------------- | 973 // ---------------------------------------------------------------------------- |
967 // I/O support. | 974 // I/O support. |
968 | 975 |
969 // Our version of printf(). | 976 // Our version of printf(). |
970 V8_EXPORT_PRIVATE void PRINTF_FORMAT(1, 2) PrintF(const char* format, ...); | 977 V8_EXPORT_PRIVATE void PRINTF_FORMAT(1, 2) PrintF(const char* format, ...); |
971 void PRINTF_FORMAT(2, 3) PrintF(FILE* out, const char* format, ...); | 978 void PRINTF_FORMAT(2, 3) PrintF(FILE* out, const char* format, ...); |
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1712 private: | 1719 private: |
1713 T value_; | 1720 T value_; |
1714 ThreadedListZoneEntry<T>* next_; | 1721 ThreadedListZoneEntry<T>* next_; |
1715 DISALLOW_COPY_AND_ASSIGN(ThreadedListZoneEntry); | 1722 DISALLOW_COPY_AND_ASSIGN(ThreadedListZoneEntry); |
1716 }; | 1723 }; |
1717 | 1724 |
1718 } // namespace internal | 1725 } // namespace internal |
1719 } // namespace v8 | 1726 } // namespace v8 |
1720 | 1727 |
1721 #endif // V8_UTILS_H_ | 1728 #endif // V8_UTILS_H_ |
OLD | NEW |