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 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1087 | 1087 |
1088 static BailoutId None() { return BailoutId(kNoneId); } | 1088 static BailoutId None() { return BailoutId(kNoneId); } |
1089 static BailoutId FunctionEntry() { return BailoutId(kFunctionEntryId); } | 1089 static BailoutId FunctionEntry() { return BailoutId(kFunctionEntryId); } |
1090 static BailoutId Declarations() { return BailoutId(kDeclarationsId); } | 1090 static BailoutId Declarations() { return BailoutId(kDeclarationsId); } |
1091 static BailoutId FirstUsable() { return BailoutId(kFirstUsableId); } | 1091 static BailoutId FirstUsable() { return BailoutId(kFirstUsableId); } |
1092 static BailoutId StubEntry() { return BailoutId(kStubEntryId); } | 1092 static BailoutId StubEntry() { return BailoutId(kStubEntryId); } |
1093 | 1093 |
1094 bool IsNone() const { return id_ == kNoneId; } | 1094 bool IsNone() const { return id_ == kNoneId; } |
1095 bool operator==(const BailoutId& other) const { return id_ == other.id_; } | 1095 bool operator==(const BailoutId& other) const { return id_ == other.id_; } |
1096 bool operator!=(const BailoutId& other) const { return id_ != other.id_; } | 1096 bool operator!=(const BailoutId& other) const { return id_ != other.id_; } |
| 1097 bool operator<(const BailoutId& other) const { return id_ < other.id_; } |
1097 | 1098 |
1098 private: | 1099 private: |
1099 static const int kNoneId = -1; | 1100 static const int kNoneId = -1; |
1100 | 1101 |
1101 // Using 0 could disguise errors. | 1102 // Using 0 could disguise errors. |
1102 static const int kFunctionEntryId = 2; | 1103 static const int kFunctionEntryId = 2; |
1103 | 1104 |
1104 // This AST id identifies the point after the declarations have been visited. | 1105 // This AST id identifies the point after the declarations have been visited. |
1105 // We need it to capture the environment effects of declarations that emit | 1106 // We need it to capture the environment effects of declarations that emit |
1106 // code (function declarations). | 1107 // code (function declarations). |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1608 } | 1609 } |
1609 | 1610 |
1610 *index = result; | 1611 *index = result; |
1611 return true; | 1612 return true; |
1612 } | 1613 } |
1613 | 1614 |
1614 | 1615 |
1615 } } // namespace v8::internal | 1616 } } // namespace v8::internal |
1616 | 1617 |
1617 #endif // V8_UTILS_H_ | 1618 #endif // V8_UTILS_H_ |
OLD | NEW |