| 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 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 958 | 958 |
| 959 static BailoutId None() { return BailoutId(kNoneId); } | 959 static BailoutId None() { return BailoutId(kNoneId); } |
| 960 static BailoutId FunctionEntry() { return BailoutId(kFunctionEntryId); } | 960 static BailoutId FunctionEntry() { return BailoutId(kFunctionEntryId); } |
| 961 static BailoutId Declarations() { return BailoutId(kDeclarationsId); } | 961 static BailoutId Declarations() { return BailoutId(kDeclarationsId); } |
| 962 static BailoutId FirstUsable() { return BailoutId(kFirstUsableId); } | 962 static BailoutId FirstUsable() { return BailoutId(kFirstUsableId); } |
| 963 static BailoutId StubEntry() { return BailoutId(kStubEntryId); } | 963 static BailoutId StubEntry() { return BailoutId(kStubEntryId); } |
| 964 | 964 |
| 965 bool IsNone() const { return id_ == kNoneId; } | 965 bool IsNone() const { return id_ == kNoneId; } |
| 966 bool operator==(const BailoutId& other) const { return id_ == other.id_; } | 966 bool operator==(const BailoutId& other) const { return id_ == other.id_; } |
| 967 bool operator!=(const BailoutId& other) const { return id_ != other.id_; } | 967 bool operator!=(const BailoutId& other) const { return id_ != other.id_; } |
| 968 friend size_t hash_value(BailoutId); |
| 969 friend std::ostream& operator<<(std::ostream&, BailoutId); |
| 968 | 970 |
| 969 private: | 971 private: |
| 970 static const int kNoneId = -1; | 972 static const int kNoneId = -1; |
| 971 | 973 |
| 972 // Using 0 could disguise errors. | 974 // Using 0 could disguise errors. |
| 973 static const int kFunctionEntryId = 2; | 975 static const int kFunctionEntryId = 2; |
| 974 | 976 |
| 975 // This AST id identifies the point after the declarations have been visited. | 977 // This AST id identifies the point after the declarations have been visited. |
| 976 // We need it to capture the environment effects of declarations that emit | 978 // We need it to capture the environment effects of declarations that emit |
| 977 // code (function declarations). | 979 // code (function declarations). |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1460 // Takes the address of the limit variable in order to find out where | 1462 // Takes the address of the limit variable in order to find out where |
| 1461 // the top of stack is right now. | 1463 // the top of stack is right now. |
| 1462 uintptr_t limit = reinterpret_cast<uintptr_t>(&limit); | 1464 uintptr_t limit = reinterpret_cast<uintptr_t>(&limit); |
| 1463 return limit; | 1465 return limit; |
| 1464 } | 1466 } |
| 1465 | 1467 |
| 1466 } // namespace internal | 1468 } // namespace internal |
| 1467 } // namespace v8 | 1469 } // namespace v8 |
| 1468 | 1470 |
| 1469 #endif // V8_UTILS_H_ | 1471 #endif // V8_UTILS_H_ |
| OLD | NEW |