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 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1094 // Every FunctionState starts with this id. | 1094 // Every FunctionState starts with this id. |
1095 static const int kFirstUsableId = 4; | 1095 static const int kFirstUsableId = 4; |
1096 | 1096 |
1097 // Every compiled stub starts with this id. | 1097 // Every compiled stub starts with this id. |
1098 static const int kStubEntryId = 5; | 1098 static const int kStubEntryId = 5; |
1099 | 1099 |
1100 int id_; | 1100 int id_; |
1101 }; | 1101 }; |
1102 | 1102 |
1103 | 1103 |
1104 template <class C> | |
1105 class ContainerPointerWrapper { | |
1106 public: | |
1107 typedef typename C::iterator iterator; | |
1108 typedef typename C::reverse_iterator reverse_iterator; | |
1109 explicit ContainerPointerWrapper(C* container) : container_(container) {} | |
1110 iterator begin() { return container_->begin(); } | |
1111 iterator end() { return container_->end(); } | |
1112 reverse_iterator rbegin() { return container_->rbegin(); } | |
1113 reverse_iterator rend() { return container_->rend(); } | |
1114 private: | |
1115 C* container_; | |
1116 }; | |
1117 | |
1118 | |
1119 // ---------------------------------------------------------------------------- | 1104 // ---------------------------------------------------------------------------- |
1120 // I/O support. | 1105 // I/O support. |
1121 | 1106 |
1122 #if __GNUC__ >= 4 | 1107 #if __GNUC__ >= 4 |
1123 // On gcc we can ask the compiler to check the types of %d-style format | 1108 // On gcc we can ask the compiler to check the types of %d-style format |
1124 // specifiers and their associated arguments. TODO(erikcorry) fix this | 1109 // specifiers and their associated arguments. TODO(erikcorry) fix this |
1125 // so it works on MacOSX. | 1110 // so it works on MacOSX. |
1126 #if defined(__MACH__) && defined(__APPLE__) | 1111 #if defined(__MACH__) && defined(__APPLE__) |
1127 #define PRINTF_CHECKING | 1112 #define PRINTF_CHECKING |
1128 #define FPRINTF_CHECKING | 1113 #define FPRINTF_CHECKING |
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1710 // Takes the address of the limit variable in order to find out where | 1695 // Takes the address of the limit variable in order to find out where |
1711 // the top of stack is right now. | 1696 // the top of stack is right now. |
1712 uintptr_t limit = reinterpret_cast<uintptr_t>(&limit); | 1697 uintptr_t limit = reinterpret_cast<uintptr_t>(&limit); |
1713 return limit; | 1698 return limit; |
1714 } | 1699 } |
1715 | 1700 |
1716 } // namespace internal | 1701 } // namespace internal |
1717 } // namespace v8 | 1702 } // namespace v8 |
1718 | 1703 |
1719 #endif // V8_UTILS_H_ | 1704 #endif // V8_UTILS_H_ |
OLD | NEW |