OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1108 class BailoutId { | 1108 class BailoutId { |
1109 public: | 1109 public: |
1110 explicit BailoutId(int id) : id_(id) { } | 1110 explicit BailoutId(int id) : id_(id) { } |
1111 int ToInt() const { return id_; } | 1111 int ToInt() const { return id_; } |
1112 | 1112 |
1113 static BailoutId None() { return BailoutId(kNoneId); } | 1113 static BailoutId None() { return BailoutId(kNoneId); } |
1114 static BailoutId FunctionEntry() { return BailoutId(kFunctionEntryId); } | 1114 static BailoutId FunctionEntry() { return BailoutId(kFunctionEntryId); } |
1115 static BailoutId Declarations() { return BailoutId(kDeclarationsId); } | 1115 static BailoutId Declarations() { return BailoutId(kDeclarationsId); } |
1116 static BailoutId FirstUsable() { return BailoutId(kFirstUsableId); } | 1116 static BailoutId FirstUsable() { return BailoutId(kFirstUsableId); } |
1117 static BailoutId StubEntry() { return BailoutId(kStubEntryId); } | 1117 static BailoutId StubEntry() { return BailoutId(kStubEntryId); } |
| 1118 static BailoutId PendingMarker() { return BailoutId(kPendingMarkerId); } |
1118 | 1119 |
1119 bool IsNone() const { return id_ == kNoneId; } | 1120 bool IsNone() const { return id_ == kNoneId; } |
| 1121 bool IsPendingMarker() const { return id_ == kPendingMarkerId; } |
1120 bool operator==(const BailoutId& other) const { return id_ == other.id_; } | 1122 bool operator==(const BailoutId& other) const { return id_ == other.id_; } |
1121 | 1123 |
1122 private: | 1124 private: |
1123 static const int kNoneId = -1; | 1125 static const int kNoneId = -1; |
1124 | 1126 |
1125 // Using 0 could disguise errors. | 1127 // Using 0 could disguise errors. |
1126 static const int kFunctionEntryId = 2; | 1128 static const int kFunctionEntryId = 2; |
1127 | 1129 |
1128 // This AST id identifies the point after the declarations have been visited. | 1130 // This AST id identifies the point after the declarations have been visited. |
1129 // We need it to capture the environment effects of declarations that emit | 1131 // We need it to capture the environment effects of declarations that emit |
1130 // code (function declarations). | 1132 // code (function declarations). |
1131 static const int kDeclarationsId = 3; | 1133 static const int kDeclarationsId = 3; |
1132 | 1134 |
1133 // Every FunctionState starts with this id. | 1135 // Every FunctionState starts with this id. |
1134 static const int kFirstUsableId = 4; | 1136 static const int kFirstUsableId = 4; |
1135 | 1137 |
1136 // Every compiled stub starts with this id. | 1138 // Every compiled stub starts with this id. |
1137 static const int kStubEntryId = 5; | 1139 static const int kStubEntryId = 5; |
1138 | 1140 |
| 1141 // For Control instructions we cannot verify the ast_id, since there is no |
| 1142 // 1:1 mapping but it corresponds to two simulates for each branch. |
| 1143 static const int kPendingMarkerId = 6; |
| 1144 |
1139 int id_; | 1145 int id_; |
1140 }; | 1146 }; |
1141 | 1147 |
1142 } } // namespace v8::internal | 1148 } } // namespace v8::internal |
1143 | 1149 |
1144 #endif // V8_UTILS_H_ | 1150 #endif // V8_UTILS_H_ |
OLD | NEW |