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 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1008 | 1008 |
1009 class BailoutId { | 1009 class BailoutId { |
1010 public: | 1010 public: |
1011 explicit BailoutId(int id) : id_(id) { } | 1011 explicit BailoutId(int id) : id_(id) { } |
1012 int ToInt() const { return id_; } | 1012 int ToInt() const { return id_; } |
1013 | 1013 |
1014 static BailoutId None() { return BailoutId(kNoneId); } | 1014 static BailoutId None() { return BailoutId(kNoneId); } |
1015 static BailoutId FunctionEntry() { return BailoutId(kFunctionEntryId); } | 1015 static BailoutId FunctionEntry() { return BailoutId(kFunctionEntryId); } |
1016 static BailoutId Declarations() { return BailoutId(kDeclarationsId); } | 1016 static BailoutId Declarations() { return BailoutId(kDeclarationsId); } |
1017 static BailoutId FirstUsable() { return BailoutId(kFirstUsableId); } | 1017 static BailoutId FirstUsable() { return BailoutId(kFirstUsableId); } |
1018 static BailoutId StubEntry() { return BailoutId(kStubEntryId); } | |
1018 | 1019 |
1019 bool IsNone() const { return id_ == kNoneId; } | 1020 bool IsNone() const { return id_ == kNoneId; } |
1020 bool operator==(const BailoutId& other) const { return id_ == other.id_; } | 1021 bool operator==(const BailoutId& other) const { return id_ == other.id_; } |
1021 | 1022 |
1022 private: | 1023 private: |
1023 static const int kNoneId = -1; | 1024 static const int kNoneId = -1; |
1024 | 1025 |
1025 // Using 0 could disguise errors. | 1026 // Using 0 could disguise errors. |
1026 static const int kFunctionEntryId = 2; | 1027 static const int kFunctionEntryId = 2; |
1027 | 1028 |
1028 // This AST id identifies the point after the declarations have been visited. | 1029 // This AST id identifies the point after the declarations have been visited. |
1029 // We need it to capture the environment effects of declarations that emit | 1030 // We need it to capture the environment effects of declarations that emit |
1030 // code (function declarations). | 1031 // code (function declarations). |
1031 static const int kDeclarationsId = 3; | 1032 static const int kDeclarationsId = 3; |
1032 | 1033 |
1033 // Ever FunctionState starts with this id. | 1034 // Ever FunctionState starts with this id. |
1034 static const int kFirstUsableId = 4; | 1035 static const int kFirstUsableId = 4; |
Jakob Kummerow
2012/11/19 12:36:00
every
danno
2012/11/26 17:16:18
Done.
| |
1035 | 1036 |
1037 // Ever compiled stub starts with this id. | |
1038 static const int kStubEntryId = 5; | |
Jakob Kummerow
2012/11/19 12:36:00
every
danno
2012/11/26 17:16:18
Done.
| |
1039 | |
1036 int id_; | 1040 int id_; |
1037 }; | 1041 }; |
1038 | 1042 |
1039 } } // namespace v8::internal | 1043 } } // namespace v8::internal |
1040 | 1044 |
1041 #endif // V8_UTILS_H_ | 1045 #endif // V8_UTILS_H_ |
OLD | NEW |