| 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 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 939 | 939 |
| 940 // Every FunctionState starts with this id. | 940 // Every FunctionState starts with this id. |
| 941 static const int kFirstUsableId = 5; | 941 static const int kFirstUsableId = 5; |
| 942 | 942 |
| 943 // Every compiled stub starts with this id. | 943 // Every compiled stub starts with this id. |
| 944 static const int kStubEntryId = 6; | 944 static const int kStubEntryId = 6; |
| 945 | 945 |
| 946 int id_; | 946 int id_; |
| 947 }; | 947 }; |
| 948 | 948 |
| 949 class TokenDispenserForFinally { | |
| 950 public: | |
| 951 int GetBreakContinueToken() { return next_token_++; } | |
| 952 static const int kFallThroughToken = 0; | |
| 953 static const int kThrowToken = 1; | |
| 954 static const int kReturnToken = 2; | |
| 955 | |
| 956 static const int kFirstBreakContinueToken = 3; | |
| 957 static const int kInvalidToken = -1; | |
| 958 | |
| 959 private: | |
| 960 int next_token_ = kFirstBreakContinueToken; | |
| 961 }; | |
| 962 | 949 |
| 963 // ---------------------------------------------------------------------------- | 950 // ---------------------------------------------------------------------------- |
| 964 // I/O support. | 951 // I/O support. |
| 965 | 952 |
| 966 // Our version of printf(). | 953 // Our version of printf(). |
| 967 V8_EXPORT_PRIVATE void PRINTF_FORMAT(1, 2) PrintF(const char* format, ...); | 954 V8_EXPORT_PRIVATE void PRINTF_FORMAT(1, 2) PrintF(const char* format, ...); |
| 968 void PRINTF_FORMAT(2, 3) PrintF(FILE* out, const char* format, ...); | 955 void PRINTF_FORMAT(2, 3) PrintF(FILE* out, const char* format, ...); |
| 969 | 956 |
| 970 // Prepends the current process ID to the output. | 957 // Prepends the current process ID to the output. |
| 971 void PRINTF_FORMAT(1, 2) PrintPID(const char* format, ...); | 958 void PRINTF_FORMAT(1, 2) PrintPID(const char* format, ...); |
| (...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1674 private: | 1661 private: |
| 1675 T* head_; | 1662 T* head_; |
| 1676 T** tail_; | 1663 T** tail_; |
| 1677 DISALLOW_COPY_AND_ASSIGN(ThreadedList); | 1664 DISALLOW_COPY_AND_ASSIGN(ThreadedList); |
| 1678 }; | 1665 }; |
| 1679 | 1666 |
| 1680 } // namespace internal | 1667 } // namespace internal |
| 1681 } // namespace v8 | 1668 } // namespace v8 |
| 1682 | 1669 |
| 1683 #endif // V8_UTILS_H_ | 1670 #endif // V8_UTILS_H_ |
| OLD | NEW |